From e907e01d29910f6480adcfa4054cfc9809fb36fe Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 27 Aug 2024 08:09:46 -0700 Subject: [PATCH] feat(all): auto-regenerate discovery clients (#2756) --- cloudkms/v1/cloudkms-api.json | 36 ++++- cloudkms/v1/cloudkms-gen.go | 57 +++++++- go.work.sum | 1 + pollen/v1/pollen-api.json | 10 +- pollen/v1/pollen-gen.go | 2 + redis/v1/redis-api.json | 162 ++++++++++++++++++++- redis/v1/redis-gen.go | 262 ++++++++++++++++++++++++++++++++-- redis/v1beta1/redis-api.json | 162 ++++++++++++++++++++- redis/v1beta1/redis-gen.go | 262 ++++++++++++++++++++++++++++++++-- 9 files changed, 924 insertions(+), 30 deletions(-) diff --git a/cloudkms/v1/cloudkms-api.json b/cloudkms/v1/cloudkms-api.json index 6313094275c..e2d4c7fa9c1 100644 --- a/cloudkms/v1/cloudkms-api.json +++ b/cloudkms/v1/cloudkms-api.json @@ -859,6 +859,17 @@ "location": "query", "type": "string" }, + "pageSize": { + "description": "Optional. Optional limit on the number of KeyHandles to include in the response. The service may return fewer than this value. Further KeyHandles can subsequently be obtained by including the ListKeyHandlesResponse.next_page_token in a subsequent request. If unspecified, at most KeyHandles 100 will be returned.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. Optional pagination token, returned earlier via ListKeyHandlesResponse.next_page_token.", + "location": "query", + "type": "string" + }, "parent": { "description": "Required. Name of the resource project and location from which to list KeyHandles, e.g. `projects/{PROJECT_ID}/locations/{LOCATION}`.", "location": "path", @@ -2101,7 +2112,7 @@ } } }, - "revision": "20240801", + "revision": "20240808", "rootUrl": "https://cloudkms.googleapis.com/", "schemas": { "AsymmetricDecryptRequest": { @@ -2292,6 +2303,23 @@ "name": { "description": "Identifier. Name of the AutokeyConfig resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig`.", "type": "string" + }, + "state": { + "description": "Output only. The state for the AutokeyConfig.", + "enum": [ + "STATE_UNSPECIFIED", + "ACTIVE", + "KEY_PROJECT_DELETED", + "UNINITIALIZED" + ], + "enumDescriptions": [ + "The state of the AutokeyConfig is unspecified.", + "The AutokeyConfig is currently active.", + "A previously configured key project has been deleted and the current AutokeyConfig is unusable.", + "The AutokeyConfig is not yet initialized or has been reset to its default uninitialized state." + ], + "readOnly": true, + "type": "string" } }, "type": "object" @@ -2943,7 +2971,7 @@ "type": "string" }, "serviceResolvers": { - "description": "A list of ServiceResolvers where the EKM can be reached. There should be one ServiceResolver per EKM replica. Currently, only a single ServiceResolver is supported.", + "description": "Optional. A list of ServiceResolvers where the EKM can be reached. There should be one ServiceResolver per EKM replica. Currently, only a single ServiceResolver is supported.", "items": { "$ref": "ServiceResolver" }, @@ -3534,6 +3562,10 @@ "$ref": "KeyHandle" }, "type": "array" + }, + "nextPageToken": { + "description": "A token to retrieve next page of results. Pass this value in ListKeyHandlesRequest.page_token to retrieve the next page of results.", + "type": "string" } }, "type": "object" diff --git a/cloudkms/v1/cloudkms-gen.go b/cloudkms/v1/cloudkms-gen.go index f0feb4b5373..5194747f6cb 100644 --- a/cloudkms/v1/cloudkms-gen.go +++ b/cloudkms/v1/cloudkms-gen.go @@ -603,6 +603,16 @@ type AutokeyConfig struct { // Name: Identifier. Name of the AutokeyConfig resource, e.g. // `folders/{FOLDER_NUMBER}/autokeyConfig`. Name string `json:"name,omitempty"` + // State: Output only. The state for the AutokeyConfig. + // + // Possible values: + // "STATE_UNSPECIFIED" - The state of the AutokeyConfig is unspecified. + // "ACTIVE" - The AutokeyConfig is currently active. + // "KEY_PROJECT_DELETED" - A previously configured key project has been + // deleted and the current AutokeyConfig is unusable. + // "UNINITIALIZED" - The AutokeyConfig is not yet initialized or has been + // reset to its default uninitialized state. + State string `json:"state,omitempty"` // ServerResponse contains the HTTP response code and headers from the server. googleapi.ServerResponse `json:"-"` @@ -1380,9 +1390,9 @@ type EkmConnection struct { // Name: Output only. The resource name for the EkmConnection in the format // `projects/*/locations/*/ekmConnections/*`. Name string `json:"name,omitempty"` - // ServiceResolvers: A list of ServiceResolvers where the EKM can be reached. - // There should be one ServiceResolver per EKM replica. Currently, only a - // single ServiceResolver is supported. + // ServiceResolvers: Optional. A list of ServiceResolvers where the EKM can be + // reached. There should be one ServiceResolver per EKM replica. Currently, + // only a single ServiceResolver is supported. ServiceResolvers []*ServiceResolver `json:"serviceResolvers,omitempty"` // ServerResponse contains the HTTP response code and headers from the server. @@ -2232,6 +2242,9 @@ func (s ListImportJobsResponse) MarshalJSON() ([]byte, error) { type ListKeyHandlesResponse struct { // KeyHandles: Resulting KeyHandles. KeyHandles []*KeyHandle `json:"keyHandles,omitempty"` + // NextPageToken: A token to retrieve next page of results. Pass this value in + // ListKeyHandlesRequest.page_token to retrieve the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` // ServerResponse contains the HTTP response code and headers from the server. googleapi.ServerResponse `json:"-"` @@ -5849,6 +5862,23 @@ func (c *ProjectsLocationsKeyHandlesListCall) Filter(filter string) *ProjectsLoc return c } +// PageSize sets the optional parameter "pageSize": Optional limit on the +// number of KeyHandles to include in the response. The service may return +// fewer than this value. Further KeyHandles can subsequently be obtained by +// including the ListKeyHandlesResponse.next_page_token in a subsequent +// request. If unspecified, at most KeyHandles 100 will be returned. +func (c *ProjectsLocationsKeyHandlesListCall) PageSize(pageSize int64) *ProjectsLocationsKeyHandlesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": Optional pagination +// token, returned earlier via ListKeyHandlesResponse.next_page_token. +func (c *ProjectsLocationsKeyHandlesListCall) PageToken(pageToken string) *ProjectsLocationsKeyHandlesListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. @@ -5939,6 +5969,27 @@ func (c *ProjectsLocationsKeyHandlesListCall) Do(opts ...googleapi.CallOption) ( return ret, nil } +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsKeyHandlesListCall) Pages(ctx context.Context, f func(*ListKeyHandlesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + type ProjectsLocationsKeyRingsCreateCall struct { s *Service parent string diff --git a/go.work.sum b/go.work.sum index 38e5a00aacc..676cd54b394 100644 --- a/go.work.sum +++ b/go.work.sum @@ -62,6 +62,7 @@ cloud.google.com/go/compute v1.27.1 h1:0WbBLIPNANheCRZ4h8QhgzjN53KMutbiVBOLtPiVz cloud.google.com/go/compute v1.27.2 h1:5cE5hdrwJV/92ravlwIFRGnyH9CpLGhh4N0ZDVTU+BA= cloud.google.com/go/compute v1.27.4 h1:XM8ulx6crjdl09XBfji7viFgZOEQuIxBwKmjRH9Rtmc= cloud.google.com/go/compute v1.27.4/go.mod h1:7JZS+h21ERAGHOy5qb7+EPyXlQwzshzrx1x6L9JhTqU= +cloud.google.com/go/compute v1.27.5 h1:iii9Z+FhEeZ5cUkGOEqU+GM7MJSyxMgbE7H7j+JndYY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= cloud.google.com/go/contactcenterinsights v1.13.0/go.mod h1:ieq5d5EtHsu8vhe2y3amtZ+BE+AQwX5qAy7cpo0POsI= cloud.google.com/go/contactcenterinsights v1.13.6/go.mod h1:mL+DbN3pMQGaAbDC4wZhryLciwSwHf5Tfk4Itr72Zyk= diff --git a/pollen/v1/pollen-api.json b/pollen/v1/pollen-api.json index 31fd9c6ce06..4871c7b32ae 100644 --- a/pollen/v1/pollen-api.json +++ b/pollen/v1/pollen-api.json @@ -233,7 +233,7 @@ } } }, - "revision": "20240720", + "revision": "20240825", "rootUrl": "https://pollen.googleapis.com/", "schemas": { "Color": { @@ -471,7 +471,9 @@ "HAZEL", "GRAMINALES", "RAGWEED", - "MUGWORT" + "MUGWORT", + "JAPANESE_CEDAR", + "JAPANESE_CYPRESS" ], "enumDescriptions": [ "Unspecified plant code.", @@ -489,7 +491,9 @@ "Hazel is classified as a tree pollen type.", "Graminales is classified as a grass pollen type.", "Ragweed is classified as a weed pollen type.", - "Mugwort is classified as a weed pollen type." + "Mugwort is classified as a weed pollen type.", + "Japanese cedar is classified as a tree pollen type.", + "Japanese cypress is classified as a tree pollen type." ], "type": "string" }, diff --git a/pollen/v1/pollen-gen.go b/pollen/v1/pollen-gen.go index 65502de8f5c..f2bd3fb19c6 100644 --- a/pollen/v1/pollen-gen.go +++ b/pollen/v1/pollen-gen.go @@ -549,6 +549,8 @@ type PlantInfo struct { // "GRAMINALES" - Graminales is classified as a grass pollen type. // "RAGWEED" - Ragweed is classified as a weed pollen type. // "MUGWORT" - Mugwort is classified as a weed pollen type. + // "JAPANESE_CEDAR" - Japanese cedar is classified as a tree pollen type. + // "JAPANESE_CYPRESS" - Japanese cypress is classified as a tree pollen type. Code string `json:"code,omitempty"` // DisplayName: A human readable representation of the plant name. Example: // “Cottonwood". diff --git a/redis/v1/redis-api.json b/redis/v1/redis-api.json index 8131657b50f..79318d50bb7 100644 --- a/redis/v1/redis-api.json +++ b/redis/v1/redis-api.json @@ -371,6 +371,34 @@ "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ] + }, + "rescheduleClusterMaintenance": { + "description": "Reschedules upcoming maintenance event.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:rescheduleClusterMaintenance", + "httpMethod": "POST", + "id": "redis.projects.locations.clusters.rescheduleClusterMaintenance", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Redis Cluster instance resource name using the form: `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` where `location_id` refers to a GCP region.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}:rescheduleClusterMaintenance", + "request": { + "$ref": "RescheduleClusterMaintenanceRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] } } }, @@ -821,7 +849,7 @@ } } }, - "revision": "20240812", + "revision": "20240822", "rootUrl": "https://redis.googleapis.com/", "schemas": { "AOFConfig": { @@ -840,7 +868,7 @@ "Not set. Default: EVERYSEC", "Never fsync. Normally Linux will flush data every 30 seconds with this configuration, but it's up to the kernel's exact tuning.", "fsync every second. Fast enough, and you may lose 1 second of data if there is a disaster", - "fsync every time new commands are appended to the AOF. It has the best data loss protection at the cost of performance" + "fsync every time new write commands are appended to the AOF. It has the best data loss protection at the cost of performance" ], "type": "string" } @@ -851,6 +879,10 @@ "description": "Configuration for availability of database instance", "id": "AvailabilityConfiguration", "properties": { + "automaticFailoverRoutingConfigured": { + "description": "Checks for existence of (multi-cluster) routing configuration that allows automatic failover to a different zone/region in case of an outage. Applicable to Bigtable resources.", + "type": "boolean" + }, "availabilityType": { "description": "Availability type. Potential values: * `ZONAL`: The instance serves data from only one zone. Outages in that zone affect data accessibility. * `REGIONAL`: The instance can serve data from more than one zone in a region (it is highly available).", "enum": [ @@ -1003,6 +1035,15 @@ "readOnly": true, "type": "array" }, + "maintenancePolicy": { + "$ref": "ClusterMaintenancePolicy", + "description": "Optional. ClusterMaintenancePolicy determines when to allow or deny updates." + }, + "maintenanceSchedule": { + "$ref": "ClusterMaintenanceSchedule", + "description": "Output only. ClusterMaintenanceSchedule Output only Published maintenance schedule.", + "readOnly": true + }, "name": { "description": "Required. Identifier. Unique name of the resource in this scope including project and location using the form: `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`", "type": "string" @@ -1123,6 +1164,57 @@ }, "type": "object" }, + "ClusterMaintenancePolicy": { + "description": "Maintenance policy per cluster.", + "id": "ClusterMaintenancePolicy", + "properties": { + "createTime": { + "description": "Output only. The time when the policy was created i.e. Maintenance Window or Deny Period was assigned.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "updateTime": { + "description": "Output only. The time when the policy was updated i.e. Maintenance Window or Deny Period was updated.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "weeklyMaintenanceWindow": { + "description": "Optional. Maintenance window that is applied to resources covered by this policy. Minimum 1. For the current version, the maximum number of weekly_maintenance_window is expected to be one.", + "items": { + "$ref": "ClusterWeeklyMaintenanceWindow" + }, + "type": "array" + } + }, + "type": "object" + }, + "ClusterMaintenanceSchedule": { + "description": "Upcoming maitenance schedule.", + "id": "ClusterMaintenanceSchedule", + "properties": { + "endTime": { + "description": "Output only. The end time of any upcoming scheduled maintenance for this instance.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "scheduleDeadlineTime": { + "description": "Output only. The deadline that the maintenance schedule start time can not go beyond, including reschedule.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "startTime": { + "description": "Output only. The start time of any upcoming scheduled maintenance for this instance.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, "ClusterPersistenceConfig": { "description": "Configuration of the persistence functionality.", "id": "ClusterPersistenceConfig", @@ -1154,6 +1246,46 @@ }, "type": "object" }, + "ClusterWeeklyMaintenanceWindow": { + "description": "Time window specified for weekly operations.", + "id": "ClusterWeeklyMaintenanceWindow", + "properties": { + "day": { + "description": "Allows to define schedule that runs specified day of the week.", + "enum": [ + "DAY_OF_WEEK_UNSPECIFIED", + "MONDAY", + "TUESDAY", + "WEDNESDAY", + "THURSDAY", + "FRIDAY", + "SATURDAY", + "SUNDAY" + ], + "enumDescriptions": [ + "The day of the week is unspecified.", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", + "Sunday" + ], + "type": "string" + }, + "duration": { + "description": "Duration of the time window.", + "format": "google-duration", + "type": "string" + }, + "startTime": { + "$ref": "TimeOfDay", + "description": "Start time of the window in UTC." + } + }, + "type": "object" + }, "Compliance": { "description": "Contains compliance information about a security standard indicating unmet recommendations.", "id": "Compliance", @@ -3351,6 +3483,32 @@ }, "type": "object" }, + "RescheduleClusterMaintenanceRequest": { + "description": "Request for rescheduling a cluster maintenance.", + "id": "RescheduleClusterMaintenanceRequest", + "properties": { + "rescheduleType": { + "description": "Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as well.", + "enum": [ + "RESCHEDULE_TYPE_UNSPECIFIED", + "IMMEDIATE", + "SPECIFIC_TIME" + ], + "enumDescriptions": [ + "Not set.", + "If the user wants to schedule the maintenance to happen now.", + "If the user wants to reschedule the maintenance to a specific time." + ], + "type": "string" + }, + "scheduleTime": { + "description": "Optional. Timestamp when the maintenance shall be rescheduled to if reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for example `2012-11-15T16:19:00.094Z`.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, "RescheduleMaintenanceRequest": { "description": "Request for RescheduleMaintenance.", "id": "RescheduleMaintenanceRequest", diff --git a/redis/v1/redis-gen.go b/redis/v1/redis-gen.go index b6ce611ff38..4226d5a6cab 100644 --- a/redis/v1/redis-gen.go +++ b/redis/v1/redis-gen.go @@ -223,8 +223,8 @@ type AOFConfig struct { // this configuration, but it's up to the kernel's exact tuning. // "EVERYSEC" - fsync every second. Fast enough, and you may lose 1 second of // data if there is a disaster - // "ALWAYS" - fsync every time new commands are appended to the AOF. It has - // the best data loss protection at the cost of performance + // "ALWAYS" - fsync every time new write commands are appended to the AOF. It + // has the best data loss protection at the cost of performance AppendFsync string `json:"appendFsync,omitempty"` // ForceSendFields is a list of field names (e.g. "AppendFsync") to // unconditionally include in API requests. By default, fields with empty or @@ -247,6 +247,10 @@ func (s AOFConfig) MarshalJSON() ([]byte, error) { // AvailabilityConfiguration: Configuration for availability of database // instance type AvailabilityConfiguration struct { + // AutomaticFailoverRoutingConfigured: Checks for existence of (multi-cluster) + // routing configuration that allows automatic failover to a different + // zone/region in case of an outage. Applicable to Bigtable resources. + AutomaticFailoverRoutingConfigured bool `json:"automaticFailoverRoutingConfigured,omitempty"` // AvailabilityType: Availability type. Potential values: * `ZONAL`: The // instance serves data from only one zone. Outages in that zone affect data // accessibility. * `REGIONAL`: The instance can serve data from more than one @@ -264,16 +268,18 @@ type AvailabilityConfiguration struct { CrossRegionReplicaConfigured bool `json:"crossRegionReplicaConfigured,omitempty"` ExternalReplicaConfigured bool `json:"externalReplicaConfigured,omitempty"` PromotableReplicaConfigured bool `json:"promotableReplicaConfigured,omitempty"` - // ForceSendFields is a list of field names (e.g. "AvailabilityType") 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. + // "AutomaticFailoverRoutingConfigured") 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. "AvailabilityType") 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 is a list of field names (e.g. + // "AutomaticFailoverRoutingConfigured") 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:"-"` } @@ -418,6 +424,12 @@ type Cluster struct { // for Redis clients to connect to the cluster. Currently only one discovery // endpoint is supported. DiscoveryEndpoints []*DiscoveryEndpoint `json:"discoveryEndpoints,omitempty"` + // MaintenancePolicy: Optional. ClusterMaintenancePolicy determines when to + // allow or deny updates. + MaintenancePolicy *ClusterMaintenancePolicy `json:"maintenancePolicy,omitempty"` + // MaintenanceSchedule: Output only. ClusterMaintenanceSchedule Output only + // Published maintenance schedule. + MaintenanceSchedule *ClusterMaintenanceSchedule `json:"maintenanceSchedule,omitempty"` // Name: Required. Identifier. Unique name of the resource in this scope // including project and location using the form: // `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` @@ -516,6 +528,65 @@ func (s *Cluster) UnmarshalJSON(data []byte) error { return nil } +// ClusterMaintenancePolicy: Maintenance policy per cluster. +type ClusterMaintenancePolicy struct { + // CreateTime: Output only. The time when the policy was created i.e. + // Maintenance Window or Deny Period was assigned. + CreateTime string `json:"createTime,omitempty"` + // UpdateTime: Output only. The time when the policy was updated i.e. + // Maintenance Window or Deny Period was updated. + UpdateTime string `json:"updateTime,omitempty"` + // WeeklyMaintenanceWindow: Optional. Maintenance window that is applied to + // resources covered by this policy. Minimum 1. For the current version, the + // maximum number of weekly_maintenance_window is expected to be one. + WeeklyMaintenanceWindow []*ClusterWeeklyMaintenanceWindow `json:"weeklyMaintenanceWindow,omitempty"` + // ForceSendFields is a list of field names (e.g. "CreateTime") 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. "CreateTime") 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 ClusterMaintenancePolicy) MarshalJSON() ([]byte, error) { + type NoMethod ClusterMaintenancePolicy + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// ClusterMaintenanceSchedule: Upcoming maitenance schedule. +type ClusterMaintenanceSchedule struct { + // EndTime: Output only. The end time of any upcoming scheduled maintenance for + // this instance. + EndTime string `json:"endTime,omitempty"` + // ScheduleDeadlineTime: Output only. The deadline that the maintenance + // schedule start time can not go beyond, including reschedule. + ScheduleDeadlineTime string `json:"scheduleDeadlineTime,omitempty"` + // StartTime: Output only. The start time of any upcoming scheduled maintenance + // for this instance. + StartTime string `json:"startTime,omitempty"` + // ForceSendFields is a list of field names (e.g. "EndTime") 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. "EndTime") 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 ClusterMaintenanceSchedule) MarshalJSON() ([]byte, error) { + type NoMethod ClusterMaintenanceSchedule + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + // ClusterPersistenceConfig: Configuration of the persistence functionality. type ClusterPersistenceConfig struct { // AofConfig: Optional. AOF configuration. This field will be ignored if mode @@ -550,6 +621,42 @@ func (s ClusterPersistenceConfig) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) } +// ClusterWeeklyMaintenanceWindow: Time window specified for weekly operations. +type ClusterWeeklyMaintenanceWindow struct { + // Day: Allows to define schedule that runs specified day of the week. + // + // Possible values: + // "DAY_OF_WEEK_UNSPECIFIED" - The day of the week is unspecified. + // "MONDAY" - Monday + // "TUESDAY" - Tuesday + // "WEDNESDAY" - Wednesday + // "THURSDAY" - Thursday + // "FRIDAY" - Friday + // "SATURDAY" - Saturday + // "SUNDAY" - Sunday + Day string `json:"day,omitempty"` + // Duration: Duration of the time window. + Duration string `json:"duration,omitempty"` + // StartTime: Start time of the window in UTC. + StartTime *TimeOfDay `json:"startTime,omitempty"` + // ForceSendFields is a list of field names (e.g. "Day") 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. "Day") 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 ClusterWeeklyMaintenanceWindow) MarshalJSON() ([]byte, error) { + type NoMethod ClusterWeeklyMaintenanceWindow + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + // Compliance: Contains compliance information about a security standard // indicating unmet recommendations. type Compliance struct { @@ -2758,6 +2865,40 @@ func (s RemoteCluster) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) } +// RescheduleClusterMaintenanceRequest: Request for rescheduling a cluster +// maintenance. +type RescheduleClusterMaintenanceRequest struct { + // RescheduleType: Required. If reschedule type is SPECIFIC_TIME, must set up + // schedule_time as well. + // + // Possible values: + // "RESCHEDULE_TYPE_UNSPECIFIED" - Not set. + // "IMMEDIATE" - If the user wants to schedule the maintenance to happen now. + // "SPECIFIC_TIME" - If the user wants to reschedule the maintenance to a + // specific time. + RescheduleType string `json:"rescheduleType,omitempty"` + // ScheduleTime: Optional. Timestamp when the maintenance shall be rescheduled + // to if reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for example + // `2012-11-15T16:19:00.094Z`. + ScheduleTime string `json:"scheduleTime,omitempty"` + // ForceSendFields is a list of field names (e.g. "RescheduleType") 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. "RescheduleType") 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 RescheduleClusterMaintenanceRequest) MarshalJSON() ([]byte, error) { + type NoMethod RescheduleClusterMaintenanceRequest + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + // RescheduleMaintenanceRequest: Request for RescheduleMaintenance. type RescheduleMaintenanceRequest struct { // RescheduleType: Required. If reschedule type is SPECIFIC_TIME, must set up @@ -4117,6 +4258,109 @@ func (c *ProjectsLocationsClustersPatchCall) Do(opts ...googleapi.CallOption) (* return ret, nil } +type ProjectsLocationsClustersRescheduleClusterMaintenanceCall struct { + s *Service + name string + rescheduleclustermaintenancerequest *RescheduleClusterMaintenanceRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// RescheduleClusterMaintenance: Reschedules upcoming maintenance event. +// +// - name: Redis Cluster instance resource name using the form: +// `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` +// where `location_id` refers to a GCP region. +func (r *ProjectsLocationsClustersService) RescheduleClusterMaintenance(name string, rescheduleclustermaintenancerequest *RescheduleClusterMaintenanceRequest) *ProjectsLocationsClustersRescheduleClusterMaintenanceCall { + c := &ProjectsLocationsClustersRescheduleClusterMaintenanceCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.rescheduleclustermaintenancerequest = rescheduleclustermaintenancerequest + 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 *ProjectsLocationsClustersRescheduleClusterMaintenanceCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersRescheduleClusterMaintenanceCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsClustersRescheduleClusterMaintenanceCall) Context(ctx context.Context) *ProjectsLocationsClustersRescheduleClusterMaintenanceCall { + 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 *ProjectsLocationsClustersRescheduleClusterMaintenanceCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsClustersRescheduleClusterMaintenanceCall) 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.rescheduleclustermaintenancerequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:rescheduleClusterMaintenance") + 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{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "redis.projects.locations.clusters.rescheduleClusterMaintenance" 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 *ProjectsLocationsClustersRescheduleClusterMaintenanceCall) 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 ProjectsLocationsInstancesCreateCall struct { s *Service parent string diff --git a/redis/v1beta1/redis-api.json b/redis/v1beta1/redis-api.json index 7742c590964..56333dd5c80 100644 --- a/redis/v1beta1/redis-api.json +++ b/redis/v1beta1/redis-api.json @@ -371,6 +371,34 @@ "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ] + }, + "rescheduleClusterMaintenance": { + "description": "Reschedules upcoming maintenance event.", + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:rescheduleClusterMaintenance", + "httpMethod": "POST", + "id": "redis.projects.locations.clusters.rescheduleClusterMaintenance", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Redis Cluster instance resource name using the form: `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` where `location_id` refers to a GCP region.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta1/{+name}:rescheduleClusterMaintenance", + "request": { + "$ref": "RescheduleClusterMaintenanceRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] } } }, @@ -821,7 +849,7 @@ } } }, - "revision": "20240812", + "revision": "20240822", "rootUrl": "https://redis.googleapis.com/", "schemas": { "AOFConfig": { @@ -840,7 +868,7 @@ "Not set. Default: EVERYSEC", "Never fsync. Normally Linux will flush data every 30 seconds with this configuration, but it's up to the kernel's exact tuning.", "fsync every second. Fast enough, and you may lose 1 second of data if there is a disaster", - "fsync every time new commands are appended to the AOF. It has the best data loss protection at the cost of performance" + "fsync every time new write commands are appended to the AOF. It has the best data loss protection at the cost of performance" ], "type": "string" } @@ -851,6 +879,10 @@ "description": "Configuration for availability of database instance", "id": "AvailabilityConfiguration", "properties": { + "automaticFailoverRoutingConfigured": { + "description": "Checks for existence of (multi-cluster) routing configuration that allows automatic failover to a different zone/region in case of an outage. Applicable to Bigtable resources.", + "type": "boolean" + }, "availabilityType": { "description": "Availability type. Potential values: * `ZONAL`: The instance serves data from only one zone. Outages in that zone affect data accessibility. * `REGIONAL`: The instance can serve data from more than one zone in a region (it is highly available).", "enum": [ @@ -1003,6 +1035,15 @@ "readOnly": true, "type": "array" }, + "maintenancePolicy": { + "$ref": "ClusterMaintenancePolicy", + "description": "Optional. ClusterMaintenancePolicy determines when to allow or deny updates." + }, + "maintenanceSchedule": { + "$ref": "ClusterMaintenanceSchedule", + "description": "Output only. ClusterMaintenanceSchedule Output only Published maintenance schedule.", + "readOnly": true + }, "name": { "description": "Required. Identifier. Unique name of the resource in this scope including project and location using the form: `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`", "type": "string" @@ -1123,6 +1164,57 @@ }, "type": "object" }, + "ClusterMaintenancePolicy": { + "description": "Maintenance policy per cluster.", + "id": "ClusterMaintenancePolicy", + "properties": { + "createTime": { + "description": "Output only. The time when the policy was created i.e. Maintenance Window or Deny Period was assigned.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "updateTime": { + "description": "Output only. The time when the policy was updated i.e. Maintenance Window or Deny Period was updated.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "weeklyMaintenanceWindow": { + "description": "Optional. Maintenance window that is applied to resources covered by this policy. Minimum 1. For the current version, the maximum number of weekly_maintenance_window is expected to be one.", + "items": { + "$ref": "ClusterWeeklyMaintenanceWindow" + }, + "type": "array" + } + }, + "type": "object" + }, + "ClusterMaintenanceSchedule": { + "description": "Upcoming maitenance schedule.", + "id": "ClusterMaintenanceSchedule", + "properties": { + "endTime": { + "description": "Output only. The end time of any upcoming scheduled maintenance for this instance.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "scheduleDeadlineTime": { + "description": "Output only. The deadline that the maintenance schedule start time can not go beyond, including reschedule.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "startTime": { + "description": "Output only. The start time of any upcoming scheduled maintenance for this instance.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, "ClusterPersistenceConfig": { "description": "Configuration of the persistence functionality.", "id": "ClusterPersistenceConfig", @@ -1154,6 +1246,46 @@ }, "type": "object" }, + "ClusterWeeklyMaintenanceWindow": { + "description": "Time window specified for weekly operations.", + "id": "ClusterWeeklyMaintenanceWindow", + "properties": { + "day": { + "description": "Allows to define schedule that runs specified day of the week.", + "enum": [ + "DAY_OF_WEEK_UNSPECIFIED", + "MONDAY", + "TUESDAY", + "WEDNESDAY", + "THURSDAY", + "FRIDAY", + "SATURDAY", + "SUNDAY" + ], + "enumDescriptions": [ + "The day of the week is unspecified.", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", + "Sunday" + ], + "type": "string" + }, + "duration": { + "description": "Duration of the time window.", + "format": "google-duration", + "type": "string" + }, + "startTime": { + "$ref": "TimeOfDay", + "description": "Start time of the window in UTC." + } + }, + "type": "object" + }, "Compliance": { "description": "Contains compliance information about a security standard indicating unmet recommendations.", "id": "Compliance", @@ -3358,6 +3490,32 @@ }, "type": "object" }, + "RescheduleClusterMaintenanceRequest": { + "description": "Request for rescheduling a cluster maintenance.", + "id": "RescheduleClusterMaintenanceRequest", + "properties": { + "rescheduleType": { + "description": "Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as well.", + "enum": [ + "RESCHEDULE_TYPE_UNSPECIFIED", + "IMMEDIATE", + "SPECIFIC_TIME" + ], + "enumDescriptions": [ + "Not set.", + "If the user wants to schedule the maintenance to happen now.", + "If the user wants to reschedule the maintenance to a specific time." + ], + "type": "string" + }, + "scheduleTime": { + "description": "Optional. Timestamp when the maintenance shall be rescheduled to if reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for example `2012-11-15T16:19:00.094Z`.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, "RescheduleMaintenanceRequest": { "description": "Request for RescheduleMaintenance.", "id": "RescheduleMaintenanceRequest", diff --git a/redis/v1beta1/redis-gen.go b/redis/v1beta1/redis-gen.go index ab078697e2d..e2dc9f649e8 100644 --- a/redis/v1beta1/redis-gen.go +++ b/redis/v1beta1/redis-gen.go @@ -223,8 +223,8 @@ type AOFConfig struct { // this configuration, but it's up to the kernel's exact tuning. // "EVERYSEC" - fsync every second. Fast enough, and you may lose 1 second of // data if there is a disaster - // "ALWAYS" - fsync every time new commands are appended to the AOF. It has - // the best data loss protection at the cost of performance + // "ALWAYS" - fsync every time new write commands are appended to the AOF. It + // has the best data loss protection at the cost of performance AppendFsync string `json:"appendFsync,omitempty"` // ForceSendFields is a list of field names (e.g. "AppendFsync") to // unconditionally include in API requests. By default, fields with empty or @@ -247,6 +247,10 @@ func (s AOFConfig) MarshalJSON() ([]byte, error) { // AvailabilityConfiguration: Configuration for availability of database // instance type AvailabilityConfiguration struct { + // AutomaticFailoverRoutingConfigured: Checks for existence of (multi-cluster) + // routing configuration that allows automatic failover to a different + // zone/region in case of an outage. Applicable to Bigtable resources. + AutomaticFailoverRoutingConfigured bool `json:"automaticFailoverRoutingConfigured,omitempty"` // AvailabilityType: Availability type. Potential values: * `ZONAL`: The // instance serves data from only one zone. Outages in that zone affect data // accessibility. * `REGIONAL`: The instance can serve data from more than one @@ -264,16 +268,18 @@ type AvailabilityConfiguration struct { CrossRegionReplicaConfigured bool `json:"crossRegionReplicaConfigured,omitempty"` ExternalReplicaConfigured bool `json:"externalReplicaConfigured,omitempty"` PromotableReplicaConfigured bool `json:"promotableReplicaConfigured,omitempty"` - // ForceSendFields is a list of field names (e.g. "AvailabilityType") 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. + // "AutomaticFailoverRoutingConfigured") 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. "AvailabilityType") 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 is a list of field names (e.g. + // "AutomaticFailoverRoutingConfigured") 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:"-"` } @@ -418,6 +424,12 @@ type Cluster struct { // for Redis clients to connect to the cluster. Currently only one discovery // endpoint is supported. DiscoveryEndpoints []*DiscoveryEndpoint `json:"discoveryEndpoints,omitempty"` + // MaintenancePolicy: Optional. ClusterMaintenancePolicy determines when to + // allow or deny updates. + MaintenancePolicy *ClusterMaintenancePolicy `json:"maintenancePolicy,omitempty"` + // MaintenanceSchedule: Output only. ClusterMaintenanceSchedule Output only + // Published maintenance schedule. + MaintenanceSchedule *ClusterMaintenanceSchedule `json:"maintenanceSchedule,omitempty"` // Name: Required. Identifier. Unique name of the resource in this scope // including project and location using the form: // `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` @@ -516,6 +528,65 @@ func (s *Cluster) UnmarshalJSON(data []byte) error { return nil } +// ClusterMaintenancePolicy: Maintenance policy per cluster. +type ClusterMaintenancePolicy struct { + // CreateTime: Output only. The time when the policy was created i.e. + // Maintenance Window or Deny Period was assigned. + CreateTime string `json:"createTime,omitempty"` + // UpdateTime: Output only. The time when the policy was updated i.e. + // Maintenance Window or Deny Period was updated. + UpdateTime string `json:"updateTime,omitempty"` + // WeeklyMaintenanceWindow: Optional. Maintenance window that is applied to + // resources covered by this policy. Minimum 1. For the current version, the + // maximum number of weekly_maintenance_window is expected to be one. + WeeklyMaintenanceWindow []*ClusterWeeklyMaintenanceWindow `json:"weeklyMaintenanceWindow,omitempty"` + // ForceSendFields is a list of field names (e.g. "CreateTime") 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. "CreateTime") 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 ClusterMaintenancePolicy) MarshalJSON() ([]byte, error) { + type NoMethod ClusterMaintenancePolicy + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// ClusterMaintenanceSchedule: Upcoming maitenance schedule. +type ClusterMaintenanceSchedule struct { + // EndTime: Output only. The end time of any upcoming scheduled maintenance for + // this instance. + EndTime string `json:"endTime,omitempty"` + // ScheduleDeadlineTime: Output only. The deadline that the maintenance + // schedule start time can not go beyond, including reschedule. + ScheduleDeadlineTime string `json:"scheduleDeadlineTime,omitempty"` + // StartTime: Output only. The start time of any upcoming scheduled maintenance + // for this instance. + StartTime string `json:"startTime,omitempty"` + // ForceSendFields is a list of field names (e.g. "EndTime") 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. "EndTime") 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 ClusterMaintenanceSchedule) MarshalJSON() ([]byte, error) { + type NoMethod ClusterMaintenanceSchedule + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + // ClusterPersistenceConfig: Configuration of the persistence functionality. type ClusterPersistenceConfig struct { // AofConfig: Optional. AOF configuration. This field will be ignored if mode @@ -550,6 +621,42 @@ func (s ClusterPersistenceConfig) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) } +// ClusterWeeklyMaintenanceWindow: Time window specified for weekly operations. +type ClusterWeeklyMaintenanceWindow struct { + // Day: Allows to define schedule that runs specified day of the week. + // + // Possible values: + // "DAY_OF_WEEK_UNSPECIFIED" - The day of the week is unspecified. + // "MONDAY" - Monday + // "TUESDAY" - Tuesday + // "WEDNESDAY" - Wednesday + // "THURSDAY" - Thursday + // "FRIDAY" - Friday + // "SATURDAY" - Saturday + // "SUNDAY" - Sunday + Day string `json:"day,omitempty"` + // Duration: Duration of the time window. + Duration string `json:"duration,omitempty"` + // StartTime: Start time of the window in UTC. + StartTime *TimeOfDay `json:"startTime,omitempty"` + // ForceSendFields is a list of field names (e.g. "Day") 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. "Day") 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 ClusterWeeklyMaintenanceWindow) MarshalJSON() ([]byte, error) { + type NoMethod ClusterWeeklyMaintenanceWindow + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + // Compliance: Contains compliance information about a security standard // indicating unmet recommendations. type Compliance struct { @@ -2762,6 +2869,40 @@ func (s RemoteCluster) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) } +// RescheduleClusterMaintenanceRequest: Request for rescheduling a cluster +// maintenance. +type RescheduleClusterMaintenanceRequest struct { + // RescheduleType: Required. If reschedule type is SPECIFIC_TIME, must set up + // schedule_time as well. + // + // Possible values: + // "RESCHEDULE_TYPE_UNSPECIFIED" - Not set. + // "IMMEDIATE" - If the user wants to schedule the maintenance to happen now. + // "SPECIFIC_TIME" - If the user wants to reschedule the maintenance to a + // specific time. + RescheduleType string `json:"rescheduleType,omitempty"` + // ScheduleTime: Optional. Timestamp when the maintenance shall be rescheduled + // to if reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for example + // `2012-11-15T16:19:00.094Z`. + ScheduleTime string `json:"scheduleTime,omitempty"` + // ForceSendFields is a list of field names (e.g. "RescheduleType") 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. "RescheduleType") 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 RescheduleClusterMaintenanceRequest) MarshalJSON() ([]byte, error) { + type NoMethod RescheduleClusterMaintenanceRequest + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + // RescheduleMaintenanceRequest: Request for RescheduleMaintenance. type RescheduleMaintenanceRequest struct { // RescheduleType: Required. If reschedule type is SPECIFIC_TIME, must set up @@ -4121,6 +4262,109 @@ func (c *ProjectsLocationsClustersPatchCall) Do(opts ...googleapi.CallOption) (* return ret, nil } +type ProjectsLocationsClustersRescheduleClusterMaintenanceCall struct { + s *Service + name string + rescheduleclustermaintenancerequest *RescheduleClusterMaintenanceRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// RescheduleClusterMaintenance: Reschedules upcoming maintenance event. +// +// - name: Redis Cluster instance resource name using the form: +// `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` +// where `location_id` refers to a GCP region. +func (r *ProjectsLocationsClustersService) RescheduleClusterMaintenance(name string, rescheduleclustermaintenancerequest *RescheduleClusterMaintenanceRequest) *ProjectsLocationsClustersRescheduleClusterMaintenanceCall { + c := &ProjectsLocationsClustersRescheduleClusterMaintenanceCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.rescheduleclustermaintenancerequest = rescheduleclustermaintenancerequest + 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 *ProjectsLocationsClustersRescheduleClusterMaintenanceCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersRescheduleClusterMaintenanceCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsClustersRescheduleClusterMaintenanceCall) Context(ctx context.Context) *ProjectsLocationsClustersRescheduleClusterMaintenanceCall { + 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 *ProjectsLocationsClustersRescheduleClusterMaintenanceCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsClustersRescheduleClusterMaintenanceCall) 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.rescheduleclustermaintenancerequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:rescheduleClusterMaintenance") + 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{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "redis.projects.locations.clusters.rescheduleClusterMaintenance" 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 *ProjectsLocationsClustersRescheduleClusterMaintenanceCall) 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 ProjectsLocationsInstancesCreateCall struct { s *Service parent string