You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

5541 lines
191 KiB

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