|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543 |
- // Copyright 2019 Google LLC.
- // Use of this source code is governed by a BSD-style
- // license that can be found in the LICENSE file.
-
- // Code generated file. DO NOT EDIT.
-
- // Package sqladmin provides access to the Cloud SQL Admin API.
- //
- // For product documentation, see: https://cloud.google.com/sql/docs/reference/latest
- //
- // Creating a client
- //
- // Usage example:
- //
- // import "google.golang.org/api/sqladmin/v1beta4"
- // ...
- // ctx := context.Background()
- // sqladminService, err := sqladmin.NewService(ctx)
- //
- // In this example, Google Application Default Credentials are used for authentication.
- //
- // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
- //
- // Other authentication options
- //
- // By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
- //
- // sqladminService, err := sqladmin.NewService(ctx, option.WithScopes(sqladmin.SqlserviceAdminScope))
- //
- // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
- //
- // sqladminService, err := sqladmin.NewService(ctx, option.WithAPIKey("AIza..."))
- //
- // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
- //
- // config := &oauth2.Config{...}
- // // ...
- // token, err := config.Exchange(ctx, ...)
- // sqladminService, err := sqladmin.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
- //
- // See https://godoc.org/google.golang.org/api/option/ for details on options.
- package sqladmin // import "google.golang.org/api/sqladmin/v1beta4"
-
- import (
- "bytes"
- "context"
- "encoding/json"
- "errors"
- "fmt"
- "io"
- "net/http"
- "net/url"
- "strconv"
- "strings"
-
- gensupport "google.golang.org/api/gensupport"
- googleapi "google.golang.org/api/googleapi"
- option "google.golang.org/api/option"
- htransport "google.golang.org/api/transport/http"
- )
-
- // Always reference these packages, just in case the auto-generated code
- // below doesn't.
- var _ = bytes.NewBuffer
- var _ = strconv.Itoa
- var _ = fmt.Sprintf
- var _ = json.NewDecoder
- var _ = io.Copy
- var _ = url.Parse
- var _ = gensupport.MarshalJSON
- var _ = googleapi.Version
- var _ = errors.New
- var _ = strings.Replace
- var _ = context.Canceled
-
- const apiId = "sqladmin:v1beta4"
- const apiName = "sqladmin"
- const apiVersion = "v1beta4"
- const basePath = "https://www.googleapis.com/sql/v1beta4/"
-
- // OAuth2 scopes used by this API.
- const (
- // View and manage your data across Google Cloud Platform services
- CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
-
- // Manage your Google SQL Service instances
- SqlserviceAdminScope = "https://www.googleapis.com/auth/sqlservice.admin"
- )
-
- // NewService creates a new Service.
- func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
- scopesOption := option.WithScopes(
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/sqlservice.admin",
- )
- // NOTE: prepend, so we don't override user-specified scopes.
- opts = append([]option.ClientOption{scopesOption}, opts...)
- client, endpoint, err := htransport.NewClient(ctx, opts...)
- if err != nil {
- return nil, err
- }
- s, err := New(client)
- if err != nil {
- return nil, err
- }
- if endpoint != "" {
- s.BasePath = endpoint
- }
- return s, nil
- }
-
- // New creates a new Service. It uses the provided http.Client for requests.
- //
- // Deprecated: please use NewService instead.
- // To provide a custom HTTP client, use option.WithHTTPClient.
- // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
- func New(client *http.Client) (*Service, error) {
- if client == nil {
- return nil, errors.New("client is nil")
- }
- s := &Service{client: client, BasePath: basePath}
- s.BackupRuns = NewBackupRunsService(s)
- s.Databases = NewDatabasesService(s)
- s.Flags = NewFlagsService(s)
- s.Instances = NewInstancesService(s)
- s.Operations = NewOperationsService(s)
- s.SslCerts = NewSslCertsService(s)
- s.Tiers = NewTiersService(s)
- s.Users = NewUsersService(s)
- return s, nil
- }
-
- type Service struct {
- client *http.Client
- BasePath string // API endpoint base URL
- UserAgent string // optional additional User-Agent fragment
-
- BackupRuns *BackupRunsService
-
- Databases *DatabasesService
-
- Flags *FlagsService
-
- Instances *InstancesService
-
- Operations *OperationsService
-
- SslCerts *SslCertsService
-
- Tiers *TiersService
-
- Users *UsersService
- }
-
- func (s *Service) userAgent() string {
- if s.UserAgent == "" {
- return googleapi.UserAgent
- }
- return googleapi.UserAgent + " " + s.UserAgent
- }
-
- func NewBackupRunsService(s *Service) *BackupRunsService {
- rs := &BackupRunsService{s: s}
- return rs
- }
-
- type BackupRunsService struct {
- s *Service
- }
-
- func NewDatabasesService(s *Service) *DatabasesService {
- rs := &DatabasesService{s: s}
- return rs
- }
-
- type DatabasesService struct {
- s *Service
- }
-
- func NewFlagsService(s *Service) *FlagsService {
- rs := &FlagsService{s: s}
- return rs
- }
-
- type FlagsService struct {
- s *Service
- }
-
- func NewInstancesService(s *Service) *InstancesService {
- rs := &InstancesService{s: s}
- return rs
- }
-
- type InstancesService struct {
- s *Service
- }
-
- func NewOperationsService(s *Service) *OperationsService {
- rs := &OperationsService{s: s}
- return rs
- }
-
- type OperationsService struct {
- s *Service
- }
-
- func NewSslCertsService(s *Service) *SslCertsService {
- rs := &SslCertsService{s: s}
- return rs
- }
-
- type SslCertsService struct {
- s *Service
- }
-
- func NewTiersService(s *Service) *TiersService {
- rs := &TiersService{s: s}
- return rs
- }
-
- type TiersService struct {
- s *Service
- }
-
- func NewUsersService(s *Service) *UsersService {
- rs := &UsersService{s: s}
- return rs
- }
-
- type UsersService struct {
- s *Service
- }
-
- // AclEntry: An entry for an Access Control list.
- type AclEntry struct {
- // ExpirationTime: The time when this access control entry expires in
- // RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
- ExpirationTime string `json:"expirationTime,omitempty"`
-
- // Kind: This is always sql#aclEntry.
- Kind string `json:"kind,omitempty"`
-
- // Name: An optional label to identify this entry.
- Name string `json:"name,omitempty"`
-
- // Value: The whitelisted value for the access control list.
- Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "ExpirationTime") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "ExpirationTime") to
- // include in API requests with the JSON null value. By default, fields
- // with empty values are omitted from API requests. However, any field
- // with an empty value appearing in NullFields will be sent to the
- // server as null. It is an error if a field in this list has a
- // non-empty value. This may be used to include null fields in Patch
- // requests.
- NullFields []string `json:"-"`
- }
-
- func (s *AclEntry) MarshalJSON() ([]byte, error) {
- type NoMethod AclEntry
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // ApiWarning: An Admin API warning message.
- type ApiWarning struct {
- // Code: Code to uniquely identify the warning type.
- Code string `json:"code,omitempty"`
-
- // Message: The warning message.
- Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *ApiWarning) MarshalJSON() ([]byte, error) {
- type NoMethod ApiWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // BackupConfiguration: Database instance backup configuration.
- type BackupConfiguration struct {
- // BinaryLogEnabled: Whether binary log is enabled. If backup
- // configuration is disabled, binary log must be disabled as well.
- BinaryLogEnabled bool `json:"binaryLogEnabled,omitempty"`
-
- // Enabled: Whether this configuration is enabled.
- Enabled bool `json:"enabled,omitempty"`
-
- // Kind: This is always sql#backupConfiguration.
- Kind string `json:"kind,omitempty"`
-
- // ReplicationLogArchivingEnabled: Reserved for future use.
- ReplicationLogArchivingEnabled bool `json:"replicationLogArchivingEnabled,omitempty"`
-
- // StartTime: Start time for the daily backup configuration in UTC
- // timezone in the 24 hour format - HH:MM.
- StartTime string `json:"startTime,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "BinaryLogEnabled") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "BinaryLogEnabled") to
- // include in API requests with the JSON null value. By default, fields
- // with empty values are omitted from API requests. However, any field
- // with an empty value appearing in NullFields will be sent to the
- // server as null. It is an error if a field in this list has a
- // non-empty value. This may be used to include null fields in Patch
- // requests.
- NullFields []string `json:"-"`
- }
-
- func (s *BackupConfiguration) MarshalJSON() ([]byte, error) {
- type NoMethod BackupConfiguration
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // BackupRun: A BackupRun resource.
- type BackupRun struct {
- // Description: The description of this run, only applicable to
- // on-demand backups.
- Description string `json:"description,omitempty"`
-
- // EndTime: The time the backup operation completed in UTC timezone in
- // RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
- EndTime string `json:"endTime,omitempty"`
-
- // EnqueuedTime: The time the run was enqueued in UTC timezone in RFC
- // 3339 format, for example 2012-11-15T16:19:00.094Z.
- EnqueuedTime string `json:"enqueuedTime,omitempty"`
-
- // Error: Information about why the backup operation failed. This is
- // only present if the run has the FAILED status.
- Error *OperationError `json:"error,omitempty"`
-
- // Id: The identifier for this backup run. Unique only for a specific
- // Cloud SQL instance.
- Id int64 `json:"id,omitempty,string"`
-
- // Instance: Name of the database instance.
- Instance string `json:"instance,omitempty"`
-
- // Kind: This is always sql#backupRun.
- Kind string `json:"kind,omitempty"`
-
- // SelfLink: The URI of this resource.
- SelfLink string `json:"selfLink,omitempty"`
-
- // StartTime: The time the backup operation actually started in UTC
- // timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
- StartTime string `json:"startTime,omitempty"`
-
- // Status: The status of this run.
- Status string `json:"status,omitempty"`
-
- // Type: The type of this run; can be either "AUTOMATED" or "ON_DEMAND".
- Type string `json:"type,omitempty"`
-
- // WindowStartTime: The start time of the backup window during which
- // this the backup was attempted in RFC 3339 format, for example
- // 2012-11-15T16:19:00.094Z.
- WindowStartTime string `json:"windowStartTime,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Description") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Description") to include
- // in API requests with the JSON null value. By default, fields with
- // empty values are omitted from API requests. However, any field with
- // an empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *BackupRun) MarshalJSON() ([]byte, error) {
- type NoMethod BackupRun
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // BackupRunsListResponse: Backup run list results.
- type BackupRunsListResponse struct {
- // Items: A list of backup runs in reverse chronological order of the
- // enqueued time.
- Items []*BackupRun `json:"items,omitempty"`
-
- // Kind: This is always sql#backupRunsList.
- Kind string `json:"kind,omitempty"`
-
- // NextPageToken: The continuation token, used to page through large
- // result sets. Provide this value in a subsequent request to return the
- // next page of results.
- NextPageToken string `json:"nextPageToken,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Items") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Items") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *BackupRunsListResponse) MarshalJSON() ([]byte, error) {
- type NoMethod BackupRunsListResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // BinLogCoordinates: Binary log coordinates.
- type BinLogCoordinates struct {
- // BinLogFileName: Name of the binary log file for a Cloud SQL instance.
- BinLogFileName string `json:"binLogFileName,omitempty"`
-
- // BinLogPosition: Position (offset) within the binary log file.
- BinLogPosition int64 `json:"binLogPosition,omitempty,string"`
-
- // Kind: This is always sql#binLogCoordinates.
- Kind string `json:"kind,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "BinLogFileName") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "BinLogFileName") to
- // include in API requests with the JSON null value. By default, fields
- // with empty values are omitted from API requests. However, any field
- // with an empty value appearing in NullFields will be sent to the
- // server as null. It is an error if a field in this list has a
- // non-empty value. This may be used to include null fields in Patch
- // requests.
- NullFields []string `json:"-"`
- }
-
- func (s *BinLogCoordinates) MarshalJSON() ([]byte, error) {
- type NoMethod BinLogCoordinates
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // CloneContext: Database instance clone context.
- type CloneContext struct {
- // BinLogCoordinates: Binary log coordinates, if specified, identify the
- // position up to which the source instance should be cloned. If not
- // specified, the source instance is cloned up to the most recent binary
- // log coordinates.
- BinLogCoordinates *BinLogCoordinates `json:"binLogCoordinates,omitempty"`
-
- // DestinationInstanceName: Name of the Cloud SQL instance to be created
- // as a clone.
- DestinationInstanceName string `json:"destinationInstanceName,omitempty"`
-
- // Kind: This is always sql#cloneContext.
- Kind string `json:"kind,omitempty"`
-
- // PitrTimestampMs: Reserved for future use.
- PitrTimestampMs int64 `json:"pitrTimestampMs,omitempty,string"`
-
- // ForceSendFields is a list of field names (e.g. "BinLogCoordinates")
- // to unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "BinLogCoordinates") to
- // include in API requests with the JSON null value. By default, fields
- // with empty values are omitted from API requests. However, any field
- // with an empty value appearing in NullFields will be sent to the
- // server as null. It is an error if a field in this list has a
- // non-empty value. This may be used to include null fields in Patch
- // requests.
- NullFields []string `json:"-"`
- }
-
- func (s *CloneContext) MarshalJSON() ([]byte, error) {
- type NoMethod CloneContext
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // Database: Represents a SQL database on the Cloud SQL instance.
- type Database struct {
- // Charset: The MySQL charset value.
- Charset string `json:"charset,omitempty"`
-
- // Collation: The MySQL collation value.
- Collation string `json:"collation,omitempty"`
-
- // Etag: This field is deprecated and will be removed from a future
- // version of the API.
- Etag string `json:"etag,omitempty"`
-
- // Instance: The name of the Cloud SQL instance. This does not include
- // the project ID.
- Instance string `json:"instance,omitempty"`
-
- // Kind: This is always sql#database.
- Kind string `json:"kind,omitempty"`
-
- // Name: The name of the database in the Cloud SQL instance. This does
- // not include the project ID or instance name.
- Name string `json:"name,omitempty"`
-
- // Project: The project ID of the project containing the Cloud SQL
- // database. The Google apps domain is prefixed if applicable.
- Project string `json:"project,omitempty"`
-
- // SelfLink: The URI of this resource.
- SelfLink string `json:"selfLink,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Charset") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Charset") to include in
- // API requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *Database) MarshalJSON() ([]byte, error) {
- type NoMethod Database
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // DatabaseFlags: Database flags for Cloud SQL instances.
- type DatabaseFlags struct {
- // Name: The name of the flag. These flags are passed at instance
- // startup, so include both server options and system variables for
- // MySQL. Flags should be specified with underscores, not hyphens. For
- // more information, see Configuring Database Flags in the Cloud SQL
- // documentation.
- Name string `json:"name,omitempty"`
-
- // Value: The value of the flag. Booleans should be set to on for true
- // and off for false. This field must be omitted if the flag doesn't
- // take a value.
- Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Name") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Name") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *DatabaseFlags) MarshalJSON() ([]byte, error) {
- type NoMethod DatabaseFlags
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // DatabaseInstance: A Cloud SQL instance resource.
- type DatabaseInstance struct {
- // BackendType: FIRST_GEN: First Generation instance. MySQL
- // only.
- // SECOND_GEN: Second Generation instance or PostgreSQL
- // instance.
- // EXTERNAL: A database server that is not managed by Google.
- // This property is read-only; use the tier property in the settings
- // object to determine the database type and Second or First Generation.
- BackendType string `json:"backendType,omitempty"`
-
- // ConnectionName: Connection name of the Cloud SQL instance used in
- // connection strings.
- ConnectionName string `json:"connectionName,omitempty"`
-
- // CurrentDiskSize: The current disk usage of the instance in bytes.
- // This property has been deprecated. Users should use the
- // "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
- // Monitoring API instead. Please see this announcement for details.
- CurrentDiskSize int64 `json:"currentDiskSize,omitempty,string"`
-
- // DatabaseVersion: The database engine type and version. The
- // databaseVersion field can not be changed after instance creation.
- // MySQL Second Generation instances: MYSQL_5_7 (default) or MYSQL_5_6.
- // PostgreSQL instances: POSTGRES_9_6 MySQL First Generation instances:
- // MYSQL_5_6 (default) or MYSQL_5_5
- DatabaseVersion string `json:"databaseVersion,omitempty"`
-
- // Etag: This field is deprecated and will be removed from a future
- // version of the API. Use the settings.settingsVersion field instead.
- Etag string `json:"etag,omitempty"`
-
- // FailoverReplica: The name and status of the failover replica. This
- // property is applicable only to Second Generation instances.
- FailoverReplica *DatabaseInstanceFailoverReplica `json:"failoverReplica,omitempty"`
-
- // GceZone: The Compute Engine zone that the instance is currently
- // serving from. This value could be different from the zone that was
- // specified when the instance was created if the instance has failed
- // over to its secondary zone.
- GceZone string `json:"gceZone,omitempty"`
-
- // InstanceType: The instance type. This can be one of the
- // following.
- // CLOUD_SQL_INSTANCE: A Cloud SQL instance that is not replicating from
- // a master.
- // ON_PREMISES_INSTANCE: An instance running on the customer's
- // premises.
- // READ_REPLICA_INSTANCE: A Cloud SQL instance configured as a
- // read-replica.
- InstanceType string `json:"instanceType,omitempty"`
-
- // IpAddresses: The assigned IP addresses for the instance.
- IpAddresses []*IpMapping `json:"ipAddresses,omitempty"`
-
- // Ipv6Address: The IPv6 address assigned to the instance. This property
- // is applicable only to First Generation instances.
- Ipv6Address string `json:"ipv6Address,omitempty"`
-
- // Kind: This is always sql#instance.
- Kind string `json:"kind,omitempty"`
-
- // MasterInstanceName: The name of the instance which will act as master
- // in the replication setup.
- MasterInstanceName string `json:"masterInstanceName,omitempty"`
-
- // MaxDiskSize: The maximum disk size of the instance in bytes.
- MaxDiskSize int64 `json:"maxDiskSize,omitempty,string"`
-
- // Name: Name of the Cloud SQL instance. This does not include the
- // project ID.
- Name string `json:"name,omitempty"`
-
- // OnPremisesConfiguration: Configuration specific to on-premises
- // instances.
- OnPremisesConfiguration *OnPremisesConfiguration `json:"onPremisesConfiguration,omitempty"`
-
- // Project: The project ID of the project containing the Cloud SQL
- // instance. The Google apps domain is prefixed if applicable.
- Project string `json:"project,omitempty"`
-
- // Region: The geographical region. Can be us-central (FIRST_GEN
- // instances only), us-central1 (SECOND_GEN instances only), asia-east1
- // or europe-west1. Defaults to us-central or us-central1 depending on
- // the instance type (First Generation or Second Generation). The region
- // can not be changed after instance creation.
- Region string `json:"region,omitempty"`
-
- // ReplicaConfiguration: Configuration specific to failover replicas and
- // read replicas.
- ReplicaConfiguration *ReplicaConfiguration `json:"replicaConfiguration,omitempty"`
-
- // ReplicaNames: The replicas of the instance.
- ReplicaNames []string `json:"replicaNames,omitempty"`
-
- // SelfLink: The URI of this resource.
- SelfLink string `json:"selfLink,omitempty"`
-
- // ServerCaCert: SSL configuration.
- ServerCaCert *SslCert `json:"serverCaCert,omitempty"`
-
- // ServiceAccountEmailAddress: The service account email address
- // assigned to the instance. This property is applicable only to Second
- // Generation instances.
- ServiceAccountEmailAddress string `json:"serviceAccountEmailAddress,omitempty"`
-
- // Settings: The user settings.
- Settings *Settings `json:"settings,omitempty"`
-
- // State: The current serving state of the Cloud SQL instance. This can
- // be one of the following.
- // RUNNABLE: The instance is running, or is ready to run when
- // accessed.
- // SUSPENDED: The instance is not available, for example due to problems
- // with billing.
- // PENDING_CREATE: The instance is being created.
- // MAINTENANCE: The instance is down for maintenance.
- // FAILED: The instance creation failed.
- // UNKNOWN_STATE: The state of the instance is unknown.
- State string `json:"state,omitempty"`
-
- // SuspensionReason: If the instance state is SUSPENDED, the reason for
- // the suspension.
- SuspensionReason []string `json:"suspensionReason,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "BackendType") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "BackendType") to include
- // in API requests with the JSON null value. By default, fields with
- // empty values are omitted from API requests. However, any field with
- // an empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *DatabaseInstance) MarshalJSON() ([]byte, error) {
- type NoMethod DatabaseInstance
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // DatabaseInstanceFailoverReplica: The name and status of the failover
- // replica. This property is applicable only to Second Generation
- // instances.
- type DatabaseInstanceFailoverReplica struct {
- // Available: The availability status of the failover replica. A false
- // status indicates that the failover replica is out of sync. The master
- // can only failover to the falover replica when the status is true.
- Available bool `json:"available,omitempty"`
-
- // Name: The name of the failover replica. If specified at instance
- // creation, a failover replica is created for the instance. The name
- // doesn't include the project ID. This property is applicable only to
- // Second Generation instances.
- Name string `json:"name,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Available") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Available") to include in
- // API requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *DatabaseInstanceFailoverReplica) MarshalJSON() ([]byte, error) {
- type NoMethod DatabaseInstanceFailoverReplica
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // DatabasesListResponse: Database list response.
- type DatabasesListResponse struct {
- // Items: List of database resources in the instance.
- Items []*Database `json:"items,omitempty"`
-
- // Kind: This is always sql#databasesList.
- Kind string `json:"kind,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Items") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Items") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *DatabasesListResponse) MarshalJSON() ([]byte, error) {
- type NoMethod DatabasesListResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // DemoteMasterConfiguration: Read-replica configuration for connecting
- // to the on-premises master.
- type DemoteMasterConfiguration struct {
- // Kind: This is always sql#demoteMasterConfiguration.
- Kind string `json:"kind,omitempty"`
-
- // MysqlReplicaConfiguration: MySQL specific configuration when
- // replicating from a MySQL on-premises master. Replication
- // configuration information such as the username, password,
- // certificates, and keys are not stored in the instance metadata. The
- // configuration information is used only to set up the replication
- // connection and is stored by MySQL in a file named master.info in the
- // data directory.
- MysqlReplicaConfiguration *DemoteMasterMySqlReplicaConfiguration `json:"mysqlReplicaConfiguration,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Kind") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Kind") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *DemoteMasterConfiguration) MarshalJSON() ([]byte, error) {
- type NoMethod DemoteMasterConfiguration
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // DemoteMasterContext: Database instance demote master context.
- type DemoteMasterContext struct {
- // Kind: This is always sql#demoteMasterContext.
- Kind string `json:"kind,omitempty"`
-
- // MasterInstanceName: The name of the instance which will act as
- // on-premises master in the replication setup.
- MasterInstanceName string `json:"masterInstanceName,omitempty"`
-
- // ReplicaConfiguration: Configuration specific to read-replicas
- // replicating from the on-premises master.
- ReplicaConfiguration *DemoteMasterConfiguration `json:"replicaConfiguration,omitempty"`
-
- // VerifyGtidConsistency: Verify GTID consistency for demote operation.
- // Default value: True. Second Generation instances only. Setting this
- // flag to false enables you to bypass GTID consistency check between
- // on-premises master and Cloud SQL instance during the demotion
- // operation but also exposes you to the risk of future replication
- // failures. Change the value only if you know the reason for the GTID
- // divergence and are confident that doing so will not cause any
- // replication issues.
- VerifyGtidConsistency bool `json:"verifyGtidConsistency,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Kind") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Kind") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *DemoteMasterContext) MarshalJSON() ([]byte, error) {
- type NoMethod DemoteMasterContext
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // DemoteMasterMySqlReplicaConfiguration: Read-replica configuration
- // specific to MySQL databases.
- type DemoteMasterMySqlReplicaConfiguration struct {
- // CaCertificate: PEM representation of the trusted CA's x509
- // certificate.
- CaCertificate string `json:"caCertificate,omitempty"`
-
- // ClientCertificate: PEM representation of the slave's x509
- // certificate.
- ClientCertificate string `json:"clientCertificate,omitempty"`
-
- // ClientKey: PEM representation of the slave's private key. The
- // corresponsing public key is encoded in the client's certificate. The
- // format of the slave's private key can be either PKCS #1 or PKCS #8.
- ClientKey string `json:"clientKey,omitempty"`
-
- // Kind: This is always sql#demoteMasterMysqlReplicaConfiguration.
- Kind string `json:"kind,omitempty"`
-
- // Password: The password for the replication connection.
- Password string `json:"password,omitempty"`
-
- // Username: The username for the replication connection.
- Username string `json:"username,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "CaCertificate") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CaCertificate") to include
- // in API requests with the JSON null value. By default, fields with
- // empty values are omitted from API requests. However, any field with
- // an empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *DemoteMasterMySqlReplicaConfiguration) MarshalJSON() ([]byte, error) {
- type NoMethod DemoteMasterMySqlReplicaConfiguration
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // ExportContext: Database instance export context.
- type ExportContext struct {
- // CsvExportOptions: Options for exporting data as CSV.
- CsvExportOptions *ExportContextCsvExportOptions `json:"csvExportOptions,omitempty"`
-
- // Databases: Databases to be exported.
- // MySQL instances: If fileType is SQL and no database is specified, all
- // databases are exported, except for the mysql system database. If
- // fileType is CSV, you can specify one database, either by using this
- // property or by using the csvExportOptions.selectQuery property, which
- // takes precedence over this property.
- // PostgreSQL instances: Specify exactly one database to be exported. If
- // fileType is CSV, this database must match the database used in the
- // csvExportOptions.selectQuery property.
- Databases []string `json:"databases,omitempty"`
-
- // FileType: The file type for the specified uri.
- // SQL: The file contains SQL statements.
- // CSV: The file contains CSV data.
- FileType string `json:"fileType,omitempty"`
-
- // Kind: This is always sql#exportContext.
- Kind string `json:"kind,omitempty"`
-
- // SqlExportOptions: Options for exporting data as SQL statements.
- SqlExportOptions *ExportContextSqlExportOptions `json:"sqlExportOptions,omitempty"`
-
- // Uri: The path to the file in Google Cloud Storage where the export
- // will be stored. The URI is in the form gs://bucketName/fileName. If
- // the file already exists, the requests succeeds, but the operation
- // fails. If fileType is SQL and the filename ends with .gz, the
- // contents are compressed.
- Uri string `json:"uri,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "CsvExportOptions") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CsvExportOptions") to
- // include in API requests with the JSON null value. By default, fields
- // with empty values are omitted from API requests. However, any field
- // with an empty value appearing in NullFields will be sent to the
- // server as null. It is an error if a field in this list has a
- // non-empty value. This may be used to include null fields in Patch
- // requests.
- NullFields []string `json:"-"`
- }
-
- func (s *ExportContext) MarshalJSON() ([]byte, error) {
- type NoMethod ExportContext
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // ExportContextCsvExportOptions: Options for exporting data as CSV.
- type ExportContextCsvExportOptions struct {
- // SelectQuery: The select query used to extract the data.
- SelectQuery string `json:"selectQuery,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "SelectQuery") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "SelectQuery") to include
- // in API requests with the JSON null value. By default, fields with
- // empty values are omitted from API requests. However, any field with
- // an empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *ExportContextCsvExportOptions) MarshalJSON() ([]byte, error) {
- type NoMethod ExportContextCsvExportOptions
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // ExportContextSqlExportOptions: Options for exporting data as SQL
- // statements.
- type ExportContextSqlExportOptions struct {
- // MysqlExportOptions: Options for exporting from MySQL.
- MysqlExportOptions *ExportContextSqlExportOptionsMysqlExportOptions `json:"mysqlExportOptions,omitempty"`
-
- // SchemaOnly: Export only schemas.
- SchemaOnly bool `json:"schemaOnly,omitempty"`
-
- // Tables: Tables to export, or that were exported, from the specified
- // database. If you specify tables, specify one and only one database.
- // For PostgreSQL instances, you can specify only one table.
- Tables []string `json:"tables,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "MysqlExportOptions")
- // to unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "MysqlExportOptions") to
- // include in API requests with the JSON null value. By default, fields
- // with empty values are omitted from API requests. However, any field
- // with an empty value appearing in NullFields will be sent to the
- // server as null. It is an error if a field in this list has a
- // non-empty value. This may be used to include null fields in Patch
- // requests.
- NullFields []string `json:"-"`
- }
-
- func (s *ExportContextSqlExportOptions) MarshalJSON() ([]byte, error) {
- type NoMethod ExportContextSqlExportOptions
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // ExportContextSqlExportOptionsMysqlExportOptions: Options for
- // exporting from MySQL.
- type ExportContextSqlExportOptionsMysqlExportOptions struct {
- // MasterData: Option to include SQL statement required to set up
- // replication. If set to 1, the dump file includes a CHANGE MASTER TO
- // statement with the binary log coordinates. If set to 2, the CHANGE
- // MASTER TO statement is written as a SQL comment, and has no effect.
- // All other values are ignored.
- MasterData int64 `json:"masterData,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "MasterData") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "MasterData") to include in
- // API requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *ExportContextSqlExportOptionsMysqlExportOptions) MarshalJSON() ([]byte, error) {
- type NoMethod ExportContextSqlExportOptionsMysqlExportOptions
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // FailoverContext: Database instance failover context.
- type FailoverContext struct {
- // Kind: This is always sql#failoverContext.
- Kind string `json:"kind,omitempty"`
-
- // SettingsVersion: The current settings version of this instance.
- // Request will be rejected if this version doesn't match the current
- // settings version.
- SettingsVersion int64 `json:"settingsVersion,omitempty,string"`
-
- // ForceSendFields is a list of field names (e.g. "Kind") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Kind") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *FailoverContext) MarshalJSON() ([]byte, error) {
- type NoMethod FailoverContext
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // Flag: A flag resource.
- type Flag struct {
- // AllowedStringValues: For STRING flags, a list of strings that the
- // value can be set to.
- AllowedStringValues []string `json:"allowedStringValues,omitempty"`
-
- // AppliesTo: The database version this flag applies to. Can be
- // MYSQL_5_5, MYSQL_5_6, or MYSQL_5_7. MYSQL_5_7 is applicable only to
- // Second Generation instances.
- AppliesTo []string `json:"appliesTo,omitempty"`
-
- // InBeta: True if the flag is only released in Beta.
- InBeta bool `json:"inBeta,omitempty"`
-
- // Kind: This is always sql#flag.
- Kind string `json:"kind,omitempty"`
-
- // MaxValue: For INTEGER flags, the maximum allowed value.
- MaxValue int64 `json:"maxValue,omitempty,string"`
-
- // MinValue: For INTEGER flags, the minimum allowed value.
- MinValue int64 `json:"minValue,omitempty,string"`
-
- // Name: This is the name of the flag. Flag names always use
- // underscores, not hyphens, e.g. max_allowed_packet
- Name string `json:"name,omitempty"`
-
- // RequiresRestart: Indicates whether changing this flag will trigger a
- // database restart. Only applicable to Second Generation instances.
- RequiresRestart bool `json:"requiresRestart,omitempty"`
-
- // Type: The type of the flag. Flags are typed to being BOOLEAN, STRING,
- // INTEGER or NONE. NONE is used for flags which do not take a value,
- // such as skip_grant_tables.
- Type string `json:"type,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "AllowedStringValues")
- // to unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "AllowedStringValues") to
- // include in API requests with the JSON null value. By default, fields
- // with empty values are omitted from API requests. However, any field
- // with an empty value appearing in NullFields will be sent to the
- // server as null. It is an error if a field in this list has a
- // non-empty value. This may be used to include null fields in Patch
- // requests.
- NullFields []string `json:"-"`
- }
-
- func (s *Flag) MarshalJSON() ([]byte, error) {
- type NoMethod Flag
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // FlagsListResponse: Flags list response.
- type FlagsListResponse struct {
- // Items: List of flags.
- Items []*Flag `json:"items,omitempty"`
-
- // Kind: This is always sql#flagsList.
- Kind string `json:"kind,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Items") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Items") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *FlagsListResponse) MarshalJSON() ([]byte, error) {
- type NoMethod FlagsListResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // ImportContext: Database instance import context.
- type ImportContext struct {
- // CsvImportOptions: Options for importing data as CSV.
- CsvImportOptions *ImportContextCsvImportOptions `json:"csvImportOptions,omitempty"`
-
- // Database: The target database for the import. If fileType is SQL,
- // this field is required only if the import file does not specify a
- // database, and is overridden by any database specification in the
- // import file. If fileType is CSV, one database must be specified.
- Database string `json:"database,omitempty"`
-
- // FileType: The file type for the specified uri.
- // SQL: The file contains SQL statements.
- // CSV: The file contains CSV data.
- FileType string `json:"fileType,omitempty"`
-
- // ImportUser: The PostgreSQL user for this import operation. PostgreSQL
- // instances only.
- ImportUser string `json:"importUser,omitempty"`
-
- // Kind: This is always sql#importContext.
- Kind string `json:"kind,omitempty"`
-
- // Uri: Path to the import file in Cloud Storage, in the form
- // gs://bucketName/fileName. Compressed gzip files (.gz) are supported
- // when fileType is SQL. The instance must have write permissions to the
- // bucket and read access to the file.
- Uri string `json:"uri,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "CsvImportOptions") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CsvImportOptions") to
- // include in API requests with the JSON null value. By default, fields
- // with empty values are omitted from API requests. However, any field
- // with an empty value appearing in NullFields will be sent to the
- // server as null. It is an error if a field in this list has a
- // non-empty value. This may be used to include null fields in Patch
- // requests.
- NullFields []string `json:"-"`
- }
-
- func (s *ImportContext) MarshalJSON() ([]byte, error) {
- type NoMethod ImportContext
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // ImportContextCsvImportOptions: Options for importing data as CSV.
- type ImportContextCsvImportOptions struct {
- // Columns: The columns to which CSV data is imported. If not specified,
- // all columns of the database table are loaded with CSV data.
- Columns []string `json:"columns,omitempty"`
-
- // Table: The table to which CSV data is imported.
- Table string `json:"table,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Columns") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Columns") to include in
- // API requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *ImportContextCsvImportOptions) MarshalJSON() ([]byte, error) {
- type NoMethod ImportContextCsvImportOptions
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // InstancesCloneRequest: Database instance clone request.
- type InstancesCloneRequest struct {
- // CloneContext: Contains details about the clone operation.
- CloneContext *CloneContext `json:"cloneContext,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "CloneContext") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CloneContext") to include
- // in API requests with the JSON null value. By default, fields with
- // empty values are omitted from API requests. However, any field with
- // an empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *InstancesCloneRequest) MarshalJSON() ([]byte, error) {
- type NoMethod InstancesCloneRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // InstancesDemoteMasterRequest: Database demote master request.
- type InstancesDemoteMasterRequest struct {
- // DemoteMasterContext: Contains details about the demoteMaster
- // operation.
- DemoteMasterContext *DemoteMasterContext `json:"demoteMasterContext,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "DemoteMasterContext")
- // to unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "DemoteMasterContext") to
- // include in API requests with the JSON null value. By default, fields
- // with empty values are omitted from API requests. However, any field
- // with an empty value appearing in NullFields will be sent to the
- // server as null. It is an error if a field in this list has a
- // non-empty value. This may be used to include null fields in Patch
- // requests.
- NullFields []string `json:"-"`
- }
-
- func (s *InstancesDemoteMasterRequest) MarshalJSON() ([]byte, error) {
- type NoMethod InstancesDemoteMasterRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // InstancesExportRequest: Database instance export request.
- type InstancesExportRequest struct {
- // ExportContext: Contains details about the export operation.
- ExportContext *ExportContext `json:"exportContext,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "ExportContext") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "ExportContext") to include
- // in API requests with the JSON null value. By default, fields with
- // empty values are omitted from API requests. However, any field with
- // an empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *InstancesExportRequest) MarshalJSON() ([]byte, error) {
- type NoMethod InstancesExportRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // InstancesFailoverRequest: Instance failover request.
- type InstancesFailoverRequest struct {
- // FailoverContext: Failover Context.
- FailoverContext *FailoverContext `json:"failoverContext,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "FailoverContext") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "FailoverContext") to
- // include in API requests with the JSON null value. By default, fields
- // with empty values are omitted from API requests. However, any field
- // with an empty value appearing in NullFields will be sent to the
- // server as null. It is an error if a field in this list has a
- // non-empty value. This may be used to include null fields in Patch
- // requests.
- NullFields []string `json:"-"`
- }
-
- func (s *InstancesFailoverRequest) MarshalJSON() ([]byte, error) {
- type NoMethod InstancesFailoverRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // InstancesImportRequest: Database instance import request.
- type InstancesImportRequest struct {
- // ImportContext: Contains details about the import operation.
- ImportContext *ImportContext `json:"importContext,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "ImportContext") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "ImportContext") to include
- // in API requests with the JSON null value. By default, fields with
- // empty values are omitted from API requests. However, any field with
- // an empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *InstancesImportRequest) MarshalJSON() ([]byte, error) {
- type NoMethod InstancesImportRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // InstancesListResponse: Database instances list response.
- type InstancesListResponse struct {
- // Items: List of database instance resources.
- Items []*DatabaseInstance `json:"items,omitempty"`
-
- // Kind: This is always sql#instancesList.
- Kind string `json:"kind,omitempty"`
-
- // NextPageToken: The continuation token, used to page through large
- // result sets. Provide this value in a subsequent request to return the
- // next page of results.
- NextPageToken string `json:"nextPageToken,omitempty"`
-
- // Warnings: List of warnings that ocurred while handling the request.
- Warnings []*ApiWarning `json:"warnings,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Items") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Items") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *InstancesListResponse) MarshalJSON() ([]byte, error) {
- type NoMethod InstancesListResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // InstancesListServerCasResponse: Instances ListServerCas response.
- type InstancesListServerCasResponse struct {
- ActiveVersion string `json:"activeVersion,omitempty"`
-
- // Certs: List of server CA certificates for the instance.
- Certs []*SslCert `json:"certs,omitempty"`
-
- // Kind: This is always sql#instancesListServerCas.
- Kind string `json:"kind,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "ActiveVersion") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "ActiveVersion") to include
- // in API requests with the JSON null value. By default, fields with
- // empty values are omitted from API requests. However, any field with
- // an empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *InstancesListServerCasResponse) MarshalJSON() ([]byte, error) {
- type NoMethod InstancesListServerCasResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // InstancesRestoreBackupRequest: Database instance restore backup
- // request.
- type InstancesRestoreBackupRequest struct {
- // RestoreBackupContext: Parameters required to perform the restore
- // backup operation.
- RestoreBackupContext *RestoreBackupContext `json:"restoreBackupContext,omitempty"`
-
- // ForceSendFields is a list of field names (e.g.
- // "RestoreBackupContext") to unconditionally include in API requests.
- // By default, fields with empty values are omitted from API requests.
- // However, any non-pointer, non-interface field appearing in
- // ForceSendFields will be sent to the server regardless of whether the
- // field is empty or not. This may be used to include empty fields in
- // Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "RestoreBackupContext") to
- // include in API requests with the JSON null value. By default, fields
- // with empty values are omitted from API requests. However, any field
- // with an empty value appearing in NullFields will be sent to the
- // server as null. It is an error if a field in this list has a
- // non-empty value. This may be used to include null fields in Patch
- // requests.
- NullFields []string `json:"-"`
- }
-
- func (s *InstancesRestoreBackupRequest) MarshalJSON() ([]byte, error) {
- type NoMethod InstancesRestoreBackupRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // InstancesRotateServerCaRequest: Rotate Server CA request.
- type InstancesRotateServerCaRequest struct {
- // RotateServerCaContext: Contains details about the rotate server CA
- // operation.
- RotateServerCaContext *RotateServerCaContext `json:"rotateServerCaContext,omitempty"`
-
- // ForceSendFields is a list of field names (e.g.
- // "RotateServerCaContext") to unconditionally include in API requests.
- // By default, fields with empty values are omitted from API requests.
- // However, any non-pointer, non-interface field appearing in
- // ForceSendFields will be sent to the server regardless of whether the
- // field is empty or not. This may be used to include empty fields in
- // Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "RotateServerCaContext") to
- // include in API requests with the JSON null value. By default, fields
- // with empty values are omitted from API requests. However, any field
- // with an empty value appearing in NullFields will be sent to the
- // server as null. It is an error if a field in this list has a
- // non-empty value. This may be used to include null fields in Patch
- // requests.
- NullFields []string `json:"-"`
- }
-
- func (s *InstancesRotateServerCaRequest) MarshalJSON() ([]byte, error) {
- type NoMethod InstancesRotateServerCaRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // InstancesTruncateLogRequest: Instance truncate log request.
- type InstancesTruncateLogRequest struct {
- // TruncateLogContext: Contains details about the truncate log
- // operation.
- TruncateLogContext *TruncateLogContext `json:"truncateLogContext,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "TruncateLogContext")
- // to unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "TruncateLogContext") to
- // include in API requests with the JSON null value. By default, fields
- // with empty values are omitted from API requests. However, any field
- // with an empty value appearing in NullFields will be sent to the
- // server as null. It is an error if a field in this list has a
- // non-empty value. This may be used to include null fields in Patch
- // requests.
- NullFields []string `json:"-"`
- }
-
- func (s *InstancesTruncateLogRequest) MarshalJSON() ([]byte, error) {
- type NoMethod InstancesTruncateLogRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // IpConfiguration: IP Management configuration.
- type IpConfiguration struct {
- // AuthorizedNetworks: The list of external networks that are allowed to
- // connect to the instance using the IP. In CIDR notation, also known as
- // 'slash' notation (e.g. 192.168.100.0/24).
- AuthorizedNetworks []*AclEntry `json:"authorizedNetworks,omitempty"`
-
- // Ipv4Enabled: Whether the instance should be assigned an IP address or
- // not.
- Ipv4Enabled bool `json:"ipv4Enabled,omitempty"`
-
- // PrivateNetwork: The resource link for the VPC network from which the
- // Cloud SQL instance is accessible for private IP. For example,
- // /projects/myProject/global/networks/default. This setting can be
- // updated, but it cannot be removed after it is set.
- PrivateNetwork string `json:"privateNetwork,omitempty"`
-
- // RequireSsl: Whether SSL connections over IP should be enforced or
- // not.
- RequireSsl bool `json:"requireSsl,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "AuthorizedNetworks")
- // to unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "AuthorizedNetworks") to
- // include in API requests with the JSON null value. By default, fields
- // with empty values are omitted from API requests. However, any field
- // with an empty value appearing in NullFields will be sent to the
- // server as null. It is an error if a field in this list has a
- // non-empty value. This may be used to include null fields in Patch
- // requests.
- NullFields []string `json:"-"`
- }
-
- func (s *IpConfiguration) MarshalJSON() ([]byte, error) {
- type NoMethod IpConfiguration
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // IpMapping: Database instance IP Mapping.
- type IpMapping struct {
- // IpAddress: The IP address assigned.
- IpAddress string `json:"ipAddress,omitempty"`
-
- // TimeToRetire: The due time for this IP to be retired in RFC 3339
- // format, for example 2012-11-15T16:19:00.094Z. This field is only
- // available when the IP is scheduled to be retired.
- TimeToRetire string `json:"timeToRetire,omitempty"`
-
- // Type: The type of this IP address. A PRIMARY address is an address
- // that can accept incoming connections. An OUTGOING address is the
- // source address of connections originating from the instance, if
- // supported.
- Type string `json:"type,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "IpAddress") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "IpAddress") to include in
- // API requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *IpMapping) MarshalJSON() ([]byte, error) {
- type NoMethod IpMapping
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // LocationPreference: Preferred location. This specifies where a Cloud
- // SQL instance should preferably be located, either in a specific
- // Compute Engine zone, or co-located with an App Engine application.
- // Note that if the preferred location is not available, the instance
- // will be located as close as possible within the region. Only one
- // location may be specified.
- type LocationPreference struct {
- // FollowGaeApplication: The AppEngine application to follow, it must be
- // in the same region as the Cloud SQL instance.
- FollowGaeApplication string `json:"followGaeApplication,omitempty"`
-
- // Kind: This is always sql#locationPreference.
- Kind string `json:"kind,omitempty"`
-
- // Zone: The preferred Compute Engine zone (e.g. us-central1-a,
- // us-central1-b, etc.).
- Zone string `json:"zone,omitempty"`
-
- // ForceSendFields is a list of field names (e.g.
- // "FollowGaeApplication") to unconditionally include in API requests.
- // By default, fields with empty values are omitted from API requests.
- // However, any non-pointer, non-interface field appearing in
- // ForceSendFields will be sent to the server regardless of whether the
- // field is empty or not. This may be used to include empty fields in
- // Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "FollowGaeApplication") to
- // include in API requests with the JSON null value. By default, fields
- // with empty values are omitted from API requests. However, any field
- // with an empty value appearing in NullFields will be sent to the
- // server as null. It is an error if a field in this list has a
- // non-empty value. This may be used to include null fields in Patch
- // requests.
- NullFields []string `json:"-"`
- }
-
- func (s *LocationPreference) MarshalJSON() ([]byte, error) {
- type NoMethod LocationPreference
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // MaintenanceWindow: Maintenance window. This specifies when a v2 Cloud
- // SQL instance should preferably be restarted for system maintenance
- // purposes.
- type MaintenanceWindow struct {
- // Day: day of week (1-7), starting on Monday.
- Day int64 `json:"day,omitempty"`
-
- // Hour: hour of day - 0 to 23.
- Hour int64 `json:"hour,omitempty"`
-
- // Kind: This is always sql#maintenanceWindow.
- Kind string `json:"kind,omitempty"`
-
- // UpdateTrack: Maintenance timing setting: canary (Earlier) or stable
- // (Later).
- // Learn more.
- UpdateTrack string `json:"updateTrack,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Day") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Day") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *MaintenanceWindow) MarshalJSON() ([]byte, error) {
- type NoMethod MaintenanceWindow
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // MySqlReplicaConfiguration: Read-replica configuration specific to
- // MySQL databases.
- type MySqlReplicaConfiguration struct {
- // CaCertificate: PEM representation of the trusted CA's x509
- // certificate.
- CaCertificate string `json:"caCertificate,omitempty"`
-
- // ClientCertificate: PEM representation of the slave's x509
- // certificate.
- ClientCertificate string `json:"clientCertificate,omitempty"`
-
- // ClientKey: PEM representation of the slave's private key. The
- // corresponsing public key is encoded in the client's certificate.
- ClientKey string `json:"clientKey,omitempty"`
-
- // ConnectRetryInterval: Seconds to wait between connect retries.
- // MySQL's default is 60 seconds.
- ConnectRetryInterval int64 `json:"connectRetryInterval,omitempty"`
-
- // DumpFilePath: Path to a SQL dump file in Google Cloud Storage from
- // which the slave instance is to be created. The URI is in the form
- // gs://bucketName/fileName. Compressed gzip files (.gz) are also
- // supported. Dumps should have the binlog co-ordinates from which
- // replication should begin. This can be accomplished by setting
- // --master-data to 1 when using mysqldump.
- DumpFilePath string `json:"dumpFilePath,omitempty"`
-
- // Kind: This is always sql#mysqlReplicaConfiguration.
- Kind string `json:"kind,omitempty"`
-
- // MasterHeartbeatPeriod: Interval in milliseconds between replication
- // heartbeats.
- MasterHeartbeatPeriod int64 `json:"masterHeartbeatPeriod,omitempty,string"`
-
- // Password: The password for the replication connection.
- Password string `json:"password,omitempty"`
-
- // SslCipher: A list of permissible ciphers to use for SSL encryption.
- SslCipher string `json:"sslCipher,omitempty"`
-
- // Username: The username for the replication connection.
- Username string `json:"username,omitempty"`
-
- // VerifyServerCertificate: Whether or not to check the master's Common
- // Name value in the certificate that it sends during the SSL handshake.
- VerifyServerCertificate bool `json:"verifyServerCertificate,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "CaCertificate") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CaCertificate") to include
- // in API requests with the JSON null value. By default, fields with
- // empty values are omitted from API requests. However, any field with
- // an empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *MySqlReplicaConfiguration) MarshalJSON() ([]byte, error) {
- type NoMethod MySqlReplicaConfiguration
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // OnPremisesConfiguration: On-premises instance configuration.
- type OnPremisesConfiguration struct {
- // HostPort: The host and port of the on-premises instance in host:port
- // format
- HostPort string `json:"hostPort,omitempty"`
-
- // Kind: This is always sql#onPremisesConfiguration.
- Kind string `json:"kind,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "HostPort") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "HostPort") to include in
- // API requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *OnPremisesConfiguration) MarshalJSON() ([]byte, error) {
- type NoMethod OnPremisesConfiguration
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // Operation: An Operation resource. For successful operations that
- // return an Operation resource, only the fields relevant to the
- // operation are populated in the resource.
- type Operation struct {
- // EndTime: The time this operation finished in UTC timezone in RFC 3339
- // format, for example 2012-11-15T16:19:00.094Z.
- EndTime string `json:"endTime,omitempty"`
-
- // Error: If errors occurred during processing of this operation, this
- // field will be populated.
- Error *OperationErrors `json:"error,omitempty"`
-
- // ExportContext: The context for export operation, if applicable.
- ExportContext *ExportContext `json:"exportContext,omitempty"`
-
- // ImportContext: The context for import operation, if applicable.
- ImportContext *ImportContext `json:"importContext,omitempty"`
-
- // InsertTime: The time this operation was enqueued in UTC timezone in
- // RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
- InsertTime string `json:"insertTime,omitempty"`
-
- // Kind: This is always sql#operation.
- Kind string `json:"kind,omitempty"`
-
- // Name: An identifier that uniquely identifies the operation. You can
- // use this identifier to retrieve the Operations resource that has
- // information about the operation.
- Name string `json:"name,omitempty"`
-
- // OperationType: The type of the operation. Valid values are CREATE,
- // DELETE, UPDATE, RESTART, IMPORT, EXPORT, BACKUP_VOLUME,
- // RESTORE_VOLUME, CREATE_USER, DELETE_USER, CREATE_DATABASE,
- // DELETE_DATABASE .
- OperationType string `json:"operationType,omitempty"`
-
- // SelfLink: The URI of this resource.
- SelfLink string `json:"selfLink,omitempty"`
-
- // StartTime: The time this operation actually started in UTC timezone
- // in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
- StartTime string `json:"startTime,omitempty"`
-
- // Status: The status of an operation. Valid values are PENDING,
- // RUNNING, DONE, UNKNOWN.
- Status string `json:"status,omitempty"`
-
- // TargetId: Name of the database instance related to this operation.
- TargetId string `json:"targetId,omitempty"`
-
- TargetLink string `json:"targetLink,omitempty"`
-
- // TargetProject: The project ID of the target instance related to this
- // operation.
- TargetProject string `json:"targetProject,omitempty"`
-
- // User: The email address of the user who initiated this operation.
- User string `json:"user,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "EndTime") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "EndTime") to include in
- // API requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *Operation) MarshalJSON() ([]byte, error) {
- type NoMethod Operation
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // OperationError: Database instance operation error.
- type OperationError struct {
- // Code: Identifies the specific error that occurred.
- Code string `json:"code,omitempty"`
-
- // Kind: This is always sql#operationError.
- Kind string `json:"kind,omitempty"`
-
- // Message: Additional information about the error encountered.
- Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *OperationError) MarshalJSON() ([]byte, error) {
- type NoMethod OperationError
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // OperationErrors: Database instance operation errors list wrapper.
- type OperationErrors struct {
- // Errors: The list of errors encountered while processing this
- // operation.
- Errors []*OperationError `json:"errors,omitempty"`
-
- // Kind: This is always sql#operationErrors.
- Kind string `json:"kind,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Errors") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Errors") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *OperationErrors) MarshalJSON() ([]byte, error) {
- type NoMethod OperationErrors
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // OperationsListResponse: Database instance list operations response.
- type OperationsListResponse struct {
- // Items: List of operation resources.
- Items []*Operation `json:"items,omitempty"`
-
- // Kind: This is always sql#operationsList.
- Kind string `json:"kind,omitempty"`
-
- // NextPageToken: The continuation token, used to page through large
- // result sets. Provide this value in a subsequent request to return the
- // next page of results.
- NextPageToken string `json:"nextPageToken,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Items") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Items") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *OperationsListResponse) MarshalJSON() ([]byte, error) {
- type NoMethod OperationsListResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // ReplicaConfiguration: Read-replica configuration for connecting to
- // the master.
- type ReplicaConfiguration struct {
- // FailoverTarget: Specifies if the replica is the failover target. If
- // the field is set to true the replica will be designated as a failover
- // replica. In case the master instance fails, the replica instance will
- // be promoted as the new master instance.
- // Only one replica can be specified as failover target, and the replica
- // has to be in different zone with the master instance.
- FailoverTarget bool `json:"failoverTarget,omitempty"`
-
- // Kind: This is always sql#replicaConfiguration.
- Kind string `json:"kind,omitempty"`
-
- // MysqlReplicaConfiguration: MySQL specific configuration when
- // replicating from a MySQL on-premises master. Replication
- // configuration information such as the username, password,
- // certificates, and keys are not stored in the instance metadata. The
- // configuration information is used only to set up the replication
- // connection and is stored by MySQL in a file named master.info in the
- // data directory.
- MysqlReplicaConfiguration *MySqlReplicaConfiguration `json:"mysqlReplicaConfiguration,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "FailoverTarget") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "FailoverTarget") to
- // include in API requests with the JSON null value. By default, fields
- // with empty values are omitted from API requests. However, any field
- // with an empty value appearing in NullFields will be sent to the
- // server as null. It is an error if a field in this list has a
- // non-empty value. This may be used to include null fields in Patch
- // requests.
- NullFields []string `json:"-"`
- }
-
- func (s *ReplicaConfiguration) MarshalJSON() ([]byte, error) {
- type NoMethod ReplicaConfiguration
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // RestoreBackupContext: Database instance restore from backup context.
- type RestoreBackupContext struct {
- // BackupRunId: The ID of the backup run to restore from.
- BackupRunId int64 `json:"backupRunId,omitempty,string"`
-
- // InstanceId: The ID of the instance that the backup was taken from.
- InstanceId string `json:"instanceId,omitempty"`
-
- // Kind: This is always sql#restoreBackupContext.
- Kind string `json:"kind,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "BackupRunId") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "BackupRunId") to include
- // in API requests with the JSON null value. By default, fields with
- // empty values are omitted from API requests. However, any field with
- // an empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *RestoreBackupContext) MarshalJSON() ([]byte, error) {
- type NoMethod RestoreBackupContext
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // RotateServerCaContext: Instance rotate server CA context.
- type RotateServerCaContext struct {
- // Kind: This is always sql#rotateServerCaContext.
- Kind string `json:"kind,omitempty"`
-
- // NextVersion: The fingerprint of the next version to be rotated to. If
- // left unspecified, will be rotated to the most recently added server
- // CA version.
- NextVersion string `json:"nextVersion,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Kind") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Kind") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *RotateServerCaContext) MarshalJSON() ([]byte, error) {
- type NoMethod RotateServerCaContext
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // Settings: Database instance settings.
- type Settings struct {
- // ActivationPolicy: The activation policy specifies when the instance
- // is activated; it is applicable only when the instance state is
- // RUNNABLE. Valid values:
- // ALWAYS: The instance is on, and remains so even in the absence of
- // connection requests.
- // NEVER: The instance is off; it is not activated, even if a connection
- // request arrives.
- // ON_DEMAND: First Generation instances only. The instance responds to
- // incoming requests, and turns itself off when not in use. Instances
- // with PER_USE pricing turn off after 15 minutes of inactivity.
- // Instances with PER_PACKAGE pricing turn off after 12 hours of
- // inactivity.
- ActivationPolicy string `json:"activationPolicy,omitempty"`
-
- // AuthorizedGaeApplications: The App Engine app IDs that can access
- // this instance. First Generation instances only.
- AuthorizedGaeApplications []string `json:"authorizedGaeApplications,omitempty"`
-
- // AvailabilityType: Availability type (PostgreSQL instances only).
- // Potential values:
- // ZONAL: The instance serves data from only one zone. Outages in that
- // zone affect data accessibility.
- // REGIONAL: The instance can serve data from more than one zone in a
- // region (it is highly available).
- // For more information, see Overview of the High Availability
- // Configuration.
- AvailabilityType string `json:"availabilityType,omitempty"`
-
- // BackupConfiguration: The daily backup configuration for the instance.
- BackupConfiguration *BackupConfiguration `json:"backupConfiguration,omitempty"`
-
- // CrashSafeReplicationEnabled: Configuration specific to read replica
- // instances. Indicates whether database flags for crash-safe
- // replication are enabled. This property is only applicable to First
- // Generation instances.
- CrashSafeReplicationEnabled bool `json:"crashSafeReplicationEnabled,omitempty"`
-
- // DataDiskSizeGb: The size of data disk, in GB. The data disk size
- // minimum is 10GB. Not used for First Generation instances.
- DataDiskSizeGb int64 `json:"dataDiskSizeGb,omitempty,string"`
-
- // DataDiskType: The type of data disk: PD_SSD (default) or PD_HDD. Not
- // used for First Generation instances.
- DataDiskType string `json:"dataDiskType,omitempty"`
-
- // DatabaseFlags: The database flags passed to the instance at startup.
- DatabaseFlags []*DatabaseFlags `json:"databaseFlags,omitempty"`
-
- // DatabaseReplicationEnabled: Configuration specific to read replica
- // instances. Indicates whether replication is enabled or not.
- DatabaseReplicationEnabled bool `json:"databaseReplicationEnabled,omitempty"`
-
- // IpConfiguration: The settings for IP Management. This allows to
- // enable or disable the instance IP and manage which external networks
- // can connect to the instance. The IPv4 address cannot be disabled for
- // Second Generation instances.
- IpConfiguration *IpConfiguration `json:"ipConfiguration,omitempty"`
-
- // Kind: This is always sql#settings.
- Kind string `json:"kind,omitempty"`
-
- // LocationPreference: The location preference settings. This allows the
- // instance to be located as near as possible to either an App Engine
- // app or Compute Engine zone for better performance. App Engine
- // co-location is only applicable to First Generation instances.
- LocationPreference *LocationPreference `json:"locationPreference,omitempty"`
-
- // MaintenanceWindow: The maintenance window for this instance. This
- // specifies when the instance can be restarted for maintenance
- // purposes. Not used for First Generation instances.
- MaintenanceWindow *MaintenanceWindow `json:"maintenanceWindow,omitempty"`
-
- // PricingPlan: The pricing plan for this instance. This can be either
- // PER_USE or PACKAGE. Only PER_USE is supported for Second Generation
- // instances.
- PricingPlan string `json:"pricingPlan,omitempty"`
-
- // ReplicationType: The type of replication this instance uses. This can
- // be either ASYNCHRONOUS or SYNCHRONOUS. This property is only
- // applicable to First Generation instances.
- ReplicationType string `json:"replicationType,omitempty"`
-
- // SettingsVersion: The version of instance settings. This is a required
- // field for update method to make sure concurrent updates are handled
- // properly. During update, use the most recent settingsVersion value
- // for this instance and do not try to update this value.
- SettingsVersion int64 `json:"settingsVersion,omitempty,string"`
-
- // StorageAutoResize: Configuration to increase storage size
- // automatically. The default value is true. Not used for First
- // Generation instances.
- StorageAutoResize *bool `json:"storageAutoResize,omitempty"`
-
- // StorageAutoResizeLimit: The maximum size to which storage capacity
- // can be automatically increased. The default value is 0, which
- // specifies that there is no limit. Not used for First Generation
- // instances.
- StorageAutoResizeLimit int64 `json:"storageAutoResizeLimit,omitempty,string"`
-
- // Tier: The tier (or machine type) for this instance, for example
- // db-n1-standard-1 (MySQL instances) or db-custom-1-3840 (PostgreSQL
- // instances). For MySQL instances, this property determines whether the
- // instance is First or Second Generation. For more information, see
- // Instance Settings.
- Tier string `json:"tier,omitempty"`
-
- // UserLabels: User-provided labels, represented as a dictionary where
- // each label is a single key value pair.
- UserLabels map[string]string `json:"userLabels,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "ActivationPolicy") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "ActivationPolicy") to
- // include in API requests with the JSON null value. By default, fields
- // with empty values are omitted from API requests. However, any field
- // with an empty value appearing in NullFields will be sent to the
- // server as null. It is an error if a field in this list has a
- // non-empty value. This may be used to include null fields in Patch
- // requests.
- NullFields []string `json:"-"`
- }
-
- func (s *Settings) MarshalJSON() ([]byte, error) {
- type NoMethod Settings
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // SslCert: SslCerts Resource
- type SslCert struct {
- // Cert: PEM representation.
- Cert string `json:"cert,omitempty"`
-
- // CertSerialNumber: Serial number, as extracted from the certificate.
- CertSerialNumber string `json:"certSerialNumber,omitempty"`
-
- // CommonName: User supplied name. Constrained to [a-zA-Z.-_ ]+.
- CommonName string `json:"commonName,omitempty"`
-
- // CreateTime: The time when the certificate was created in RFC 3339
- // format, for example 2012-11-15T16:19:00.094Z
- CreateTime string `json:"createTime,omitempty"`
-
- // ExpirationTime: The time when the certificate expires in RFC 3339
- // format, for example 2012-11-15T16:19:00.094Z.
- ExpirationTime string `json:"expirationTime,omitempty"`
-
- // Instance: Name of the database instance.
- Instance string `json:"instance,omitempty"`
-
- // Kind: This is always sql#sslCert.
- Kind string `json:"kind,omitempty"`
-
- // SelfLink: The URI of this resource.
- SelfLink string `json:"selfLink,omitempty"`
-
- // Sha1Fingerprint: Sha1 Fingerprint.
- Sha1Fingerprint string `json:"sha1Fingerprint,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Cert") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Cert") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *SslCert) MarshalJSON() ([]byte, error) {
- type NoMethod SslCert
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // SslCertDetail: SslCertDetail.
- type SslCertDetail struct {
- // CertInfo: The public information about the cert.
- CertInfo *SslCert `json:"certInfo,omitempty"`
-
- // CertPrivateKey: The private key for the client cert, in pem format.
- // Keep private in order to protect your security.
- CertPrivateKey string `json:"certPrivateKey,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "CertInfo") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CertInfo") to include in
- // API requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *SslCertDetail) MarshalJSON() ([]byte, error) {
- type NoMethod SslCertDetail
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // SslCertsCreateEphemeralRequest: SslCerts create ephemeral certificate
- // request.
- type SslCertsCreateEphemeralRequest struct {
- // PublicKey: PEM encoded public key to include in the signed
- // certificate.
- PublicKey string `json:"public_key,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "PublicKey") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "PublicKey") to include in
- // API requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *SslCertsCreateEphemeralRequest) MarshalJSON() ([]byte, error) {
- type NoMethod SslCertsCreateEphemeralRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // SslCertsInsertRequest: SslCerts insert request.
- type SslCertsInsertRequest struct {
- // CommonName: User supplied name. Must be a distinct name from the
- // other certificates for this instance.
- CommonName string `json:"commonName,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "CommonName") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CommonName") to include in
- // API requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *SslCertsInsertRequest) MarshalJSON() ([]byte, error) {
- type NoMethod SslCertsInsertRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // SslCertsInsertResponse: SslCert insert response.
- type SslCertsInsertResponse struct {
- // ClientCert: The new client certificate and private key. For First
- // Generation instances, the new certificate does not take effect until
- // the instance is restarted.
- ClientCert *SslCertDetail `json:"clientCert,omitempty"`
-
- // Kind: This is always sql#sslCertsInsert.
- Kind string `json:"kind,omitempty"`
-
- // Operation: The operation to track the ssl certs insert request.
- Operation *Operation `json:"operation,omitempty"`
-
- // ServerCaCert: The server Certificate Authority's certificate. If this
- // is missing you can force a new one to be generated by calling
- // resetSslConfig method on instances resource.
- ServerCaCert *SslCert `json:"serverCaCert,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "ClientCert") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "ClientCert") to include in
- // API requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *SslCertsInsertResponse) MarshalJSON() ([]byte, error) {
- type NoMethod SslCertsInsertResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // SslCertsListResponse: SslCerts list response.
- type SslCertsListResponse struct {
- // Items: List of client certificates for the instance.
- Items []*SslCert `json:"items,omitempty"`
-
- // Kind: This is always sql#sslCertsList.
- Kind string `json:"kind,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Items") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Items") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *SslCertsListResponse) MarshalJSON() ([]byte, error) {
- type NoMethod SslCertsListResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // Tier: A Google Cloud SQL service tier resource.
- type Tier struct {
- // DiskQuota: The maximum disk size of this tier in bytes.
- DiskQuota int64 `json:"DiskQuota,omitempty,string"`
-
- // RAM: The maximum RAM usage of this tier in bytes.
- RAM int64 `json:"RAM,omitempty,string"`
-
- // Kind: This is always sql#tier.
- Kind string `json:"kind,omitempty"`
-
- // Region: The applicable regions for this tier.
- Region []string `json:"region,omitempty"`
-
- // Tier: An identifier for the machine type, for example,
- // db-n1-standard-1. For related information, see Pricing.
- Tier string `json:"tier,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "DiskQuota") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "DiskQuota") to include in
- // API requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *Tier) MarshalJSON() ([]byte, error) {
- type NoMethod Tier
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // TiersListResponse: Tiers list response.
- type TiersListResponse struct {
- // Items: List of tiers.
- Items []*Tier `json:"items,omitempty"`
-
- // Kind: This is always sql#tiersList.
- Kind string `json:"kind,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Items") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Items") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *TiersListResponse) MarshalJSON() ([]byte, error) {
- type NoMethod TiersListResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // TruncateLogContext: Database Instance truncate log context.
- type TruncateLogContext struct {
- // Kind: This is always sql#truncateLogContext.
- Kind string `json:"kind,omitempty"`
-
- // LogType: The type of log to truncate. Valid values are
- // MYSQL_GENERAL_TABLE and MYSQL_SLOW_TABLE.
- LogType string `json:"logType,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Kind") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Kind") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *TruncateLogContext) MarshalJSON() ([]byte, error) {
- type NoMethod TruncateLogContext
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // User: A Cloud SQL user resource.
- type User struct {
- // Etag: This field is deprecated and will be removed from a future
- // version of the API.
- Etag string `json:"etag,omitempty"`
-
- // Host: The host name from which the user can connect. For insert
- // operations, host defaults to an empty string. For update operations,
- // host is specified as part of the request URL. The host name cannot be
- // updated after insertion.
- Host string `json:"host,omitempty"`
-
- // Instance: The name of the Cloud SQL instance. This does not include
- // the project ID. Can be omitted for update since it is already
- // specified on the URL.
- Instance string `json:"instance,omitempty"`
-
- // Kind: This is always sql#user.
- Kind string `json:"kind,omitempty"`
-
- // Name: The name of the user in the Cloud SQL instance. Can be omitted
- // for update since it is already specified in the URL.
- Name string `json:"name,omitempty"`
-
- // Password: The password for the user.
- Password string `json:"password,omitempty"`
-
- // Project: The project ID of the project containing the Cloud SQL
- // database. The Google apps domain is prefixed if applicable. Can be
- // omitted for update since it is already specified on the URL.
- Project string `json:"project,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Etag") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Etag") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *User) MarshalJSON() ([]byte, error) {
- type NoMethod User
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // UsersListResponse: User list response.
- type UsersListResponse struct {
- // Items: List of user resources in the instance.
- Items []*User `json:"items,omitempty"`
-
- // Kind: This is always sql#usersList.
- Kind string `json:"kind,omitempty"`
-
- // NextPageToken: An identifier that uniquely identifies the operation.
- // You can use this identifier to retrieve the Operations resource that
- // has information about the operation.
- NextPageToken string `json:"nextPageToken,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Items") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Items") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *UsersListResponse) MarshalJSON() ([]byte, error) {
- type NoMethod UsersListResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // method id "sql.backupRuns.delete":
-
- type BackupRunsDeleteCall struct {
- s *Service
- project string
- instance string
- id int64
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Delete: Deletes the backup taken by a backup run.
- func (r *BackupRunsService) Delete(project string, instance string, id int64) *BackupRunsDeleteCall {
- c := &BackupRunsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.id = id
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *BackupRunsDeleteCall) Fields(s ...googleapi.Field) *BackupRunsDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *BackupRunsDeleteCall) Context(ctx context.Context) *BackupRunsDeleteCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *BackupRunsDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *BackupRunsDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/backupRuns/{id}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- "id": strconv.FormatInt(c.id, 10),
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.backupRuns.delete" call.
- // Exactly one of *Operation or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *Operation.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *BackupRunsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Operation{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Deletes the backup taken by a backup run.",
- // "httpMethod": "DELETE",
- // "id": "sql.backupRuns.delete",
- // "parameterOrder": [
- // "project",
- // "instance",
- // "id"
- // ],
- // "parameters": {
- // "id": {
- // "description": "The ID of the Backup Run to delete. To find a Backup Run ID, use the list method.",
- // "format": "int64",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "instance": {
- // "description": "Cloud SQL instance ID. This does not include the project ID.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID of the project that contains the instance.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}/backupRuns/{id}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.backupRuns.get":
-
- type BackupRunsGetCall struct {
- s *Service
- project string
- instance string
- id int64
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // Get: Retrieves a resource containing information about a backup run.
- func (r *BackupRunsService) Get(project string, instance string, id int64) *BackupRunsGetCall {
- c := &BackupRunsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.id = id
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *BackupRunsGetCall) Fields(s ...googleapi.Field) *BackupRunsGetCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *BackupRunsGetCall) IfNoneMatch(entityTag string) *BackupRunsGetCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *BackupRunsGetCall) Context(ctx context.Context) *BackupRunsGetCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *BackupRunsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *BackupRunsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/backupRuns/{id}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("GET", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- "id": strconv.FormatInt(c.id, 10),
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.backupRuns.get" call.
- // Exactly one of *BackupRun or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *BackupRun.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *BackupRunsGetCall) Do(opts ...googleapi.CallOption) (*BackupRun, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &BackupRun{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Retrieves a resource containing information about a backup run.",
- // "httpMethod": "GET",
- // "id": "sql.backupRuns.get",
- // "parameterOrder": [
- // "project",
- // "instance",
- // "id"
- // ],
- // "parameters": {
- // "id": {
- // "description": "The ID of this Backup Run.",
- // "format": "int64",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "instance": {
- // "description": "Cloud SQL instance ID. This does not include the project ID.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID of the project that contains the instance.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}/backupRuns/{id}",
- // "response": {
- // "$ref": "BackupRun"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.backupRuns.insert":
-
- type BackupRunsInsertCall struct {
- s *Service
- project string
- instance string
- backuprun *BackupRun
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Insert: Creates a new backup run on demand. This method is applicable
- // only to Second Generation instances.
- func (r *BackupRunsService) Insert(project string, instance string, backuprun *BackupRun) *BackupRunsInsertCall {
- c := &BackupRunsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.backuprun = backuprun
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *BackupRunsInsertCall) Fields(s ...googleapi.Field) *BackupRunsInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *BackupRunsInsertCall) Context(ctx context.Context) *BackupRunsInsertCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *BackupRunsInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *BackupRunsInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.backuprun)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/backupRuns")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.backupRuns.insert" call.
- // Exactly one of *Operation or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *Operation.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *BackupRunsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Operation{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Creates a new backup run on demand. This method is applicable only to Second Generation instances.",
- // "httpMethod": "POST",
- // "id": "sql.backupRuns.insert",
- // "parameterOrder": [
- // "project",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Cloud SQL instance ID. This does not include the project ID.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID of the project that contains the instance.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}/backupRuns",
- // "request": {
- // "$ref": "BackupRun"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.backupRuns.list":
-
- type BackupRunsListCall struct {
- s *Service
- project string
- instance string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // List: Lists all backup runs associated with a given instance and
- // configuration in the reverse chronological order of the backup
- // initiation time.
- func (r *BackupRunsService) List(project string, instance string) *BackupRunsListCall {
- c := &BackupRunsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- return c
- }
-
- // MaxResults sets the optional parameter "maxResults": Maximum number
- // of backup runs per response.
- func (c *BackupRunsListCall) MaxResults(maxResults int64) *BackupRunsListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
- }
-
- // PageToken sets the optional parameter "pageToken": A
- // previously-returned page token representing part of the larger set of
- // results to view.
- func (c *BackupRunsListCall) PageToken(pageToken string) *BackupRunsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *BackupRunsListCall) Fields(s ...googleapi.Field) *BackupRunsListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *BackupRunsListCall) IfNoneMatch(entityTag string) *BackupRunsListCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *BackupRunsListCall) Context(ctx context.Context) *BackupRunsListCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *BackupRunsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *BackupRunsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/backupRuns")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("GET", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.backupRuns.list" call.
- // Exactly one of *BackupRunsListResponse or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *BackupRunsListResponse.ServerResponse.Header or (if a response was
- // returned at all) in error.(*googleapi.Error).Header. Use
- // googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *BackupRunsListCall) Do(opts ...googleapi.CallOption) (*BackupRunsListResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &BackupRunsListResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Lists all backup runs associated with a given instance and configuration in the reverse chronological order of the backup initiation time.",
- // "httpMethod": "GET",
- // "id": "sql.backupRuns.list",
- // "parameterOrder": [
- // "project",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Cloud SQL instance ID. This does not include the project ID.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "maxResults": {
- // "description": "Maximum number of backup runs per response.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "pageToken": {
- // "description": "A previously-returned page token representing part of the larger set of results to view.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID of the project that contains the instance.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}/backupRuns",
- // "response": {
- // "$ref": "BackupRunsListResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // Pages invokes f for each page of results.
- // A non-nil error returned from f will halt the iteration.
- // The provided context supersedes any context provided to the Context method.
- func (c *BackupRunsListCall) Pages(ctx context.Context, f func(*BackupRunsListResponse) error) error {
- c.ctx_ = ctx
- defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
- for {
- x, err := c.Do()
- if err != nil {
- return err
- }
- if err := f(x); err != nil {
- return err
- }
- if x.NextPageToken == "" {
- return nil
- }
- c.PageToken(x.NextPageToken)
- }
- }
-
- // method id "sql.databases.delete":
-
- type DatabasesDeleteCall struct {
- s *Service
- project string
- instance string
- database string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Delete: Deletes a database from a Cloud SQL instance.
- func (r *DatabasesService) Delete(project string, instance string, database string) *DatabasesDeleteCall {
- c := &DatabasesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.database = database
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *DatabasesDeleteCall) Fields(s ...googleapi.Field) *DatabasesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *DatabasesDeleteCall) Context(ctx context.Context) *DatabasesDeleteCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *DatabasesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *DatabasesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/databases/{database}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- "database": c.database,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.databases.delete" call.
- // Exactly one of *Operation or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *Operation.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *DatabasesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Operation{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Deletes a database from a Cloud SQL instance.",
- // "httpMethod": "DELETE",
- // "id": "sql.databases.delete",
- // "parameterOrder": [
- // "project",
- // "instance",
- // "database"
- // ],
- // "parameters": {
- // "database": {
- // "description": "Name of the database to be deleted in the instance.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "instance": {
- // "description": "Database instance ID. This does not include the project ID.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID of the project that contains the instance.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}/databases/{database}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.databases.get":
-
- type DatabasesGetCall struct {
- s *Service
- project string
- instance string
- database string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // Get: Retrieves a resource containing information about a database
- // inside a Cloud SQL instance.
- func (r *DatabasesService) Get(project string, instance string, database string) *DatabasesGetCall {
- c := &DatabasesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.database = database
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *DatabasesGetCall) Fields(s ...googleapi.Field) *DatabasesGetCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *DatabasesGetCall) IfNoneMatch(entityTag string) *DatabasesGetCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *DatabasesGetCall) Context(ctx context.Context) *DatabasesGetCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *DatabasesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *DatabasesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/databases/{database}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("GET", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- "database": c.database,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.databases.get" call.
- // Exactly one of *Database or error will be non-nil. Any non-2xx status
- // code is an error. Response headers are in either
- // *Database.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *DatabasesGetCall) Do(opts ...googleapi.CallOption) (*Database, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Database{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Retrieves a resource containing information about a database inside a Cloud SQL instance.",
- // "httpMethod": "GET",
- // "id": "sql.databases.get",
- // "parameterOrder": [
- // "project",
- // "instance",
- // "database"
- // ],
- // "parameters": {
- // "database": {
- // "description": "Name of the database in the instance.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "instance": {
- // "description": "Database instance ID. This does not include the project ID.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID of the project that contains the instance.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}/databases/{database}",
- // "response": {
- // "$ref": "Database"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.databases.insert":
-
- type DatabasesInsertCall struct {
- s *Service
- project string
- instance string
- database *Database
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Insert: Inserts a resource containing information about a database
- // inside a Cloud SQL instance.
- func (r *DatabasesService) Insert(project string, instance string, database *Database) *DatabasesInsertCall {
- c := &DatabasesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.database = database
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *DatabasesInsertCall) Fields(s ...googleapi.Field) *DatabasesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *DatabasesInsertCall) Context(ctx context.Context) *DatabasesInsertCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *DatabasesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *DatabasesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.database)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/databases")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.databases.insert" call.
- // Exactly one of *Operation or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *Operation.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *DatabasesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Operation{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Inserts a resource containing information about a database inside a Cloud SQL instance.",
- // "httpMethod": "POST",
- // "id": "sql.databases.insert",
- // "parameterOrder": [
- // "project",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Database instance ID. This does not include the project ID.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID of the project that contains the instance.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}/databases",
- // "request": {
- // "$ref": "Database"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.databases.list":
-
- type DatabasesListCall struct {
- s *Service
- project string
- instance string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // List: Lists databases in the specified Cloud SQL instance.
- func (r *DatabasesService) List(project string, instance string) *DatabasesListCall {
- c := &DatabasesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *DatabasesListCall) Fields(s ...googleapi.Field) *DatabasesListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *DatabasesListCall) IfNoneMatch(entityTag string) *DatabasesListCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *DatabasesListCall) Context(ctx context.Context) *DatabasesListCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *DatabasesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *DatabasesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/databases")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("GET", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.databases.list" call.
- // Exactly one of *DatabasesListResponse or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *DatabasesListResponse.ServerResponse.Header or (if a response was
- // returned at all) in error.(*googleapi.Error).Header. Use
- // googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *DatabasesListCall) Do(opts ...googleapi.CallOption) (*DatabasesListResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &DatabasesListResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Lists databases in the specified Cloud SQL instance.",
- // "httpMethod": "GET",
- // "id": "sql.databases.list",
- // "parameterOrder": [
- // "project",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Cloud SQL instance ID. This does not include the project ID.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID of the project that contains the instance.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}/databases",
- // "response": {
- // "$ref": "DatabasesListResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.databases.patch":
-
- type DatabasesPatchCall struct {
- s *Service
- project string
- instance string
- database string
- database2 *Database
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Patch: Updates a resource containing information about a database
- // inside a Cloud SQL instance. This method supports patch semantics.
- func (r *DatabasesService) Patch(project string, instance string, database string, database2 *Database) *DatabasesPatchCall {
- c := &DatabasesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.database = database
- c.database2 = database2
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *DatabasesPatchCall) Fields(s ...googleapi.Field) *DatabasesPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *DatabasesPatchCall) Context(ctx context.Context) *DatabasesPatchCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *DatabasesPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *DatabasesPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.database2)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/databases/{database}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- "database": c.database,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.databases.patch" call.
- // Exactly one of *Operation or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *Operation.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *DatabasesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Operation{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Updates a resource containing information about a database inside a Cloud SQL instance. This method supports patch semantics.",
- // "httpMethod": "PATCH",
- // "id": "sql.databases.patch",
- // "parameterOrder": [
- // "project",
- // "instance",
- // "database"
- // ],
- // "parameters": {
- // "database": {
- // "description": "Name of the database to be updated in the instance.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "instance": {
- // "description": "Database instance ID. This does not include the project ID.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID of the project that contains the instance.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}/databases/{database}",
- // "request": {
- // "$ref": "Database"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.databases.update":
-
- type DatabasesUpdateCall struct {
- s *Service
- project string
- instance string
- database string
- database2 *Database
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Update: Updates a resource containing information about a database
- // inside a Cloud SQL instance.
- func (r *DatabasesService) Update(project string, instance string, database string, database2 *Database) *DatabasesUpdateCall {
- c := &DatabasesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.database = database
- c.database2 = database2
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *DatabasesUpdateCall) Fields(s ...googleapi.Field) *DatabasesUpdateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *DatabasesUpdateCall) Context(ctx context.Context) *DatabasesUpdateCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *DatabasesUpdateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *DatabasesUpdateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.database2)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/databases/{database}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PUT", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- "database": c.database,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.databases.update" call.
- // Exactly one of *Operation or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *Operation.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *DatabasesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Operation{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Updates a resource containing information about a database inside a Cloud SQL instance.",
- // "httpMethod": "PUT",
- // "id": "sql.databases.update",
- // "parameterOrder": [
- // "project",
- // "instance",
- // "database"
- // ],
- // "parameters": {
- // "database": {
- // "description": "Name of the database to be updated in the instance.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "instance": {
- // "description": "Database instance ID. This does not include the project ID.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID of the project that contains the instance.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}/databases/{database}",
- // "request": {
- // "$ref": "Database"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.flags.list":
-
- type FlagsListCall struct {
- s *Service
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // List: List all available database flags for Cloud SQL instances.
- func (r *FlagsService) List() *FlagsListCall {
- c := &FlagsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- return c
- }
-
- // DatabaseVersion sets the optional parameter "databaseVersion":
- // Database type and version you want to retrieve flags for. By default,
- // this method returns flags for all database types and versions.
- func (c *FlagsListCall) DatabaseVersion(databaseVersion string) *FlagsListCall {
- c.urlParams_.Set("databaseVersion", databaseVersion)
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *FlagsListCall) Fields(s ...googleapi.Field) *FlagsListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *FlagsListCall) IfNoneMatch(entityTag string) *FlagsListCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *FlagsListCall) Context(ctx context.Context) *FlagsListCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *FlagsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *FlagsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "flags")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("GET", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.flags.list" call.
- // Exactly one of *FlagsListResponse or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *FlagsListResponse.ServerResponse.Header or (if a response was
- // returned at all) in error.(*googleapi.Error).Header. Use
- // googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *FlagsListCall) Do(opts ...googleapi.CallOption) (*FlagsListResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &FlagsListResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "List all available database flags for Cloud SQL instances.",
- // "httpMethod": "GET",
- // "id": "sql.flags.list",
- // "parameters": {
- // "databaseVersion": {
- // "description": "Database type and version you want to retrieve flags for. By default, this method returns flags for all database types and versions.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "flags",
- // "response": {
- // "$ref": "FlagsListResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.instances.addServerCa":
-
- type InstancesAddServerCaCall struct {
- s *Service
- project string
- instance string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // AddServerCa: Add a new trusted Certificate Authority (CA) version for
- // the specified instance. Required to prepare for a certificate
- // rotation. If a CA version was previously added but never used in a
- // certificate rotation, this operation replaces that version. There
- // cannot be more than one CA version waiting to be rotated in.
- func (r *InstancesService) AddServerCa(project string, instance string) *InstancesAddServerCaCall {
- c := &InstancesAddServerCaCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *InstancesAddServerCaCall) Fields(s ...googleapi.Field) *InstancesAddServerCaCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *InstancesAddServerCaCall) Context(ctx context.Context) *InstancesAddServerCaCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *InstancesAddServerCaCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *InstancesAddServerCaCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/addServerCa")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.instances.addServerCa" call.
- // Exactly one of *Operation or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *Operation.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *InstancesAddServerCaCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Operation{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Add a new trusted Certificate Authority (CA) version for the specified instance. Required to prepare for a certificate rotation. If a CA version was previously added but never used in a certificate rotation, this operation replaces that version. There cannot be more than one CA version waiting to be rotated in.",
- // "httpMethod": "POST",
- // "id": "sql.instances.addServerCa",
- // "parameterOrder": [
- // "project",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Cloud SQL instance ID. This does not include the project ID.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID of the project that contains the instance.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}/addServerCa",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.instances.clone":
-
- type InstancesCloneCall struct {
- s *Service
- project string
- instance string
- instancesclonerequest *InstancesCloneRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Clone: Creates a Cloud SQL instance as a clone of the source
- // instance.
- func (r *InstancesService) Clone(project string, instance string, instancesclonerequest *InstancesCloneRequest) *InstancesCloneCall {
- c := &InstancesCloneCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.instancesclonerequest = instancesclonerequest
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *InstancesCloneCall) Fields(s ...googleapi.Field) *InstancesCloneCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *InstancesCloneCall) Context(ctx context.Context) *InstancesCloneCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *InstancesCloneCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *InstancesCloneCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesclonerequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/clone")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.instances.clone" call.
- // Exactly one of *Operation or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *Operation.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *InstancesCloneCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Operation{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Creates a Cloud SQL instance as a clone of the source instance.",
- // "httpMethod": "POST",
- // "id": "sql.instances.clone",
- // "parameterOrder": [
- // "project",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "The ID of the Cloud SQL instance to be cloned (source). This does not include the project ID.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID of the source as well as the clone Cloud SQL instance.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}/clone",
- // "request": {
- // "$ref": "InstancesCloneRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.instances.delete":
-
- type InstancesDeleteCall struct {
- s *Service
- project string
- instance string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Delete: Deletes a Cloud SQL instance.
- func (r *InstancesService) Delete(project string, instance string) *InstancesDeleteCall {
- c := &InstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *InstancesDeleteCall) Fields(s ...googleapi.Field) *InstancesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *InstancesDeleteCall) Context(ctx context.Context) *InstancesDeleteCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *InstancesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.instances.delete" call.
- // Exactly one of *Operation or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *Operation.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *InstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Operation{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Deletes a Cloud SQL instance.",
- // "httpMethod": "DELETE",
- // "id": "sql.instances.delete",
- // "parameterOrder": [
- // "project",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Cloud SQL instance ID. This does not include the project ID.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID of the project that contains the instance to be deleted.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.instances.demoteMaster":
-
- type InstancesDemoteMasterCall struct {
- s *Service
- project string
- instance string
- instancesdemotemasterrequest *InstancesDemoteMasterRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // DemoteMaster: Demotes the stand-alone instance to be a Cloud SQL read
- // replica for an external database server.
- func (r *InstancesService) DemoteMaster(project string, instance string, instancesdemotemasterrequest *InstancesDemoteMasterRequest) *InstancesDemoteMasterCall {
- c := &InstancesDemoteMasterCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.instancesdemotemasterrequest = instancesdemotemasterrequest
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *InstancesDemoteMasterCall) Fields(s ...googleapi.Field) *InstancesDemoteMasterCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *InstancesDemoteMasterCall) Context(ctx context.Context) *InstancesDemoteMasterCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *InstancesDemoteMasterCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *InstancesDemoteMasterCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesdemotemasterrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/demoteMaster")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.instances.demoteMaster" call.
- // Exactly one of *Operation or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *Operation.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *InstancesDemoteMasterCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Operation{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Demotes the stand-alone instance to be a Cloud SQL read replica for an external database server.",
- // "httpMethod": "POST",
- // "id": "sql.instances.demoteMaster",
- // "parameterOrder": [
- // "project",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Cloud SQL instance name.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "ID of the project that contains the instance.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}/demoteMaster",
- // "request": {
- // "$ref": "InstancesDemoteMasterRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.instances.export":
-
- type InstancesExportCall struct {
- s *Service
- project string
- instance string
- instancesexportrequest *InstancesExportRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Export: Exports data from a Cloud SQL instance to a Cloud Storage
- // bucket as a SQL dump or CSV file.
- func (r *InstancesService) Export(project string, instance string, instancesexportrequest *InstancesExportRequest) *InstancesExportCall {
- c := &InstancesExportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.instancesexportrequest = instancesexportrequest
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *InstancesExportCall) Fields(s ...googleapi.Field) *InstancesExportCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *InstancesExportCall) Context(ctx context.Context) *InstancesExportCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *InstancesExportCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *InstancesExportCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesexportrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/export")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.instances.export" call.
- // Exactly one of *Operation or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *Operation.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *InstancesExportCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Operation{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file.",
- // "httpMethod": "POST",
- // "id": "sql.instances.export",
- // "parameterOrder": [
- // "project",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Cloud SQL instance ID. This does not include the project ID.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID of the project that contains the instance to be exported.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}/export",
- // "request": {
- // "$ref": "InstancesExportRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform"
- // ]
- // }
-
- }
-
- // method id "sql.instances.failover":
-
- type InstancesFailoverCall struct {
- s *Service
- project string
- instance string
- instancesfailoverrequest *InstancesFailoverRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Failover: Failover the instance to its failover replica instance.
- func (r *InstancesService) Failover(project string, instance string, instancesfailoverrequest *InstancesFailoverRequest) *InstancesFailoverCall {
- c := &InstancesFailoverCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.instancesfailoverrequest = instancesfailoverrequest
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *InstancesFailoverCall) Fields(s ...googleapi.Field) *InstancesFailoverCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *InstancesFailoverCall) Context(ctx context.Context) *InstancesFailoverCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *InstancesFailoverCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *InstancesFailoverCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesfailoverrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/failover")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.instances.failover" call.
- // Exactly one of *Operation or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *Operation.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *InstancesFailoverCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Operation{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Failover the instance to its failover replica instance.",
- // "httpMethod": "POST",
- // "id": "sql.instances.failover",
- // "parameterOrder": [
- // "project",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Cloud SQL instance ID. This does not include the project ID.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "ID of the project that contains the read replica.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}/failover",
- // "request": {
- // "$ref": "InstancesFailoverRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.instances.get":
-
- type InstancesGetCall struct {
- s *Service
- project string
- instance string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // Get: Retrieves a resource containing information about a Cloud SQL
- // instance.
- func (r *InstancesService) Get(project string, instance string) *InstancesGetCall {
- c := &InstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *InstancesGetCall) Fields(s ...googleapi.Field) *InstancesGetCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *InstancesGetCall) IfNoneMatch(entityTag string) *InstancesGetCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *InstancesGetCall) Context(ctx context.Context) *InstancesGetCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *InstancesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("GET", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.instances.get" call.
- // Exactly one of *DatabaseInstance or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *DatabaseInstance.ServerResponse.Header or (if a response was
- // returned at all) in error.(*googleapi.Error).Header. Use
- // googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *InstancesGetCall) Do(opts ...googleapi.CallOption) (*DatabaseInstance, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &DatabaseInstance{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Retrieves a resource containing information about a Cloud SQL instance.",
- // "httpMethod": "GET",
- // "id": "sql.instances.get",
- // "parameterOrder": [
- // "project",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Database instance ID. This does not include the project ID.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID of the project that contains the instance.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}",
- // "response": {
- // "$ref": "DatabaseInstance"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.instances.import":
-
- type InstancesImportCall struct {
- s *Service
- project string
- instance string
- instancesimportrequest *InstancesImportRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Import: Imports data into a Cloud SQL instance from a SQL dump or CSV
- // file in Cloud Storage.
- func (r *InstancesService) Import(project string, instance string, instancesimportrequest *InstancesImportRequest) *InstancesImportCall {
- c := &InstancesImportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.instancesimportrequest = instancesimportrequest
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *InstancesImportCall) Fields(s ...googleapi.Field) *InstancesImportCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *InstancesImportCall) Context(ctx context.Context) *InstancesImportCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *InstancesImportCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *InstancesImportCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesimportrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/import")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.instances.import" call.
- // Exactly one of *Operation or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *Operation.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *InstancesImportCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Operation{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage.",
- // "httpMethod": "POST",
- // "id": "sql.instances.import",
- // "parameterOrder": [
- // "project",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Cloud SQL instance ID. This does not include the project ID.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID of the project that contains the instance.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}/import",
- // "request": {
- // "$ref": "InstancesImportRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform"
- // ]
- // }
-
- }
-
- // method id "sql.instances.insert":
-
- type InstancesInsertCall struct {
- s *Service
- project string
- databaseinstance *DatabaseInstance
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Insert: Creates a new Cloud SQL instance.
- func (r *InstancesService) Insert(project string, databaseinstance *DatabaseInstance) *InstancesInsertCall {
- c := &InstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.databaseinstance = databaseinstance
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *InstancesInsertCall) Fields(s ...googleapi.Field) *InstancesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *InstancesInsertCall) Context(ctx context.Context) *InstancesInsertCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *InstancesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.instances.insert" call.
- // Exactly one of *Operation or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *Operation.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *InstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Operation{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Creates a new Cloud SQL instance.",
- // "httpMethod": "POST",
- // "id": "sql.instances.insert",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID of the project to which the newly created Cloud SQL instances should belong.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances",
- // "request": {
- // "$ref": "DatabaseInstance"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.instances.list":
-
- type InstancesListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // List: Lists instances under a given project in the alphabetical order
- // of the instance name.
- func (r *InstancesService) List(project string) *InstancesListCall {
- c := &InstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
- }
-
- // Filter sets the optional parameter "filter": An expression for
- // filtering the results of the request, such as by name or label.
- func (c *InstancesListCall) Filter(filter string) *InstancesListCall {
- c.urlParams_.Set("filter", filter)
- return c
- }
-
- // MaxResults sets the optional parameter "maxResults": The maximum
- // number of results to return per response.
- func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
- }
-
- // PageToken sets the optional parameter "pageToken": A
- // previously-returned page token representing part of the larger set of
- // results to view.
- func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *InstancesListCall) Fields(s ...googleapi.Field) *InstancesListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *InstancesListCall) IfNoneMatch(entityTag string) *InstancesListCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *InstancesListCall) Context(ctx context.Context) *InstancesListCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *InstancesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("GET", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.instances.list" call.
- // Exactly one of *InstancesListResponse or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *InstancesListResponse.ServerResponse.Header or (if a response was
- // returned at all) in error.(*googleapi.Error).Header. Use
- // googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *InstancesListCall) Do(opts ...googleapi.CallOption) (*InstancesListResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &InstancesListResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Lists instances under a given project in the alphabetical order of the instance name.",
- // "httpMethod": "GET",
- // "id": "sql.instances.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "An expression for filtering the results of the request, such as by name or label.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "description": "The maximum number of results to return per response.",
- // "format": "uint32",
- // "location": "query",
- // "type": "integer"
- // },
- // "pageToken": {
- // "description": "A previously-returned page token representing part of the larger set of results to view.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID of the project for which to list Cloud SQL instances.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances",
- // "response": {
- // "$ref": "InstancesListResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // Pages invokes f for each page of results.
- // A non-nil error returned from f will halt the iteration.
- // The provided context supersedes any context provided to the Context method.
- func (c *InstancesListCall) Pages(ctx context.Context, f func(*InstancesListResponse) error) error {
- c.ctx_ = ctx
- defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
- for {
- x, err := c.Do()
- if err != nil {
- return err
- }
- if err := f(x); err != nil {
- return err
- }
- if x.NextPageToken == "" {
- return nil
- }
- c.PageToken(x.NextPageToken)
- }
- }
-
- // method id "sql.instances.listServerCas":
-
- type InstancesListServerCasCall struct {
- s *Service
- project string
- instance string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // ListServerCas: Lists all of the trusted Certificate Authorities (CAs)
- // for the specified instance. There can be up to three CAs listed: the
- // CA that was used to sign the certificate that is currently in use, a
- // CA that has been added but not yet used to sign a certificate, and a
- // CA used to sign a certificate that has previously rotated out.
- func (r *InstancesService) ListServerCas(project string, instance string) *InstancesListServerCasCall {
- c := &InstancesListServerCasCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *InstancesListServerCasCall) Fields(s ...googleapi.Field) *InstancesListServerCasCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *InstancesListServerCasCall) IfNoneMatch(entityTag string) *InstancesListServerCasCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *InstancesListServerCasCall) Context(ctx context.Context) *InstancesListServerCasCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *InstancesListServerCasCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *InstancesListServerCasCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/listServerCas")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("GET", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.instances.listServerCas" call.
- // Exactly one of *InstancesListServerCasResponse or error will be
- // non-nil. Any non-2xx status code is an error. Response headers are in
- // either *InstancesListServerCasResponse.ServerResponse.Header or (if a
- // response was returned at all) in error.(*googleapi.Error).Header. Use
- // googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *InstancesListServerCasCall) Do(opts ...googleapi.CallOption) (*InstancesListServerCasResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &InstancesListServerCasResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Lists all of the trusted Certificate Authorities (CAs) for the specified instance. There can be up to three CAs listed: the CA that was used to sign the certificate that is currently in use, a CA that has been added but not yet used to sign a certificate, and a CA used to sign a certificate that has previously rotated out.",
- // "httpMethod": "GET",
- // "id": "sql.instances.listServerCas",
- // "parameterOrder": [
- // "project",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Cloud SQL instance ID. This does not include the project ID.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID of the project that contains the instance.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}/listServerCas",
- // "response": {
- // "$ref": "InstancesListServerCasResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.instances.patch":
-
- type InstancesPatchCall struct {
- s *Service
- project string
- instance string
- databaseinstance *DatabaseInstance
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Patch: Updates settings of a Cloud SQL instance. Caution: This is not
- // a partial update, so you must include values for all the settings
- // that you want to retain. For partial updates, use patch.. This method
- // supports patch semantics.
- func (r *InstancesService) Patch(project string, instance string, databaseinstance *DatabaseInstance) *InstancesPatchCall {
- c := &InstancesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.databaseinstance = databaseinstance
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *InstancesPatchCall) Fields(s ...googleapi.Field) *InstancesPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *InstancesPatchCall) Context(ctx context.Context) *InstancesPatchCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *InstancesPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *InstancesPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.instances.patch" call.
- // Exactly one of *Operation or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *Operation.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *InstancesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Operation{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Updates settings of a Cloud SQL instance. Caution: This is not a partial update, so you must include values for all the settings that you want to retain. For partial updates, use patch.. This method supports patch semantics.",
- // "httpMethod": "PATCH",
- // "id": "sql.instances.patch",
- // "parameterOrder": [
- // "project",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Cloud SQL instance ID. This does not include the project ID.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID of the project that contains the instance.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}",
- // "request": {
- // "$ref": "DatabaseInstance"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.instances.promoteReplica":
-
- type InstancesPromoteReplicaCall struct {
- s *Service
- project string
- instance string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // PromoteReplica: Promotes the read replica instance to be a
- // stand-alone Cloud SQL instance.
- func (r *InstancesService) PromoteReplica(project string, instance string) *InstancesPromoteReplicaCall {
- c := &InstancesPromoteReplicaCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *InstancesPromoteReplicaCall) Fields(s ...googleapi.Field) *InstancesPromoteReplicaCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *InstancesPromoteReplicaCall) Context(ctx context.Context) *InstancesPromoteReplicaCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *InstancesPromoteReplicaCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *InstancesPromoteReplicaCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/promoteReplica")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.instances.promoteReplica" call.
- // Exactly one of *Operation or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *Operation.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *InstancesPromoteReplicaCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Operation{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Promotes the read replica instance to be a stand-alone Cloud SQL instance.",
- // "httpMethod": "POST",
- // "id": "sql.instances.promoteReplica",
- // "parameterOrder": [
- // "project",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Cloud SQL read replica instance name.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "ID of the project that contains the read replica.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}/promoteReplica",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.instances.resetSslConfig":
-
- type InstancesResetSslConfigCall struct {
- s *Service
- project string
- instance string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // ResetSslConfig: Deletes all client certificates and generates a new
- // server SSL certificate for the instance.
- func (r *InstancesService) ResetSslConfig(project string, instance string) *InstancesResetSslConfigCall {
- c := &InstancesResetSslConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *InstancesResetSslConfigCall) Fields(s ...googleapi.Field) *InstancesResetSslConfigCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *InstancesResetSslConfigCall) Context(ctx context.Context) *InstancesResetSslConfigCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *InstancesResetSslConfigCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *InstancesResetSslConfigCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/resetSslConfig")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.instances.resetSslConfig" call.
- // Exactly one of *Operation or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *Operation.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *InstancesResetSslConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Operation{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Deletes all client certificates and generates a new server SSL certificate for the instance.",
- // "httpMethod": "POST",
- // "id": "sql.instances.resetSslConfig",
- // "parameterOrder": [
- // "project",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Cloud SQL instance ID. This does not include the project ID.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID of the project that contains the instance.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}/resetSslConfig",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.instances.restart":
-
- type InstancesRestartCall struct {
- s *Service
- project string
- instance string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Restart: Restarts a Cloud SQL instance.
- func (r *InstancesService) Restart(project string, instance string) *InstancesRestartCall {
- c := &InstancesRestartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *InstancesRestartCall) Fields(s ...googleapi.Field) *InstancesRestartCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *InstancesRestartCall) Context(ctx context.Context) *InstancesRestartCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *InstancesRestartCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *InstancesRestartCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/restart")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.instances.restart" call.
- // Exactly one of *Operation or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *Operation.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *InstancesRestartCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Operation{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Restarts a Cloud SQL instance.",
- // "httpMethod": "POST",
- // "id": "sql.instances.restart",
- // "parameterOrder": [
- // "project",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Cloud SQL instance ID. This does not include the project ID.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID of the project that contains the instance to be restarted.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}/restart",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.instances.restoreBackup":
-
- type InstancesRestoreBackupCall struct {
- s *Service
- project string
- instance string
- instancesrestorebackuprequest *InstancesRestoreBackupRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // RestoreBackup: Restores a backup of a Cloud SQL instance.
- func (r *InstancesService) RestoreBackup(project string, instance string, instancesrestorebackuprequest *InstancesRestoreBackupRequest) *InstancesRestoreBackupCall {
- c := &InstancesRestoreBackupCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.instancesrestorebackuprequest = instancesrestorebackuprequest
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *InstancesRestoreBackupCall) Fields(s ...googleapi.Field) *InstancesRestoreBackupCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *InstancesRestoreBackupCall) Context(ctx context.Context) *InstancesRestoreBackupCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *InstancesRestoreBackupCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *InstancesRestoreBackupCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesrestorebackuprequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/restoreBackup")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.instances.restoreBackup" call.
- // Exactly one of *Operation or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *Operation.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *InstancesRestoreBackupCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Operation{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Restores a backup of a Cloud SQL instance.",
- // "httpMethod": "POST",
- // "id": "sql.instances.restoreBackup",
- // "parameterOrder": [
- // "project",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Cloud SQL instance ID. This does not include the project ID.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID of the project that contains the instance.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}/restoreBackup",
- // "request": {
- // "$ref": "InstancesRestoreBackupRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.instances.rotateServerCa":
-
- type InstancesRotateServerCaCall struct {
- s *Service
- project string
- instance string
- instancesrotateservercarequest *InstancesRotateServerCaRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // RotateServerCa: Rotates the server certificate to one signed by the
- // Certificate Authority (CA) version previously added with the
- // addServerCA method.
- func (r *InstancesService) RotateServerCa(project string, instance string, instancesrotateservercarequest *InstancesRotateServerCaRequest) *InstancesRotateServerCaCall {
- c := &InstancesRotateServerCaCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.instancesrotateservercarequest = instancesrotateservercarequest
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *InstancesRotateServerCaCall) Fields(s ...googleapi.Field) *InstancesRotateServerCaCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *InstancesRotateServerCaCall) Context(ctx context.Context) *InstancesRotateServerCaCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *InstancesRotateServerCaCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *InstancesRotateServerCaCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesrotateservercarequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/rotateServerCa")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.instances.rotateServerCa" call.
- // Exactly one of *Operation or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *Operation.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *InstancesRotateServerCaCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Operation{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Rotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the addServerCA method.",
- // "httpMethod": "POST",
- // "id": "sql.instances.rotateServerCa",
- // "parameterOrder": [
- // "project",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Cloud SQL instance ID. This does not include the project ID.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID of the project that contains the instance.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}/rotateServerCa",
- // "request": {
- // "$ref": "InstancesRotateServerCaRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.instances.startReplica":
-
- type InstancesStartReplicaCall struct {
- s *Service
- project string
- instance string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // StartReplica: Starts the replication in the read replica instance.
- func (r *InstancesService) StartReplica(project string, instance string) *InstancesStartReplicaCall {
- c := &InstancesStartReplicaCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *InstancesStartReplicaCall) Fields(s ...googleapi.Field) *InstancesStartReplicaCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *InstancesStartReplicaCall) Context(ctx context.Context) *InstancesStartReplicaCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *InstancesStartReplicaCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *InstancesStartReplicaCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/startReplica")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.instances.startReplica" call.
- // Exactly one of *Operation or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *Operation.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *InstancesStartReplicaCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Operation{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Starts the replication in the read replica instance.",
- // "httpMethod": "POST",
- // "id": "sql.instances.startReplica",
- // "parameterOrder": [
- // "project",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Cloud SQL read replica instance name.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "ID of the project that contains the read replica.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}/startReplica",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.instances.stopReplica":
-
- type InstancesStopReplicaCall struct {
- s *Service
- project string
- instance string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // StopReplica: Stops the replication in the read replica instance.
- func (r *InstancesService) StopReplica(project string, instance string) *InstancesStopReplicaCall {
- c := &InstancesStopReplicaCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *InstancesStopReplicaCall) Fields(s ...googleapi.Field) *InstancesStopReplicaCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *InstancesStopReplicaCall) Context(ctx context.Context) *InstancesStopReplicaCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *InstancesStopReplicaCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *InstancesStopReplicaCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/stopReplica")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.instances.stopReplica" call.
- // Exactly one of *Operation or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *Operation.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *InstancesStopReplicaCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Operation{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Stops the replication in the read replica instance.",
- // "httpMethod": "POST",
- // "id": "sql.instances.stopReplica",
- // "parameterOrder": [
- // "project",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Cloud SQL read replica instance name.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "ID of the project that contains the read replica.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}/stopReplica",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.instances.truncateLog":
-
- type InstancesTruncateLogCall struct {
- s *Service
- project string
- instance string
- instancestruncatelogrequest *InstancesTruncateLogRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // TruncateLog: Truncate MySQL general and slow query log tables
- func (r *InstancesService) TruncateLog(project string, instance string, instancestruncatelogrequest *InstancesTruncateLogRequest) *InstancesTruncateLogCall {
- c := &InstancesTruncateLogCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.instancestruncatelogrequest = instancestruncatelogrequest
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *InstancesTruncateLogCall) Fields(s ...googleapi.Field) *InstancesTruncateLogCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *InstancesTruncateLogCall) Context(ctx context.Context) *InstancesTruncateLogCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *InstancesTruncateLogCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *InstancesTruncateLogCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancestruncatelogrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/truncateLog")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.instances.truncateLog" call.
- // Exactly one of *Operation or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *Operation.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *InstancesTruncateLogCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Operation{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Truncate MySQL general and slow query log tables",
- // "httpMethod": "POST",
- // "id": "sql.instances.truncateLog",
- // "parameterOrder": [
- // "project",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Cloud SQL instance ID. This does not include the project ID.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID of the Cloud SQL project.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}/truncateLog",
- // "request": {
- // "$ref": "InstancesTruncateLogRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.instances.update":
-
- type InstancesUpdateCall struct {
- s *Service
- project string
- instance string
- databaseinstance *DatabaseInstance
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Update: Updates settings of a Cloud SQL instance. Caution: This is
- // not a partial update, so you must include values for all the settings
- // that you want to retain. For partial updates, use patch.
- func (r *InstancesService) Update(project string, instance string, databaseinstance *DatabaseInstance) *InstancesUpdateCall {
- c := &InstancesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.databaseinstance = databaseinstance
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *InstancesUpdateCall) Fields(s ...googleapi.Field) *InstancesUpdateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *InstancesUpdateCall) Context(ctx context.Context) *InstancesUpdateCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *InstancesUpdateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *InstancesUpdateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PUT", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.instances.update" call.
- // Exactly one of *Operation or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *Operation.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *InstancesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Operation{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Updates settings of a Cloud SQL instance. Caution: This is not a partial update, so you must include values for all the settings that you want to retain. For partial updates, use patch.",
- // "httpMethod": "PUT",
- // "id": "sql.instances.update",
- // "parameterOrder": [
- // "project",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Cloud SQL instance ID. This does not include the project ID.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID of the project that contains the instance.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}",
- // "request": {
- // "$ref": "DatabaseInstance"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.operations.get":
-
- type OperationsGetCall struct {
- s *Service
- project string
- operation string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // Get: Retrieves an instance operation that has been performed on an
- // instance.
- func (r *OperationsService) Get(project string, operation string) *OperationsGetCall {
- c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.operation = operation
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *OperationsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/operations/{operation}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("GET", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "operation": c.operation,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.operations.get" call.
- // Exactly one of *Operation or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *Operation.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Operation{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Retrieves an instance operation that has been performed on an instance.",
- // "httpMethod": "GET",
- // "id": "sql.operations.get",
- // "parameterOrder": [
- // "project",
- // "operation"
- // ],
- // "parameters": {
- // "operation": {
- // "description": "Instance operation ID.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID of the project that contains the instance.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/operations/{operation}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.operations.list":
-
- type OperationsListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // List: Lists all instance operations that have been performed on the
- // given Cloud SQL instance in the reverse chronological order of the
- // start time.
- func (r *OperationsService) List(project string, instance string) *OperationsListCall {
- c := &OperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.urlParams_.Set("instance", instance)
- return c
- }
-
- // MaxResults sets the optional parameter "maxResults": Maximum number
- // of operations per response.
- func (c *OperationsListCall) MaxResults(maxResults int64) *OperationsListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
- }
-
- // PageToken sets the optional parameter "pageToken": A
- // previously-returned page token representing part of the larger set of
- // results to view.
- func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *OperationsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/operations")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("GET", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.operations.list" call.
- // Exactly one of *OperationsListResponse or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *OperationsListResponse.ServerResponse.Header or (if a response was
- // returned at all) in error.(*googleapi.Error).Header. Use
- // googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*OperationsListResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &OperationsListResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Lists all instance operations that have been performed on the given Cloud SQL instance in the reverse chronological order of the start time.",
- // "httpMethod": "GET",
- // "id": "sql.operations.list",
- // "parameterOrder": [
- // "project",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Cloud SQL instance ID. This does not include the project ID.",
- // "location": "query",
- // "required": true,
- // "type": "string"
- // },
- // "maxResults": {
- // "description": "Maximum number of operations per response.",
- // "format": "uint32",
- // "location": "query",
- // "type": "integer"
- // },
- // "pageToken": {
- // "description": "A previously-returned page token representing part of the larger set of results to view.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID of the project that contains the instance.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/operations",
- // "response": {
- // "$ref": "OperationsListResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // Pages invokes f for each page of results.
- // A non-nil error returned from f will halt the iteration.
- // The provided context supersedes any context provided to the Context method.
- func (c *OperationsListCall) Pages(ctx context.Context, f func(*OperationsListResponse) error) error {
- c.ctx_ = ctx
- defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
- for {
- x, err := c.Do()
- if err != nil {
- return err
- }
- if err := f(x); err != nil {
- return err
- }
- if x.NextPageToken == "" {
- return nil
- }
- c.PageToken(x.NextPageToken)
- }
- }
-
- // method id "sql.sslCerts.createEphemeral":
-
- type SslCertsCreateEphemeralCall struct {
- s *Service
- project string
- instance string
- sslcertscreateephemeralrequest *SslCertsCreateEphemeralRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // CreateEphemeral: Generates a short-lived X509 certificate containing
- // the provided public key and signed by a private key specific to the
- // target instance. Users may use the certificate to authenticate as
- // themselves when connecting to the database.
- func (r *SslCertsService) CreateEphemeral(project string, instance string, sslcertscreateephemeralrequest *SslCertsCreateEphemeralRequest) *SslCertsCreateEphemeralCall {
- c := &SslCertsCreateEphemeralCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.sslcertscreateephemeralrequest = sslcertscreateephemeralrequest
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *SslCertsCreateEphemeralCall) Fields(s ...googleapi.Field) *SslCertsCreateEphemeralCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *SslCertsCreateEphemeralCall) Context(ctx context.Context) *SslCertsCreateEphemeralCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *SslCertsCreateEphemeralCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *SslCertsCreateEphemeralCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertscreateephemeralrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/createEphemeral")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.sslCerts.createEphemeral" call.
- // Exactly one of *SslCert or error will be non-nil. Any non-2xx status
- // code is an error. Response headers are in either
- // *SslCert.ServerResponse.Header or (if a response was returned at all)
- // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
- // check whether the returned error was because http.StatusNotModified
- // was returned.
- func (c *SslCertsCreateEphemeralCall) Do(opts ...googleapi.CallOption) (*SslCert, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &SslCert{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Generates a short-lived X509 certificate containing the provided public key and signed by a private key specific to the target instance. Users may use the certificate to authenticate as themselves when connecting to the database.",
- // "httpMethod": "POST",
- // "id": "sql.sslCerts.createEphemeral",
- // "parameterOrder": [
- // "project",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Cloud SQL instance ID. This does not include the project ID.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID of the Cloud SQL project.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}/createEphemeral",
- // "request": {
- // "$ref": "SslCertsCreateEphemeralRequest"
- // },
- // "response": {
- // "$ref": "SslCert"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.sslCerts.delete":
-
- type SslCertsDeleteCall struct {
- s *Service
- project string
- instance string
- sha1Fingerprint string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Delete: Deletes the SSL certificate. For First Generation instances,
- // the certificate remains valid until the instance is restarted.
- func (r *SslCertsService) Delete(project string, instance string, sha1Fingerprint string) *SslCertsDeleteCall {
- c := &SslCertsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.sha1Fingerprint = sha1Fingerprint
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *SslCertsDeleteCall) Fields(s ...googleapi.Field) *SslCertsDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *SslCertsDeleteCall) Context(ctx context.Context) *SslCertsDeleteCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *SslCertsDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *SslCertsDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- "sha1Fingerprint": c.sha1Fingerprint,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.sslCerts.delete" call.
- // Exactly one of *Operation or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *Operation.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *SslCertsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Operation{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Deletes the SSL certificate. For First Generation instances, the certificate remains valid until the instance is restarted.",
- // "httpMethod": "DELETE",
- // "id": "sql.sslCerts.delete",
- // "parameterOrder": [
- // "project",
- // "instance",
- // "sha1Fingerprint"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Cloud SQL instance ID. This does not include the project ID.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID of the project that contains the instance.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "sha1Fingerprint": {
- // "description": "Sha1 FingerPrint.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.sslCerts.get":
-
- type SslCertsGetCall struct {
- s *Service
- project string
- instance string
- sha1Fingerprint string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // Get: Retrieves a particular SSL certificate. Does not include the
- // private key (required for usage). The private key must be saved from
- // the response to initial creation.
- func (r *SslCertsService) Get(project string, instance string, sha1Fingerprint string) *SslCertsGetCall {
- c := &SslCertsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.sha1Fingerprint = sha1Fingerprint
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *SslCertsGetCall) Fields(s ...googleapi.Field) *SslCertsGetCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *SslCertsGetCall) IfNoneMatch(entityTag string) *SslCertsGetCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *SslCertsGetCall) Context(ctx context.Context) *SslCertsGetCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *SslCertsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *SslCertsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("GET", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- "sha1Fingerprint": c.sha1Fingerprint,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.sslCerts.get" call.
- // Exactly one of *SslCert or error will be non-nil. Any non-2xx status
- // code is an error. Response headers are in either
- // *SslCert.ServerResponse.Header or (if a response was returned at all)
- // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
- // check whether the returned error was because http.StatusNotModified
- // was returned.
- func (c *SslCertsGetCall) Do(opts ...googleapi.CallOption) (*SslCert, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &SslCert{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Retrieves a particular SSL certificate. Does not include the private key (required for usage). The private key must be saved from the response to initial creation.",
- // "httpMethod": "GET",
- // "id": "sql.sslCerts.get",
- // "parameterOrder": [
- // "project",
- // "instance",
- // "sha1Fingerprint"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Cloud SQL instance ID. This does not include the project ID.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID of the project that contains the instance.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "sha1Fingerprint": {
- // "description": "Sha1 FingerPrint.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}",
- // "response": {
- // "$ref": "SslCert"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.sslCerts.insert":
-
- type SslCertsInsertCall struct {
- s *Service
- project string
- instance string
- sslcertsinsertrequest *SslCertsInsertRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Insert: Creates an SSL certificate and returns it along with the
- // private key and server certificate authority. The new certificate
- // will not be usable until the instance is restarted.
- func (r *SslCertsService) Insert(project string, instance string, sslcertsinsertrequest *SslCertsInsertRequest) *SslCertsInsertCall {
- c := &SslCertsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.sslcertsinsertrequest = sslcertsinsertrequest
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *SslCertsInsertCall) Fields(s ...googleapi.Field) *SslCertsInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *SslCertsInsertCall) Context(ctx context.Context) *SslCertsInsertCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *SslCertsInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *SslCertsInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertsinsertrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/sslCerts")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.sslCerts.insert" call.
- // Exactly one of *SslCertsInsertResponse or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *SslCertsInsertResponse.ServerResponse.Header or (if a response was
- // returned at all) in error.(*googleapi.Error).Header. Use
- // googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *SslCertsInsertCall) Do(opts ...googleapi.CallOption) (*SslCertsInsertResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &SslCertsInsertResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Creates an SSL certificate and returns it along with the private key and server certificate authority. The new certificate will not be usable until the instance is restarted.",
- // "httpMethod": "POST",
- // "id": "sql.sslCerts.insert",
- // "parameterOrder": [
- // "project",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Cloud SQL instance ID. This does not include the project ID.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID of the project that contains the instance.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}/sslCerts",
- // "request": {
- // "$ref": "SslCertsInsertRequest"
- // },
- // "response": {
- // "$ref": "SslCertsInsertResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.sslCerts.list":
-
- type SslCertsListCall struct {
- s *Service
- project string
- instance string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // List: Lists all of the current SSL certificates for the instance.
- func (r *SslCertsService) List(project string, instance string) *SslCertsListCall {
- c := &SslCertsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *SslCertsListCall) Fields(s ...googleapi.Field) *SslCertsListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *SslCertsListCall) IfNoneMatch(entityTag string) *SslCertsListCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *SslCertsListCall) Context(ctx context.Context) *SslCertsListCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *SslCertsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *SslCertsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/sslCerts")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("GET", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.sslCerts.list" call.
- // Exactly one of *SslCertsListResponse or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *SslCertsListResponse.ServerResponse.Header or (if a response was
- // returned at all) in error.(*googleapi.Error).Header. Use
- // googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *SslCertsListCall) Do(opts ...googleapi.CallOption) (*SslCertsListResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &SslCertsListResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Lists all of the current SSL certificates for the instance.",
- // "httpMethod": "GET",
- // "id": "sql.sslCerts.list",
- // "parameterOrder": [
- // "project",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Cloud SQL instance ID. This does not include the project ID.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID of the project that contains the instance.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}/sslCerts",
- // "response": {
- // "$ref": "SslCertsListResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.tiers.list":
-
- type TiersListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // List: Lists all available machine types (tiers) for Cloud SQL, for
- // example, db-n1-standard-1. For related information, see Pricing.
- func (r *TiersService) List(project string) *TiersListCall {
- c := &TiersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *TiersListCall) Fields(s ...googleapi.Field) *TiersListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *TiersListCall) IfNoneMatch(entityTag string) *TiersListCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *TiersListCall) Context(ctx context.Context) *TiersListCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *TiersListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *TiersListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/tiers")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("GET", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.tiers.list" call.
- // Exactly one of *TiersListResponse or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *TiersListResponse.ServerResponse.Header or (if a response was
- // returned at all) in error.(*googleapi.Error).Header. Use
- // googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *TiersListCall) Do(opts ...googleapi.CallOption) (*TiersListResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &TiersListResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Lists all available machine types (tiers) for Cloud SQL, for example, db-n1-standard-1. For related information, see Pricing.",
- // "httpMethod": "GET",
- // "id": "sql.tiers.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID of the project for which to list tiers.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/tiers",
- // "response": {
- // "$ref": "TiersListResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.users.delete":
-
- type UsersDeleteCall struct {
- s *Service
- project string
- instance string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Delete: Deletes a user from a Cloud SQL instance.
- func (r *UsersService) Delete(project string, instance string, host string, name string) *UsersDeleteCall {
- c := &UsersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.urlParams_.Set("host", host)
- c.urlParams_.Set("name", name)
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *UsersDeleteCall) Fields(s ...googleapi.Field) *UsersDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *UsersDeleteCall) Context(ctx context.Context) *UsersDeleteCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *UsersDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *UsersDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/users")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.users.delete" call.
- // Exactly one of *Operation or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *Operation.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *UsersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Operation{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Deletes a user from a Cloud SQL instance.",
- // "httpMethod": "DELETE",
- // "id": "sql.users.delete",
- // "parameterOrder": [
- // "project",
- // "instance",
- // "host",
- // "name"
- // ],
- // "parameters": {
- // "host": {
- // "description": "Host of the user in the instance.",
- // "location": "query",
- // "required": true,
- // "type": "string"
- // },
- // "instance": {
- // "description": "Database instance ID. This does not include the project ID.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "name": {
- // "description": "Name of the user in the instance.",
- // "location": "query",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID of the project that contains the instance.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}/users",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.users.insert":
-
- type UsersInsertCall struct {
- s *Service
- project string
- instance string
- user *User
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Insert: Creates a new user in a Cloud SQL instance.
- func (r *UsersService) Insert(project string, instance string, user *User) *UsersInsertCall {
- c := &UsersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.user = user
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *UsersInsertCall) Fields(s ...googleapi.Field) *UsersInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *UsersInsertCall) Context(ctx context.Context) *UsersInsertCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *UsersInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *UsersInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.user)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/users")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.users.insert" call.
- // Exactly one of *Operation or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *Operation.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *UsersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Operation{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Creates a new user in a Cloud SQL instance.",
- // "httpMethod": "POST",
- // "id": "sql.users.insert",
- // "parameterOrder": [
- // "project",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Database instance ID. This does not include the project ID.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID of the project that contains the instance.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}/users",
- // "request": {
- // "$ref": "User"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.users.list":
-
- type UsersListCall struct {
- s *Service
- project string
- instance string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // List: Lists users in the specified Cloud SQL instance.
- func (r *UsersService) List(project string, instance string) *UsersListCall {
- c := &UsersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *UsersListCall) Fields(s ...googleapi.Field) *UsersListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *UsersListCall) IfNoneMatch(entityTag string) *UsersListCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *UsersListCall) Context(ctx context.Context) *UsersListCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *UsersListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *UsersListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/users")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("GET", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.users.list" call.
- // Exactly one of *UsersListResponse or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *UsersListResponse.ServerResponse.Header or (if a response was
- // returned at all) in error.(*googleapi.Error).Header. Use
- // googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *UsersListCall) Do(opts ...googleapi.CallOption) (*UsersListResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &UsersListResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Lists users in the specified Cloud SQL instance.",
- // "httpMethod": "GET",
- // "id": "sql.users.list",
- // "parameterOrder": [
- // "project",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Database instance ID. This does not include the project ID.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID of the project that contains the instance.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}/users",
- // "response": {
- // "$ref": "UsersListResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
-
- // method id "sql.users.update":
-
- type UsersUpdateCall struct {
- s *Service
- project string
- instance string
- user *User
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Update: Updates an existing user in a Cloud SQL instance.
- func (r *UsersService) Update(project string, instance string, name string, user *User) *UsersUpdateCall {
- c := &UsersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.urlParams_.Set("name", name)
- c.user = user
- return c
- }
-
- // Host sets the optional parameter "host": Host of the user in the
- // instance.
- func (c *UsersUpdateCall) Host(host string) *UsersUpdateCall {
- c.urlParams_.Set("host", host)
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *UsersUpdateCall) Fields(s ...googleapi.Field) *UsersUpdateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *UsersUpdateCall) Context(ctx context.Context) *UsersUpdateCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *UsersUpdateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *UsersUpdateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.user)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/users")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PUT", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "sql.users.update" call.
- // Exactly one of *Operation or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *Operation.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *UsersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Operation{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Updates an existing user in a Cloud SQL instance.",
- // "httpMethod": "PUT",
- // "id": "sql.users.update",
- // "parameterOrder": [
- // "project",
- // "instance",
- // "name"
- // ],
- // "parameters": {
- // "host": {
- // "description": "Host of the user in the instance.",
- // "location": "query",
- // "type": "string"
- // },
- // "instance": {
- // "description": "Database instance ID. This does not include the project ID.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "name": {
- // "description": "Name of the user in the instance.",
- // "location": "query",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID of the project that contains the instance.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}/users",
- // "request": {
- // "$ref": "User"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
-
- }
|