sqladmin-gen.go 162 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869
  1. // Package sqladmin provides access to the Cloud SQL Administration API.
  2. //
  3. // See https://cloud.google.com/sql/docs/reference/latest
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/sqladmin/v1beta3"
  8. // ...
  9. // sqladminService, err := sqladmin.New(oauthHttpClient)
  10. package sqladmin // import "google.golang.org/api/sqladmin/v1beta3"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "sqladmin:v1beta3"
  41. const apiName = "sqladmin"
  42. const apiVersion = "v1beta3"
  43. const basePath = "https://www.googleapis.com/sql/v1beta3/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // View and manage your data across Google Cloud Platform services
  47. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  48. // Manage your Google SQL Service instances
  49. SqlserviceAdminScope = "https://www.googleapis.com/auth/sqlservice.admin"
  50. )
  51. func New(client *http.Client) (*Service, error) {
  52. if client == nil {
  53. return nil, errors.New("client is nil")
  54. }
  55. s := &Service{client: client, BasePath: basePath}
  56. s.BackupRuns = NewBackupRunsService(s)
  57. s.Flags = NewFlagsService(s)
  58. s.Instances = NewInstancesService(s)
  59. s.Operations = NewOperationsService(s)
  60. s.SslCerts = NewSslCertsService(s)
  61. s.Tiers = NewTiersService(s)
  62. return s, nil
  63. }
  64. type Service struct {
  65. client *http.Client
  66. BasePath string // API endpoint base URL
  67. UserAgent string // optional additional User-Agent fragment
  68. BackupRuns *BackupRunsService
  69. Flags *FlagsService
  70. Instances *InstancesService
  71. Operations *OperationsService
  72. SslCerts *SslCertsService
  73. Tiers *TiersService
  74. }
  75. func (s *Service) userAgent() string {
  76. if s.UserAgent == "" {
  77. return googleapi.UserAgent
  78. }
  79. return googleapi.UserAgent + " " + s.UserAgent
  80. }
  81. func NewBackupRunsService(s *Service) *BackupRunsService {
  82. rs := &BackupRunsService{s: s}
  83. return rs
  84. }
  85. type BackupRunsService struct {
  86. s *Service
  87. }
  88. func NewFlagsService(s *Service) *FlagsService {
  89. rs := &FlagsService{s: s}
  90. return rs
  91. }
  92. type FlagsService struct {
  93. s *Service
  94. }
  95. func NewInstancesService(s *Service) *InstancesService {
  96. rs := &InstancesService{s: s}
  97. return rs
  98. }
  99. type InstancesService struct {
  100. s *Service
  101. }
  102. func NewOperationsService(s *Service) *OperationsService {
  103. rs := &OperationsService{s: s}
  104. return rs
  105. }
  106. type OperationsService struct {
  107. s *Service
  108. }
  109. func NewSslCertsService(s *Service) *SslCertsService {
  110. rs := &SslCertsService{s: s}
  111. return rs
  112. }
  113. type SslCertsService struct {
  114. s *Service
  115. }
  116. func NewTiersService(s *Service) *TiersService {
  117. rs := &TiersService{s: s}
  118. return rs
  119. }
  120. type TiersService struct {
  121. s *Service
  122. }
  123. // BackupConfiguration: Database instance backup configuration.
  124. type BackupConfiguration struct {
  125. // BinaryLogEnabled: Whether binary log is enabled. If backup
  126. // configuration is disabled, binary log must be disabled as well.
  127. BinaryLogEnabled bool `json:"binaryLogEnabled,omitempty"`
  128. // Enabled: Whether this configuration is enabled.
  129. Enabled bool `json:"enabled,omitempty"`
  130. // Id: Identifier for this configuration. This gets generated
  131. // automatically when a backup configuration is created.
  132. Id string `json:"id,omitempty"`
  133. // Kind: This is always sql#backupConfiguration.
  134. Kind string `json:"kind,omitempty"`
  135. // StartTime: Start time for the daily backup configuration in UTC
  136. // timezone in the 24 hour format - HH:MM.
  137. StartTime string `json:"startTime,omitempty"`
  138. // ForceSendFields is a list of field names (e.g. "BinaryLogEnabled") to
  139. // unconditionally include in API requests. By default, fields with
  140. // empty values are omitted from API requests. However, any non-pointer,
  141. // non-interface field appearing in ForceSendFields will be sent to the
  142. // server regardless of whether the field is empty or not. This may be
  143. // used to include empty fields in Patch requests.
  144. ForceSendFields []string `json:"-"`
  145. }
  146. func (s *BackupConfiguration) MarshalJSON() ([]byte, error) {
  147. type noMethod BackupConfiguration
  148. raw := noMethod(*s)
  149. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  150. }
  151. // BackupRun: A database instance backup run resource.
  152. type BackupRun struct {
  153. // BackupConfiguration: Backup Configuration identifier.
  154. BackupConfiguration string `json:"backupConfiguration,omitempty"`
  155. // DueTime: The due time of this run in UTC timezone in RFC 3339 format,
  156. // for example 2012-11-15T16:19:00.094Z.
  157. DueTime string `json:"dueTime,omitempty"`
  158. // EndTime: The time the backup operation completed in UTC timezone in
  159. // RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
  160. EndTime string `json:"endTime,omitempty"`
  161. // EnqueuedTime: The time the run was enqueued in UTC timezone in RFC
  162. // 3339 format, for example 2012-11-15T16:19:00.094Z.
  163. EnqueuedTime string `json:"enqueuedTime,omitempty"`
  164. // Error: Information about why the backup operation failed. This is
  165. // only present if the run has the FAILED status.
  166. Error *OperationError `json:"error,omitempty"`
  167. // Instance: Name of the database instance.
  168. Instance string `json:"instance,omitempty"`
  169. // Kind: This is always sql#backupRun.
  170. Kind string `json:"kind,omitempty"`
  171. // StartTime: The time the backup operation actually started in UTC
  172. // timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
  173. StartTime string `json:"startTime,omitempty"`
  174. // Status: The status of this run.
  175. Status string `json:"status,omitempty"`
  176. // ServerResponse contains the HTTP response code and headers from the
  177. // server.
  178. googleapi.ServerResponse `json:"-"`
  179. // ForceSendFields is a list of field names (e.g. "BackupConfiguration")
  180. // to unconditionally include in API requests. By default, fields with
  181. // empty values are omitted from API requests. However, any non-pointer,
  182. // non-interface field appearing in ForceSendFields will be sent to the
  183. // server regardless of whether the field is empty or not. This may be
  184. // used to include empty fields in Patch requests.
  185. ForceSendFields []string `json:"-"`
  186. }
  187. func (s *BackupRun) MarshalJSON() ([]byte, error) {
  188. type noMethod BackupRun
  189. raw := noMethod(*s)
  190. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  191. }
  192. // BackupRunsListResponse: Backup run list results.
  193. type BackupRunsListResponse struct {
  194. // Items: A list of backup runs in reverse chronological order of the
  195. // enqueued time.
  196. Items []*BackupRun `json:"items,omitempty"`
  197. // Kind: This is always sql#backupRunsList.
  198. Kind string `json:"kind,omitempty"`
  199. // NextPageToken: The continuation token, used to page through large
  200. // result sets. Provide this value in a subsequent request to return the
  201. // next page of results.
  202. NextPageToken string `json:"nextPageToken,omitempty"`
  203. // ServerResponse contains the HTTP response code and headers from the
  204. // server.
  205. googleapi.ServerResponse `json:"-"`
  206. // ForceSendFields is a list of field names (e.g. "Items") to
  207. // unconditionally include in API requests. By default, fields with
  208. // empty values are omitted from API requests. However, any non-pointer,
  209. // non-interface field appearing in ForceSendFields will be sent to the
  210. // server regardless of whether the field is empty or not. This may be
  211. // used to include empty fields in Patch requests.
  212. ForceSendFields []string `json:"-"`
  213. }
  214. func (s *BackupRunsListResponse) MarshalJSON() ([]byte, error) {
  215. type noMethod BackupRunsListResponse
  216. raw := noMethod(*s)
  217. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  218. }
  219. // BinLogCoordinates: Binary log coordinates.
  220. type BinLogCoordinates struct {
  221. // BinLogFileName: Name of the binary log file for a Cloud SQL instance.
  222. BinLogFileName string `json:"binLogFileName,omitempty"`
  223. // BinLogPosition: Position (offset) within the binary log file.
  224. BinLogPosition int64 `json:"binLogPosition,omitempty,string"`
  225. // Kind: This is always sql#binLogCoordinates.
  226. Kind string `json:"kind,omitempty"`
  227. // ForceSendFields is a list of field names (e.g. "BinLogFileName") to
  228. // unconditionally include in API requests. By default, fields with
  229. // empty values are omitted from API requests. However, any non-pointer,
  230. // non-interface field appearing in ForceSendFields will be sent to the
  231. // server regardless of whether the field is empty or not. This may be
  232. // used to include empty fields in Patch requests.
  233. ForceSendFields []string `json:"-"`
  234. }
  235. func (s *BinLogCoordinates) MarshalJSON() ([]byte, error) {
  236. type noMethod BinLogCoordinates
  237. raw := noMethod(*s)
  238. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  239. }
  240. // CloneContext: Database instance clone context.
  241. type CloneContext struct {
  242. // BinLogCoordinates: Binary log coordinates, if specified, indentify
  243. // the position up to which the source instance should be cloned. If not
  244. // specified, the source instance is cloned up to the most recent binary
  245. // log coordinates.
  246. BinLogCoordinates *BinLogCoordinates `json:"binLogCoordinates,omitempty"`
  247. // DestinationInstanceName: Name of the Cloud SQL instance to be created
  248. // as a clone.
  249. DestinationInstanceName string `json:"destinationInstanceName,omitempty"`
  250. // Kind: This is always sql#cloneContext.
  251. Kind string `json:"kind,omitempty"`
  252. // SourceInstanceName: Name of the Cloud SQL instance to be cloned.
  253. SourceInstanceName string `json:"sourceInstanceName,omitempty"`
  254. // ForceSendFields is a list of field names (e.g. "BinLogCoordinates")
  255. // to unconditionally include in API requests. By default, fields with
  256. // empty values are omitted from API requests. However, any non-pointer,
  257. // non-interface field appearing in ForceSendFields will be sent to the
  258. // server regardless of whether the field is empty or not. This may be
  259. // used to include empty fields in Patch requests.
  260. ForceSendFields []string `json:"-"`
  261. }
  262. func (s *CloneContext) MarshalJSON() ([]byte, error) {
  263. type noMethod CloneContext
  264. raw := noMethod(*s)
  265. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  266. }
  267. // DatabaseFlags: MySQL flags for Cloud SQL instances.
  268. type DatabaseFlags struct {
  269. // Name: The name of the flag. These flags are passed at instance
  270. // startup, so include both MySQL server options and MySQL system
  271. // variables. Flags should be specified with underscores, not hyphens.
  272. // For more information, see Configuring MySQL Flags in the Google Cloud
  273. // SQL documentation, as well as the official MySQL documentation for
  274. // server options and system variables.
  275. Name string `json:"name,omitempty"`
  276. // Value: The value of the flag. Booleans should be set to on for true
  277. // and off for false. This field must be omitted if the flag doesn't
  278. // take a value.
  279. Value string `json:"value,omitempty"`
  280. // ForceSendFields is a list of field names (e.g. "Name") to
  281. // unconditionally include in API requests. By default, fields with
  282. // empty values are omitted from API requests. However, any non-pointer,
  283. // non-interface field appearing in ForceSendFields will be sent to the
  284. // server regardless of whether the field is empty or not. This may be
  285. // used to include empty fields in Patch requests.
  286. ForceSendFields []string `json:"-"`
  287. }
  288. func (s *DatabaseFlags) MarshalJSON() ([]byte, error) {
  289. type noMethod DatabaseFlags
  290. raw := noMethod(*s)
  291. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  292. }
  293. // DatabaseInstance: A Cloud SQL instance resource.
  294. type DatabaseInstance struct {
  295. // CurrentDiskSize: The current disk usage of the instance in bytes.
  296. CurrentDiskSize int64 `json:"currentDiskSize,omitempty,string"`
  297. // DatabaseVersion: The database engine type and version. Can be
  298. // MYSQL_5_5 or MYSQL_5_6. Defaults to MYSQL_5_5. The databaseVersion
  299. // cannot be changed after instance creation.
  300. DatabaseVersion string `json:"databaseVersion,omitempty"`
  301. // Etag: HTTP 1.1 Entity tag for the resource.
  302. Etag string `json:"etag,omitempty"`
  303. // Instance: Name of the Cloud SQL instance. This does not include the
  304. // project ID.
  305. Instance string `json:"instance,omitempty"`
  306. // InstanceType: The instance type. This can be one of the
  307. // following.
  308. // CLOUD_SQL_INSTANCE: Regular Cloud SQL
  309. // instance.
  310. // READ_REPLICA_INSTANCE: Cloud SQL instance acting as a read-replica.
  311. InstanceType string `json:"instanceType,omitempty"`
  312. // IpAddresses: The assigned IP addresses for the instance.
  313. IpAddresses []*IpMapping `json:"ipAddresses,omitempty"`
  314. // Ipv6Address: The IPv6 address assigned to the instance.
  315. Ipv6Address string `json:"ipv6Address,omitempty"`
  316. // Kind: This is always sql#instance.
  317. Kind string `json:"kind,omitempty"`
  318. // MasterInstanceName: The name of the instance which will act as master
  319. // in the replication setup.
  320. MasterInstanceName string `json:"masterInstanceName,omitempty"`
  321. // MaxDiskSize: The maximum disk size of the instance in bytes.
  322. MaxDiskSize int64 `json:"maxDiskSize,omitempty,string"`
  323. // Project: The project ID of the project containing the Cloud SQL
  324. // instance. The Google apps domain is prefixed if applicable.
  325. Project string `json:"project,omitempty"`
  326. // Region: The geographical region. Can be us-central, asia-east1 or
  327. // europe-west1. Defaults to us-central. The region can not be changed
  328. // after instance creation.
  329. Region string `json:"region,omitempty"`
  330. // ReplicaNames: The replicas of the instance.
  331. ReplicaNames []string `json:"replicaNames,omitempty"`
  332. // ServerCaCert: SSL configuration.
  333. ServerCaCert *SslCert `json:"serverCaCert,omitempty"`
  334. // ServiceAccountEmailAddress: The service account email address
  335. // assigned to the instance.
  336. ServiceAccountEmailAddress string `json:"serviceAccountEmailAddress,omitempty"`
  337. // Settings: The user settings.
  338. Settings *Settings `json:"settings,omitempty"`
  339. // State: The current serving state of the Cloud SQL instance. This can
  340. // be one of the following.
  341. // RUNNABLE: The instance is running, or is ready to run when
  342. // accessed.
  343. // SUSPENDED: The instance is not available, for example due to problems
  344. // with billing.
  345. // PENDING_CREATE: The instance is being created.
  346. // MAINTENANCE: The instance is down for maintenance.
  347. // UNKNOWN_STATE: The state of the instance is unknown.
  348. State string `json:"state,omitempty"`
  349. // ServerResponse contains the HTTP response code and headers from the
  350. // server.
  351. googleapi.ServerResponse `json:"-"`
  352. // ForceSendFields is a list of field names (e.g. "CurrentDiskSize") to
  353. // unconditionally include in API requests. By default, fields with
  354. // empty values are omitted from API requests. However, any non-pointer,
  355. // non-interface field appearing in ForceSendFields will be sent to the
  356. // server regardless of whether the field is empty or not. This may be
  357. // used to include empty fields in Patch requests.
  358. ForceSendFields []string `json:"-"`
  359. }
  360. func (s *DatabaseInstance) MarshalJSON() ([]byte, error) {
  361. type noMethod DatabaseInstance
  362. raw := noMethod(*s)
  363. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  364. }
  365. // ExportContext: Database instance export context.
  366. type ExportContext struct {
  367. // Database: Databases (for example, guestbook) from which the export is
  368. // made. If unspecified, all databases are exported.
  369. Database []string `json:"database,omitempty"`
  370. // Kind: This is always sql#exportContext.
  371. Kind string `json:"kind,omitempty"`
  372. // Table: Tables to export, or that were exported, from the specified
  373. // database. If you specify tables, specify one and only one database.
  374. Table []string `json:"table,omitempty"`
  375. // Uri: The path to the file in Google Cloud Storage where the export
  376. // will be stored, or where it was already stored. The URI is in the
  377. // form gs://bucketName/fileName. If the file already exists, the
  378. // operation fails. If the filename ends with .gz, the contents are
  379. // compressed.
  380. Uri string `json:"uri,omitempty"`
  381. // ForceSendFields is a list of field names (e.g. "Database") to
  382. // unconditionally include in API requests. By default, fields with
  383. // empty values are omitted from API requests. However, any non-pointer,
  384. // non-interface field appearing in ForceSendFields will be sent to the
  385. // server regardless of whether the field is empty or not. This may be
  386. // used to include empty fields in Patch requests.
  387. ForceSendFields []string `json:"-"`
  388. }
  389. func (s *ExportContext) MarshalJSON() ([]byte, error) {
  390. type noMethod ExportContext
  391. raw := noMethod(*s)
  392. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  393. }
  394. // Flag: A Google Cloud SQL service flag resource.
  395. type Flag struct {
  396. // AllowedStringValues: For STRING flags, a list of strings that the
  397. // value can be set to.
  398. AllowedStringValues []string `json:"allowedStringValues,omitempty"`
  399. // AppliesTo: The database version this flag applies to. Currently this
  400. // can only be [MYSQL_5_5].
  401. AppliesTo []string `json:"appliesTo,omitempty"`
  402. // Kind: This is always sql#flag.
  403. Kind string `json:"kind,omitempty"`
  404. // MaxValue: For INTEGER flags, the maximum allowed value.
  405. MaxValue int64 `json:"maxValue,omitempty,string"`
  406. // MinValue: For INTEGER flags, the minimum allowed value.
  407. MinValue int64 `json:"minValue,omitempty,string"`
  408. // Name: This is the name of the flag. Flag names always use
  409. // underscores, not hyphens, e.g. max_allowed_packet
  410. Name string `json:"name,omitempty"`
  411. // Type: The type of the flag. Flags are typed to being BOOLEAN, STRING,
  412. // INTEGER or NONE. NONE is used for flags which do not take a value,
  413. // such as skip_grant_tables.
  414. Type string `json:"type,omitempty"`
  415. // ForceSendFields is a list of field names (e.g. "AllowedStringValues")
  416. // to unconditionally include in API requests. By default, fields with
  417. // empty values are omitted from API requests. However, any non-pointer,
  418. // non-interface field appearing in ForceSendFields will be sent to the
  419. // server regardless of whether the field is empty or not. This may be
  420. // used to include empty fields in Patch requests.
  421. ForceSendFields []string `json:"-"`
  422. }
  423. func (s *Flag) MarshalJSON() ([]byte, error) {
  424. type noMethod Flag
  425. raw := noMethod(*s)
  426. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  427. }
  428. // FlagsListResponse: Flags list response.
  429. type FlagsListResponse struct {
  430. // Items: List of flags.
  431. Items []*Flag `json:"items,omitempty"`
  432. // Kind: This is always sql#flagsList.
  433. Kind string `json:"kind,omitempty"`
  434. // ServerResponse contains the HTTP response code and headers from the
  435. // server.
  436. googleapi.ServerResponse `json:"-"`
  437. // ForceSendFields is a list of field names (e.g. "Items") to
  438. // unconditionally include in API requests. By default, fields with
  439. // empty values are omitted from API requests. However, any non-pointer,
  440. // non-interface field appearing in ForceSendFields will be sent to the
  441. // server regardless of whether the field is empty or not. This may be
  442. // used to include empty fields in Patch requests.
  443. ForceSendFields []string `json:"-"`
  444. }
  445. func (s *FlagsListResponse) MarshalJSON() ([]byte, error) {
  446. type noMethod FlagsListResponse
  447. raw := noMethod(*s)
  448. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  449. }
  450. // ImportContext: Database instance import context.
  451. type ImportContext struct {
  452. // Database: The database (for example, guestbook) to which the import
  453. // is made. If not set, it is assumed that the database is specified in
  454. // the file to be imported.
  455. Database string `json:"database,omitempty"`
  456. // Kind: This is always sql#importContext.
  457. Kind string `json:"kind,omitempty"`
  458. // Uri: A path to the MySQL dump file in Google Cloud Storage from which
  459. // the import is made. The URI is in the form gs://bucketName/fileName.
  460. // Compressed gzip files (.gz) are also supported.
  461. Uri []string `json:"uri,omitempty"`
  462. // ForceSendFields is a list of field names (e.g. "Database") to
  463. // unconditionally include in API requests. By default, fields with
  464. // empty values are omitted from API requests. However, any non-pointer,
  465. // non-interface field appearing in ForceSendFields will be sent to the
  466. // server regardless of whether the field is empty or not. This may be
  467. // used to include empty fields in Patch requests.
  468. ForceSendFields []string `json:"-"`
  469. }
  470. func (s *ImportContext) MarshalJSON() ([]byte, error) {
  471. type noMethod ImportContext
  472. raw := noMethod(*s)
  473. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  474. }
  475. // InstanceOperation: An Operations resource contains information about
  476. // database instance operations such as create, delete, and restart.
  477. // Operations resources are created in response to operations that were
  478. // initiated; you never create them directly.
  479. type InstanceOperation struct {
  480. // EndTime: The time this operation finished in UTC timezone in RFC 3339
  481. // format, for example 2012-11-15T16:19:00.094Z.
  482. EndTime string `json:"endTime,omitempty"`
  483. // EnqueuedTime: The time this operation was enqueued in UTC timezone in
  484. // RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
  485. EnqueuedTime string `json:"enqueuedTime,omitempty"`
  486. // Error: The error(s) encountered by this operation. Only set if the
  487. // operation results in an error.
  488. Error []*OperationError `json:"error,omitempty"`
  489. // ExportContext: The context for export operation, if applicable.
  490. ExportContext *ExportContext `json:"exportContext,omitempty"`
  491. // ImportContext: The context for import operation, if applicable.
  492. ImportContext *ImportContext `json:"importContext,omitempty"`
  493. // Instance: Name of the database instance.
  494. Instance string `json:"instance,omitempty"`
  495. // Kind: This is always sql#instanceOperation.
  496. Kind string `json:"kind,omitempty"`
  497. // Operation: An identifier that uniquely identifies the operation. You
  498. // can use this identifier to retrieve the Operations resource that has
  499. // information about the operation.
  500. Operation string `json:"operation,omitempty"`
  501. // OperationType: The type of the operation. Valid values are CREATE,
  502. // DELETE, UPDATE, RESTART, IMPORT, EXPORT, BACKUP_VOLUME,
  503. // RESTORE_VOLUME.
  504. OperationType string `json:"operationType,omitempty"`
  505. // StartTime: The time this operation actually started in UTC timezone
  506. // in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
  507. StartTime string `json:"startTime,omitempty"`
  508. // State: The state of an operation. Valid values are PENDING, RUNNING,
  509. // DONE, UNKNOWN.
  510. State string `json:"state,omitempty"`
  511. // UserEmailAddress: The email address of the user who initiated this
  512. // operation.
  513. UserEmailAddress string `json:"userEmailAddress,omitempty"`
  514. // ServerResponse contains the HTTP response code and headers from the
  515. // server.
  516. googleapi.ServerResponse `json:"-"`
  517. // ForceSendFields is a list of field names (e.g. "EndTime") to
  518. // unconditionally include in API requests. By default, fields with
  519. // empty values are omitted from API requests. However, any non-pointer,
  520. // non-interface field appearing in ForceSendFields will be sent to the
  521. // server regardless of whether the field is empty or not. This may be
  522. // used to include empty fields in Patch requests.
  523. ForceSendFields []string `json:"-"`
  524. }
  525. func (s *InstanceOperation) MarshalJSON() ([]byte, error) {
  526. type noMethod InstanceOperation
  527. raw := noMethod(*s)
  528. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  529. }
  530. // InstanceSetRootPasswordRequest: Database instance set root password
  531. // request.
  532. type InstanceSetRootPasswordRequest struct {
  533. // SetRootPasswordContext: Set Root Password Context.
  534. SetRootPasswordContext *SetRootPasswordContext `json:"setRootPasswordContext,omitempty"`
  535. // ForceSendFields is a list of field names (e.g.
  536. // "SetRootPasswordContext") to unconditionally include in API requests.
  537. // By default, fields with empty values are omitted from API requests.
  538. // However, any non-pointer, non-interface field appearing in
  539. // ForceSendFields will be sent to the server regardless of whether the
  540. // field is empty or not. This may be used to include empty fields in
  541. // Patch requests.
  542. ForceSendFields []string `json:"-"`
  543. }
  544. func (s *InstanceSetRootPasswordRequest) MarshalJSON() ([]byte, error) {
  545. type noMethod InstanceSetRootPasswordRequest
  546. raw := noMethod(*s)
  547. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  548. }
  549. // InstancesCloneRequest: Database instance clone request.
  550. type InstancesCloneRequest struct {
  551. // CloneContext: Contains details about the clone operation.
  552. CloneContext *CloneContext `json:"cloneContext,omitempty"`
  553. // ForceSendFields is a list of field names (e.g. "CloneContext") to
  554. // unconditionally include in API requests. By default, fields with
  555. // empty values are omitted from API requests. However, any non-pointer,
  556. // non-interface field appearing in ForceSendFields will be sent to the
  557. // server regardless of whether the field is empty or not. This may be
  558. // used to include empty fields in Patch requests.
  559. ForceSendFields []string `json:"-"`
  560. }
  561. func (s *InstancesCloneRequest) MarshalJSON() ([]byte, error) {
  562. type noMethod InstancesCloneRequest
  563. raw := noMethod(*s)
  564. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  565. }
  566. // InstancesCloneResponse: Database instance clone response.
  567. type InstancesCloneResponse struct {
  568. // Kind: This is always sql#instancesClone.
  569. Kind string `json:"kind,omitempty"`
  570. // Operation: An unique identifier for the operation associated with the
  571. // cloned instance. You can use this identifier to retrieve the
  572. // Operations resource, which has information about the operation.
  573. Operation string `json:"operation,omitempty"`
  574. // ServerResponse contains the HTTP response code and headers from the
  575. // server.
  576. googleapi.ServerResponse `json:"-"`
  577. // ForceSendFields is a list of field names (e.g. "Kind") to
  578. // unconditionally include in API requests. By default, fields with
  579. // empty values are omitted from API requests. However, any non-pointer,
  580. // non-interface field appearing in ForceSendFields will be sent to the
  581. // server regardless of whether the field is empty or not. This may be
  582. // used to include empty fields in Patch requests.
  583. ForceSendFields []string `json:"-"`
  584. }
  585. func (s *InstancesCloneResponse) MarshalJSON() ([]byte, error) {
  586. type noMethod InstancesCloneResponse
  587. raw := noMethod(*s)
  588. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  589. }
  590. // InstancesDeleteResponse: Database instance delete response.
  591. type InstancesDeleteResponse struct {
  592. // Kind: This is always sql#instancesDelete.
  593. Kind string `json:"kind,omitempty"`
  594. // Operation: An identifier that uniquely identifies the operation. You
  595. // can use this identifier to retrieve the Operations resource that has
  596. // information about the operation.
  597. Operation string `json:"operation,omitempty"`
  598. // ServerResponse contains the HTTP response code and headers from the
  599. // server.
  600. googleapi.ServerResponse `json:"-"`
  601. // ForceSendFields is a list of field names (e.g. "Kind") to
  602. // unconditionally include in API requests. By default, fields with
  603. // empty values are omitted from API requests. However, any non-pointer,
  604. // non-interface field appearing in ForceSendFields will be sent to the
  605. // server regardless of whether the field is empty or not. This may be
  606. // used to include empty fields in Patch requests.
  607. ForceSendFields []string `json:"-"`
  608. }
  609. func (s *InstancesDeleteResponse) MarshalJSON() ([]byte, error) {
  610. type noMethod InstancesDeleteResponse
  611. raw := noMethod(*s)
  612. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  613. }
  614. // InstancesExportRequest: Database instance export request.
  615. type InstancesExportRequest struct {
  616. // ExportContext: Contains details about the export operation.
  617. ExportContext *ExportContext `json:"exportContext,omitempty"`
  618. // ForceSendFields is a list of field names (e.g. "ExportContext") to
  619. // unconditionally include in API requests. By default, fields with
  620. // empty values are omitted from API requests. However, any non-pointer,
  621. // non-interface field appearing in ForceSendFields will be sent to the
  622. // server regardless of whether the field is empty or not. This may be
  623. // used to include empty fields in Patch requests.
  624. ForceSendFields []string `json:"-"`
  625. }
  626. func (s *InstancesExportRequest) MarshalJSON() ([]byte, error) {
  627. type noMethod InstancesExportRequest
  628. raw := noMethod(*s)
  629. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  630. }
  631. // InstancesExportResponse: Database instance export response.
  632. type InstancesExportResponse struct {
  633. // Kind: This is always sql#instancesExport.
  634. Kind string `json:"kind,omitempty"`
  635. // Operation: An identifier that uniquely identifies the operation. You
  636. // can use this identifier to retrieve the Operations resource that has
  637. // information about the operation.
  638. Operation string `json:"operation,omitempty"`
  639. // ServerResponse contains the HTTP response code and headers from the
  640. // server.
  641. googleapi.ServerResponse `json:"-"`
  642. // ForceSendFields is a list of field names (e.g. "Kind") to
  643. // unconditionally include in API requests. By default, fields with
  644. // empty values are omitted from API requests. However, any non-pointer,
  645. // non-interface field appearing in ForceSendFields will be sent to the
  646. // server regardless of whether the field is empty or not. This may be
  647. // used to include empty fields in Patch requests.
  648. ForceSendFields []string `json:"-"`
  649. }
  650. func (s *InstancesExportResponse) MarshalJSON() ([]byte, error) {
  651. type noMethod InstancesExportResponse
  652. raw := noMethod(*s)
  653. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  654. }
  655. // InstancesImportRequest: Database instance import request.
  656. type InstancesImportRequest struct {
  657. // ImportContext: Contains details about the import operation.
  658. ImportContext *ImportContext `json:"importContext,omitempty"`
  659. // ForceSendFields is a list of field names (e.g. "ImportContext") to
  660. // unconditionally include in API requests. By default, fields with
  661. // empty values are omitted from API requests. However, any non-pointer,
  662. // non-interface field appearing in ForceSendFields will be sent to the
  663. // server regardless of whether the field is empty or not. This may be
  664. // used to include empty fields in Patch requests.
  665. ForceSendFields []string `json:"-"`
  666. }
  667. func (s *InstancesImportRequest) MarshalJSON() ([]byte, error) {
  668. type noMethod InstancesImportRequest
  669. raw := noMethod(*s)
  670. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  671. }
  672. // InstancesImportResponse: Database instance import response.
  673. type InstancesImportResponse struct {
  674. // Kind: This is always sql#instancesImport.
  675. Kind string `json:"kind,omitempty"`
  676. // Operation: An identifier that uniquely identifies the operation. You
  677. // can use this identifier to retrieve the Operations resource that has
  678. // information about the operation.
  679. Operation string `json:"operation,omitempty"`
  680. // ServerResponse contains the HTTP response code and headers from the
  681. // server.
  682. googleapi.ServerResponse `json:"-"`
  683. // ForceSendFields is a list of field names (e.g. "Kind") to
  684. // unconditionally include in API requests. By default, fields with
  685. // empty values are omitted from API requests. However, any non-pointer,
  686. // non-interface field appearing in ForceSendFields will be sent to the
  687. // server regardless of whether the field is empty or not. This may be
  688. // used to include empty fields in Patch requests.
  689. ForceSendFields []string `json:"-"`
  690. }
  691. func (s *InstancesImportResponse) MarshalJSON() ([]byte, error) {
  692. type noMethod InstancesImportResponse
  693. raw := noMethod(*s)
  694. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  695. }
  696. // InstancesInsertResponse: Database instance insert response.
  697. type InstancesInsertResponse struct {
  698. // Kind: This is always sql#instancesInsert.
  699. Kind string `json:"kind,omitempty"`
  700. // Operation: An identifier that uniquely identifies the operation. You
  701. // can use this identifier to retrieve the Operations resource that has
  702. // information about the operation.
  703. Operation string `json:"operation,omitempty"`
  704. // ServerResponse contains the HTTP response code and headers from the
  705. // server.
  706. googleapi.ServerResponse `json:"-"`
  707. // ForceSendFields is a list of field names (e.g. "Kind") to
  708. // unconditionally include in API requests. By default, fields with
  709. // empty values are omitted from API requests. However, any non-pointer,
  710. // non-interface field appearing in ForceSendFields will be sent to the
  711. // server regardless of whether the field is empty or not. This may be
  712. // used to include empty fields in Patch requests.
  713. ForceSendFields []string `json:"-"`
  714. }
  715. func (s *InstancesInsertResponse) MarshalJSON() ([]byte, error) {
  716. type noMethod InstancesInsertResponse
  717. raw := noMethod(*s)
  718. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  719. }
  720. // InstancesListResponse: Database instances list response.
  721. type InstancesListResponse struct {
  722. // Items: List of database instance resources.
  723. Items []*DatabaseInstance `json:"items,omitempty"`
  724. // Kind: This is always sql#instancesList.
  725. Kind string `json:"kind,omitempty"`
  726. // NextPageToken: The continuation token, used to page through large
  727. // result sets. Provide this value in a subsequent request to return the
  728. // next page of results.
  729. NextPageToken string `json:"nextPageToken,omitempty"`
  730. // ServerResponse contains the HTTP response code and headers from the
  731. // server.
  732. googleapi.ServerResponse `json:"-"`
  733. // ForceSendFields is a list of field names (e.g. "Items") to
  734. // unconditionally include in API requests. By default, fields with
  735. // empty values are omitted from API requests. However, any non-pointer,
  736. // non-interface field appearing in ForceSendFields will be sent to the
  737. // server regardless of whether the field is empty or not. This may be
  738. // used to include empty fields in Patch requests.
  739. ForceSendFields []string `json:"-"`
  740. }
  741. func (s *InstancesListResponse) MarshalJSON() ([]byte, error) {
  742. type noMethod InstancesListResponse
  743. raw := noMethod(*s)
  744. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  745. }
  746. // InstancesPromoteReplicaResponse: Database promote read replica
  747. // response.
  748. type InstancesPromoteReplicaResponse struct {
  749. // Kind: This is always sql#instancesPromoteReplica.
  750. Kind string `json:"kind,omitempty"`
  751. // Operation: An identifier that uniquely identifies the operation. You
  752. // can use this identifier to retrieve the Operations resource that has
  753. // information about the operation.
  754. Operation string `json:"operation,omitempty"`
  755. // ServerResponse contains the HTTP response code and headers from the
  756. // server.
  757. googleapi.ServerResponse `json:"-"`
  758. // ForceSendFields is a list of field names (e.g. "Kind") to
  759. // unconditionally include in API requests. By default, fields with
  760. // empty values are omitted from API requests. However, any non-pointer,
  761. // non-interface field appearing in ForceSendFields will be sent to the
  762. // server regardless of whether the field is empty or not. This may be
  763. // used to include empty fields in Patch requests.
  764. ForceSendFields []string `json:"-"`
  765. }
  766. func (s *InstancesPromoteReplicaResponse) MarshalJSON() ([]byte, error) {
  767. type noMethod InstancesPromoteReplicaResponse
  768. raw := noMethod(*s)
  769. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  770. }
  771. // InstancesResetSslConfigResponse: Database instance resetSslConfig
  772. // response.
  773. type InstancesResetSslConfigResponse struct {
  774. // Kind: This is always sql#instancesResetSslConfig.
  775. Kind string `json:"kind,omitempty"`
  776. // Operation: An identifier that uniquely identifies the operation. You
  777. // can use this identifier to retrieve the Operations resource that has
  778. // information about the operation. All ssl client certificates will be
  779. // deleted and a new server certificate will be created. Does not take
  780. // effect until the next instance restart.
  781. Operation string `json:"operation,omitempty"`
  782. // ServerResponse contains the HTTP response code and headers from the
  783. // server.
  784. googleapi.ServerResponse `json:"-"`
  785. // ForceSendFields is a list of field names (e.g. "Kind") to
  786. // unconditionally include in API requests. By default, fields with
  787. // empty values are omitted from API requests. However, any non-pointer,
  788. // non-interface field appearing in ForceSendFields will be sent to the
  789. // server regardless of whether the field is empty or not. This may be
  790. // used to include empty fields in Patch requests.
  791. ForceSendFields []string `json:"-"`
  792. }
  793. func (s *InstancesResetSslConfigResponse) MarshalJSON() ([]byte, error) {
  794. type noMethod InstancesResetSslConfigResponse
  795. raw := noMethod(*s)
  796. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  797. }
  798. // InstancesRestartResponse: Database instance restart response.
  799. type InstancesRestartResponse struct {
  800. // Kind: This is always sql#instancesRestart.
  801. Kind string `json:"kind,omitempty"`
  802. // Operation: An identifier that uniquely identifies the operation. You
  803. // can use this identifier to retrieve the Operations resource that has
  804. // information about the operation.
  805. Operation string `json:"operation,omitempty"`
  806. // ServerResponse contains the HTTP response code and headers from the
  807. // server.
  808. googleapi.ServerResponse `json:"-"`
  809. // ForceSendFields is a list of field names (e.g. "Kind") to
  810. // unconditionally include in API requests. By default, fields with
  811. // empty values are omitted from API requests. However, any non-pointer,
  812. // non-interface field appearing in ForceSendFields will be sent to the
  813. // server regardless of whether the field is empty or not. This may be
  814. // used to include empty fields in Patch requests.
  815. ForceSendFields []string `json:"-"`
  816. }
  817. func (s *InstancesRestartResponse) MarshalJSON() ([]byte, error) {
  818. type noMethod InstancesRestartResponse
  819. raw := noMethod(*s)
  820. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  821. }
  822. // InstancesRestoreBackupResponse: Database instance restore backup
  823. // response.
  824. type InstancesRestoreBackupResponse struct {
  825. // Kind: This is always sql#instancesRestoreBackup.
  826. Kind string `json:"kind,omitempty"`
  827. // Operation: An identifier that uniquely identifies the operation. You
  828. // can use this identifier to retrieve the Operations resource that has
  829. // information about the operation.
  830. Operation string `json:"operation,omitempty"`
  831. // ServerResponse contains the HTTP response code and headers from the
  832. // server.
  833. googleapi.ServerResponse `json:"-"`
  834. // ForceSendFields is a list of field names (e.g. "Kind") to
  835. // unconditionally include in API requests. By default, fields with
  836. // empty values are omitted from API requests. However, any non-pointer,
  837. // non-interface field appearing in ForceSendFields will be sent to the
  838. // server regardless of whether the field is empty or not. This may be
  839. // used to include empty fields in Patch requests.
  840. ForceSendFields []string `json:"-"`
  841. }
  842. func (s *InstancesRestoreBackupResponse) MarshalJSON() ([]byte, error) {
  843. type noMethod InstancesRestoreBackupResponse
  844. raw := noMethod(*s)
  845. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  846. }
  847. // InstancesSetRootPasswordResponse: Database instance set root password
  848. // response.
  849. type InstancesSetRootPasswordResponse struct {
  850. // Kind: This is always sql#instancesSetRootPassword.
  851. Kind string `json:"kind,omitempty"`
  852. // Operation: An identifier that uniquely identifies the operation. You
  853. // can use this identifier to retrieve the Operations resource that has
  854. // information about the operation.
  855. Operation string `json:"operation,omitempty"`
  856. // ServerResponse contains the HTTP response code and headers from the
  857. // server.
  858. googleapi.ServerResponse `json:"-"`
  859. // ForceSendFields is a list of field names (e.g. "Kind") to
  860. // unconditionally include in API requests. By default, fields with
  861. // empty values are omitted from API requests. However, any non-pointer,
  862. // non-interface field appearing in ForceSendFields will be sent to the
  863. // server regardless of whether the field is empty or not. This may be
  864. // used to include empty fields in Patch requests.
  865. ForceSendFields []string `json:"-"`
  866. }
  867. func (s *InstancesSetRootPasswordResponse) MarshalJSON() ([]byte, error) {
  868. type noMethod InstancesSetRootPasswordResponse
  869. raw := noMethod(*s)
  870. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  871. }
  872. // InstancesUpdateResponse: Database instance update response.
  873. type InstancesUpdateResponse struct {
  874. // Kind: This is always sql#instancesUpdate.
  875. Kind string `json:"kind,omitempty"`
  876. // Operation: An identifier that uniquely identifies the operation. You
  877. // can use this identifier to retrieve information about the operation.
  878. Operation string `json:"operation,omitempty"`
  879. // ServerResponse contains the HTTP response code and headers from the
  880. // server.
  881. googleapi.ServerResponse `json:"-"`
  882. // ForceSendFields is a list of field names (e.g. "Kind") to
  883. // unconditionally include in API requests. By default, fields with
  884. // empty values are omitted from API requests. However, any non-pointer,
  885. // non-interface field appearing in ForceSendFields will be sent to the
  886. // server regardless of whether the field is empty or not. This may be
  887. // used to include empty fields in Patch requests.
  888. ForceSendFields []string `json:"-"`
  889. }
  890. func (s *InstancesUpdateResponse) MarshalJSON() ([]byte, error) {
  891. type noMethod InstancesUpdateResponse
  892. raw := noMethod(*s)
  893. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  894. }
  895. // IpConfiguration: IP Management configuration.
  896. type IpConfiguration struct {
  897. // AuthorizedNetworks: The list of external networks that are allowed to
  898. // connect to the instance using the IP. In CIDR notation, also known as
  899. // 'slash' notation (e.g. 192.168.100.0/24).
  900. AuthorizedNetworks []string `json:"authorizedNetworks,omitempty"`
  901. // Enabled: Whether the instance should be assigned an IP address or
  902. // not.
  903. Enabled bool `json:"enabled,omitempty"`
  904. // Kind: This is always sql#ipConfiguration.
  905. Kind string `json:"kind,omitempty"`
  906. // RequireSsl: Whether the mysqld should default to 'REQUIRE X509' for
  907. // users connecting over IP.
  908. RequireSsl bool `json:"requireSsl,omitempty"`
  909. // ForceSendFields is a list of field names (e.g. "AuthorizedNetworks")
  910. // to unconditionally include in API requests. By default, fields with
  911. // empty values are omitted from API requests. However, any non-pointer,
  912. // non-interface field appearing in ForceSendFields will be sent to the
  913. // server regardless of whether the field is empty or not. This may be
  914. // used to include empty fields in Patch requests.
  915. ForceSendFields []string `json:"-"`
  916. }
  917. func (s *IpConfiguration) MarshalJSON() ([]byte, error) {
  918. type noMethod IpConfiguration
  919. raw := noMethod(*s)
  920. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  921. }
  922. // IpMapping: Database instance IP Mapping.
  923. type IpMapping struct {
  924. // IpAddress: The IP address assigned.
  925. IpAddress string `json:"ipAddress,omitempty"`
  926. // TimeToRetire: The due time for this IP to be retired in RFC 3339
  927. // format, for example 2012-11-15T16:19:00.094Z. This field is only
  928. // available when the IP is scheduled to be retired.
  929. TimeToRetire string `json:"timeToRetire,omitempty"`
  930. // ForceSendFields is a list of field names (e.g. "IpAddress") to
  931. // unconditionally include in API requests. By default, fields with
  932. // empty values are omitted from API requests. However, any non-pointer,
  933. // non-interface field appearing in ForceSendFields will be sent to the
  934. // server regardless of whether the field is empty or not. This may be
  935. // used to include empty fields in Patch requests.
  936. ForceSendFields []string `json:"-"`
  937. }
  938. func (s *IpMapping) MarshalJSON() ([]byte, error) {
  939. type noMethod IpMapping
  940. raw := noMethod(*s)
  941. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  942. }
  943. // LocationPreference: Preferred location. This specifies where a Cloud
  944. // SQL instance should preferably be located, either in a specific
  945. // Compute Engine zone, or co-located with an App Engine application.
  946. // Note that if the preferred location is not available, the instance
  947. // will be located as close as possible within the region. Only one
  948. // location may be specified.
  949. type LocationPreference struct {
  950. // FollowGaeApplication: The App Engine application to follow, it must
  951. // be in the same region as the Cloud SQL instance.
  952. FollowGaeApplication string `json:"followGaeApplication,omitempty"`
  953. // Kind: This is always sql#locationPreference.
  954. Kind string `json:"kind,omitempty"`
  955. // Zone: The preferred Compute Engine zone (e.g. us-centra1-a,
  956. // us-central1-b, etc.).
  957. Zone string `json:"zone,omitempty"`
  958. // ForceSendFields is a list of field names (e.g.
  959. // "FollowGaeApplication") to unconditionally include in API requests.
  960. // By default, fields with empty values are omitted from API requests.
  961. // However, any non-pointer, non-interface field appearing in
  962. // ForceSendFields will be sent to the server regardless of whether the
  963. // field is empty or not. This may be used to include empty fields in
  964. // Patch requests.
  965. ForceSendFields []string `json:"-"`
  966. }
  967. func (s *LocationPreference) MarshalJSON() ([]byte, error) {
  968. type noMethod LocationPreference
  969. raw := noMethod(*s)
  970. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  971. }
  972. // OperationError: Database instance operation error.
  973. type OperationError struct {
  974. // Code: Identifies the specific error that occurred.
  975. Code string `json:"code,omitempty"`
  976. // Kind: This is always sql#operationError.
  977. Kind string `json:"kind,omitempty"`
  978. // ForceSendFields is a list of field names (e.g. "Code") to
  979. // unconditionally include in API requests. By default, fields with
  980. // empty values are omitted from API requests. However, any non-pointer,
  981. // non-interface field appearing in ForceSendFields will be sent to the
  982. // server regardless of whether the field is empty or not. This may be
  983. // used to include empty fields in Patch requests.
  984. ForceSendFields []string `json:"-"`
  985. }
  986. func (s *OperationError) MarshalJSON() ([]byte, error) {
  987. type noMethod OperationError
  988. raw := noMethod(*s)
  989. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  990. }
  991. // OperationsListResponse: Database instance list operations response.
  992. type OperationsListResponse struct {
  993. // Items: List of operation resources.
  994. Items []*InstanceOperation `json:"items,omitempty"`
  995. // Kind: This is always sql#operationsList.
  996. Kind string `json:"kind,omitempty"`
  997. // NextPageToken: The continuation token, used to page through large
  998. // result sets. Provide this value in a subsequent request to return the
  999. // next page of results.
  1000. NextPageToken string `json:"nextPageToken,omitempty"`
  1001. // ServerResponse contains the HTTP response code and headers from the
  1002. // server.
  1003. googleapi.ServerResponse `json:"-"`
  1004. // ForceSendFields is a list of field names (e.g. "Items") to
  1005. // unconditionally include in API requests. By default, fields with
  1006. // empty values are omitted from API requests. However, any non-pointer,
  1007. // non-interface field appearing in ForceSendFields will be sent to the
  1008. // server regardless of whether the field is empty or not. This may be
  1009. // used to include empty fields in Patch requests.
  1010. ForceSendFields []string `json:"-"`
  1011. }
  1012. func (s *OperationsListResponse) MarshalJSON() ([]byte, error) {
  1013. type noMethod OperationsListResponse
  1014. raw := noMethod(*s)
  1015. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1016. }
  1017. // SetRootPasswordContext: Database instance set root password context.
  1018. type SetRootPasswordContext struct {
  1019. // Kind: This is always sql#setRootUserContext.
  1020. Kind string `json:"kind,omitempty"`
  1021. // Password: The password for the root user.
  1022. Password string `json:"password,omitempty"`
  1023. // ForceSendFields is a list of field names (e.g. "Kind") to
  1024. // unconditionally include in API requests. By default, fields with
  1025. // empty values are omitted from API requests. However, any non-pointer,
  1026. // non-interface field appearing in ForceSendFields will be sent to the
  1027. // server regardless of whether the field is empty or not. This may be
  1028. // used to include empty fields in Patch requests.
  1029. ForceSendFields []string `json:"-"`
  1030. }
  1031. func (s *SetRootPasswordContext) MarshalJSON() ([]byte, error) {
  1032. type noMethod SetRootPasswordContext
  1033. raw := noMethod(*s)
  1034. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1035. }
  1036. // Settings: Database instance settings.
  1037. type Settings struct {
  1038. // ActivationPolicy: The activation policy for this instance. This
  1039. // specifies when the instance should be activated and is applicable
  1040. // only when the instance state is RUNNABLE. This can be one of the
  1041. // following.
  1042. // ALWAYS: The instance should always be active.
  1043. // NEVER: The instance should never be activated.
  1044. // ON_DEMAND: The instance is activated upon receiving requests.
  1045. ActivationPolicy string `json:"activationPolicy,omitempty"`
  1046. // AuthorizedGaeApplications: The App Engine app IDs that can access
  1047. // this instance.
  1048. AuthorizedGaeApplications []string `json:"authorizedGaeApplications,omitempty"`
  1049. // BackupConfiguration: The daily backup configuration for the instance.
  1050. BackupConfiguration []*BackupConfiguration `json:"backupConfiguration,omitempty"`
  1051. // DatabaseFlags: The database flags passed to the instance at startup.
  1052. DatabaseFlags []*DatabaseFlags `json:"databaseFlags,omitempty"`
  1053. // DatabaseReplicationEnabled: Configuration specific to read replica
  1054. // instance. Indicates whether replication is enabled or not.
  1055. DatabaseReplicationEnabled bool `json:"databaseReplicationEnabled,omitempty"`
  1056. // IpConfiguration: The settings for IP Management. This allows to
  1057. // enable or disable the instance IP and manage which external networks
  1058. // can connect to the instance.
  1059. IpConfiguration *IpConfiguration `json:"ipConfiguration,omitempty"`
  1060. // Kind: This is always sql#settings.
  1061. Kind string `json:"kind,omitempty"`
  1062. // LocationPreference: The location preference settings. This allows the
  1063. // instance to be located as near as possible to either an App Engine
  1064. // app or GCE zone for better performance.
  1065. LocationPreference *LocationPreference `json:"locationPreference,omitempty"`
  1066. // PricingPlan: The pricing plan for this instance. This can be either
  1067. // PER_USE or PACKAGE.
  1068. PricingPlan string `json:"pricingPlan,omitempty"`
  1069. // ReplicationType: The type of replication this instance uses. This can
  1070. // be either ASYNCHRONOUS or SYNCHRONOUS.
  1071. ReplicationType string `json:"replicationType,omitempty"`
  1072. // SettingsVersion: The version of instance settings. This is a required
  1073. // field for update method to make sure concurrent updates are handled
  1074. // properly. During update, use the most recent settingsVersion value
  1075. // for this instance and do not try to update this value.
  1076. SettingsVersion int64 `json:"settingsVersion,omitempty,string"`
  1077. // Tier: The tier of service for this instance, for example D1, D2. For
  1078. // more information, see pricing.
  1079. Tier string `json:"tier,omitempty"`
  1080. // ForceSendFields is a list of field names (e.g. "ActivationPolicy") to
  1081. // unconditionally include in API requests. By default, fields with
  1082. // empty values are omitted from API requests. However, any non-pointer,
  1083. // non-interface field appearing in ForceSendFields will be sent to the
  1084. // server regardless of whether the field is empty or not. This may be
  1085. // used to include empty fields in Patch requests.
  1086. ForceSendFields []string `json:"-"`
  1087. }
  1088. func (s *Settings) MarshalJSON() ([]byte, error) {
  1089. type noMethod Settings
  1090. raw := noMethod(*s)
  1091. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1092. }
  1093. // SslCert: SslCerts Resource
  1094. type SslCert struct {
  1095. // Cert: PEM representation.
  1096. Cert string `json:"cert,omitempty"`
  1097. // CertSerialNumber: Serial number, as extracted from the certificate.
  1098. CertSerialNumber string `json:"certSerialNumber,omitempty"`
  1099. // CommonName: User supplied name. Constrained to [a-zA-Z.-_ ]+.
  1100. CommonName string `json:"commonName,omitempty"`
  1101. // CreateTime: Time when the certificate was created.
  1102. CreateTime string `json:"createTime,omitempty"`
  1103. // ExpirationTime: Time when the certificate expires.
  1104. ExpirationTime string `json:"expirationTime,omitempty"`
  1105. // Instance: Name of the database instance.
  1106. Instance string `json:"instance,omitempty"`
  1107. // Kind: This is always sql#sslCert.
  1108. Kind string `json:"kind,omitempty"`
  1109. // Sha1Fingerprint: Sha1 Fingerprint.
  1110. Sha1Fingerprint string `json:"sha1Fingerprint,omitempty"`
  1111. // ServerResponse contains the HTTP response code and headers from the
  1112. // server.
  1113. googleapi.ServerResponse `json:"-"`
  1114. // ForceSendFields is a list of field names (e.g. "Cert") to
  1115. // unconditionally include in API requests. By default, fields with
  1116. // empty values are omitted from API requests. However, any non-pointer,
  1117. // non-interface field appearing in ForceSendFields will be sent to the
  1118. // server regardless of whether the field is empty or not. This may be
  1119. // used to include empty fields in Patch requests.
  1120. ForceSendFields []string `json:"-"`
  1121. }
  1122. func (s *SslCert) MarshalJSON() ([]byte, error) {
  1123. type noMethod SslCert
  1124. raw := noMethod(*s)
  1125. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1126. }
  1127. // SslCertDetail: SslCertDetail.
  1128. type SslCertDetail struct {
  1129. // CertInfo: The public information about the cert.
  1130. CertInfo *SslCert `json:"certInfo,omitempty"`
  1131. // CertPrivateKey: The private key for the client cert, in pem format.
  1132. // Keep private in order to protect your security.
  1133. CertPrivateKey string `json:"certPrivateKey,omitempty"`
  1134. // ForceSendFields is a list of field names (e.g. "CertInfo") to
  1135. // unconditionally include in API requests. By default, fields with
  1136. // empty values are omitted from API requests. However, any non-pointer,
  1137. // non-interface field appearing in ForceSendFields will be sent to the
  1138. // server regardless of whether the field is empty or not. This may be
  1139. // used to include empty fields in Patch requests.
  1140. ForceSendFields []string `json:"-"`
  1141. }
  1142. func (s *SslCertDetail) MarshalJSON() ([]byte, error) {
  1143. type noMethod SslCertDetail
  1144. raw := noMethod(*s)
  1145. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1146. }
  1147. // SslCertsDeleteResponse: SslCert delete response.
  1148. type SslCertsDeleteResponse struct {
  1149. // Kind: This is always sql#sslCertsDelete.
  1150. Kind string `json:"kind,omitempty"`
  1151. // Operation: An identifier that uniquely identifies the operation. You
  1152. // can use this identifier to retrieve the Operations resource that has
  1153. // information about the operation.
  1154. Operation string `json:"operation,omitempty"`
  1155. // ServerResponse contains the HTTP response code and headers from the
  1156. // server.
  1157. googleapi.ServerResponse `json:"-"`
  1158. // ForceSendFields is a list of field names (e.g. "Kind") to
  1159. // unconditionally include in API requests. By default, fields with
  1160. // empty values are omitted from API requests. However, any non-pointer,
  1161. // non-interface field appearing in ForceSendFields will be sent to the
  1162. // server regardless of whether the field is empty or not. This may be
  1163. // used to include empty fields in Patch requests.
  1164. ForceSendFields []string `json:"-"`
  1165. }
  1166. func (s *SslCertsDeleteResponse) MarshalJSON() ([]byte, error) {
  1167. type noMethod SslCertsDeleteResponse
  1168. raw := noMethod(*s)
  1169. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1170. }
  1171. // SslCertsInsertRequest: SslCerts insert request.
  1172. type SslCertsInsertRequest struct {
  1173. // CommonName: User supplied name. Must be a distinct name from the
  1174. // other certificates for this instance. New certificates will not be
  1175. // usable until the instance is restarted.
  1176. CommonName string `json:"commonName,omitempty"`
  1177. // ForceSendFields is a list of field names (e.g. "CommonName") to
  1178. // unconditionally include in API requests. By default, fields with
  1179. // empty values are omitted from API requests. However, any non-pointer,
  1180. // non-interface field appearing in ForceSendFields will be sent to the
  1181. // server regardless of whether the field is empty or not. This may be
  1182. // used to include empty fields in Patch requests.
  1183. ForceSendFields []string `json:"-"`
  1184. }
  1185. func (s *SslCertsInsertRequest) MarshalJSON() ([]byte, error) {
  1186. type noMethod SslCertsInsertRequest
  1187. raw := noMethod(*s)
  1188. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1189. }
  1190. // SslCertsInsertResponse: SslCert insert response.
  1191. type SslCertsInsertResponse struct {
  1192. // ClientCert: The new client certificate and private key. The new
  1193. // certificate will not work until the instance is restarted.
  1194. ClientCert *SslCertDetail `json:"clientCert,omitempty"`
  1195. // Kind: This is always sql#sslCertsInsert.
  1196. Kind string `json:"kind,omitempty"`
  1197. // ServerCaCert: The server Certificate Authority's certificate. If this
  1198. // is missing you can force a new one to be generated by calling
  1199. // resetSslConfig method on instances resource..
  1200. ServerCaCert *SslCert `json:"serverCaCert,omitempty"`
  1201. // ServerResponse contains the HTTP response code and headers from the
  1202. // server.
  1203. googleapi.ServerResponse `json:"-"`
  1204. // ForceSendFields is a list of field names (e.g. "ClientCert") to
  1205. // unconditionally include in API requests. By default, fields with
  1206. // empty values are omitted from API requests. However, any non-pointer,
  1207. // non-interface field appearing in ForceSendFields will be sent to the
  1208. // server regardless of whether the field is empty or not. This may be
  1209. // used to include empty fields in Patch requests.
  1210. ForceSendFields []string `json:"-"`
  1211. }
  1212. func (s *SslCertsInsertResponse) MarshalJSON() ([]byte, error) {
  1213. type noMethod SslCertsInsertResponse
  1214. raw := noMethod(*s)
  1215. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1216. }
  1217. // SslCertsListResponse: SslCerts list response.
  1218. type SslCertsListResponse struct {
  1219. // Items: List of client certificates for the instance.
  1220. Items []*SslCert `json:"items,omitempty"`
  1221. // Kind: This is always sql#sslCertsList.
  1222. Kind string `json:"kind,omitempty"`
  1223. // ServerResponse contains the HTTP response code and headers from the
  1224. // server.
  1225. googleapi.ServerResponse `json:"-"`
  1226. // ForceSendFields is a list of field names (e.g. "Items") to
  1227. // unconditionally include in API requests. By default, fields with
  1228. // empty values are omitted from API requests. However, any non-pointer,
  1229. // non-interface field appearing in ForceSendFields will be sent to the
  1230. // server regardless of whether the field is empty or not. This may be
  1231. // used to include empty fields in Patch requests.
  1232. ForceSendFields []string `json:"-"`
  1233. }
  1234. func (s *SslCertsListResponse) MarshalJSON() ([]byte, error) {
  1235. type noMethod SslCertsListResponse
  1236. raw := noMethod(*s)
  1237. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1238. }
  1239. // Tier: A Google Cloud SQL service tier resource.
  1240. type Tier struct {
  1241. // DiskQuota: The maximum disk size of this tier in bytes.
  1242. DiskQuota int64 `json:"DiskQuota,omitempty,string"`
  1243. // RAM: The maximum RAM usage of this tier in bytes.
  1244. RAM int64 `json:"RAM,omitempty,string"`
  1245. // Kind: This is always sql#tier.
  1246. Kind string `json:"kind,omitempty"`
  1247. // Region: The applicable regions for this tier. Can be us-east1,
  1248. // europe-west1, or asia-east1.
  1249. Region []string `json:"region,omitempty"`
  1250. // Tier: An identifier for the service tier, for example D1, D2 etc. For
  1251. // related information, see Pricing.
  1252. Tier string `json:"tier,omitempty"`
  1253. // ForceSendFields is a list of field names (e.g. "DiskQuota") to
  1254. // unconditionally include in API requests. By default, fields with
  1255. // empty values are omitted from API requests. However, any non-pointer,
  1256. // non-interface field appearing in ForceSendFields will be sent to the
  1257. // server regardless of whether the field is empty or not. This may be
  1258. // used to include empty fields in Patch requests.
  1259. ForceSendFields []string `json:"-"`
  1260. }
  1261. func (s *Tier) MarshalJSON() ([]byte, error) {
  1262. type noMethod Tier
  1263. raw := noMethod(*s)
  1264. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1265. }
  1266. // TiersListResponse: Tiers list response.
  1267. type TiersListResponse struct {
  1268. // Items: List of tiers.
  1269. Items []*Tier `json:"items,omitempty"`
  1270. // Kind: This is always sql#tiersList.
  1271. Kind string `json:"kind,omitempty"`
  1272. // ServerResponse contains the HTTP response code and headers from the
  1273. // server.
  1274. googleapi.ServerResponse `json:"-"`
  1275. // ForceSendFields is a list of field names (e.g. "Items") to
  1276. // unconditionally include in API requests. By default, fields with
  1277. // empty values are omitted from API requests. However, any non-pointer,
  1278. // non-interface field appearing in ForceSendFields will be sent to the
  1279. // server regardless of whether the field is empty or not. This may be
  1280. // used to include empty fields in Patch requests.
  1281. ForceSendFields []string `json:"-"`
  1282. }
  1283. func (s *TiersListResponse) MarshalJSON() ([]byte, error) {
  1284. type noMethod TiersListResponse
  1285. raw := noMethod(*s)
  1286. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1287. }
  1288. // method id "sql.backupRuns.get":
  1289. type BackupRunsGetCall struct {
  1290. s *Service
  1291. project string
  1292. instance string
  1293. backupConfiguration string
  1294. urlParams_ gensupport.URLParams
  1295. ifNoneMatch_ string
  1296. ctx_ context.Context
  1297. }
  1298. // Get: Retrieves information about a specified backup run for a Cloud
  1299. // SQL instance.
  1300. func (r *BackupRunsService) Get(project string, instance string, backupConfiguration string, dueTime string) *BackupRunsGetCall {
  1301. c := &BackupRunsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1302. c.project = project
  1303. c.instance = instance
  1304. c.backupConfiguration = backupConfiguration
  1305. c.urlParams_.Set("dueTime", dueTime)
  1306. return c
  1307. }
  1308. // Fields allows partial responses to be retrieved. See
  1309. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1310. // for more information.
  1311. func (c *BackupRunsGetCall) Fields(s ...googleapi.Field) *BackupRunsGetCall {
  1312. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1313. return c
  1314. }
  1315. // IfNoneMatch sets the optional parameter which makes the operation
  1316. // fail if the object's ETag matches the given value. This is useful for
  1317. // getting updates only after the object has changed since the last
  1318. // request. Use googleapi.IsNotModified to check whether the response
  1319. // error from Do is the result of In-None-Match.
  1320. func (c *BackupRunsGetCall) IfNoneMatch(entityTag string) *BackupRunsGetCall {
  1321. c.ifNoneMatch_ = entityTag
  1322. return c
  1323. }
  1324. // Context sets the context to be used in this call's Do method. Any
  1325. // pending HTTP request will be aborted if the provided context is
  1326. // canceled.
  1327. func (c *BackupRunsGetCall) Context(ctx context.Context) *BackupRunsGetCall {
  1328. c.ctx_ = ctx
  1329. return c
  1330. }
  1331. func (c *BackupRunsGetCall) doRequest(alt string) (*http.Response, error) {
  1332. var body io.Reader = nil
  1333. c.urlParams_.Set("alt", alt)
  1334. urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/backupRuns/{backupConfiguration}")
  1335. urls += "?" + c.urlParams_.Encode()
  1336. req, _ := http.NewRequest("GET", urls, body)
  1337. googleapi.Expand(req.URL, map[string]string{
  1338. "project": c.project,
  1339. "instance": c.instance,
  1340. "backupConfiguration": c.backupConfiguration,
  1341. })
  1342. req.Header.Set("User-Agent", c.s.userAgent())
  1343. if c.ifNoneMatch_ != "" {
  1344. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  1345. }
  1346. if c.ctx_ != nil {
  1347. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1348. }
  1349. return c.s.client.Do(req)
  1350. }
  1351. // Do executes the "sql.backupRuns.get" call.
  1352. // Exactly one of *BackupRun or error will be non-nil. Any non-2xx
  1353. // status code is an error. Response headers are in either
  1354. // *BackupRun.ServerResponse.Header or (if a response was returned at
  1355. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1356. // to check whether the returned error was because
  1357. // http.StatusNotModified was returned.
  1358. func (c *BackupRunsGetCall) Do(opts ...googleapi.CallOption) (*BackupRun, error) {
  1359. gensupport.SetOptions(c.urlParams_, opts...)
  1360. res, err := c.doRequest("json")
  1361. if res != nil && res.StatusCode == http.StatusNotModified {
  1362. if res.Body != nil {
  1363. res.Body.Close()
  1364. }
  1365. return nil, &googleapi.Error{
  1366. Code: res.StatusCode,
  1367. Header: res.Header,
  1368. }
  1369. }
  1370. if err != nil {
  1371. return nil, err
  1372. }
  1373. defer googleapi.CloseBody(res)
  1374. if err := googleapi.CheckResponse(res); err != nil {
  1375. return nil, err
  1376. }
  1377. ret := &BackupRun{
  1378. ServerResponse: googleapi.ServerResponse{
  1379. Header: res.Header,
  1380. HTTPStatusCode: res.StatusCode,
  1381. },
  1382. }
  1383. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1384. return nil, err
  1385. }
  1386. return ret, nil
  1387. // {
  1388. // "description": "Retrieves information about a specified backup run for a Cloud SQL instance.",
  1389. // "httpMethod": "GET",
  1390. // "id": "sql.backupRuns.get",
  1391. // "parameterOrder": [
  1392. // "project",
  1393. // "instance",
  1394. // "backupConfiguration",
  1395. // "dueTime"
  1396. // ],
  1397. // "parameters": {
  1398. // "backupConfiguration": {
  1399. // "description": "Identifier for the backup configuration. This gets generated automatically when a backup configuration is created.",
  1400. // "location": "path",
  1401. // "required": true,
  1402. // "type": "string"
  1403. // },
  1404. // "dueTime": {
  1405. // "description": "The start time of the four-hour backup window. The backup can occur any time in the window. The time is in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.",
  1406. // "location": "query",
  1407. // "required": true,
  1408. // "type": "string"
  1409. // },
  1410. // "instance": {
  1411. // "description": "Cloud SQL instance ID. This does not include the project ID.",
  1412. // "location": "path",
  1413. // "required": true,
  1414. // "type": "string"
  1415. // },
  1416. // "project": {
  1417. // "description": "Project ID of the project that contains the instance.",
  1418. // "location": "path",
  1419. // "required": true,
  1420. // "type": "string"
  1421. // }
  1422. // },
  1423. // "path": "projects/{project}/instances/{instance}/backupRuns/{backupConfiguration}",
  1424. // "response": {
  1425. // "$ref": "BackupRun"
  1426. // },
  1427. // "scopes": [
  1428. // "https://www.googleapis.com/auth/cloud-platform",
  1429. // "https://www.googleapis.com/auth/sqlservice.admin"
  1430. // ]
  1431. // }
  1432. }
  1433. // method id "sql.backupRuns.list":
  1434. type BackupRunsListCall struct {
  1435. s *Service
  1436. project string
  1437. instance string
  1438. urlParams_ gensupport.URLParams
  1439. ifNoneMatch_ string
  1440. ctx_ context.Context
  1441. }
  1442. // List: Lists all backup runs associated with a Cloud SQL instance.
  1443. func (r *BackupRunsService) List(project string, instance string, backupConfiguration string) *BackupRunsListCall {
  1444. c := &BackupRunsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1445. c.project = project
  1446. c.instance = instance
  1447. c.urlParams_.Set("backupConfiguration", backupConfiguration)
  1448. return c
  1449. }
  1450. // MaxResults sets the optional parameter "maxResults": Maximum number
  1451. // of backup runs per response.
  1452. func (c *BackupRunsListCall) MaxResults(maxResults int64) *BackupRunsListCall {
  1453. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  1454. return c
  1455. }
  1456. // PageToken sets the optional parameter "pageToken": A
  1457. // previously-returned page token representing part of the larger set of
  1458. // results to view.
  1459. func (c *BackupRunsListCall) PageToken(pageToken string) *BackupRunsListCall {
  1460. c.urlParams_.Set("pageToken", pageToken)
  1461. return c
  1462. }
  1463. // Fields allows partial responses to be retrieved. See
  1464. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1465. // for more information.
  1466. func (c *BackupRunsListCall) Fields(s ...googleapi.Field) *BackupRunsListCall {
  1467. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1468. return c
  1469. }
  1470. // IfNoneMatch sets the optional parameter which makes the operation
  1471. // fail if the object's ETag matches the given value. This is useful for
  1472. // getting updates only after the object has changed since the last
  1473. // request. Use googleapi.IsNotModified to check whether the response
  1474. // error from Do is the result of In-None-Match.
  1475. func (c *BackupRunsListCall) IfNoneMatch(entityTag string) *BackupRunsListCall {
  1476. c.ifNoneMatch_ = entityTag
  1477. return c
  1478. }
  1479. // Context sets the context to be used in this call's Do method. Any
  1480. // pending HTTP request will be aborted if the provided context is
  1481. // canceled.
  1482. func (c *BackupRunsListCall) Context(ctx context.Context) *BackupRunsListCall {
  1483. c.ctx_ = ctx
  1484. return c
  1485. }
  1486. func (c *BackupRunsListCall) doRequest(alt string) (*http.Response, error) {
  1487. var body io.Reader = nil
  1488. c.urlParams_.Set("alt", alt)
  1489. urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/backupRuns")
  1490. urls += "?" + c.urlParams_.Encode()
  1491. req, _ := http.NewRequest("GET", urls, body)
  1492. googleapi.Expand(req.URL, map[string]string{
  1493. "project": c.project,
  1494. "instance": c.instance,
  1495. })
  1496. req.Header.Set("User-Agent", c.s.userAgent())
  1497. if c.ifNoneMatch_ != "" {
  1498. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  1499. }
  1500. if c.ctx_ != nil {
  1501. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1502. }
  1503. return c.s.client.Do(req)
  1504. }
  1505. // Do executes the "sql.backupRuns.list" call.
  1506. // Exactly one of *BackupRunsListResponse or error will be non-nil. Any
  1507. // non-2xx status code is an error. Response headers are in either
  1508. // *BackupRunsListResponse.ServerResponse.Header or (if a response was
  1509. // returned at all) in error.(*googleapi.Error).Header. Use
  1510. // googleapi.IsNotModified to check whether the returned error was
  1511. // because http.StatusNotModified was returned.
  1512. func (c *BackupRunsListCall) Do(opts ...googleapi.CallOption) (*BackupRunsListResponse, error) {
  1513. gensupport.SetOptions(c.urlParams_, opts...)
  1514. res, err := c.doRequest("json")
  1515. if res != nil && res.StatusCode == http.StatusNotModified {
  1516. if res.Body != nil {
  1517. res.Body.Close()
  1518. }
  1519. return nil, &googleapi.Error{
  1520. Code: res.StatusCode,
  1521. Header: res.Header,
  1522. }
  1523. }
  1524. if err != nil {
  1525. return nil, err
  1526. }
  1527. defer googleapi.CloseBody(res)
  1528. if err := googleapi.CheckResponse(res); err != nil {
  1529. return nil, err
  1530. }
  1531. ret := &BackupRunsListResponse{
  1532. ServerResponse: googleapi.ServerResponse{
  1533. Header: res.Header,
  1534. HTTPStatusCode: res.StatusCode,
  1535. },
  1536. }
  1537. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1538. return nil, err
  1539. }
  1540. return ret, nil
  1541. // {
  1542. // "description": "Lists all backup runs associated with a Cloud SQL instance.",
  1543. // "httpMethod": "GET",
  1544. // "id": "sql.backupRuns.list",
  1545. // "parameterOrder": [
  1546. // "project",
  1547. // "instance",
  1548. // "backupConfiguration"
  1549. // ],
  1550. // "parameters": {
  1551. // "backupConfiguration": {
  1552. // "description": "Identifier for the backup configuration. This gets generated automatically when a backup configuration is created.",
  1553. // "location": "query",
  1554. // "required": true,
  1555. // "type": "string"
  1556. // },
  1557. // "instance": {
  1558. // "description": "Cloud SQL instance ID. This does not include the project ID.",
  1559. // "location": "path",
  1560. // "required": true,
  1561. // "type": "string"
  1562. // },
  1563. // "maxResults": {
  1564. // "description": "Maximum number of backup runs per response.",
  1565. // "format": "int32",
  1566. // "location": "query",
  1567. // "type": "integer"
  1568. // },
  1569. // "pageToken": {
  1570. // "description": "A previously-returned page token representing part of the larger set of results to view.",
  1571. // "location": "query",
  1572. // "type": "string"
  1573. // },
  1574. // "project": {
  1575. // "description": "Project ID of the project that contains the instance.",
  1576. // "location": "path",
  1577. // "required": true,
  1578. // "type": "string"
  1579. // }
  1580. // },
  1581. // "path": "projects/{project}/instances/{instance}/backupRuns",
  1582. // "response": {
  1583. // "$ref": "BackupRunsListResponse"
  1584. // },
  1585. // "scopes": [
  1586. // "https://www.googleapis.com/auth/cloud-platform",
  1587. // "https://www.googleapis.com/auth/sqlservice.admin"
  1588. // ]
  1589. // }
  1590. }
  1591. // Pages invokes f for each page of results.
  1592. // A non-nil error returned from f will halt the iteration.
  1593. // The provided context supersedes any context provided to the Context method.
  1594. func (c *BackupRunsListCall) Pages(ctx context.Context, f func(*BackupRunsListResponse) error) error {
  1595. c.ctx_ = ctx
  1596. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1597. for {
  1598. x, err := c.Do()
  1599. if err != nil {
  1600. return err
  1601. }
  1602. if err := f(x); err != nil {
  1603. return err
  1604. }
  1605. if x.NextPageToken == "" {
  1606. return nil
  1607. }
  1608. c.PageToken(x.NextPageToken)
  1609. }
  1610. }
  1611. // method id "sql.flags.list":
  1612. type FlagsListCall struct {
  1613. s *Service
  1614. urlParams_ gensupport.URLParams
  1615. ifNoneMatch_ string
  1616. ctx_ context.Context
  1617. }
  1618. // List: Lists all database flags that can be set for Google Cloud SQL
  1619. // instances.
  1620. func (r *FlagsService) List() *FlagsListCall {
  1621. c := &FlagsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1622. return c
  1623. }
  1624. // Fields allows partial responses to be retrieved. See
  1625. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1626. // for more information.
  1627. func (c *FlagsListCall) Fields(s ...googleapi.Field) *FlagsListCall {
  1628. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1629. return c
  1630. }
  1631. // IfNoneMatch sets the optional parameter which makes the operation
  1632. // fail if the object's ETag matches the given value. This is useful for
  1633. // getting updates only after the object has changed since the last
  1634. // request. Use googleapi.IsNotModified to check whether the response
  1635. // error from Do is the result of In-None-Match.
  1636. func (c *FlagsListCall) IfNoneMatch(entityTag string) *FlagsListCall {
  1637. c.ifNoneMatch_ = entityTag
  1638. return c
  1639. }
  1640. // Context sets the context to be used in this call's Do method. Any
  1641. // pending HTTP request will be aborted if the provided context is
  1642. // canceled.
  1643. func (c *FlagsListCall) Context(ctx context.Context) *FlagsListCall {
  1644. c.ctx_ = ctx
  1645. return c
  1646. }
  1647. func (c *FlagsListCall) doRequest(alt string) (*http.Response, error) {
  1648. var body io.Reader = nil
  1649. c.urlParams_.Set("alt", alt)
  1650. urls := googleapi.ResolveRelative(c.s.BasePath, "flags")
  1651. urls += "?" + c.urlParams_.Encode()
  1652. req, _ := http.NewRequest("GET", urls, body)
  1653. googleapi.SetOpaque(req.URL)
  1654. req.Header.Set("User-Agent", c.s.userAgent())
  1655. if c.ifNoneMatch_ != "" {
  1656. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  1657. }
  1658. if c.ctx_ != nil {
  1659. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1660. }
  1661. return c.s.client.Do(req)
  1662. }
  1663. // Do executes the "sql.flags.list" call.
  1664. // Exactly one of *FlagsListResponse or error will be non-nil. Any
  1665. // non-2xx status code is an error. Response headers are in either
  1666. // *FlagsListResponse.ServerResponse.Header or (if a response was
  1667. // returned at all) in error.(*googleapi.Error).Header. Use
  1668. // googleapi.IsNotModified to check whether the returned error was
  1669. // because http.StatusNotModified was returned.
  1670. func (c *FlagsListCall) Do(opts ...googleapi.CallOption) (*FlagsListResponse, error) {
  1671. gensupport.SetOptions(c.urlParams_, opts...)
  1672. res, err := c.doRequest("json")
  1673. if res != nil && res.StatusCode == http.StatusNotModified {
  1674. if res.Body != nil {
  1675. res.Body.Close()
  1676. }
  1677. return nil, &googleapi.Error{
  1678. Code: res.StatusCode,
  1679. Header: res.Header,
  1680. }
  1681. }
  1682. if err != nil {
  1683. return nil, err
  1684. }
  1685. defer googleapi.CloseBody(res)
  1686. if err := googleapi.CheckResponse(res); err != nil {
  1687. return nil, err
  1688. }
  1689. ret := &FlagsListResponse{
  1690. ServerResponse: googleapi.ServerResponse{
  1691. Header: res.Header,
  1692. HTTPStatusCode: res.StatusCode,
  1693. },
  1694. }
  1695. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1696. return nil, err
  1697. }
  1698. return ret, nil
  1699. // {
  1700. // "description": "Lists all database flags that can be set for Google Cloud SQL instances.",
  1701. // "httpMethod": "GET",
  1702. // "id": "sql.flags.list",
  1703. // "path": "flags",
  1704. // "response": {
  1705. // "$ref": "FlagsListResponse"
  1706. // },
  1707. // "scopes": [
  1708. // "https://www.googleapis.com/auth/cloud-platform",
  1709. // "https://www.googleapis.com/auth/sqlservice.admin"
  1710. // ]
  1711. // }
  1712. }
  1713. // method id "sql.instances.clone":
  1714. type InstancesCloneCall struct {
  1715. s *Service
  1716. project string
  1717. instancesclonerequest *InstancesCloneRequest
  1718. urlParams_ gensupport.URLParams
  1719. ctx_ context.Context
  1720. }
  1721. // Clone: Creates a Cloud SQL instance as a clone of a source instance.
  1722. func (r *InstancesService) Clone(project string, instancesclonerequest *InstancesCloneRequest) *InstancesCloneCall {
  1723. c := &InstancesCloneCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1724. c.project = project
  1725. c.instancesclonerequest = instancesclonerequest
  1726. return c
  1727. }
  1728. // Fields allows partial responses to be retrieved. See
  1729. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1730. // for more information.
  1731. func (c *InstancesCloneCall) Fields(s ...googleapi.Field) *InstancesCloneCall {
  1732. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1733. return c
  1734. }
  1735. // Context sets the context to be used in this call's Do method. Any
  1736. // pending HTTP request will be aborted if the provided context is
  1737. // canceled.
  1738. func (c *InstancesCloneCall) Context(ctx context.Context) *InstancesCloneCall {
  1739. c.ctx_ = ctx
  1740. return c
  1741. }
  1742. func (c *InstancesCloneCall) doRequest(alt string) (*http.Response, error) {
  1743. var body io.Reader = nil
  1744. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesclonerequest)
  1745. if err != nil {
  1746. return nil, err
  1747. }
  1748. ctype := "application/json"
  1749. c.urlParams_.Set("alt", alt)
  1750. urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/clone")
  1751. urls += "?" + c.urlParams_.Encode()
  1752. req, _ := http.NewRequest("POST", urls, body)
  1753. googleapi.Expand(req.URL, map[string]string{
  1754. "project": c.project,
  1755. })
  1756. req.Header.Set("Content-Type", ctype)
  1757. req.Header.Set("User-Agent", c.s.userAgent())
  1758. if c.ctx_ != nil {
  1759. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1760. }
  1761. return c.s.client.Do(req)
  1762. }
  1763. // Do executes the "sql.instances.clone" call.
  1764. // Exactly one of *InstancesCloneResponse or error will be non-nil. Any
  1765. // non-2xx status code is an error. Response headers are in either
  1766. // *InstancesCloneResponse.ServerResponse.Header or (if a response was
  1767. // returned at all) in error.(*googleapi.Error).Header. Use
  1768. // googleapi.IsNotModified to check whether the returned error was
  1769. // because http.StatusNotModified was returned.
  1770. func (c *InstancesCloneCall) Do(opts ...googleapi.CallOption) (*InstancesCloneResponse, error) {
  1771. gensupport.SetOptions(c.urlParams_, opts...)
  1772. res, err := c.doRequest("json")
  1773. if res != nil && res.StatusCode == http.StatusNotModified {
  1774. if res.Body != nil {
  1775. res.Body.Close()
  1776. }
  1777. return nil, &googleapi.Error{
  1778. Code: res.StatusCode,
  1779. Header: res.Header,
  1780. }
  1781. }
  1782. if err != nil {
  1783. return nil, err
  1784. }
  1785. defer googleapi.CloseBody(res)
  1786. if err := googleapi.CheckResponse(res); err != nil {
  1787. return nil, err
  1788. }
  1789. ret := &InstancesCloneResponse{
  1790. ServerResponse: googleapi.ServerResponse{
  1791. Header: res.Header,
  1792. HTTPStatusCode: res.StatusCode,
  1793. },
  1794. }
  1795. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1796. return nil, err
  1797. }
  1798. return ret, nil
  1799. // {
  1800. // "description": "Creates a Cloud SQL instance as a clone of a source instance.",
  1801. // "httpMethod": "POST",
  1802. // "id": "sql.instances.clone",
  1803. // "parameterOrder": [
  1804. // "project"
  1805. // ],
  1806. // "parameters": {
  1807. // "project": {
  1808. // "description": "Project ID of the source as well as the clone Cloud SQL instance.",
  1809. // "location": "path",
  1810. // "required": true,
  1811. // "type": "string"
  1812. // }
  1813. // },
  1814. // "path": "projects/{project}/instances/clone",
  1815. // "request": {
  1816. // "$ref": "InstancesCloneRequest"
  1817. // },
  1818. // "response": {
  1819. // "$ref": "InstancesCloneResponse"
  1820. // },
  1821. // "scopes": [
  1822. // "https://www.googleapis.com/auth/cloud-platform",
  1823. // "https://www.googleapis.com/auth/sqlservice.admin"
  1824. // ]
  1825. // }
  1826. }
  1827. // method id "sql.instances.delete":
  1828. type InstancesDeleteCall struct {
  1829. s *Service
  1830. project string
  1831. instance string
  1832. urlParams_ gensupport.URLParams
  1833. ctx_ context.Context
  1834. }
  1835. // Delete: Deletes a Cloud SQL instance.
  1836. func (r *InstancesService) Delete(project string, instance string) *InstancesDeleteCall {
  1837. c := &InstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1838. c.project = project
  1839. c.instance = instance
  1840. return c
  1841. }
  1842. // Fields allows partial responses to be retrieved. See
  1843. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1844. // for more information.
  1845. func (c *InstancesDeleteCall) Fields(s ...googleapi.Field) *InstancesDeleteCall {
  1846. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1847. return c
  1848. }
  1849. // Context sets the context to be used in this call's Do method. Any
  1850. // pending HTTP request will be aborted if the provided context is
  1851. // canceled.
  1852. func (c *InstancesDeleteCall) Context(ctx context.Context) *InstancesDeleteCall {
  1853. c.ctx_ = ctx
  1854. return c
  1855. }
  1856. func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
  1857. var body io.Reader = nil
  1858. c.urlParams_.Set("alt", alt)
  1859. urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}")
  1860. urls += "?" + c.urlParams_.Encode()
  1861. req, _ := http.NewRequest("DELETE", urls, body)
  1862. googleapi.Expand(req.URL, map[string]string{
  1863. "project": c.project,
  1864. "instance": c.instance,
  1865. })
  1866. req.Header.Set("User-Agent", c.s.userAgent())
  1867. if c.ctx_ != nil {
  1868. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1869. }
  1870. return c.s.client.Do(req)
  1871. }
  1872. // Do executes the "sql.instances.delete" call.
  1873. // Exactly one of *InstancesDeleteResponse or error will be non-nil. Any
  1874. // non-2xx status code is an error. Response headers are in either
  1875. // *InstancesDeleteResponse.ServerResponse.Header or (if a response was
  1876. // returned at all) in error.(*googleapi.Error).Header. Use
  1877. // googleapi.IsNotModified to check whether the returned error was
  1878. // because http.StatusNotModified was returned.
  1879. func (c *InstancesDeleteCall) Do(opts ...googleapi.CallOption) (*InstancesDeleteResponse, error) {
  1880. gensupport.SetOptions(c.urlParams_, opts...)
  1881. res, err := c.doRequest("json")
  1882. if res != nil && res.StatusCode == http.StatusNotModified {
  1883. if res.Body != nil {
  1884. res.Body.Close()
  1885. }
  1886. return nil, &googleapi.Error{
  1887. Code: res.StatusCode,
  1888. Header: res.Header,
  1889. }
  1890. }
  1891. if err != nil {
  1892. return nil, err
  1893. }
  1894. defer googleapi.CloseBody(res)
  1895. if err := googleapi.CheckResponse(res); err != nil {
  1896. return nil, err
  1897. }
  1898. ret := &InstancesDeleteResponse{
  1899. ServerResponse: googleapi.ServerResponse{
  1900. Header: res.Header,
  1901. HTTPStatusCode: res.StatusCode,
  1902. },
  1903. }
  1904. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1905. return nil, err
  1906. }
  1907. return ret, nil
  1908. // {
  1909. // "description": "Deletes a Cloud SQL instance.",
  1910. // "httpMethod": "DELETE",
  1911. // "id": "sql.instances.delete",
  1912. // "parameterOrder": [
  1913. // "project",
  1914. // "instance"
  1915. // ],
  1916. // "parameters": {
  1917. // "instance": {
  1918. // "description": "Cloud SQL instance ID. This does not include the project ID.",
  1919. // "location": "path",
  1920. // "required": true,
  1921. // "type": "string"
  1922. // },
  1923. // "project": {
  1924. // "description": "Project ID of the project that contains the instance to be deleted.",
  1925. // "location": "path",
  1926. // "required": true,
  1927. // "type": "string"
  1928. // }
  1929. // },
  1930. // "path": "projects/{project}/instances/{instance}",
  1931. // "response": {
  1932. // "$ref": "InstancesDeleteResponse"
  1933. // },
  1934. // "scopes": [
  1935. // "https://www.googleapis.com/auth/cloud-platform",
  1936. // "https://www.googleapis.com/auth/sqlservice.admin"
  1937. // ]
  1938. // }
  1939. }
  1940. // method id "sql.instances.export":
  1941. type InstancesExportCall struct {
  1942. s *Service
  1943. project string
  1944. instance string
  1945. instancesexportrequest *InstancesExportRequest
  1946. urlParams_ gensupport.URLParams
  1947. ctx_ context.Context
  1948. }
  1949. // Export: Exports data from a Cloud SQL instance to a Google Cloud
  1950. // Storage bucket as a MySQL dump file.
  1951. func (r *InstancesService) Export(project string, instance string, instancesexportrequest *InstancesExportRequest) *InstancesExportCall {
  1952. c := &InstancesExportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1953. c.project = project
  1954. c.instance = instance
  1955. c.instancesexportrequest = instancesexportrequest
  1956. return c
  1957. }
  1958. // Fields allows partial responses to be retrieved. See
  1959. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1960. // for more information.
  1961. func (c *InstancesExportCall) Fields(s ...googleapi.Field) *InstancesExportCall {
  1962. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1963. return c
  1964. }
  1965. // Context sets the context to be used in this call's Do method. Any
  1966. // pending HTTP request will be aborted if the provided context is
  1967. // canceled.
  1968. func (c *InstancesExportCall) Context(ctx context.Context) *InstancesExportCall {
  1969. c.ctx_ = ctx
  1970. return c
  1971. }
  1972. func (c *InstancesExportCall) doRequest(alt string) (*http.Response, error) {
  1973. var body io.Reader = nil
  1974. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesexportrequest)
  1975. if err != nil {
  1976. return nil, err
  1977. }
  1978. ctype := "application/json"
  1979. c.urlParams_.Set("alt", alt)
  1980. urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/export")
  1981. urls += "?" + c.urlParams_.Encode()
  1982. req, _ := http.NewRequest("POST", urls, body)
  1983. googleapi.Expand(req.URL, map[string]string{
  1984. "project": c.project,
  1985. "instance": c.instance,
  1986. })
  1987. req.Header.Set("Content-Type", ctype)
  1988. req.Header.Set("User-Agent", c.s.userAgent())
  1989. if c.ctx_ != nil {
  1990. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1991. }
  1992. return c.s.client.Do(req)
  1993. }
  1994. // Do executes the "sql.instances.export" call.
  1995. // Exactly one of *InstancesExportResponse or error will be non-nil. Any
  1996. // non-2xx status code is an error. Response headers are in either
  1997. // *InstancesExportResponse.ServerResponse.Header or (if a response was
  1998. // returned at all) in error.(*googleapi.Error).Header. Use
  1999. // googleapi.IsNotModified to check whether the returned error was
  2000. // because http.StatusNotModified was returned.
  2001. func (c *InstancesExportCall) Do(opts ...googleapi.CallOption) (*InstancesExportResponse, error) {
  2002. gensupport.SetOptions(c.urlParams_, opts...)
  2003. res, err := c.doRequest("json")
  2004. if res != nil && res.StatusCode == http.StatusNotModified {
  2005. if res.Body != nil {
  2006. res.Body.Close()
  2007. }
  2008. return nil, &googleapi.Error{
  2009. Code: res.StatusCode,
  2010. Header: res.Header,
  2011. }
  2012. }
  2013. if err != nil {
  2014. return nil, err
  2015. }
  2016. defer googleapi.CloseBody(res)
  2017. if err := googleapi.CheckResponse(res); err != nil {
  2018. return nil, err
  2019. }
  2020. ret := &InstancesExportResponse{
  2021. ServerResponse: googleapi.ServerResponse{
  2022. Header: res.Header,
  2023. HTTPStatusCode: res.StatusCode,
  2024. },
  2025. }
  2026. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2027. return nil, err
  2028. }
  2029. return ret, nil
  2030. // {
  2031. // "description": "Exports data from a Cloud SQL instance to a Google Cloud Storage bucket as a MySQL dump file.",
  2032. // "httpMethod": "POST",
  2033. // "id": "sql.instances.export",
  2034. // "parameterOrder": [
  2035. // "project",
  2036. // "instance"
  2037. // ],
  2038. // "parameters": {
  2039. // "instance": {
  2040. // "description": "Cloud SQL instance ID. This does not include the project ID.",
  2041. // "location": "path",
  2042. // "required": true,
  2043. // "type": "string"
  2044. // },
  2045. // "project": {
  2046. // "description": "Project ID of the project that contains the instance to be exported.",
  2047. // "location": "path",
  2048. // "required": true,
  2049. // "type": "string"
  2050. // }
  2051. // },
  2052. // "path": "projects/{project}/instances/{instance}/export",
  2053. // "request": {
  2054. // "$ref": "InstancesExportRequest"
  2055. // },
  2056. // "response": {
  2057. // "$ref": "InstancesExportResponse"
  2058. // },
  2059. // "scopes": [
  2060. // "https://www.googleapis.com/auth/cloud-platform"
  2061. // ]
  2062. // }
  2063. }
  2064. // method id "sql.instances.get":
  2065. type InstancesGetCall struct {
  2066. s *Service
  2067. project string
  2068. instance string
  2069. urlParams_ gensupport.URLParams
  2070. ifNoneMatch_ string
  2071. ctx_ context.Context
  2072. }
  2073. // Get: Retrieves information about a Cloud SQL instance.
  2074. func (r *InstancesService) Get(project string, instance string) *InstancesGetCall {
  2075. c := &InstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2076. c.project = project
  2077. c.instance = instance
  2078. return c
  2079. }
  2080. // Fields allows partial responses to be retrieved. See
  2081. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2082. // for more information.
  2083. func (c *InstancesGetCall) Fields(s ...googleapi.Field) *InstancesGetCall {
  2084. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2085. return c
  2086. }
  2087. // IfNoneMatch sets the optional parameter which makes the operation
  2088. // fail if the object's ETag matches the given value. This is useful for
  2089. // getting updates only after the object has changed since the last
  2090. // request. Use googleapi.IsNotModified to check whether the response
  2091. // error from Do is the result of In-None-Match.
  2092. func (c *InstancesGetCall) IfNoneMatch(entityTag string) *InstancesGetCall {
  2093. c.ifNoneMatch_ = entityTag
  2094. return c
  2095. }
  2096. // Context sets the context to be used in this call's Do method. Any
  2097. // pending HTTP request will be aborted if the provided context is
  2098. // canceled.
  2099. func (c *InstancesGetCall) Context(ctx context.Context) *InstancesGetCall {
  2100. c.ctx_ = ctx
  2101. return c
  2102. }
  2103. func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) {
  2104. var body io.Reader = nil
  2105. c.urlParams_.Set("alt", alt)
  2106. urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}")
  2107. urls += "?" + c.urlParams_.Encode()
  2108. req, _ := http.NewRequest("GET", urls, body)
  2109. googleapi.Expand(req.URL, map[string]string{
  2110. "project": c.project,
  2111. "instance": c.instance,
  2112. })
  2113. req.Header.Set("User-Agent", c.s.userAgent())
  2114. if c.ifNoneMatch_ != "" {
  2115. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  2116. }
  2117. if c.ctx_ != nil {
  2118. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2119. }
  2120. return c.s.client.Do(req)
  2121. }
  2122. // Do executes the "sql.instances.get" call.
  2123. // Exactly one of *DatabaseInstance or error will be non-nil. Any
  2124. // non-2xx status code is an error. Response headers are in either
  2125. // *DatabaseInstance.ServerResponse.Header or (if a response was
  2126. // returned at all) in error.(*googleapi.Error).Header. Use
  2127. // googleapi.IsNotModified to check whether the returned error was
  2128. // because http.StatusNotModified was returned.
  2129. func (c *InstancesGetCall) Do(opts ...googleapi.CallOption) (*DatabaseInstance, error) {
  2130. gensupport.SetOptions(c.urlParams_, opts...)
  2131. res, err := c.doRequest("json")
  2132. if res != nil && res.StatusCode == http.StatusNotModified {
  2133. if res.Body != nil {
  2134. res.Body.Close()
  2135. }
  2136. return nil, &googleapi.Error{
  2137. Code: res.StatusCode,
  2138. Header: res.Header,
  2139. }
  2140. }
  2141. if err != nil {
  2142. return nil, err
  2143. }
  2144. defer googleapi.CloseBody(res)
  2145. if err := googleapi.CheckResponse(res); err != nil {
  2146. return nil, err
  2147. }
  2148. ret := &DatabaseInstance{
  2149. ServerResponse: googleapi.ServerResponse{
  2150. Header: res.Header,
  2151. HTTPStatusCode: res.StatusCode,
  2152. },
  2153. }
  2154. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2155. return nil, err
  2156. }
  2157. return ret, nil
  2158. // {
  2159. // "description": "Retrieves information about a Cloud SQL instance.",
  2160. // "httpMethod": "GET",
  2161. // "id": "sql.instances.get",
  2162. // "parameterOrder": [
  2163. // "project",
  2164. // "instance"
  2165. // ],
  2166. // "parameters": {
  2167. // "instance": {
  2168. // "description": "Database instance ID. This does not include the project ID.",
  2169. // "location": "path",
  2170. // "required": true,
  2171. // "type": "string"
  2172. // },
  2173. // "project": {
  2174. // "description": "Project ID of the project that contains the instance.",
  2175. // "location": "path",
  2176. // "required": true,
  2177. // "type": "string"
  2178. // }
  2179. // },
  2180. // "path": "projects/{project}/instances/{instance}",
  2181. // "response": {
  2182. // "$ref": "DatabaseInstance"
  2183. // },
  2184. // "scopes": [
  2185. // "https://www.googleapis.com/auth/cloud-platform",
  2186. // "https://www.googleapis.com/auth/sqlservice.admin"
  2187. // ]
  2188. // }
  2189. }
  2190. // method id "sql.instances.import":
  2191. type InstancesImportCall struct {
  2192. s *Service
  2193. project string
  2194. instance string
  2195. instancesimportrequest *InstancesImportRequest
  2196. urlParams_ gensupport.URLParams
  2197. ctx_ context.Context
  2198. }
  2199. // Import: Imports data into a Cloud SQL instance from a MySQL dump file
  2200. // stored in a Google Cloud Storage bucket.
  2201. func (r *InstancesService) Import(project string, instance string, instancesimportrequest *InstancesImportRequest) *InstancesImportCall {
  2202. c := &InstancesImportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2203. c.project = project
  2204. c.instance = instance
  2205. c.instancesimportrequest = instancesimportrequest
  2206. return c
  2207. }
  2208. // Fields allows partial responses to be retrieved. See
  2209. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2210. // for more information.
  2211. func (c *InstancesImportCall) Fields(s ...googleapi.Field) *InstancesImportCall {
  2212. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2213. return c
  2214. }
  2215. // Context sets the context to be used in this call's Do method. Any
  2216. // pending HTTP request will be aborted if the provided context is
  2217. // canceled.
  2218. func (c *InstancesImportCall) Context(ctx context.Context) *InstancesImportCall {
  2219. c.ctx_ = ctx
  2220. return c
  2221. }
  2222. func (c *InstancesImportCall) doRequest(alt string) (*http.Response, error) {
  2223. var body io.Reader = nil
  2224. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesimportrequest)
  2225. if err != nil {
  2226. return nil, err
  2227. }
  2228. ctype := "application/json"
  2229. c.urlParams_.Set("alt", alt)
  2230. urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/import")
  2231. urls += "?" + c.urlParams_.Encode()
  2232. req, _ := http.NewRequest("POST", urls, body)
  2233. googleapi.Expand(req.URL, map[string]string{
  2234. "project": c.project,
  2235. "instance": c.instance,
  2236. })
  2237. req.Header.Set("Content-Type", ctype)
  2238. req.Header.Set("User-Agent", c.s.userAgent())
  2239. if c.ctx_ != nil {
  2240. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2241. }
  2242. return c.s.client.Do(req)
  2243. }
  2244. // Do executes the "sql.instances.import" call.
  2245. // Exactly one of *InstancesImportResponse or error will be non-nil. Any
  2246. // non-2xx status code is an error. Response headers are in either
  2247. // *InstancesImportResponse.ServerResponse.Header or (if a response was
  2248. // returned at all) in error.(*googleapi.Error).Header. Use
  2249. // googleapi.IsNotModified to check whether the returned error was
  2250. // because http.StatusNotModified was returned.
  2251. func (c *InstancesImportCall) Do(opts ...googleapi.CallOption) (*InstancesImportResponse, error) {
  2252. gensupport.SetOptions(c.urlParams_, opts...)
  2253. res, err := c.doRequest("json")
  2254. if res != nil && res.StatusCode == http.StatusNotModified {
  2255. if res.Body != nil {
  2256. res.Body.Close()
  2257. }
  2258. return nil, &googleapi.Error{
  2259. Code: res.StatusCode,
  2260. Header: res.Header,
  2261. }
  2262. }
  2263. if err != nil {
  2264. return nil, err
  2265. }
  2266. defer googleapi.CloseBody(res)
  2267. if err := googleapi.CheckResponse(res); err != nil {
  2268. return nil, err
  2269. }
  2270. ret := &InstancesImportResponse{
  2271. ServerResponse: googleapi.ServerResponse{
  2272. Header: res.Header,
  2273. HTTPStatusCode: res.StatusCode,
  2274. },
  2275. }
  2276. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2277. return nil, err
  2278. }
  2279. return ret, nil
  2280. // {
  2281. // "description": "Imports data into a Cloud SQL instance from a MySQL dump file stored in a Google Cloud Storage bucket.",
  2282. // "httpMethod": "POST",
  2283. // "id": "sql.instances.import",
  2284. // "parameterOrder": [
  2285. // "project",
  2286. // "instance"
  2287. // ],
  2288. // "parameters": {
  2289. // "instance": {
  2290. // "description": "Cloud SQL instance ID. This does not include the project ID.",
  2291. // "location": "path",
  2292. // "required": true,
  2293. // "type": "string"
  2294. // },
  2295. // "project": {
  2296. // "description": "Project ID of the project that contains the instance.",
  2297. // "location": "path",
  2298. // "required": true,
  2299. // "type": "string"
  2300. // }
  2301. // },
  2302. // "path": "projects/{project}/instances/{instance}/import",
  2303. // "request": {
  2304. // "$ref": "InstancesImportRequest"
  2305. // },
  2306. // "response": {
  2307. // "$ref": "InstancesImportResponse"
  2308. // },
  2309. // "scopes": [
  2310. // "https://www.googleapis.com/auth/cloud-platform"
  2311. // ]
  2312. // }
  2313. }
  2314. // method id "sql.instances.insert":
  2315. type InstancesInsertCall struct {
  2316. s *Service
  2317. project string
  2318. databaseinstance *DatabaseInstance
  2319. urlParams_ gensupport.URLParams
  2320. ctx_ context.Context
  2321. }
  2322. // Insert: Creates a new Cloud SQL instance.
  2323. func (r *InstancesService) Insert(project string, databaseinstance *DatabaseInstance) *InstancesInsertCall {
  2324. c := &InstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2325. c.project = project
  2326. c.databaseinstance = databaseinstance
  2327. return c
  2328. }
  2329. // Fields allows partial responses to be retrieved. See
  2330. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2331. // for more information.
  2332. func (c *InstancesInsertCall) Fields(s ...googleapi.Field) *InstancesInsertCall {
  2333. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2334. return c
  2335. }
  2336. // Context sets the context to be used in this call's Do method. Any
  2337. // pending HTTP request will be aborted if the provided context is
  2338. // canceled.
  2339. func (c *InstancesInsertCall) Context(ctx context.Context) *InstancesInsertCall {
  2340. c.ctx_ = ctx
  2341. return c
  2342. }
  2343. func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, error) {
  2344. var body io.Reader = nil
  2345. body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance)
  2346. if err != nil {
  2347. return nil, err
  2348. }
  2349. ctype := "application/json"
  2350. c.urlParams_.Set("alt", alt)
  2351. urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances")
  2352. urls += "?" + c.urlParams_.Encode()
  2353. req, _ := http.NewRequest("POST", urls, body)
  2354. googleapi.Expand(req.URL, map[string]string{
  2355. "project": c.project,
  2356. })
  2357. req.Header.Set("Content-Type", ctype)
  2358. req.Header.Set("User-Agent", c.s.userAgent())
  2359. if c.ctx_ != nil {
  2360. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2361. }
  2362. return c.s.client.Do(req)
  2363. }
  2364. // Do executes the "sql.instances.insert" call.
  2365. // Exactly one of *InstancesInsertResponse or error will be non-nil. Any
  2366. // non-2xx status code is an error. Response headers are in either
  2367. // *InstancesInsertResponse.ServerResponse.Header or (if a response was
  2368. // returned at all) in error.(*googleapi.Error).Header. Use
  2369. // googleapi.IsNotModified to check whether the returned error was
  2370. // because http.StatusNotModified was returned.
  2371. func (c *InstancesInsertCall) Do(opts ...googleapi.CallOption) (*InstancesInsertResponse, error) {
  2372. gensupport.SetOptions(c.urlParams_, opts...)
  2373. res, err := c.doRequest("json")
  2374. if res != nil && res.StatusCode == http.StatusNotModified {
  2375. if res.Body != nil {
  2376. res.Body.Close()
  2377. }
  2378. return nil, &googleapi.Error{
  2379. Code: res.StatusCode,
  2380. Header: res.Header,
  2381. }
  2382. }
  2383. if err != nil {
  2384. return nil, err
  2385. }
  2386. defer googleapi.CloseBody(res)
  2387. if err := googleapi.CheckResponse(res); err != nil {
  2388. return nil, err
  2389. }
  2390. ret := &InstancesInsertResponse{
  2391. ServerResponse: googleapi.ServerResponse{
  2392. Header: res.Header,
  2393. HTTPStatusCode: res.StatusCode,
  2394. },
  2395. }
  2396. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2397. return nil, err
  2398. }
  2399. return ret, nil
  2400. // {
  2401. // "description": "Creates a new Cloud SQL instance.",
  2402. // "httpMethod": "POST",
  2403. // "id": "sql.instances.insert",
  2404. // "parameterOrder": [
  2405. // "project"
  2406. // ],
  2407. // "parameters": {
  2408. // "project": {
  2409. // "description": "Project ID of the project to which the newly created Cloud SQL instances should belong.",
  2410. // "location": "path",
  2411. // "required": true,
  2412. // "type": "string"
  2413. // }
  2414. // },
  2415. // "path": "projects/{project}/instances",
  2416. // "request": {
  2417. // "$ref": "DatabaseInstance"
  2418. // },
  2419. // "response": {
  2420. // "$ref": "InstancesInsertResponse"
  2421. // },
  2422. // "scopes": [
  2423. // "https://www.googleapis.com/auth/cloud-platform",
  2424. // "https://www.googleapis.com/auth/sqlservice.admin"
  2425. // ]
  2426. // }
  2427. }
  2428. // method id "sql.instances.list":
  2429. type InstancesListCall struct {
  2430. s *Service
  2431. project string
  2432. urlParams_ gensupport.URLParams
  2433. ifNoneMatch_ string
  2434. ctx_ context.Context
  2435. }
  2436. // List: Lists instances for a given project, in alphabetical order by
  2437. // instance name.
  2438. func (r *InstancesService) List(project string) *InstancesListCall {
  2439. c := &InstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2440. c.project = project
  2441. return c
  2442. }
  2443. // MaxResults sets the optional parameter "maxResults": The maximum
  2444. // number of results to return per response.
  2445. func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall {
  2446. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  2447. return c
  2448. }
  2449. // PageToken sets the optional parameter "pageToken": A
  2450. // previously-returned page token representing part of the larger set of
  2451. // results to view.
  2452. func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall {
  2453. c.urlParams_.Set("pageToken", pageToken)
  2454. return c
  2455. }
  2456. // Fields allows partial responses to be retrieved. See
  2457. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2458. // for more information.
  2459. func (c *InstancesListCall) Fields(s ...googleapi.Field) *InstancesListCall {
  2460. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2461. return c
  2462. }
  2463. // IfNoneMatch sets the optional parameter which makes the operation
  2464. // fail if the object's ETag matches the given value. This is useful for
  2465. // getting updates only after the object has changed since the last
  2466. // request. Use googleapi.IsNotModified to check whether the response
  2467. // error from Do is the result of In-None-Match.
  2468. func (c *InstancesListCall) IfNoneMatch(entityTag string) *InstancesListCall {
  2469. c.ifNoneMatch_ = entityTag
  2470. return c
  2471. }
  2472. // Context sets the context to be used in this call's Do method. Any
  2473. // pending HTTP request will be aborted if the provided context is
  2474. // canceled.
  2475. func (c *InstancesListCall) Context(ctx context.Context) *InstancesListCall {
  2476. c.ctx_ = ctx
  2477. return c
  2478. }
  2479. func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) {
  2480. var body io.Reader = nil
  2481. c.urlParams_.Set("alt", alt)
  2482. urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances")
  2483. urls += "?" + c.urlParams_.Encode()
  2484. req, _ := http.NewRequest("GET", urls, body)
  2485. googleapi.Expand(req.URL, map[string]string{
  2486. "project": c.project,
  2487. })
  2488. req.Header.Set("User-Agent", c.s.userAgent())
  2489. if c.ifNoneMatch_ != "" {
  2490. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  2491. }
  2492. if c.ctx_ != nil {
  2493. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2494. }
  2495. return c.s.client.Do(req)
  2496. }
  2497. // Do executes the "sql.instances.list" call.
  2498. // Exactly one of *InstancesListResponse or error will be non-nil. Any
  2499. // non-2xx status code is an error. Response headers are in either
  2500. // *InstancesListResponse.ServerResponse.Header or (if a response was
  2501. // returned at all) in error.(*googleapi.Error).Header. Use
  2502. // googleapi.IsNotModified to check whether the returned error was
  2503. // because http.StatusNotModified was returned.
  2504. func (c *InstancesListCall) Do(opts ...googleapi.CallOption) (*InstancesListResponse, error) {
  2505. gensupport.SetOptions(c.urlParams_, opts...)
  2506. res, err := c.doRequest("json")
  2507. if res != nil && res.StatusCode == http.StatusNotModified {
  2508. if res.Body != nil {
  2509. res.Body.Close()
  2510. }
  2511. return nil, &googleapi.Error{
  2512. Code: res.StatusCode,
  2513. Header: res.Header,
  2514. }
  2515. }
  2516. if err != nil {
  2517. return nil, err
  2518. }
  2519. defer googleapi.CloseBody(res)
  2520. if err := googleapi.CheckResponse(res); err != nil {
  2521. return nil, err
  2522. }
  2523. ret := &InstancesListResponse{
  2524. ServerResponse: googleapi.ServerResponse{
  2525. Header: res.Header,
  2526. HTTPStatusCode: res.StatusCode,
  2527. },
  2528. }
  2529. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2530. return nil, err
  2531. }
  2532. return ret, nil
  2533. // {
  2534. // "description": "Lists instances for a given project, in alphabetical order by instance name.",
  2535. // "httpMethod": "GET",
  2536. // "id": "sql.instances.list",
  2537. // "parameterOrder": [
  2538. // "project"
  2539. // ],
  2540. // "parameters": {
  2541. // "maxResults": {
  2542. // "description": "The maximum number of results to return per response.",
  2543. // "format": "uint32",
  2544. // "location": "query",
  2545. // "type": "integer"
  2546. // },
  2547. // "pageToken": {
  2548. // "description": "A previously-returned page token representing part of the larger set of results to view.",
  2549. // "location": "query",
  2550. // "type": "string"
  2551. // },
  2552. // "project": {
  2553. // "description": "Project ID of the project for which to list Cloud SQL instances.",
  2554. // "location": "path",
  2555. // "required": true,
  2556. // "type": "string"
  2557. // }
  2558. // },
  2559. // "path": "projects/{project}/instances",
  2560. // "response": {
  2561. // "$ref": "InstancesListResponse"
  2562. // },
  2563. // "scopes": [
  2564. // "https://www.googleapis.com/auth/cloud-platform",
  2565. // "https://www.googleapis.com/auth/sqlservice.admin"
  2566. // ]
  2567. // }
  2568. }
  2569. // Pages invokes f for each page of results.
  2570. // A non-nil error returned from f will halt the iteration.
  2571. // The provided context supersedes any context provided to the Context method.
  2572. func (c *InstancesListCall) Pages(ctx context.Context, f func(*InstancesListResponse) error) error {
  2573. c.ctx_ = ctx
  2574. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2575. for {
  2576. x, err := c.Do()
  2577. if err != nil {
  2578. return err
  2579. }
  2580. if err := f(x); err != nil {
  2581. return err
  2582. }
  2583. if x.NextPageToken == "" {
  2584. return nil
  2585. }
  2586. c.PageToken(x.NextPageToken)
  2587. }
  2588. }
  2589. // method id "sql.instances.patch":
  2590. type InstancesPatchCall struct {
  2591. s *Service
  2592. project string
  2593. instance string
  2594. databaseinstance *DatabaseInstance
  2595. urlParams_ gensupport.URLParams
  2596. ctx_ context.Context
  2597. }
  2598. // Patch: Updates the settings of a Cloud SQL instance. This method
  2599. // supports patch semantics.
  2600. func (r *InstancesService) Patch(project string, instance string, databaseinstance *DatabaseInstance) *InstancesPatchCall {
  2601. c := &InstancesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2602. c.project = project
  2603. c.instance = instance
  2604. c.databaseinstance = databaseinstance
  2605. return c
  2606. }
  2607. // Fields allows partial responses to be retrieved. See
  2608. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2609. // for more information.
  2610. func (c *InstancesPatchCall) Fields(s ...googleapi.Field) *InstancesPatchCall {
  2611. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2612. return c
  2613. }
  2614. // Context sets the context to be used in this call's Do method. Any
  2615. // pending HTTP request will be aborted if the provided context is
  2616. // canceled.
  2617. func (c *InstancesPatchCall) Context(ctx context.Context) *InstancesPatchCall {
  2618. c.ctx_ = ctx
  2619. return c
  2620. }
  2621. func (c *InstancesPatchCall) doRequest(alt string) (*http.Response, error) {
  2622. var body io.Reader = nil
  2623. body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance)
  2624. if err != nil {
  2625. return nil, err
  2626. }
  2627. ctype := "application/json"
  2628. c.urlParams_.Set("alt", alt)
  2629. urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}")
  2630. urls += "?" + c.urlParams_.Encode()
  2631. req, _ := http.NewRequest("PATCH", urls, body)
  2632. googleapi.Expand(req.URL, map[string]string{
  2633. "project": c.project,
  2634. "instance": c.instance,
  2635. })
  2636. req.Header.Set("Content-Type", ctype)
  2637. req.Header.Set("User-Agent", c.s.userAgent())
  2638. if c.ctx_ != nil {
  2639. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2640. }
  2641. return c.s.client.Do(req)
  2642. }
  2643. // Do executes the "sql.instances.patch" call.
  2644. // Exactly one of *InstancesUpdateResponse or error will be non-nil. Any
  2645. // non-2xx status code is an error. Response headers are in either
  2646. // *InstancesUpdateResponse.ServerResponse.Header or (if a response was
  2647. // returned at all) in error.(*googleapi.Error).Header. Use
  2648. // googleapi.IsNotModified to check whether the returned error was
  2649. // because http.StatusNotModified was returned.
  2650. func (c *InstancesPatchCall) Do(opts ...googleapi.CallOption) (*InstancesUpdateResponse, error) {
  2651. gensupport.SetOptions(c.urlParams_, opts...)
  2652. res, err := c.doRequest("json")
  2653. if res != nil && res.StatusCode == http.StatusNotModified {
  2654. if res.Body != nil {
  2655. res.Body.Close()
  2656. }
  2657. return nil, &googleapi.Error{
  2658. Code: res.StatusCode,
  2659. Header: res.Header,
  2660. }
  2661. }
  2662. if err != nil {
  2663. return nil, err
  2664. }
  2665. defer googleapi.CloseBody(res)
  2666. if err := googleapi.CheckResponse(res); err != nil {
  2667. return nil, err
  2668. }
  2669. ret := &InstancesUpdateResponse{
  2670. ServerResponse: googleapi.ServerResponse{
  2671. Header: res.Header,
  2672. HTTPStatusCode: res.StatusCode,
  2673. },
  2674. }
  2675. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2676. return nil, err
  2677. }
  2678. return ret, nil
  2679. // {
  2680. // "description": "Updates the settings of a Cloud SQL instance. This method supports patch semantics.",
  2681. // "httpMethod": "PATCH",
  2682. // "id": "sql.instances.patch",
  2683. // "parameterOrder": [
  2684. // "project",
  2685. // "instance"
  2686. // ],
  2687. // "parameters": {
  2688. // "instance": {
  2689. // "description": "Cloud SQL instance ID. This does not include the project ID.",
  2690. // "location": "path",
  2691. // "required": true,
  2692. // "type": "string"
  2693. // },
  2694. // "project": {
  2695. // "description": "Project ID of the project that contains the instance.",
  2696. // "location": "path",
  2697. // "required": true,
  2698. // "type": "string"
  2699. // }
  2700. // },
  2701. // "path": "projects/{project}/instances/{instance}",
  2702. // "request": {
  2703. // "$ref": "DatabaseInstance"
  2704. // },
  2705. // "response": {
  2706. // "$ref": "InstancesUpdateResponse"
  2707. // },
  2708. // "scopes": [
  2709. // "https://www.googleapis.com/auth/cloud-platform",
  2710. // "https://www.googleapis.com/auth/sqlservice.admin"
  2711. // ]
  2712. // }
  2713. }
  2714. // method id "sql.instances.promoteReplica":
  2715. type InstancesPromoteReplicaCall struct {
  2716. s *Service
  2717. project string
  2718. instance string
  2719. urlParams_ gensupport.URLParams
  2720. ctx_ context.Context
  2721. }
  2722. // PromoteReplica: Promotes the read replica instance to be a
  2723. // stand-alone Cloud SQL instance.
  2724. func (r *InstancesService) PromoteReplica(project string, instance string) *InstancesPromoteReplicaCall {
  2725. c := &InstancesPromoteReplicaCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2726. c.project = project
  2727. c.instance = instance
  2728. return c
  2729. }
  2730. // Fields allows partial responses to be retrieved. See
  2731. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2732. // for more information.
  2733. func (c *InstancesPromoteReplicaCall) Fields(s ...googleapi.Field) *InstancesPromoteReplicaCall {
  2734. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2735. return c
  2736. }
  2737. // Context sets the context to be used in this call's Do method. Any
  2738. // pending HTTP request will be aborted if the provided context is
  2739. // canceled.
  2740. func (c *InstancesPromoteReplicaCall) Context(ctx context.Context) *InstancesPromoteReplicaCall {
  2741. c.ctx_ = ctx
  2742. return c
  2743. }
  2744. func (c *InstancesPromoteReplicaCall) doRequest(alt string) (*http.Response, error) {
  2745. var body io.Reader = nil
  2746. c.urlParams_.Set("alt", alt)
  2747. urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/promoteReplica")
  2748. urls += "?" + c.urlParams_.Encode()
  2749. req, _ := http.NewRequest("POST", urls, body)
  2750. googleapi.Expand(req.URL, map[string]string{
  2751. "project": c.project,
  2752. "instance": c.instance,
  2753. })
  2754. req.Header.Set("User-Agent", c.s.userAgent())
  2755. if c.ctx_ != nil {
  2756. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2757. }
  2758. return c.s.client.Do(req)
  2759. }
  2760. // Do executes the "sql.instances.promoteReplica" call.
  2761. // Exactly one of *InstancesPromoteReplicaResponse or error will be
  2762. // non-nil. Any non-2xx status code is an error. Response headers are in
  2763. // either *InstancesPromoteReplicaResponse.ServerResponse.Header or (if
  2764. // a response was returned at all) in error.(*googleapi.Error).Header.
  2765. // Use googleapi.IsNotModified to check whether the returned error was
  2766. // because http.StatusNotModified was returned.
  2767. func (c *InstancesPromoteReplicaCall) Do(opts ...googleapi.CallOption) (*InstancesPromoteReplicaResponse, error) {
  2768. gensupport.SetOptions(c.urlParams_, opts...)
  2769. res, err := c.doRequest("json")
  2770. if res != nil && res.StatusCode == http.StatusNotModified {
  2771. if res.Body != nil {
  2772. res.Body.Close()
  2773. }
  2774. return nil, &googleapi.Error{
  2775. Code: res.StatusCode,
  2776. Header: res.Header,
  2777. }
  2778. }
  2779. if err != nil {
  2780. return nil, err
  2781. }
  2782. defer googleapi.CloseBody(res)
  2783. if err := googleapi.CheckResponse(res); err != nil {
  2784. return nil, err
  2785. }
  2786. ret := &InstancesPromoteReplicaResponse{
  2787. ServerResponse: googleapi.ServerResponse{
  2788. Header: res.Header,
  2789. HTTPStatusCode: res.StatusCode,
  2790. },
  2791. }
  2792. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2793. return nil, err
  2794. }
  2795. return ret, nil
  2796. // {
  2797. // "description": "Promotes the read replica instance to be a stand-alone Cloud SQL instance.",
  2798. // "httpMethod": "POST",
  2799. // "id": "sql.instances.promoteReplica",
  2800. // "parameterOrder": [
  2801. // "project",
  2802. // "instance"
  2803. // ],
  2804. // "parameters": {
  2805. // "instance": {
  2806. // "description": "Cloud SQL read replica instance name.",
  2807. // "location": "path",
  2808. // "required": true,
  2809. // "type": "string"
  2810. // },
  2811. // "project": {
  2812. // "description": "ID of the project that contains the read replica.",
  2813. // "location": "path",
  2814. // "required": true,
  2815. // "type": "string"
  2816. // }
  2817. // },
  2818. // "path": "projects/{project}/instances/{instance}/promoteReplica",
  2819. // "response": {
  2820. // "$ref": "InstancesPromoteReplicaResponse"
  2821. // },
  2822. // "scopes": [
  2823. // "https://www.googleapis.com/auth/cloud-platform",
  2824. // "https://www.googleapis.com/auth/sqlservice.admin"
  2825. // ]
  2826. // }
  2827. }
  2828. // method id "sql.instances.resetSslConfig":
  2829. type InstancesResetSslConfigCall struct {
  2830. s *Service
  2831. project string
  2832. instance string
  2833. urlParams_ gensupport.URLParams
  2834. ctx_ context.Context
  2835. }
  2836. // ResetSslConfig: Deletes all client certificates and generates a new
  2837. // server SSL certificate for a Cloud SQL instance.
  2838. func (r *InstancesService) ResetSslConfig(project string, instance string) *InstancesResetSslConfigCall {
  2839. c := &InstancesResetSslConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2840. c.project = project
  2841. c.instance = instance
  2842. return c
  2843. }
  2844. // Fields allows partial responses to be retrieved. See
  2845. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2846. // for more information.
  2847. func (c *InstancesResetSslConfigCall) Fields(s ...googleapi.Field) *InstancesResetSslConfigCall {
  2848. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2849. return c
  2850. }
  2851. // Context sets the context to be used in this call's Do method. Any
  2852. // pending HTTP request will be aborted if the provided context is
  2853. // canceled.
  2854. func (c *InstancesResetSslConfigCall) Context(ctx context.Context) *InstancesResetSslConfigCall {
  2855. c.ctx_ = ctx
  2856. return c
  2857. }
  2858. func (c *InstancesResetSslConfigCall) doRequest(alt string) (*http.Response, error) {
  2859. var body io.Reader = nil
  2860. c.urlParams_.Set("alt", alt)
  2861. urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/resetSslConfig")
  2862. urls += "?" + c.urlParams_.Encode()
  2863. req, _ := http.NewRequest("POST", urls, body)
  2864. googleapi.Expand(req.URL, map[string]string{
  2865. "project": c.project,
  2866. "instance": c.instance,
  2867. })
  2868. req.Header.Set("User-Agent", c.s.userAgent())
  2869. if c.ctx_ != nil {
  2870. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2871. }
  2872. return c.s.client.Do(req)
  2873. }
  2874. // Do executes the "sql.instances.resetSslConfig" call.
  2875. // Exactly one of *InstancesResetSslConfigResponse or error will be
  2876. // non-nil. Any non-2xx status code is an error. Response headers are in
  2877. // either *InstancesResetSslConfigResponse.ServerResponse.Header or (if
  2878. // a response was returned at all) in error.(*googleapi.Error).Header.
  2879. // Use googleapi.IsNotModified to check whether the returned error was
  2880. // because http.StatusNotModified was returned.
  2881. func (c *InstancesResetSslConfigCall) Do(opts ...googleapi.CallOption) (*InstancesResetSslConfigResponse, error) {
  2882. gensupport.SetOptions(c.urlParams_, opts...)
  2883. res, err := c.doRequest("json")
  2884. if res != nil && res.StatusCode == http.StatusNotModified {
  2885. if res.Body != nil {
  2886. res.Body.Close()
  2887. }
  2888. return nil, &googleapi.Error{
  2889. Code: res.StatusCode,
  2890. Header: res.Header,
  2891. }
  2892. }
  2893. if err != nil {
  2894. return nil, err
  2895. }
  2896. defer googleapi.CloseBody(res)
  2897. if err := googleapi.CheckResponse(res); err != nil {
  2898. return nil, err
  2899. }
  2900. ret := &InstancesResetSslConfigResponse{
  2901. ServerResponse: googleapi.ServerResponse{
  2902. Header: res.Header,
  2903. HTTPStatusCode: res.StatusCode,
  2904. },
  2905. }
  2906. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2907. return nil, err
  2908. }
  2909. return ret, nil
  2910. // {
  2911. // "description": "Deletes all client certificates and generates a new server SSL certificate for a Cloud SQL instance.",
  2912. // "httpMethod": "POST",
  2913. // "id": "sql.instances.resetSslConfig",
  2914. // "parameterOrder": [
  2915. // "project",
  2916. // "instance"
  2917. // ],
  2918. // "parameters": {
  2919. // "instance": {
  2920. // "description": "Cloud SQL instance ID. This does not include the project ID.",
  2921. // "location": "path",
  2922. // "required": true,
  2923. // "type": "string"
  2924. // },
  2925. // "project": {
  2926. // "description": "Project ID of the project that contains the instance.",
  2927. // "location": "path",
  2928. // "required": true,
  2929. // "type": "string"
  2930. // }
  2931. // },
  2932. // "path": "projects/{project}/instances/{instance}/resetSslConfig",
  2933. // "response": {
  2934. // "$ref": "InstancesResetSslConfigResponse"
  2935. // },
  2936. // "scopes": [
  2937. // "https://www.googleapis.com/auth/cloud-platform",
  2938. // "https://www.googleapis.com/auth/sqlservice.admin"
  2939. // ]
  2940. // }
  2941. }
  2942. // method id "sql.instances.restart":
  2943. type InstancesRestartCall struct {
  2944. s *Service
  2945. project string
  2946. instance string
  2947. urlParams_ gensupport.URLParams
  2948. ctx_ context.Context
  2949. }
  2950. // Restart: Restarts a Cloud SQL instance.
  2951. func (r *InstancesService) Restart(project string, instance string) *InstancesRestartCall {
  2952. c := &InstancesRestartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2953. c.project = project
  2954. c.instance = instance
  2955. return c
  2956. }
  2957. // Fields allows partial responses to be retrieved. See
  2958. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2959. // for more information.
  2960. func (c *InstancesRestartCall) Fields(s ...googleapi.Field) *InstancesRestartCall {
  2961. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2962. return c
  2963. }
  2964. // Context sets the context to be used in this call's Do method. Any
  2965. // pending HTTP request will be aborted if the provided context is
  2966. // canceled.
  2967. func (c *InstancesRestartCall) Context(ctx context.Context) *InstancesRestartCall {
  2968. c.ctx_ = ctx
  2969. return c
  2970. }
  2971. func (c *InstancesRestartCall) doRequest(alt string) (*http.Response, error) {
  2972. var body io.Reader = nil
  2973. c.urlParams_.Set("alt", alt)
  2974. urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/restart")
  2975. urls += "?" + c.urlParams_.Encode()
  2976. req, _ := http.NewRequest("POST", urls, body)
  2977. googleapi.Expand(req.URL, map[string]string{
  2978. "project": c.project,
  2979. "instance": c.instance,
  2980. })
  2981. req.Header.Set("User-Agent", c.s.userAgent())
  2982. if c.ctx_ != nil {
  2983. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2984. }
  2985. return c.s.client.Do(req)
  2986. }
  2987. // Do executes the "sql.instances.restart" call.
  2988. // Exactly one of *InstancesRestartResponse or error will be non-nil.
  2989. // Any non-2xx status code is an error. Response headers are in either
  2990. // *InstancesRestartResponse.ServerResponse.Header or (if a response was
  2991. // returned at all) in error.(*googleapi.Error).Header. Use
  2992. // googleapi.IsNotModified to check whether the returned error was
  2993. // because http.StatusNotModified was returned.
  2994. func (c *InstancesRestartCall) Do(opts ...googleapi.CallOption) (*InstancesRestartResponse, error) {
  2995. gensupport.SetOptions(c.urlParams_, opts...)
  2996. res, err := c.doRequest("json")
  2997. if res != nil && res.StatusCode == http.StatusNotModified {
  2998. if res.Body != nil {
  2999. res.Body.Close()
  3000. }
  3001. return nil, &googleapi.Error{
  3002. Code: res.StatusCode,
  3003. Header: res.Header,
  3004. }
  3005. }
  3006. if err != nil {
  3007. return nil, err
  3008. }
  3009. defer googleapi.CloseBody(res)
  3010. if err := googleapi.CheckResponse(res); err != nil {
  3011. return nil, err
  3012. }
  3013. ret := &InstancesRestartResponse{
  3014. ServerResponse: googleapi.ServerResponse{
  3015. Header: res.Header,
  3016. HTTPStatusCode: res.StatusCode,
  3017. },
  3018. }
  3019. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3020. return nil, err
  3021. }
  3022. return ret, nil
  3023. // {
  3024. // "description": "Restarts a Cloud SQL instance.",
  3025. // "httpMethod": "POST",
  3026. // "id": "sql.instances.restart",
  3027. // "parameterOrder": [
  3028. // "project",
  3029. // "instance"
  3030. // ],
  3031. // "parameters": {
  3032. // "instance": {
  3033. // "description": "Cloud SQL instance ID. This does not include the project ID.",
  3034. // "location": "path",
  3035. // "required": true,
  3036. // "type": "string"
  3037. // },
  3038. // "project": {
  3039. // "description": "Project ID of the project that contains the instance to be restarted.",
  3040. // "location": "path",
  3041. // "required": true,
  3042. // "type": "string"
  3043. // }
  3044. // },
  3045. // "path": "projects/{project}/instances/{instance}/restart",
  3046. // "response": {
  3047. // "$ref": "InstancesRestartResponse"
  3048. // },
  3049. // "scopes": [
  3050. // "https://www.googleapis.com/auth/cloud-platform",
  3051. // "https://www.googleapis.com/auth/sqlservice.admin"
  3052. // ]
  3053. // }
  3054. }
  3055. // method id "sql.instances.restoreBackup":
  3056. type InstancesRestoreBackupCall struct {
  3057. s *Service
  3058. project string
  3059. instance string
  3060. urlParams_ gensupport.URLParams
  3061. ctx_ context.Context
  3062. }
  3063. // RestoreBackup: Restores a backup of a Cloud SQL instance.
  3064. func (r *InstancesService) RestoreBackup(project string, instance string, backupConfigurationid string, dueTime string) *InstancesRestoreBackupCall {
  3065. c := &InstancesRestoreBackupCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3066. c.project = project
  3067. c.instance = instance
  3068. c.urlParams_.Set("backupConfiguration", backupConfigurationid)
  3069. c.urlParams_.Set("dueTime", dueTime)
  3070. return c
  3071. }
  3072. // Fields allows partial responses to be retrieved. See
  3073. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3074. // for more information.
  3075. func (c *InstancesRestoreBackupCall) Fields(s ...googleapi.Field) *InstancesRestoreBackupCall {
  3076. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3077. return c
  3078. }
  3079. // Context sets the context to be used in this call's Do method. Any
  3080. // pending HTTP request will be aborted if the provided context is
  3081. // canceled.
  3082. func (c *InstancesRestoreBackupCall) Context(ctx context.Context) *InstancesRestoreBackupCall {
  3083. c.ctx_ = ctx
  3084. return c
  3085. }
  3086. func (c *InstancesRestoreBackupCall) doRequest(alt string) (*http.Response, error) {
  3087. var body io.Reader = nil
  3088. c.urlParams_.Set("alt", alt)
  3089. urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/restoreBackup")
  3090. urls += "?" + c.urlParams_.Encode()
  3091. req, _ := http.NewRequest("POST", urls, body)
  3092. googleapi.Expand(req.URL, map[string]string{
  3093. "project": c.project,
  3094. "instance": c.instance,
  3095. })
  3096. req.Header.Set("User-Agent", c.s.userAgent())
  3097. if c.ctx_ != nil {
  3098. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3099. }
  3100. return c.s.client.Do(req)
  3101. }
  3102. // Do executes the "sql.instances.restoreBackup" call.
  3103. // Exactly one of *InstancesRestoreBackupResponse or error will be
  3104. // non-nil. Any non-2xx status code is an error. Response headers are in
  3105. // either *InstancesRestoreBackupResponse.ServerResponse.Header or (if a
  3106. // response was returned at all) in error.(*googleapi.Error).Header. Use
  3107. // googleapi.IsNotModified to check whether the returned error was
  3108. // because http.StatusNotModified was returned.
  3109. func (c *InstancesRestoreBackupCall) Do(opts ...googleapi.CallOption) (*InstancesRestoreBackupResponse, error) {
  3110. gensupport.SetOptions(c.urlParams_, opts...)
  3111. res, err := c.doRequest("json")
  3112. if res != nil && res.StatusCode == http.StatusNotModified {
  3113. if res.Body != nil {
  3114. res.Body.Close()
  3115. }
  3116. return nil, &googleapi.Error{
  3117. Code: res.StatusCode,
  3118. Header: res.Header,
  3119. }
  3120. }
  3121. if err != nil {
  3122. return nil, err
  3123. }
  3124. defer googleapi.CloseBody(res)
  3125. if err := googleapi.CheckResponse(res); err != nil {
  3126. return nil, err
  3127. }
  3128. ret := &InstancesRestoreBackupResponse{
  3129. ServerResponse: googleapi.ServerResponse{
  3130. Header: res.Header,
  3131. HTTPStatusCode: res.StatusCode,
  3132. },
  3133. }
  3134. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3135. return nil, err
  3136. }
  3137. return ret, nil
  3138. // {
  3139. // "description": "Restores a backup of a Cloud SQL instance.",
  3140. // "httpMethod": "POST",
  3141. // "id": "sql.instances.restoreBackup",
  3142. // "parameterOrder": [
  3143. // "project",
  3144. // "instance",
  3145. // "backupConfiguration",
  3146. // "dueTime"
  3147. // ],
  3148. // "parameters": {
  3149. // "backupConfiguration": {
  3150. // "description": "The identifier of the backup configuration. This gets generated automatically when a backup configuration is created.",
  3151. // "location": "query",
  3152. // "required": true,
  3153. // "type": "string"
  3154. // },
  3155. // "dueTime": {
  3156. // "description": "The start time of the four-hour backup window. The backup can occur any time in the window. The time is in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.",
  3157. // "location": "query",
  3158. // "required": true,
  3159. // "type": "string"
  3160. // },
  3161. // "instance": {
  3162. // "description": "Cloud SQL instance ID. This does not include the project ID.",
  3163. // "location": "path",
  3164. // "required": true,
  3165. // "type": "string"
  3166. // },
  3167. // "project": {
  3168. // "description": "Project ID of the project that contains the instance.",
  3169. // "location": "path",
  3170. // "required": true,
  3171. // "type": "string"
  3172. // }
  3173. // },
  3174. // "path": "projects/{project}/instances/{instance}/restoreBackup",
  3175. // "response": {
  3176. // "$ref": "InstancesRestoreBackupResponse"
  3177. // },
  3178. // "scopes": [
  3179. // "https://www.googleapis.com/auth/cloud-platform",
  3180. // "https://www.googleapis.com/auth/sqlservice.admin"
  3181. // ]
  3182. // }
  3183. }
  3184. // method id "sql.instances.setRootPassword":
  3185. type InstancesSetRootPasswordCall struct {
  3186. s *Service
  3187. project string
  3188. instance string
  3189. instancesetrootpasswordrequest *InstanceSetRootPasswordRequest
  3190. urlParams_ gensupport.URLParams
  3191. ctx_ context.Context
  3192. }
  3193. // SetRootPassword: Sets the password for the root user of the specified
  3194. // Cloud SQL instance.
  3195. func (r *InstancesService) SetRootPassword(project string, instance string, instancesetrootpasswordrequest *InstanceSetRootPasswordRequest) *InstancesSetRootPasswordCall {
  3196. c := &InstancesSetRootPasswordCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3197. c.project = project
  3198. c.instance = instance
  3199. c.instancesetrootpasswordrequest = instancesetrootpasswordrequest
  3200. return c
  3201. }
  3202. // Fields allows partial responses to be retrieved. See
  3203. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3204. // for more information.
  3205. func (c *InstancesSetRootPasswordCall) Fields(s ...googleapi.Field) *InstancesSetRootPasswordCall {
  3206. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3207. return c
  3208. }
  3209. // Context sets the context to be used in this call's Do method. Any
  3210. // pending HTTP request will be aborted if the provided context is
  3211. // canceled.
  3212. func (c *InstancesSetRootPasswordCall) Context(ctx context.Context) *InstancesSetRootPasswordCall {
  3213. c.ctx_ = ctx
  3214. return c
  3215. }
  3216. func (c *InstancesSetRootPasswordCall) doRequest(alt string) (*http.Response, error) {
  3217. var body io.Reader = nil
  3218. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesetrootpasswordrequest)
  3219. if err != nil {
  3220. return nil, err
  3221. }
  3222. ctype := "application/json"
  3223. c.urlParams_.Set("alt", alt)
  3224. urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/setRootPassword")
  3225. urls += "?" + c.urlParams_.Encode()
  3226. req, _ := http.NewRequest("POST", urls, body)
  3227. googleapi.Expand(req.URL, map[string]string{
  3228. "project": c.project,
  3229. "instance": c.instance,
  3230. })
  3231. req.Header.Set("Content-Type", ctype)
  3232. req.Header.Set("User-Agent", c.s.userAgent())
  3233. if c.ctx_ != nil {
  3234. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3235. }
  3236. return c.s.client.Do(req)
  3237. }
  3238. // Do executes the "sql.instances.setRootPassword" call.
  3239. // Exactly one of *InstancesSetRootPasswordResponse or error will be
  3240. // non-nil. Any non-2xx status code is an error. Response headers are in
  3241. // either *InstancesSetRootPasswordResponse.ServerResponse.Header or (if
  3242. // a response was returned at all) in error.(*googleapi.Error).Header.
  3243. // Use googleapi.IsNotModified to check whether the returned error was
  3244. // because http.StatusNotModified was returned.
  3245. func (c *InstancesSetRootPasswordCall) Do(opts ...googleapi.CallOption) (*InstancesSetRootPasswordResponse, error) {
  3246. gensupport.SetOptions(c.urlParams_, opts...)
  3247. res, err := c.doRequest("json")
  3248. if res != nil && res.StatusCode == http.StatusNotModified {
  3249. if res.Body != nil {
  3250. res.Body.Close()
  3251. }
  3252. return nil, &googleapi.Error{
  3253. Code: res.StatusCode,
  3254. Header: res.Header,
  3255. }
  3256. }
  3257. if err != nil {
  3258. return nil, err
  3259. }
  3260. defer googleapi.CloseBody(res)
  3261. if err := googleapi.CheckResponse(res); err != nil {
  3262. return nil, err
  3263. }
  3264. ret := &InstancesSetRootPasswordResponse{
  3265. ServerResponse: googleapi.ServerResponse{
  3266. Header: res.Header,
  3267. HTTPStatusCode: res.StatusCode,
  3268. },
  3269. }
  3270. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3271. return nil, err
  3272. }
  3273. return ret, nil
  3274. // {
  3275. // "description": "Sets the password for the root user of the specified Cloud SQL instance.",
  3276. // "httpMethod": "POST",
  3277. // "id": "sql.instances.setRootPassword",
  3278. // "parameterOrder": [
  3279. // "project",
  3280. // "instance"
  3281. // ],
  3282. // "parameters": {
  3283. // "instance": {
  3284. // "description": "Cloud SQL instance ID. This does not include the project ID.",
  3285. // "location": "path",
  3286. // "required": true,
  3287. // "type": "string"
  3288. // },
  3289. // "project": {
  3290. // "description": "Project ID of the project that contains the instance.",
  3291. // "location": "path",
  3292. // "required": true,
  3293. // "type": "string"
  3294. // }
  3295. // },
  3296. // "path": "projects/{project}/instances/{instance}/setRootPassword",
  3297. // "request": {
  3298. // "$ref": "InstanceSetRootPasswordRequest"
  3299. // },
  3300. // "response": {
  3301. // "$ref": "InstancesSetRootPasswordResponse"
  3302. // },
  3303. // "scopes": [
  3304. // "https://www.googleapis.com/auth/cloud-platform",
  3305. // "https://www.googleapis.com/auth/sqlservice.admin"
  3306. // ]
  3307. // }
  3308. }
  3309. // method id "sql.instances.update":
  3310. type InstancesUpdateCall struct {
  3311. s *Service
  3312. project string
  3313. instance string
  3314. databaseinstance *DatabaseInstance
  3315. urlParams_ gensupport.URLParams
  3316. ctx_ context.Context
  3317. }
  3318. // Update: Updates the settings of a Cloud SQL instance.
  3319. func (r *InstancesService) Update(project string, instance string, databaseinstance *DatabaseInstance) *InstancesUpdateCall {
  3320. c := &InstancesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3321. c.project = project
  3322. c.instance = instance
  3323. c.databaseinstance = databaseinstance
  3324. return c
  3325. }
  3326. // Fields allows partial responses to be retrieved. See
  3327. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3328. // for more information.
  3329. func (c *InstancesUpdateCall) Fields(s ...googleapi.Field) *InstancesUpdateCall {
  3330. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3331. return c
  3332. }
  3333. // Context sets the context to be used in this call's Do method. Any
  3334. // pending HTTP request will be aborted if the provided context is
  3335. // canceled.
  3336. func (c *InstancesUpdateCall) Context(ctx context.Context) *InstancesUpdateCall {
  3337. c.ctx_ = ctx
  3338. return c
  3339. }
  3340. func (c *InstancesUpdateCall) doRequest(alt string) (*http.Response, error) {
  3341. var body io.Reader = nil
  3342. body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance)
  3343. if err != nil {
  3344. return nil, err
  3345. }
  3346. ctype := "application/json"
  3347. c.urlParams_.Set("alt", alt)
  3348. urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}")
  3349. urls += "?" + c.urlParams_.Encode()
  3350. req, _ := http.NewRequest("PUT", urls, body)
  3351. googleapi.Expand(req.URL, map[string]string{
  3352. "project": c.project,
  3353. "instance": c.instance,
  3354. })
  3355. req.Header.Set("Content-Type", ctype)
  3356. req.Header.Set("User-Agent", c.s.userAgent())
  3357. if c.ctx_ != nil {
  3358. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3359. }
  3360. return c.s.client.Do(req)
  3361. }
  3362. // Do executes the "sql.instances.update" call.
  3363. // Exactly one of *InstancesUpdateResponse or error will be non-nil. Any
  3364. // non-2xx status code is an error. Response headers are in either
  3365. // *InstancesUpdateResponse.ServerResponse.Header or (if a response was
  3366. // returned at all) in error.(*googleapi.Error).Header. Use
  3367. // googleapi.IsNotModified to check whether the returned error was
  3368. // because http.StatusNotModified was returned.
  3369. func (c *InstancesUpdateCall) Do(opts ...googleapi.CallOption) (*InstancesUpdateResponse, error) {
  3370. gensupport.SetOptions(c.urlParams_, opts...)
  3371. res, err := c.doRequest("json")
  3372. if res != nil && res.StatusCode == http.StatusNotModified {
  3373. if res.Body != nil {
  3374. res.Body.Close()
  3375. }
  3376. return nil, &googleapi.Error{
  3377. Code: res.StatusCode,
  3378. Header: res.Header,
  3379. }
  3380. }
  3381. if err != nil {
  3382. return nil, err
  3383. }
  3384. defer googleapi.CloseBody(res)
  3385. if err := googleapi.CheckResponse(res); err != nil {
  3386. return nil, err
  3387. }
  3388. ret := &InstancesUpdateResponse{
  3389. ServerResponse: googleapi.ServerResponse{
  3390. Header: res.Header,
  3391. HTTPStatusCode: res.StatusCode,
  3392. },
  3393. }
  3394. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3395. return nil, err
  3396. }
  3397. return ret, nil
  3398. // {
  3399. // "description": "Updates the settings of a Cloud SQL instance.",
  3400. // "etagRequired": true,
  3401. // "httpMethod": "PUT",
  3402. // "id": "sql.instances.update",
  3403. // "parameterOrder": [
  3404. // "project",
  3405. // "instance"
  3406. // ],
  3407. // "parameters": {
  3408. // "instance": {
  3409. // "description": "Cloud SQL instance ID. This does not include the project ID.",
  3410. // "location": "path",
  3411. // "required": true,
  3412. // "type": "string"
  3413. // },
  3414. // "project": {
  3415. // "description": "Project ID of the project that contains the instance.",
  3416. // "location": "path",
  3417. // "required": true,
  3418. // "type": "string"
  3419. // }
  3420. // },
  3421. // "path": "projects/{project}/instances/{instance}",
  3422. // "request": {
  3423. // "$ref": "DatabaseInstance"
  3424. // },
  3425. // "response": {
  3426. // "$ref": "InstancesUpdateResponse"
  3427. // },
  3428. // "scopes": [
  3429. // "https://www.googleapis.com/auth/cloud-platform",
  3430. // "https://www.googleapis.com/auth/sqlservice.admin"
  3431. // ]
  3432. // }
  3433. }
  3434. // method id "sql.operations.get":
  3435. type OperationsGetCall struct {
  3436. s *Service
  3437. project string
  3438. instance string
  3439. operation string
  3440. urlParams_ gensupport.URLParams
  3441. ifNoneMatch_ string
  3442. ctx_ context.Context
  3443. }
  3444. // Get: Retrieves information about a specific operation that was
  3445. // performed on a Cloud SQL instance.
  3446. func (r *OperationsService) Get(project string, instance string, operation string) *OperationsGetCall {
  3447. c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3448. c.project = project
  3449. c.instance = instance
  3450. c.operation = operation
  3451. return c
  3452. }
  3453. // Fields allows partial responses to be retrieved. See
  3454. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3455. // for more information.
  3456. func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall {
  3457. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3458. return c
  3459. }
  3460. // IfNoneMatch sets the optional parameter which makes the operation
  3461. // fail if the object's ETag matches the given value. This is useful for
  3462. // getting updates only after the object has changed since the last
  3463. // request. Use googleapi.IsNotModified to check whether the response
  3464. // error from Do is the result of In-None-Match.
  3465. func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall {
  3466. c.ifNoneMatch_ = entityTag
  3467. return c
  3468. }
  3469. // Context sets the context to be used in this call's Do method. Any
  3470. // pending HTTP request will be aborted if the provided context is
  3471. // canceled.
  3472. func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall {
  3473. c.ctx_ = ctx
  3474. return c
  3475. }
  3476. func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) {
  3477. var body io.Reader = nil
  3478. c.urlParams_.Set("alt", alt)
  3479. urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/operations/{operation}")
  3480. urls += "?" + c.urlParams_.Encode()
  3481. req, _ := http.NewRequest("GET", urls, body)
  3482. googleapi.Expand(req.URL, map[string]string{
  3483. "project": c.project,
  3484. "instance": c.instance,
  3485. "operation": c.operation,
  3486. })
  3487. req.Header.Set("User-Agent", c.s.userAgent())
  3488. if c.ifNoneMatch_ != "" {
  3489. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  3490. }
  3491. if c.ctx_ != nil {
  3492. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3493. }
  3494. return c.s.client.Do(req)
  3495. }
  3496. // Do executes the "sql.operations.get" call.
  3497. // Exactly one of *InstanceOperation or error will be non-nil. Any
  3498. // non-2xx status code is an error. Response headers are in either
  3499. // *InstanceOperation.ServerResponse.Header or (if a response was
  3500. // returned at all) in error.(*googleapi.Error).Header. Use
  3501. // googleapi.IsNotModified to check whether the returned error was
  3502. // because http.StatusNotModified was returned.
  3503. func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*InstanceOperation, error) {
  3504. gensupport.SetOptions(c.urlParams_, opts...)
  3505. res, err := c.doRequest("json")
  3506. if res != nil && res.StatusCode == http.StatusNotModified {
  3507. if res.Body != nil {
  3508. res.Body.Close()
  3509. }
  3510. return nil, &googleapi.Error{
  3511. Code: res.StatusCode,
  3512. Header: res.Header,
  3513. }
  3514. }
  3515. if err != nil {
  3516. return nil, err
  3517. }
  3518. defer googleapi.CloseBody(res)
  3519. if err := googleapi.CheckResponse(res); err != nil {
  3520. return nil, err
  3521. }
  3522. ret := &InstanceOperation{
  3523. ServerResponse: googleapi.ServerResponse{
  3524. Header: res.Header,
  3525. HTTPStatusCode: res.StatusCode,
  3526. },
  3527. }
  3528. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3529. return nil, err
  3530. }
  3531. return ret, nil
  3532. // {
  3533. // "description": "Retrieves information about a specific operation that was performed on a Cloud SQL instance.",
  3534. // "httpMethod": "GET",
  3535. // "id": "sql.operations.get",
  3536. // "parameterOrder": [
  3537. // "project",
  3538. // "instance",
  3539. // "operation"
  3540. // ],
  3541. // "parameters": {
  3542. // "instance": {
  3543. // "description": "Cloud SQL instance ID. This does not include the project ID.",
  3544. // "location": "path",
  3545. // "required": true,
  3546. // "type": "string"
  3547. // },
  3548. // "operation": {
  3549. // "description": "Instance operation ID.",
  3550. // "location": "path",
  3551. // "required": true,
  3552. // "type": "string"
  3553. // },
  3554. // "project": {
  3555. // "description": "Project ID of the project that contains the instance.",
  3556. // "location": "path",
  3557. // "required": true,
  3558. // "type": "string"
  3559. // }
  3560. // },
  3561. // "path": "projects/{project}/instances/{instance}/operations/{operation}",
  3562. // "response": {
  3563. // "$ref": "InstanceOperation"
  3564. // },
  3565. // "scopes": [
  3566. // "https://www.googleapis.com/auth/cloud-platform",
  3567. // "https://www.googleapis.com/auth/sqlservice.admin"
  3568. // ]
  3569. // }
  3570. }
  3571. // method id "sql.operations.list":
  3572. type OperationsListCall struct {
  3573. s *Service
  3574. project string
  3575. instance string
  3576. urlParams_ gensupport.URLParams
  3577. ifNoneMatch_ string
  3578. ctx_ context.Context
  3579. }
  3580. // List: Lists all operations that have been performed on a Cloud SQL
  3581. // instance.
  3582. func (r *OperationsService) List(project string, instance string) *OperationsListCall {
  3583. c := &OperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3584. c.project = project
  3585. c.instance = instance
  3586. return c
  3587. }
  3588. // MaxResults sets the optional parameter "maxResults": Maximum number
  3589. // of operations per response.
  3590. func (c *OperationsListCall) MaxResults(maxResults int64) *OperationsListCall {
  3591. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  3592. return c
  3593. }
  3594. // PageToken sets the optional parameter "pageToken": A
  3595. // previously-returned page token representing part of the larger set of
  3596. // results to view.
  3597. func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall {
  3598. c.urlParams_.Set("pageToken", pageToken)
  3599. return c
  3600. }
  3601. // Fields allows partial responses to be retrieved. See
  3602. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3603. // for more information.
  3604. func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall {
  3605. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3606. return c
  3607. }
  3608. // IfNoneMatch sets the optional parameter which makes the operation
  3609. // fail if the object's ETag matches the given value. This is useful for
  3610. // getting updates only after the object has changed since the last
  3611. // request. Use googleapi.IsNotModified to check whether the response
  3612. // error from Do is the result of In-None-Match.
  3613. func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall {
  3614. c.ifNoneMatch_ = entityTag
  3615. return c
  3616. }
  3617. // Context sets the context to be used in this call's Do method. Any
  3618. // pending HTTP request will be aborted if the provided context is
  3619. // canceled.
  3620. func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall {
  3621. c.ctx_ = ctx
  3622. return c
  3623. }
  3624. func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) {
  3625. var body io.Reader = nil
  3626. c.urlParams_.Set("alt", alt)
  3627. urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/operations")
  3628. urls += "?" + c.urlParams_.Encode()
  3629. req, _ := http.NewRequest("GET", urls, body)
  3630. googleapi.Expand(req.URL, map[string]string{
  3631. "project": c.project,
  3632. "instance": c.instance,
  3633. })
  3634. req.Header.Set("User-Agent", c.s.userAgent())
  3635. if c.ifNoneMatch_ != "" {
  3636. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  3637. }
  3638. if c.ctx_ != nil {
  3639. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3640. }
  3641. return c.s.client.Do(req)
  3642. }
  3643. // Do executes the "sql.operations.list" call.
  3644. // Exactly one of *OperationsListResponse or error will be non-nil. Any
  3645. // non-2xx status code is an error. Response headers are in either
  3646. // *OperationsListResponse.ServerResponse.Header or (if a response was
  3647. // returned at all) in error.(*googleapi.Error).Header. Use
  3648. // googleapi.IsNotModified to check whether the returned error was
  3649. // because http.StatusNotModified was returned.
  3650. func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*OperationsListResponse, error) {
  3651. gensupport.SetOptions(c.urlParams_, opts...)
  3652. res, err := c.doRequest("json")
  3653. if res != nil && res.StatusCode == http.StatusNotModified {
  3654. if res.Body != nil {
  3655. res.Body.Close()
  3656. }
  3657. return nil, &googleapi.Error{
  3658. Code: res.StatusCode,
  3659. Header: res.Header,
  3660. }
  3661. }
  3662. if err != nil {
  3663. return nil, err
  3664. }
  3665. defer googleapi.CloseBody(res)
  3666. if err := googleapi.CheckResponse(res); err != nil {
  3667. return nil, err
  3668. }
  3669. ret := &OperationsListResponse{
  3670. ServerResponse: googleapi.ServerResponse{
  3671. Header: res.Header,
  3672. HTTPStatusCode: res.StatusCode,
  3673. },
  3674. }
  3675. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3676. return nil, err
  3677. }
  3678. return ret, nil
  3679. // {
  3680. // "description": "Lists all operations that have been performed on a Cloud SQL instance.",
  3681. // "httpMethod": "GET",
  3682. // "id": "sql.operations.list",
  3683. // "parameterOrder": [
  3684. // "project",
  3685. // "instance"
  3686. // ],
  3687. // "parameters": {
  3688. // "instance": {
  3689. // "description": "Cloud SQL instance ID. This does not include the project ID.",
  3690. // "location": "path",
  3691. // "required": true,
  3692. // "type": "string"
  3693. // },
  3694. // "maxResults": {
  3695. // "description": "Maximum number of operations per response.",
  3696. // "format": "uint32",
  3697. // "location": "query",
  3698. // "type": "integer"
  3699. // },
  3700. // "pageToken": {
  3701. // "description": "A previously-returned page token representing part of the larger set of results to view.",
  3702. // "location": "query",
  3703. // "type": "string"
  3704. // },
  3705. // "project": {
  3706. // "description": "Project ID of the project that contains the instance.",
  3707. // "location": "path",
  3708. // "required": true,
  3709. // "type": "string"
  3710. // }
  3711. // },
  3712. // "path": "projects/{project}/instances/{instance}/operations",
  3713. // "response": {
  3714. // "$ref": "OperationsListResponse"
  3715. // },
  3716. // "scopes": [
  3717. // "https://www.googleapis.com/auth/cloud-platform",
  3718. // "https://www.googleapis.com/auth/sqlservice.admin"
  3719. // ]
  3720. // }
  3721. }
  3722. // Pages invokes f for each page of results.
  3723. // A non-nil error returned from f will halt the iteration.
  3724. // The provided context supersedes any context provided to the Context method.
  3725. func (c *OperationsListCall) Pages(ctx context.Context, f func(*OperationsListResponse) error) error {
  3726. c.ctx_ = ctx
  3727. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3728. for {
  3729. x, err := c.Do()
  3730. if err != nil {
  3731. return err
  3732. }
  3733. if err := f(x); err != nil {
  3734. return err
  3735. }
  3736. if x.NextPageToken == "" {
  3737. return nil
  3738. }
  3739. c.PageToken(x.NextPageToken)
  3740. }
  3741. }
  3742. // method id "sql.sslCerts.delete":
  3743. type SslCertsDeleteCall struct {
  3744. s *Service
  3745. project string
  3746. instance string
  3747. sha1Fingerprint string
  3748. urlParams_ gensupport.URLParams
  3749. ctx_ context.Context
  3750. }
  3751. // Delete: Deletes an SSL certificate from a Cloud SQL instance.
  3752. func (r *SslCertsService) Delete(project string, instance string, sha1Fingerprint string) *SslCertsDeleteCall {
  3753. c := &SslCertsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3754. c.project = project
  3755. c.instance = instance
  3756. c.sha1Fingerprint = sha1Fingerprint
  3757. return c
  3758. }
  3759. // Fields allows partial responses to be retrieved. See
  3760. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3761. // for more information.
  3762. func (c *SslCertsDeleteCall) Fields(s ...googleapi.Field) *SslCertsDeleteCall {
  3763. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3764. return c
  3765. }
  3766. // Context sets the context to be used in this call's Do method. Any
  3767. // pending HTTP request will be aborted if the provided context is
  3768. // canceled.
  3769. func (c *SslCertsDeleteCall) Context(ctx context.Context) *SslCertsDeleteCall {
  3770. c.ctx_ = ctx
  3771. return c
  3772. }
  3773. func (c *SslCertsDeleteCall) doRequest(alt string) (*http.Response, error) {
  3774. var body io.Reader = nil
  3775. c.urlParams_.Set("alt", alt)
  3776. urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}")
  3777. urls += "?" + c.urlParams_.Encode()
  3778. req, _ := http.NewRequest("DELETE", urls, body)
  3779. googleapi.Expand(req.URL, map[string]string{
  3780. "project": c.project,
  3781. "instance": c.instance,
  3782. "sha1Fingerprint": c.sha1Fingerprint,
  3783. })
  3784. req.Header.Set("User-Agent", c.s.userAgent())
  3785. if c.ctx_ != nil {
  3786. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3787. }
  3788. return c.s.client.Do(req)
  3789. }
  3790. // Do executes the "sql.sslCerts.delete" call.
  3791. // Exactly one of *SslCertsDeleteResponse or error will be non-nil. Any
  3792. // non-2xx status code is an error. Response headers are in either
  3793. // *SslCertsDeleteResponse.ServerResponse.Header or (if a response was
  3794. // returned at all) in error.(*googleapi.Error).Header. Use
  3795. // googleapi.IsNotModified to check whether the returned error was
  3796. // because http.StatusNotModified was returned.
  3797. func (c *SslCertsDeleteCall) Do(opts ...googleapi.CallOption) (*SslCertsDeleteResponse, error) {
  3798. gensupport.SetOptions(c.urlParams_, opts...)
  3799. res, err := c.doRequest("json")
  3800. if res != nil && res.StatusCode == http.StatusNotModified {
  3801. if res.Body != nil {
  3802. res.Body.Close()
  3803. }
  3804. return nil, &googleapi.Error{
  3805. Code: res.StatusCode,
  3806. Header: res.Header,
  3807. }
  3808. }
  3809. if err != nil {
  3810. return nil, err
  3811. }
  3812. defer googleapi.CloseBody(res)
  3813. if err := googleapi.CheckResponse(res); err != nil {
  3814. return nil, err
  3815. }
  3816. ret := &SslCertsDeleteResponse{
  3817. ServerResponse: googleapi.ServerResponse{
  3818. Header: res.Header,
  3819. HTTPStatusCode: res.StatusCode,
  3820. },
  3821. }
  3822. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3823. return nil, err
  3824. }
  3825. return ret, nil
  3826. // {
  3827. // "description": "Deletes an SSL certificate from a Cloud SQL instance.",
  3828. // "httpMethod": "DELETE",
  3829. // "id": "sql.sslCerts.delete",
  3830. // "parameterOrder": [
  3831. // "project",
  3832. // "instance",
  3833. // "sha1Fingerprint"
  3834. // ],
  3835. // "parameters": {
  3836. // "instance": {
  3837. // "description": "Cloud SQL instance ID. This does not include the project ID.",
  3838. // "location": "path",
  3839. // "required": true,
  3840. // "type": "string"
  3841. // },
  3842. // "project": {
  3843. // "description": "Project ID of the project that contains the instance to be deleted.",
  3844. // "location": "path",
  3845. // "required": true,
  3846. // "type": "string"
  3847. // },
  3848. // "sha1Fingerprint": {
  3849. // "description": "Sha1 FingerPrint.",
  3850. // "location": "path",
  3851. // "required": true,
  3852. // "type": "string"
  3853. // }
  3854. // },
  3855. // "path": "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}",
  3856. // "response": {
  3857. // "$ref": "SslCertsDeleteResponse"
  3858. // },
  3859. // "scopes": [
  3860. // "https://www.googleapis.com/auth/cloud-platform",
  3861. // "https://www.googleapis.com/auth/sqlservice.admin"
  3862. // ]
  3863. // }
  3864. }
  3865. // method id "sql.sslCerts.get":
  3866. type SslCertsGetCall struct {
  3867. s *Service
  3868. project string
  3869. instance string
  3870. sha1Fingerprint string
  3871. urlParams_ gensupport.URLParams
  3872. ifNoneMatch_ string
  3873. ctx_ context.Context
  3874. }
  3875. // Get: Retrieves an SSL certificate as specified by its SHA-1
  3876. // fingerprint.
  3877. func (r *SslCertsService) Get(project string, instance string, sha1Fingerprint string) *SslCertsGetCall {
  3878. c := &SslCertsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3879. c.project = project
  3880. c.instance = instance
  3881. c.sha1Fingerprint = sha1Fingerprint
  3882. return c
  3883. }
  3884. // Fields allows partial responses to be retrieved. See
  3885. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3886. // for more information.
  3887. func (c *SslCertsGetCall) Fields(s ...googleapi.Field) *SslCertsGetCall {
  3888. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3889. return c
  3890. }
  3891. // IfNoneMatch sets the optional parameter which makes the operation
  3892. // fail if the object's ETag matches the given value. This is useful for
  3893. // getting updates only after the object has changed since the last
  3894. // request. Use googleapi.IsNotModified to check whether the response
  3895. // error from Do is the result of In-None-Match.
  3896. func (c *SslCertsGetCall) IfNoneMatch(entityTag string) *SslCertsGetCall {
  3897. c.ifNoneMatch_ = entityTag
  3898. return c
  3899. }
  3900. // Context sets the context to be used in this call's Do method. Any
  3901. // pending HTTP request will be aborted if the provided context is
  3902. // canceled.
  3903. func (c *SslCertsGetCall) Context(ctx context.Context) *SslCertsGetCall {
  3904. c.ctx_ = ctx
  3905. return c
  3906. }
  3907. func (c *SslCertsGetCall) doRequest(alt string) (*http.Response, error) {
  3908. var body io.Reader = nil
  3909. c.urlParams_.Set("alt", alt)
  3910. urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}")
  3911. urls += "?" + c.urlParams_.Encode()
  3912. req, _ := http.NewRequest("GET", urls, body)
  3913. googleapi.Expand(req.URL, map[string]string{
  3914. "project": c.project,
  3915. "instance": c.instance,
  3916. "sha1Fingerprint": c.sha1Fingerprint,
  3917. })
  3918. req.Header.Set("User-Agent", c.s.userAgent())
  3919. if c.ifNoneMatch_ != "" {
  3920. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  3921. }
  3922. if c.ctx_ != nil {
  3923. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3924. }
  3925. return c.s.client.Do(req)
  3926. }
  3927. // Do executes the "sql.sslCerts.get" call.
  3928. // Exactly one of *SslCert or error will be non-nil. Any non-2xx status
  3929. // code is an error. Response headers are in either
  3930. // *SslCert.ServerResponse.Header or (if a response was returned at all)
  3931. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3932. // check whether the returned error was because http.StatusNotModified
  3933. // was returned.
  3934. func (c *SslCertsGetCall) Do(opts ...googleapi.CallOption) (*SslCert, error) {
  3935. gensupport.SetOptions(c.urlParams_, opts...)
  3936. res, err := c.doRequest("json")
  3937. if res != nil && res.StatusCode == http.StatusNotModified {
  3938. if res.Body != nil {
  3939. res.Body.Close()
  3940. }
  3941. return nil, &googleapi.Error{
  3942. Code: res.StatusCode,
  3943. Header: res.Header,
  3944. }
  3945. }
  3946. if err != nil {
  3947. return nil, err
  3948. }
  3949. defer googleapi.CloseBody(res)
  3950. if err := googleapi.CheckResponse(res); err != nil {
  3951. return nil, err
  3952. }
  3953. ret := &SslCert{
  3954. ServerResponse: googleapi.ServerResponse{
  3955. Header: res.Header,
  3956. HTTPStatusCode: res.StatusCode,
  3957. },
  3958. }
  3959. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3960. return nil, err
  3961. }
  3962. return ret, nil
  3963. // {
  3964. // "description": "Retrieves an SSL certificate as specified by its SHA-1 fingerprint.",
  3965. // "httpMethod": "GET",
  3966. // "id": "sql.sslCerts.get",
  3967. // "parameterOrder": [
  3968. // "project",
  3969. // "instance",
  3970. // "sha1Fingerprint"
  3971. // ],
  3972. // "parameters": {
  3973. // "instance": {
  3974. // "description": "Cloud SQL instance ID. This does not include the project ID.",
  3975. // "location": "path",
  3976. // "required": true,
  3977. // "type": "string"
  3978. // },
  3979. // "project": {
  3980. // "description": "Project ID of the project that contains the instance.",
  3981. // "location": "path",
  3982. // "required": true,
  3983. // "type": "string"
  3984. // },
  3985. // "sha1Fingerprint": {
  3986. // "description": "Sha1 FingerPrint.",
  3987. // "location": "path",
  3988. // "required": true,
  3989. // "type": "string"
  3990. // }
  3991. // },
  3992. // "path": "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}",
  3993. // "response": {
  3994. // "$ref": "SslCert"
  3995. // },
  3996. // "scopes": [
  3997. // "https://www.googleapis.com/auth/cloud-platform",
  3998. // "https://www.googleapis.com/auth/sqlservice.admin"
  3999. // ]
  4000. // }
  4001. }
  4002. // method id "sql.sslCerts.insert":
  4003. type SslCertsInsertCall struct {
  4004. s *Service
  4005. project string
  4006. instance string
  4007. sslcertsinsertrequest *SslCertsInsertRequest
  4008. urlParams_ gensupport.URLParams
  4009. ctx_ context.Context
  4010. }
  4011. // Insert: Creates an SSL certificate and returns the certificate, the
  4012. // associated private key, and the server certificate authority.
  4013. func (r *SslCertsService) Insert(project string, instance string, sslcertsinsertrequest *SslCertsInsertRequest) *SslCertsInsertCall {
  4014. c := &SslCertsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4015. c.project = project
  4016. c.instance = instance
  4017. c.sslcertsinsertrequest = sslcertsinsertrequest
  4018. return c
  4019. }
  4020. // Fields allows partial responses to be retrieved. See
  4021. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4022. // for more information.
  4023. func (c *SslCertsInsertCall) Fields(s ...googleapi.Field) *SslCertsInsertCall {
  4024. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4025. return c
  4026. }
  4027. // Context sets the context to be used in this call's Do method. Any
  4028. // pending HTTP request will be aborted if the provided context is
  4029. // canceled.
  4030. func (c *SslCertsInsertCall) Context(ctx context.Context) *SslCertsInsertCall {
  4031. c.ctx_ = ctx
  4032. return c
  4033. }
  4034. func (c *SslCertsInsertCall) doRequest(alt string) (*http.Response, error) {
  4035. var body io.Reader = nil
  4036. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertsinsertrequest)
  4037. if err != nil {
  4038. return nil, err
  4039. }
  4040. ctype := "application/json"
  4041. c.urlParams_.Set("alt", alt)
  4042. urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/sslCerts")
  4043. urls += "?" + c.urlParams_.Encode()
  4044. req, _ := http.NewRequest("POST", urls, body)
  4045. googleapi.Expand(req.URL, map[string]string{
  4046. "project": c.project,
  4047. "instance": c.instance,
  4048. })
  4049. req.Header.Set("Content-Type", ctype)
  4050. req.Header.Set("User-Agent", c.s.userAgent())
  4051. if c.ctx_ != nil {
  4052. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4053. }
  4054. return c.s.client.Do(req)
  4055. }
  4056. // Do executes the "sql.sslCerts.insert" call.
  4057. // Exactly one of *SslCertsInsertResponse or error will be non-nil. Any
  4058. // non-2xx status code is an error. Response headers are in either
  4059. // *SslCertsInsertResponse.ServerResponse.Header or (if a response was
  4060. // returned at all) in error.(*googleapi.Error).Header. Use
  4061. // googleapi.IsNotModified to check whether the returned error was
  4062. // because http.StatusNotModified was returned.
  4063. func (c *SslCertsInsertCall) Do(opts ...googleapi.CallOption) (*SslCertsInsertResponse, error) {
  4064. gensupport.SetOptions(c.urlParams_, opts...)
  4065. res, err := c.doRequest("json")
  4066. if res != nil && res.StatusCode == http.StatusNotModified {
  4067. if res.Body != nil {
  4068. res.Body.Close()
  4069. }
  4070. return nil, &googleapi.Error{
  4071. Code: res.StatusCode,
  4072. Header: res.Header,
  4073. }
  4074. }
  4075. if err != nil {
  4076. return nil, err
  4077. }
  4078. defer googleapi.CloseBody(res)
  4079. if err := googleapi.CheckResponse(res); err != nil {
  4080. return nil, err
  4081. }
  4082. ret := &SslCertsInsertResponse{
  4083. ServerResponse: googleapi.ServerResponse{
  4084. Header: res.Header,
  4085. HTTPStatusCode: res.StatusCode,
  4086. },
  4087. }
  4088. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4089. return nil, err
  4090. }
  4091. return ret, nil
  4092. // {
  4093. // "description": "Creates an SSL certificate and returns the certificate, the associated private key, and the server certificate authority.",
  4094. // "httpMethod": "POST",
  4095. // "id": "sql.sslCerts.insert",
  4096. // "parameterOrder": [
  4097. // "project",
  4098. // "instance"
  4099. // ],
  4100. // "parameters": {
  4101. // "instance": {
  4102. // "description": "Cloud SQL instance ID. This does not include the project ID.",
  4103. // "location": "path",
  4104. // "required": true,
  4105. // "type": "string"
  4106. // },
  4107. // "project": {
  4108. // "description": "Project ID of the project to which the newly created Cloud SQL instances should belong.",
  4109. // "location": "path",
  4110. // "required": true,
  4111. // "type": "string"
  4112. // }
  4113. // },
  4114. // "path": "projects/{project}/instances/{instance}/sslCerts",
  4115. // "request": {
  4116. // "$ref": "SslCertsInsertRequest"
  4117. // },
  4118. // "response": {
  4119. // "$ref": "SslCertsInsertResponse"
  4120. // },
  4121. // "scopes": [
  4122. // "https://www.googleapis.com/auth/cloud-platform",
  4123. // "https://www.googleapis.com/auth/sqlservice.admin"
  4124. // ]
  4125. // }
  4126. }
  4127. // method id "sql.sslCerts.list":
  4128. type SslCertsListCall struct {
  4129. s *Service
  4130. project string
  4131. instance string
  4132. urlParams_ gensupport.URLParams
  4133. ifNoneMatch_ string
  4134. ctx_ context.Context
  4135. }
  4136. // List: Lists all of the current SSL certificates defined for a Cloud
  4137. // SQL instance.
  4138. func (r *SslCertsService) List(project string, instance string) *SslCertsListCall {
  4139. c := &SslCertsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4140. c.project = project
  4141. c.instance = instance
  4142. return c
  4143. }
  4144. // Fields allows partial responses to be retrieved. See
  4145. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4146. // for more information.
  4147. func (c *SslCertsListCall) Fields(s ...googleapi.Field) *SslCertsListCall {
  4148. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4149. return c
  4150. }
  4151. // IfNoneMatch sets the optional parameter which makes the operation
  4152. // fail if the object's ETag matches the given value. This is useful for
  4153. // getting updates only after the object has changed since the last
  4154. // request. Use googleapi.IsNotModified to check whether the response
  4155. // error from Do is the result of In-None-Match.
  4156. func (c *SslCertsListCall) IfNoneMatch(entityTag string) *SslCertsListCall {
  4157. c.ifNoneMatch_ = entityTag
  4158. return c
  4159. }
  4160. // Context sets the context to be used in this call's Do method. Any
  4161. // pending HTTP request will be aborted if the provided context is
  4162. // canceled.
  4163. func (c *SslCertsListCall) Context(ctx context.Context) *SslCertsListCall {
  4164. c.ctx_ = ctx
  4165. return c
  4166. }
  4167. func (c *SslCertsListCall) doRequest(alt string) (*http.Response, error) {
  4168. var body io.Reader = nil
  4169. c.urlParams_.Set("alt", alt)
  4170. urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/sslCerts")
  4171. urls += "?" + c.urlParams_.Encode()
  4172. req, _ := http.NewRequest("GET", urls, body)
  4173. googleapi.Expand(req.URL, map[string]string{
  4174. "project": c.project,
  4175. "instance": c.instance,
  4176. })
  4177. req.Header.Set("User-Agent", c.s.userAgent())
  4178. if c.ifNoneMatch_ != "" {
  4179. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  4180. }
  4181. if c.ctx_ != nil {
  4182. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4183. }
  4184. return c.s.client.Do(req)
  4185. }
  4186. // Do executes the "sql.sslCerts.list" call.
  4187. // Exactly one of *SslCertsListResponse or error will be non-nil. Any
  4188. // non-2xx status code is an error. Response headers are in either
  4189. // *SslCertsListResponse.ServerResponse.Header or (if a response was
  4190. // returned at all) in error.(*googleapi.Error).Header. Use
  4191. // googleapi.IsNotModified to check whether the returned error was
  4192. // because http.StatusNotModified was returned.
  4193. func (c *SslCertsListCall) Do(opts ...googleapi.CallOption) (*SslCertsListResponse, error) {
  4194. gensupport.SetOptions(c.urlParams_, opts...)
  4195. res, err := c.doRequest("json")
  4196. if res != nil && res.StatusCode == http.StatusNotModified {
  4197. if res.Body != nil {
  4198. res.Body.Close()
  4199. }
  4200. return nil, &googleapi.Error{
  4201. Code: res.StatusCode,
  4202. Header: res.Header,
  4203. }
  4204. }
  4205. if err != nil {
  4206. return nil, err
  4207. }
  4208. defer googleapi.CloseBody(res)
  4209. if err := googleapi.CheckResponse(res); err != nil {
  4210. return nil, err
  4211. }
  4212. ret := &SslCertsListResponse{
  4213. ServerResponse: googleapi.ServerResponse{
  4214. Header: res.Header,
  4215. HTTPStatusCode: res.StatusCode,
  4216. },
  4217. }
  4218. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4219. return nil, err
  4220. }
  4221. return ret, nil
  4222. // {
  4223. // "description": "Lists all of the current SSL certificates defined for a Cloud SQL instance.",
  4224. // "httpMethod": "GET",
  4225. // "id": "sql.sslCerts.list",
  4226. // "parameterOrder": [
  4227. // "project",
  4228. // "instance"
  4229. // ],
  4230. // "parameters": {
  4231. // "instance": {
  4232. // "description": "Cloud SQL instance ID. This does not include the project ID.",
  4233. // "location": "path",
  4234. // "required": true,
  4235. // "type": "string"
  4236. // },
  4237. // "project": {
  4238. // "description": "Project ID of the project for which to list Cloud SQL instances.",
  4239. // "location": "path",
  4240. // "required": true,
  4241. // "type": "string"
  4242. // }
  4243. // },
  4244. // "path": "projects/{project}/instances/{instance}/sslCerts",
  4245. // "response": {
  4246. // "$ref": "SslCertsListResponse"
  4247. // },
  4248. // "scopes": [
  4249. // "https://www.googleapis.com/auth/cloud-platform",
  4250. // "https://www.googleapis.com/auth/sqlservice.admin"
  4251. // ]
  4252. // }
  4253. }
  4254. // method id "sql.tiers.list":
  4255. type TiersListCall struct {
  4256. s *Service
  4257. project string
  4258. urlParams_ gensupport.URLParams
  4259. ifNoneMatch_ string
  4260. ctx_ context.Context
  4261. }
  4262. // List: Lists service tiers that can be used to create Google Cloud SQL
  4263. // instances.
  4264. func (r *TiersService) List(project string) *TiersListCall {
  4265. c := &TiersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4266. c.project = project
  4267. return c
  4268. }
  4269. // Fields allows partial responses to be retrieved. See
  4270. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4271. // for more information.
  4272. func (c *TiersListCall) Fields(s ...googleapi.Field) *TiersListCall {
  4273. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4274. return c
  4275. }
  4276. // IfNoneMatch sets the optional parameter which makes the operation
  4277. // fail if the object's ETag matches the given value. This is useful for
  4278. // getting updates only after the object has changed since the last
  4279. // request. Use googleapi.IsNotModified to check whether the response
  4280. // error from Do is the result of In-None-Match.
  4281. func (c *TiersListCall) IfNoneMatch(entityTag string) *TiersListCall {
  4282. c.ifNoneMatch_ = entityTag
  4283. return c
  4284. }
  4285. // Context sets the context to be used in this call's Do method. Any
  4286. // pending HTTP request will be aborted if the provided context is
  4287. // canceled.
  4288. func (c *TiersListCall) Context(ctx context.Context) *TiersListCall {
  4289. c.ctx_ = ctx
  4290. return c
  4291. }
  4292. func (c *TiersListCall) doRequest(alt string) (*http.Response, error) {
  4293. var body io.Reader = nil
  4294. c.urlParams_.Set("alt", alt)
  4295. urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/tiers")
  4296. urls += "?" + c.urlParams_.Encode()
  4297. req, _ := http.NewRequest("GET", urls, body)
  4298. googleapi.Expand(req.URL, map[string]string{
  4299. "project": c.project,
  4300. })
  4301. req.Header.Set("User-Agent", c.s.userAgent())
  4302. if c.ifNoneMatch_ != "" {
  4303. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  4304. }
  4305. if c.ctx_ != nil {
  4306. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4307. }
  4308. return c.s.client.Do(req)
  4309. }
  4310. // Do executes the "sql.tiers.list" call.
  4311. // Exactly one of *TiersListResponse or error will be non-nil. Any
  4312. // non-2xx status code is an error. Response headers are in either
  4313. // *TiersListResponse.ServerResponse.Header or (if a response was
  4314. // returned at all) in error.(*googleapi.Error).Header. Use
  4315. // googleapi.IsNotModified to check whether the returned error was
  4316. // because http.StatusNotModified was returned.
  4317. func (c *TiersListCall) Do(opts ...googleapi.CallOption) (*TiersListResponse, error) {
  4318. gensupport.SetOptions(c.urlParams_, opts...)
  4319. res, err := c.doRequest("json")
  4320. if res != nil && res.StatusCode == http.StatusNotModified {
  4321. if res.Body != nil {
  4322. res.Body.Close()
  4323. }
  4324. return nil, &googleapi.Error{
  4325. Code: res.StatusCode,
  4326. Header: res.Header,
  4327. }
  4328. }
  4329. if err != nil {
  4330. return nil, err
  4331. }
  4332. defer googleapi.CloseBody(res)
  4333. if err := googleapi.CheckResponse(res); err != nil {
  4334. return nil, err
  4335. }
  4336. ret := &TiersListResponse{
  4337. ServerResponse: googleapi.ServerResponse{
  4338. Header: res.Header,
  4339. HTTPStatusCode: res.StatusCode,
  4340. },
  4341. }
  4342. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4343. return nil, err
  4344. }
  4345. return ret, nil
  4346. // {
  4347. // "description": "Lists service tiers that can be used to create Google Cloud SQL instances.",
  4348. // "httpMethod": "GET",
  4349. // "id": "sql.tiers.list",
  4350. // "parameterOrder": [
  4351. // "project"
  4352. // ],
  4353. // "parameters": {
  4354. // "project": {
  4355. // "description": "Project ID of the project for which to list tiers.",
  4356. // "location": "path",
  4357. // "required": true,
  4358. // "type": "string"
  4359. // }
  4360. // },
  4361. // "path": "projects/{project}/tiers",
  4362. // "response": {
  4363. // "$ref": "TiersListResponse"
  4364. // },
  4365. // "scopes": [
  4366. // "https://www.googleapis.com/auth/cloud-platform",
  4367. // "https://www.googleapis.com/auth/sqlservice.admin"
  4368. // ]
  4369. // }
  4370. }