From 72cc5c4f6ef206c857f222653dff96907b320788 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 9 Sep 2024 00:24:28 -0700 Subject: [PATCH] feat(all): auto-regenerate discovery clients (#2778) --- monitoring/v1/monitoring-api.json | 29 ++- monitoring/v1/monitoring-gen.go | 24 +- monitoring/v3/monitoring-api.json | 27 +- monitoring/v3/monitoring-gen.go | 23 +- sqladmin/v1/sqladmin-api.json | 164 +++++++++++- sqladmin/v1/sqladmin-gen.go | 420 +++++++++++++++++++++++++++++- 6 files changed, 670 insertions(+), 17 deletions(-) diff --git a/monitoring/v1/monitoring-api.json b/monitoring/v1/monitoring-api.json index 044e2a7a78f..b4218c60958 100644 --- a/monitoring/v1/monitoring-api.json +++ b/monitoring/v1/monitoring-api.json @@ -753,7 +753,7 @@ } } }, - "revision": "20240721", + "revision": "20240829", "rootUrl": "https://monitoring.googleapis.com/", "schemas": { "Aggregation": { @@ -1022,10 +1022,37 @@ "description": "The persistent settings for a table's columns.", "id": "ColumnSettings", "properties": { + "alignment": { + "description": "Optional. Whether the column should be left / middle / right aligned", + "enum": [ + "CELL_ALIGNMENT_UNSPECIFIED", + "LEFT", + "CENTER", + "RIGHT" + ], + "enumDescriptions": [ + "No horizontal alignment specified; fall back to the default behavior. Label values are left aligned. Numeric values are right aligned.", + "Left-align", + "Center-align", + "Right-align" + ], + "type": "string" + }, "column": { "description": "Required. The id of the column.", "type": "string" }, + "displayName": { + "description": "Optional. Display name of the column", + "type": "string" + }, + "thresholds": { + "description": "Optional. The thresholds used to determine how the table cell should be rendered given the time series' current value.", + "items": { + "$ref": "Threshold" + }, + "type": "array" + }, "visible": { "description": "Required. Whether the column should be visible on page load.", "type": "boolean" diff --git a/monitoring/v1/monitoring-gen.go b/monitoring/v1/monitoring-gen.go index 44e2c63cb29..6d63f950e23 100644 --- a/monitoring/v1/monitoring-gen.go +++ b/monitoring/v1/monitoring-gen.go @@ -801,17 +801,33 @@ func (s ColumnLayout) MarshalJSON() ([]byte, error) { // ColumnSettings: The persistent settings for a table's columns. type ColumnSettings struct { + // Alignment: Optional. Whether the column should be left / middle / right + // aligned + // + // Possible values: + // "CELL_ALIGNMENT_UNSPECIFIED" - No horizontal alignment specified; fall + // back to the default behavior. Label values are left aligned. Numeric values + // are right aligned. + // "LEFT" - Left-align + // "CENTER" - Center-align + // "RIGHT" - Right-align + Alignment string `json:"alignment,omitempty"` // Column: Required. The id of the column. Column string `json:"column,omitempty"` + // DisplayName: Optional. Display name of the column + DisplayName string `json:"displayName,omitempty"` + // Thresholds: Optional. The thresholds used to determine how the table cell + // should be rendered given the time series' current value. + Thresholds []*Threshold `json:"thresholds,omitempty"` // Visible: Required. Whether the column should be visible on page load. Visible bool `json:"visible,omitempty"` - // ForceSendFields is a list of field names (e.g. "Column") to unconditionally - // include in API requests. By default, fields with empty or default values are - // omitted from API requests. See + // ForceSendFields is a list of field names (e.g. "Alignment") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Column") to include in API + // NullFields is a list of field names (e.g. "Alignment") to include in API // requests with the JSON null value. By default, fields with empty values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. diff --git a/monitoring/v3/monitoring-api.json b/monitoring/v3/monitoring-api.json index 9516ccabac5..ad5a3845356 100644 --- a/monitoring/v3/monitoring-api.json +++ b/monitoring/v3/monitoring-api.json @@ -2114,7 +2114,7 @@ }, "query": { "deprecated": true, - "description": "Queries time series using Monitoring Query Language.", + "description": "Queries time series by using Monitoring Query Language (MQL). We recommend using PromQL instead of MQL. For more information about the status of MQL, see the MQL deprecation notice (https://cloud.google.com/stackdriver/docs/deprecations/mql).", "flatPath": "v3/projects/{projectsId}/timeSeries:query", "httpMethod": "POST", "id": "monitoring.projects.timeSeries.query", @@ -2715,7 +2715,7 @@ } } }, - "revision": "20240818", + "revision": "20240829", "rootUrl": "https://monitoring.googleapis.com/", "schemas": { "Aggregation": { @@ -4621,6 +4621,25 @@ "description": "The sampling period of metric data points. For metrics which are written periodically, consecutive data points are stored at this time interval, excluding data loss due to errors. Metrics with a higher granularity have a smaller sampling period.", "format": "google-duration", "type": "string" + }, + "timeSeriesResourceHierarchyLevel": { + "description": "The scope of the timeseries data of the metric.", + "items": { + "enum": [ + "TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED", + "PROJECT", + "ORGANIZATION", + "FOLDER" + ], + "enumDescriptions": [ + "Do not use this default value.", + "Scopes a metric to a project.", + "Scopes a metric to an organization.", + "Scopes a metric to a folder." + ], + "type": "string" + }, + "type": "array" } }, "type": "object" @@ -5197,7 +5216,7 @@ }, "QueryTimeSeriesRequest": { "deprecated": true, - "description": "The QueryTimeSeries request.", + "description": "The QueryTimeSeries request. For information about the status of Monitoring Query Language (MQL), see the MQL deprecation notice (https://cloud.google.com/stackdriver/docs/deprecations/mql).", "id": "QueryTimeSeriesRequest", "properties": { "pageSize": { @@ -5218,7 +5237,7 @@ }, "QueryTimeSeriesResponse": { "deprecated": true, - "description": "The QueryTimeSeries response.", + "description": "The QueryTimeSeries response. For information about the status of Monitoring Query Language (MQL), see the MQL deprecation notice (https://cloud.google.com/stackdriver/docs/deprecations/mql).", "id": "QueryTimeSeriesResponse", "properties": { "nextPageToken": { diff --git a/monitoring/v3/monitoring-gen.go b/monitoring/v3/monitoring-gen.go index 7849479439a..e2d32dd06c0 100644 --- a/monitoring/v3/monitoring-gen.go +++ b/monitoring/v3/monitoring-gen.go @@ -3387,6 +3387,16 @@ type MetricDescriptorMetadata struct { // interval, excluding data loss due to errors. Metrics with a higher // granularity have a smaller sampling period. SamplePeriod string `json:"samplePeriod,omitempty"` + // TimeSeriesResourceHierarchyLevel: The scope of the timeseries data of the + // metric. + // + // Possible values: + // "TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED" - Do not use this + // default value. + // "PROJECT" - Scopes a metric to a project. + // "ORGANIZATION" - Scopes a metric to an organization. + // "FOLDER" - Scopes a metric to a folder. + TimeSeriesResourceHierarchyLevel []string `json:"timeSeriesResourceHierarchyLevel,omitempty"` // ForceSendFields is a list of field names (e.g. "IngestDelay") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See @@ -4329,7 +4339,9 @@ func (s PrometheusQueryLanguageCondition) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) } -// QueryTimeSeriesRequest: The QueryTimeSeries request. +// QueryTimeSeriesRequest: The QueryTimeSeries request. For information about +// the status of Monitoring Query Language (MQL), see the MQL deprecation +// notice (https://cloud.google.com/stackdriver/docs/deprecations/mql). type QueryTimeSeriesRequest struct { // PageSize: A positive number that is the maximum number of time_series_data // to return. @@ -4360,7 +4372,9 @@ func (s QueryTimeSeriesRequest) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) } -// QueryTimeSeriesResponse: The QueryTimeSeries response. +// QueryTimeSeriesResponse: The QueryTimeSeries response. For information about +// the status of Monitoring Query Language (MQL), see the MQL deprecation +// notice (https://cloud.google.com/stackdriver/docs/deprecations/mql). type QueryTimeSeriesResponse struct { // NextPageToken: If there are more results than have been returned, then this // field is set to a non-empty value. To see the additional results, use that @@ -12108,7 +12122,10 @@ type ProjectsTimeSeriesQueryCall struct { header_ http.Header } -// Query: Queries time series using Monitoring Query Language. +// Query: Queries time series by using Monitoring Query Language (MQL). We +// recommend using PromQL instead of MQL. For more information about the status +// of MQL, see the MQL deprecation notice +// (https://cloud.google.com/stackdriver/docs/deprecations/mql). // // - name: The project // (https://cloud.google.com/monitoring/api/v3#project_name) on which to diff --git a/sqladmin/v1/sqladmin-api.json b/sqladmin/v1/sqladmin-api.json index 70f6fa68eba..f93ffccf6ab 100644 --- a/sqladmin/v1/sqladmin-api.json +++ b/sqladmin/v1/sqladmin-api.json @@ -608,6 +608,73 @@ }, "instances": { "methods": { + "ListServerCertificates": { + "description": "Lists all versions of server certificates and certificate authorities (CAs) for the specified instance. There can be up to three sets of certs listed: the certificate that is currently in use, a future that has been added but not yet used to sign a certificate, and a certificate that has been rotated out.", + "flatPath": "v1/projects/{project}/instances/{instance}/listServerCertificates", + "httpMethod": "GET", + "id": "sql.instances.ListServerCertificates", + "parameterOrder": [ + "project", + "instance" + ], + "parameters": { + "instance": { + "description": "Required. Cloud SQL instance ID. This does not include the project ID.", + "location": "path", + "required": true, + "type": "string" + }, + "project": { + "description": "Required. Project ID of the project that contains the instance.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "v1/projects/{project}/instances/{instance}/listServerCertificates", + "response": { + "$ref": "InstancesListServerCertificatesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "RotateServerCertificate": { + "description": "Rotates the server certificate version to one previously added with the addServerCertificate method. For instances not using Certificate Authority Service (CAS) server CA, please use RotateServerCa instead.", + "flatPath": "v1/projects/{project}/instances/{instance}/rotateServerCertificate", + "httpMethod": "POST", + "id": "sql.instances.RotateServerCertificate", + "parameterOrder": [ + "project", + "instance" + ], + "parameters": { + "instance": { + "description": "Required. Cloud SQL instance ID. This does not include the project ID.", + "location": "path", + "required": true, + "type": "string" + }, + "project": { + "description": "Required. Project ID of the project that contains the instance.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "v1/projects/{project}/instances/{instance}/rotateServerCertificate", + "request": { + "$ref": "InstancesRotateServerCertificateRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, "acquireSsrsLease": { "description": "Acquire a lease for the setup of SQL Server Reporting Services (SSRS).", "flatPath": "v1/projects/{project}/instances/{instance}/acquireSsrsLease", @@ -675,6 +742,38 @@ "https://www.googleapis.com/auth/sqlservice.admin" ] }, + "addServerCertificate": { + "description": "Add a new trusted server certificate version for the specified instance using Certificate Authority Service (CAS) server CA. Required to prepare for a certificate rotation. If a server certificate version was previously added but never used in a certificate rotation, this operation replaces that version. There cannot be more than one certificate version waiting to be rotated in. For instances not using CAS server CA, please use AddServerCa instead.", + "flatPath": "v1/projects/{project}/instances/{instance}/addServerCertificate", + "httpMethod": "POST", + "id": "sql.instances.addServerCertificate", + "parameterOrder": [ + "project", + "instance" + ], + "parameters": { + "instance": { + "description": "Cloud SQL instance ID. This does not include the project ID.", + "location": "path", + "required": true, + "type": "string" + }, + "project": { + "description": "Project ID of the project that contains the instance.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "v1/projects/{project}/instances/{instance}/addServerCertificate", + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, "clone": { "description": "Creates a Cloud SQL instance as a clone of the source instance. Using this operation might cause your instance to restart.", "flatPath": "v1/projects/{project}/instances/{instance}/clone", @@ -2267,7 +2366,7 @@ } } }, - "revision": "20240829", + "revision": "20240831", "rootUrl": "https://sqladmin.googleapis.com/", "schemas": { "AclEntry": { @@ -4454,6 +4553,35 @@ }, "type": "object" }, + "InstancesListServerCertificatesResponse": { + "description": "Instances ListServerCertificates response.", + "id": "InstancesListServerCertificatesResponse", + "properties": { + "activeVersion": { + "description": "The `sha1_fingerprint` of the active certificate from `server_certs`.", + "type": "string" + }, + "caCerts": { + "description": "List of server CA certificates for the instance.", + "items": { + "$ref": "SslCert" + }, + "type": "array" + }, + "kind": { + "description": "This is always `sql#instancesListServerCertificates`.", + "type": "string" + }, + "serverCerts": { + "description": "List of server certificates for the instance, signed by the corresponding CA from the `ca_certs` list.", + "items": { + "$ref": "SslCert" + }, + "type": "array" + } + }, + "type": "object" + }, "InstancesReencryptRequest": { "description": "Database Instance reencrypt request.", "id": "InstancesReencryptRequest", @@ -4487,6 +4615,17 @@ }, "type": "object" }, + "InstancesRotateServerCertificateRequest": { + "description": "Rotate server certificate request.", + "id": "InstancesRotateServerCertificateRequest", + "properties": { + "rotateServerCertificateContext": { + "$ref": "RotateServerCertificateContext", + "description": "Optional. Contains details about the rotate server certificate operation." + } + }, + "type": "object" + }, "InstancesTruncateLogRequest": { "description": "Instance truncate log request.", "id": "InstancesTruncateLogRequest", @@ -5314,6 +5453,21 @@ }, "type": "object" }, + "RotateServerCertificateContext": { + "description": "Instance rotate server certificate context.", + "id": "RotateServerCertificateContext", + "properties": { + "kind": { + "description": "Optional. This is always `sql#rotateServerCertificateContext`.", + "type": "string" + }, + "nextVersion": { + "description": "The fingerprint of the next version to be rotated to. If left unspecified, will be rotated to the most recently added server certificate version.", + "type": "string" + } + }, + "type": "object" + }, "Settings": { "description": "Database instance settings.", "id": "Settings", @@ -5642,7 +5796,8 @@ "EXTENSIONS_NOT_ENABLED_IN_REPLICA", "UNSUPPORTED_COLUMNS", "USERS_NOT_CREATED_IN_REPLICA", - "UNSUPPORTED_SYSTEM_OBJECTS" + "UNSUPPORTED_SYSTEM_OBJECTS", + "UNSUPPORTED_TABLES_WITH_REPLICA_IDENTITY" ], "enumDescriptions": [ "", @@ -5665,7 +5820,7 @@ "The primary instance database parameter setup doesn't allow EM sync.", "The gtid_mode is not supported, applicable for MySQL.", "SQL Server Agent is not running.", - "The table definition is not support due to missing primary key or replica identity, applicable for postgres.", + "The table definition is not support due to missing primary key or replica identity, applicable for postgres. Note that this is a warning and won't block the migration.", "The customer has a definer that will break EM setup.", "SQL Server @@SERVERNAME does not match actual host name.", "The primary instance has been setup and will fail the setup.", @@ -5696,7 +5851,8 @@ "This error message indicates that the specified extensions are not enabled on destination instance. For example, before you can migrate data to the destination instance, you must enable the PGAudit extension on the instance.", "The source database has generated columns that can't be migrated. Please change them to regular columns before migration.", "The source database has users that aren't created in the replica. First, create all users, which are in the pg_user_mappings table of the source database, in the destination instance. Then, perform the migration.", - "The selected objects include system objects that aren't supported for migration." + "The selected objects include system objects that aren't supported for migration.", + "The source database has tables with the FULL or NOTHING replica identity. Before starting your migration, either remove the identity or change it to DEFAULT. Note that this is an error and will block the migration." ], "type": "string" } diff --git a/sqladmin/v1/sqladmin-gen.go b/sqladmin/v1/sqladmin-gen.go index 00dfa738556..74049715943 100644 --- a/sqladmin/v1/sqladmin-gen.go +++ b/sqladmin/v1/sqladmin-gen.go @@ -2598,6 +2598,40 @@ func (s InstancesListServerCasResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) } +// InstancesListServerCertificatesResponse: Instances ListServerCertificates +// response. +type InstancesListServerCertificatesResponse struct { + // ActiveVersion: The `sha1_fingerprint` of the active certificate from + // `server_certs`. + ActiveVersion string `json:"activeVersion,omitempty"` + // CaCerts: List of server CA certificates for the instance. + CaCerts []*SslCert `json:"caCerts,omitempty"` + // Kind: This is always `sql#instancesListServerCertificates`. + Kind string `json:"kind,omitempty"` + // ServerCerts: List of server certificates for the instance, signed by the + // corresponding CA from the `ca_certs` list. + ServerCerts []*SslCert `json:"serverCerts,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "ActiveVersion") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ActiveVersion") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s InstancesListServerCertificatesResponse) MarshalJSON() ([]byte, error) { + type NoMethod InstancesListServerCertificatesResponse + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + // InstancesReencryptRequest: Database Instance reencrypt request. type InstancesReencryptRequest struct { // BackupReencryptionConfig: Configuration specific to backup re-encryption @@ -2666,6 +2700,30 @@ func (s InstancesRotateServerCaRequest) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) } +// InstancesRotateServerCertificateRequest: Rotate server certificate request. +type InstancesRotateServerCertificateRequest struct { + // RotateServerCertificateContext: Optional. Contains details about the rotate + // server certificate operation. + RotateServerCertificateContext *RotateServerCertificateContext `json:"rotateServerCertificateContext,omitempty"` + // ForceSendFields is a list of field names (e.g. + // "RotateServerCertificateContext") to unconditionally include in API + // requests. By default, fields with empty or default values are omitted from + // API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "RotateServerCertificateContext") + // to include in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s InstancesRotateServerCertificateRequest) MarshalJSON() ([]byte, error) { + type NoMethod InstancesRotateServerCertificateRequest + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + // InstancesTruncateLogRequest: Instance truncate log request. type InstancesTruncateLogRequest struct { // TruncateLogContext: Contains details about the truncate log operation. @@ -3584,6 +3642,32 @@ func (s RotateServerCaContext) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) } +// RotateServerCertificateContext: Instance rotate server certificate context. +type RotateServerCertificateContext struct { + // Kind: Optional. This is always `sql#rotateServerCertificateContext`. + Kind string `json:"kind,omitempty"` + // NextVersion: The fingerprint of the next version to be rotated to. If left + // unspecified, will be rotated to the most recently added server certificate + // version. + NextVersion string `json:"nextVersion,omitempty"` + // ForceSendFields is a list of field names (e.g. "Kind") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Kind") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s RotateServerCertificateContext) MarshalJSON() ([]byte, error) { + type NoMethod RotateServerCertificateContext + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + // Settings: Database instance settings. type Settings struct { // ActivationPolicy: The activation policy specifies when the instance is @@ -3841,7 +3925,8 @@ type SqlExternalSyncSettingError struct { // MySQL. // "SQLSERVER_AGENT_NOT_RUNNING" - SQL Server Agent is not running. // "UNSUPPORTED_TABLE_DEFINITION" - The table definition is not support due - // to missing primary key or replica identity, applicable for postgres. + // to missing primary key or replica identity, applicable for postgres. Note + // that this is a warning and won't block the migration. // "UNSUPPORTED_DEFINER" - The customer has a definer that will break EM // setup. // "SQLSERVER_SERVERNAME_MISMATCH" - SQL Server @@SERVERNAME does not match @@ -3913,6 +3998,10 @@ type SqlExternalSyncSettingError struct { // Then, perform the migration. // "UNSUPPORTED_SYSTEM_OBJECTS" - The selected objects include system objects // that aren't supported for migration. + // "UNSUPPORTED_TABLES_WITH_REPLICA_IDENTITY" - The source database has + // tables with the FULL or NOTHING replica identity. Before starting your + // migration, either remove the identity or change it to DEFAULT. Note that + // this is an error and will block the migration. Type string `json:"type,omitempty"` // ForceSendFields is a list of field names (e.g. "Detail") to unconditionally // include in API requests. By default, fields with empty or default values are @@ -6253,6 +6342,230 @@ func (c *FlagsListCall) Do(opts ...googleapi.CallOption) (*FlagsListResponse, er return ret, nil } +type InstancesListServerCertificatesCall struct { + s *Service + project string + instance string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// ListServerCertificates: Lists all versions of server certificates and +// certificate authorities (CAs) for the specified instance. There can be up to +// three sets of certs listed: the certificate that is currently in use, a +// future that has been added but not yet used to sign a certificate, and a +// certificate that has been rotated out. +// +// - instance: Cloud SQL instance ID. This does not include the project ID. +// - project: Project ID of the project that contains the instance. +func (r *InstancesService) ListServerCertificates(project string, instance string) *InstancesListServerCertificatesCall { + c := &InstancesListServerCertificatesCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.instance = instance + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *InstancesListServerCertificatesCall) Fields(s ...googleapi.Field) *InstancesListServerCertificatesCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *InstancesListServerCertificatesCall) IfNoneMatch(entityTag string) *InstancesListServerCertificatesCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *InstancesListServerCertificatesCall) Context(ctx context.Context) *InstancesListServerCertificatesCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *InstancesListServerCertificatesCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *InstancesListServerCertificatesCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/listServerCertificates") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "sql.instances.ListServerCertificates" call. +// Any non-2xx status code is an error. Response headers are in either +// *InstancesListServerCertificatesResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesListServerCertificatesCall) Do(opts ...googleapi.CallOption) (*InstancesListServerCertificatesResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &InstancesListServerCertificatesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type InstancesRotateServerCertificateCall struct { + s *Service + project string + instance string + instancesrotateservercertificaterequest *InstancesRotateServerCertificateRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// RotateServerCertificate: Rotates the server certificate version to one +// previously added with the addServerCertificate method. For instances not +// using Certificate Authority Service (CAS) server CA, please use +// RotateServerCa instead. +// +// - instance: Cloud SQL instance ID. This does not include the project ID. +// - project: Project ID of the project that contains the instance. +func (r *InstancesService) RotateServerCertificate(project string, instance string, instancesrotateservercertificaterequest *InstancesRotateServerCertificateRequest) *InstancesRotateServerCertificateCall { + c := &InstancesRotateServerCertificateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.instance = instance + c.instancesrotateservercertificaterequest = instancesrotateservercertificaterequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *InstancesRotateServerCertificateCall) Fields(s ...googleapi.Field) *InstancesRotateServerCertificateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *InstancesRotateServerCertificateCall) Context(ctx context.Context) *InstancesRotateServerCertificateCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *InstancesRotateServerCertificateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *InstancesRotateServerCertificateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesrotateservercertificaterequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/rotateServerCertificate") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "sql.instances.RotateServerCertificate" call. +// Any non-2xx status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *InstancesRotateServerCertificateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + type InstancesAcquireSsrsLeaseCall struct { s *Service project string @@ -6469,6 +6782,111 @@ func (c *InstancesAddServerCaCall) Do(opts ...googleapi.CallOption) (*Operation, return ret, nil } +type InstancesAddServerCertificateCall struct { + s *Service + project string + instance string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// AddServerCertificate: Add a new trusted server certificate version for the +// specified instance using Certificate Authority Service (CAS) server CA. +// Required to prepare for a certificate rotation. If a server certificate +// version was previously added but never used in a certificate rotation, this +// operation replaces that version. There cannot be more than one certificate +// version waiting to be rotated in. For instances not using CAS server CA, +// please use AddServerCa instead. +// +// - instance: Cloud SQL instance ID. This does not include the project ID. +// - project: Project ID of the project that contains the instance. +func (r *InstancesService) AddServerCertificate(project string, instance string) *InstancesAddServerCertificateCall { + c := &InstancesAddServerCertificateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.instance = instance + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *InstancesAddServerCertificateCall) Fields(s ...googleapi.Field) *InstancesAddServerCertificateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *InstancesAddServerCertificateCall) Context(ctx context.Context) *InstancesAddServerCertificateCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *InstancesAddServerCertificateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *InstancesAddServerCertificateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/addServerCertificate") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "sql.instances.addServerCertificate" call. +// Any non-2xx status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *InstancesAddServerCertificateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + type InstancesCloneCall struct { s *Service project string