google_cloud_redis_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate gtype;
25extern crate lazy_static;
26extern crate location;
27extern crate longrunning;
28extern crate lro;
29extern crate reqwest;
30extern crate serde;
31extern crate serde_json;
32extern crate serde_with;
33extern crate std;
34extern crate tracing;
35extern crate wkt;
36
37mod debug;
38mod deserialize;
39mod serialize;
40
41/// Node specific properties.
42#[derive(Clone, Default, PartialEq)]
43#[non_exhaustive]
44pub struct NodeInfo {
45    /// Output only. Node identifying string. e.g. 'node-0', 'node-1'
46    pub id: std::string::String,
47
48    /// Output only. Location of the node.
49    pub zone: std::string::String,
50
51    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
52}
53
54impl NodeInfo {
55    pub fn new() -> Self {
56        std::default::Default::default()
57    }
58
59    /// Sets the value of [id][crate::model::NodeInfo::id].
60    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
61        self.id = v.into();
62        self
63    }
64
65    /// Sets the value of [zone][crate::model::NodeInfo::zone].
66    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
67        self.zone = v.into();
68        self
69    }
70}
71
72impl wkt::message::Message for NodeInfo {
73    fn typename() -> &'static str {
74        "type.googleapis.com/google.cloud.redis.v1.NodeInfo"
75    }
76}
77
78/// A Memorystore for Redis instance.
79#[derive(Clone, Default, PartialEq)]
80#[non_exhaustive]
81pub struct Instance {
82    /// Required. Unique name of the resource in this scope including project and
83    /// location using the form:
84    /// `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
85    ///
86    /// Note: Redis instances are managed and addressed at regional level so
87    /// location_id here refers to a GCP region; however, users may choose which
88    /// specific zone (or collection of zones for cross-zone instances) an instance
89    /// should be provisioned in. Refer to
90    /// [location_id][google.cloud.redis.v1.Instance.location_id] and
91    /// [alternative_location_id][google.cloud.redis.v1.Instance.alternative_location_id]
92    /// fields for more details.
93    ///
94    /// [google.cloud.redis.v1.Instance.alternative_location_id]: crate::model::Instance::alternative_location_id
95    /// [google.cloud.redis.v1.Instance.location_id]: crate::model::Instance::location_id
96    pub name: std::string::String,
97
98    /// An arbitrary and optional user-provided name for the instance.
99    pub display_name: std::string::String,
100
101    /// Resource labels to represent user provided metadata
102    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
103
104    /// Optional. The zone where the instance will be provisioned. If not provided,
105    /// the service will choose a zone from the specified region for the instance.
106    /// For standard tier, additional nodes will be added across multiple zones for
107    /// protection against zonal failures. If specified, at least one node will be
108    /// provisioned in this zone.
109    pub location_id: std::string::String,
110
111    /// Optional. If specified, at least one node will be provisioned in this zone
112    /// in addition to the zone specified in location_id. Only applicable to
113    /// standard tier. If provided, it must be a different zone from the one
114    /// provided in [location_id]. Additional nodes beyond the first 2 will be
115    /// placed in zones selected by the service.
116    pub alternative_location_id: std::string::String,
117
118    /// Optional. The version of Redis software.
119    /// If not provided, latest supported version will be used. Currently, the
120    /// supported values are:
121    ///
122    /// * `REDIS_3_2` for Redis 3.2 compatibility
123    /// * `REDIS_4_0` for Redis 4.0 compatibility (default)
124    /// * `REDIS_5_0` for Redis 5.0 compatibility
125    /// * `REDIS_6_X` for Redis 6.x compatibility
126    pub redis_version: std::string::String,
127
128    /// Optional. For DIRECT_PEERING mode, the CIDR range of internal addresses
129    /// that are reserved for this instance. Range must
130    /// be unique and non-overlapping with existing subnets in an authorized
131    /// network. For PRIVATE_SERVICE_ACCESS mode, the name of one allocated IP
132    /// address ranges associated with this private service access connection.
133    /// If not provided, the service will choose an unused /29 block, for
134    /// example, 10.0.0.0/29 or 192.168.0.0/29.  For READ_REPLICAS_ENABLED
135    /// the default block size is /28.
136    pub reserved_ip_range: std::string::String,
137
138    /// Optional. Additional IP range for node placement. Required when enabling
139    /// read replicas on an existing instance. For DIRECT_PEERING mode value must
140    /// be a CIDR range of size /28, or "auto". For PRIVATE_SERVICE_ACCESS mode
141    /// value must be the name of an allocated address range associated with the
142    /// private service access connection, or "auto".
143    pub secondary_ip_range: std::string::String,
144
145    /// Output only. Hostname or IP address of the exposed Redis endpoint used by
146    /// clients to connect to the service.
147    pub host: std::string::String,
148
149    /// Output only. The port number of the exposed Redis endpoint.
150    pub port: i32,
151
152    /// Output only. The current zone where the Redis primary node is located. In
153    /// basic tier, this will always be the same as [location_id]. In
154    /// standard tier, this can be the zone of any node in the instance.
155    pub current_location_id: std::string::String,
156
157    /// Output only. The time the instance was created.
158    pub create_time: std::option::Option<wkt::Timestamp>,
159
160    /// Output only. The current state of this instance.
161    pub state: crate::model::instance::State,
162
163    /// Output only. Additional information about the current status of this
164    /// instance, if available.
165    pub status_message: std::string::String,
166
167    /// Optional. Redis configuration parameters, according to
168    /// <http://redis.io/topics/config>. Currently, the only supported parameters
169    /// are:
170    ///
171    /// Redis version 3.2 and newer:
172    ///
173    /// * maxmemory-policy
174    /// * notify-keyspace-events
175    ///
176    /// Redis version 4.0 and newer:
177    ///
178    /// * activedefrag
179    /// * lfu-decay-time
180    /// * lfu-log-factor
181    /// * maxmemory-gb
182    ///
183    /// Redis version 5.0 and newer:
184    ///
185    /// * stream-node-max-bytes
186    /// * stream-node-max-entries
187    pub redis_configs: std::collections::HashMap<std::string::String, std::string::String>,
188
189    /// Required. The service tier of the instance.
190    pub tier: crate::model::instance::Tier,
191
192    /// Required. Redis memory size in GiB.
193    pub memory_size_gb: i32,
194
195    /// Optional. The full name of the Google Compute Engine
196    /// [network](https://cloud.google.com/vpc/docs/vpc) to which the
197    /// instance is connected. If left unspecified, the `default` network
198    /// will be used.
199    pub authorized_network: std::string::String,
200
201    /// Output only. Cloud IAM identity used by import / export operations to
202    /// transfer data to/from Cloud Storage. Format is
203    /// "serviceAccount:<service_account_email>". The value may change over time
204    /// for a given instance so should be checked before each import/export
205    /// operation.
206    pub persistence_iam_identity: std::string::String,
207
208    /// Optional. The network connect mode of the Redis instance.
209    /// If not provided, the connect mode defaults to DIRECT_PEERING.
210    pub connect_mode: crate::model::instance::ConnectMode,
211
212    /// Optional. Indicates whether OSS Redis AUTH is enabled for the instance. If
213    /// set to "true" AUTH is enabled on the instance. Default value is "false"
214    /// meaning AUTH is disabled.
215    pub auth_enabled: bool,
216
217    /// Output only. List of server CA certificates for the instance.
218    pub server_ca_certs: std::vec::Vec<crate::model::TlsCertificate>,
219
220    /// Optional. The TLS mode of the Redis instance.
221    /// If not provided, TLS is disabled for the instance.
222    pub transit_encryption_mode: crate::model::instance::TransitEncryptionMode,
223
224    /// Optional. The maintenance policy for the instance. If not provided,
225    /// maintenance events can be performed at any time.
226    pub maintenance_policy: std::option::Option<crate::model::MaintenancePolicy>,
227
228    /// Output only. Date and time of upcoming maintenance events which have been
229    /// scheduled.
230    pub maintenance_schedule: std::option::Option<crate::model::MaintenanceSchedule>,
231
232    /// Optional. The number of replica nodes. The valid range for the Standard
233    /// Tier with read replicas enabled is [1-5] and defaults to 2. If read
234    /// replicas are not enabled for a Standard Tier instance, the only valid value
235    /// is 1 and the default is 1. The valid value for basic tier is 0 and the
236    /// default is also 0.
237    pub replica_count: i32,
238
239    /// Output only. Info per node.
240    pub nodes: std::vec::Vec<crate::model::NodeInfo>,
241
242    /// Output only. Hostname or IP address of the exposed readonly Redis
243    /// endpoint. Standard tier only. Targets all healthy replica nodes in
244    /// instance. Replication is asynchronous and replica nodes will exhibit some
245    /// lag behind the primary. Write requests must target 'host'.
246    pub read_endpoint: std::string::String,
247
248    /// Output only. The port number of the exposed readonly redis
249    /// endpoint. Standard tier only. Write requests should target 'port'.
250    pub read_endpoint_port: i32,
251
252    /// Optional. Read replicas mode for the instance. Defaults to
253    /// READ_REPLICAS_DISABLED.
254    pub read_replicas_mode: crate::model::instance::ReadReplicasMode,
255
256    /// Optional. The KMS key reference that the customer provides when trying to
257    /// create the instance.
258    pub customer_managed_key: std::string::String,
259
260    /// Optional. Persistence configuration parameters
261    pub persistence_config: std::option::Option<crate::model::PersistenceConfig>,
262
263    /// Optional. reasons that causes instance in "SUSPENDED" state.
264    pub suspension_reasons: std::vec::Vec<crate::model::instance::SuspensionReason>,
265
266    /// Optional. The self service update maintenance version.
267    /// The version is date based such as "20210712_00_00".
268    pub maintenance_version: std::string::String,
269
270    /// Optional. The available maintenance versions that an instance could update
271    /// to.
272    pub available_maintenance_versions: std::vec::Vec<std::string::String>,
273
274    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
275}
276
277impl Instance {
278    pub fn new() -> Self {
279        std::default::Default::default()
280    }
281
282    /// Sets the value of [name][crate::model::Instance::name].
283    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
284        self.name = v.into();
285        self
286    }
287
288    /// Sets the value of [display_name][crate::model::Instance::display_name].
289    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
290        self.display_name = v.into();
291        self
292    }
293
294    /// Sets the value of [labels][crate::model::Instance::labels].
295    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
296    where
297        T: std::iter::IntoIterator<Item = (K, V)>,
298        K: std::convert::Into<std::string::String>,
299        V: std::convert::Into<std::string::String>,
300    {
301        use std::iter::Iterator;
302        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
303        self
304    }
305
306    /// Sets the value of [location_id][crate::model::Instance::location_id].
307    pub fn set_location_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
308        self.location_id = v.into();
309        self
310    }
311
312    /// Sets the value of [alternative_location_id][crate::model::Instance::alternative_location_id].
313    pub fn set_alternative_location_id<T: std::convert::Into<std::string::String>>(
314        mut self,
315        v: T,
316    ) -> Self {
317        self.alternative_location_id = v.into();
318        self
319    }
320
321    /// Sets the value of [redis_version][crate::model::Instance::redis_version].
322    pub fn set_redis_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
323        self.redis_version = v.into();
324        self
325    }
326
327    /// Sets the value of [reserved_ip_range][crate::model::Instance::reserved_ip_range].
328    pub fn set_reserved_ip_range<T: std::convert::Into<std::string::String>>(
329        mut self,
330        v: T,
331    ) -> Self {
332        self.reserved_ip_range = v.into();
333        self
334    }
335
336    /// Sets the value of [secondary_ip_range][crate::model::Instance::secondary_ip_range].
337    pub fn set_secondary_ip_range<T: std::convert::Into<std::string::String>>(
338        mut self,
339        v: T,
340    ) -> Self {
341        self.secondary_ip_range = v.into();
342        self
343    }
344
345    /// Sets the value of [host][crate::model::Instance::host].
346    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
347        self.host = v.into();
348        self
349    }
350
351    /// Sets the value of [port][crate::model::Instance::port].
352    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
353        self.port = v.into();
354        self
355    }
356
357    /// Sets the value of [current_location_id][crate::model::Instance::current_location_id].
358    pub fn set_current_location_id<T: std::convert::Into<std::string::String>>(
359        mut self,
360        v: T,
361    ) -> Self {
362        self.current_location_id = v.into();
363        self
364    }
365
366    /// Sets the value of [create_time][crate::model::Instance::create_time].
367    pub fn set_create_time<T>(mut self, v: T) -> Self
368    where
369        T: std::convert::Into<wkt::Timestamp>,
370    {
371        self.create_time = std::option::Option::Some(v.into());
372        self
373    }
374
375    /// Sets or clears the value of [create_time][crate::model::Instance::create_time].
376    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
377    where
378        T: std::convert::Into<wkt::Timestamp>,
379    {
380        self.create_time = v.map(|x| x.into());
381        self
382    }
383
384    /// Sets the value of [state][crate::model::Instance::state].
385    pub fn set_state<T: std::convert::Into<crate::model::instance::State>>(mut self, v: T) -> Self {
386        self.state = v.into();
387        self
388    }
389
390    /// Sets the value of [status_message][crate::model::Instance::status_message].
391    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
392        self.status_message = v.into();
393        self
394    }
395
396    /// Sets the value of [redis_configs][crate::model::Instance::redis_configs].
397    pub fn set_redis_configs<T, K, V>(mut self, v: T) -> Self
398    where
399        T: std::iter::IntoIterator<Item = (K, V)>,
400        K: std::convert::Into<std::string::String>,
401        V: std::convert::Into<std::string::String>,
402    {
403        use std::iter::Iterator;
404        self.redis_configs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
405        self
406    }
407
408    /// Sets the value of [tier][crate::model::Instance::tier].
409    pub fn set_tier<T: std::convert::Into<crate::model::instance::Tier>>(mut self, v: T) -> Self {
410        self.tier = v.into();
411        self
412    }
413
414    /// Sets the value of [memory_size_gb][crate::model::Instance::memory_size_gb].
415    pub fn set_memory_size_gb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
416        self.memory_size_gb = v.into();
417        self
418    }
419
420    /// Sets the value of [authorized_network][crate::model::Instance::authorized_network].
421    pub fn set_authorized_network<T: std::convert::Into<std::string::String>>(
422        mut self,
423        v: T,
424    ) -> Self {
425        self.authorized_network = v.into();
426        self
427    }
428
429    /// Sets the value of [persistence_iam_identity][crate::model::Instance::persistence_iam_identity].
430    pub fn set_persistence_iam_identity<T: std::convert::Into<std::string::String>>(
431        mut self,
432        v: T,
433    ) -> Self {
434        self.persistence_iam_identity = v.into();
435        self
436    }
437
438    /// Sets the value of [connect_mode][crate::model::Instance::connect_mode].
439    pub fn set_connect_mode<T: std::convert::Into<crate::model::instance::ConnectMode>>(
440        mut self,
441        v: T,
442    ) -> Self {
443        self.connect_mode = v.into();
444        self
445    }
446
447    /// Sets the value of [auth_enabled][crate::model::Instance::auth_enabled].
448    pub fn set_auth_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
449        self.auth_enabled = v.into();
450        self
451    }
452
453    /// Sets the value of [server_ca_certs][crate::model::Instance::server_ca_certs].
454    pub fn set_server_ca_certs<T, V>(mut self, v: T) -> Self
455    where
456        T: std::iter::IntoIterator<Item = V>,
457        V: std::convert::Into<crate::model::TlsCertificate>,
458    {
459        use std::iter::Iterator;
460        self.server_ca_certs = v.into_iter().map(|i| i.into()).collect();
461        self
462    }
463
464    /// Sets the value of [transit_encryption_mode][crate::model::Instance::transit_encryption_mode].
465    pub fn set_transit_encryption_mode<
466        T: std::convert::Into<crate::model::instance::TransitEncryptionMode>,
467    >(
468        mut self,
469        v: T,
470    ) -> Self {
471        self.transit_encryption_mode = v.into();
472        self
473    }
474
475    /// Sets the value of [maintenance_policy][crate::model::Instance::maintenance_policy].
476    pub fn set_maintenance_policy<T>(mut self, v: T) -> Self
477    where
478        T: std::convert::Into<crate::model::MaintenancePolicy>,
479    {
480        self.maintenance_policy = std::option::Option::Some(v.into());
481        self
482    }
483
484    /// Sets or clears the value of [maintenance_policy][crate::model::Instance::maintenance_policy].
485    pub fn set_or_clear_maintenance_policy<T>(mut self, v: std::option::Option<T>) -> Self
486    where
487        T: std::convert::Into<crate::model::MaintenancePolicy>,
488    {
489        self.maintenance_policy = v.map(|x| x.into());
490        self
491    }
492
493    /// Sets the value of [maintenance_schedule][crate::model::Instance::maintenance_schedule].
494    pub fn set_maintenance_schedule<T>(mut self, v: T) -> Self
495    where
496        T: std::convert::Into<crate::model::MaintenanceSchedule>,
497    {
498        self.maintenance_schedule = std::option::Option::Some(v.into());
499        self
500    }
501
502    /// Sets or clears the value of [maintenance_schedule][crate::model::Instance::maintenance_schedule].
503    pub fn set_or_clear_maintenance_schedule<T>(mut self, v: std::option::Option<T>) -> Self
504    where
505        T: std::convert::Into<crate::model::MaintenanceSchedule>,
506    {
507        self.maintenance_schedule = v.map(|x| x.into());
508        self
509    }
510
511    /// Sets the value of [replica_count][crate::model::Instance::replica_count].
512    pub fn set_replica_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
513        self.replica_count = v.into();
514        self
515    }
516
517    /// Sets the value of [nodes][crate::model::Instance::nodes].
518    pub fn set_nodes<T, V>(mut self, v: T) -> Self
519    where
520        T: std::iter::IntoIterator<Item = V>,
521        V: std::convert::Into<crate::model::NodeInfo>,
522    {
523        use std::iter::Iterator;
524        self.nodes = v.into_iter().map(|i| i.into()).collect();
525        self
526    }
527
528    /// Sets the value of [read_endpoint][crate::model::Instance::read_endpoint].
529    pub fn set_read_endpoint<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
530        self.read_endpoint = v.into();
531        self
532    }
533
534    /// Sets the value of [read_endpoint_port][crate::model::Instance::read_endpoint_port].
535    pub fn set_read_endpoint_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
536        self.read_endpoint_port = v.into();
537        self
538    }
539
540    /// Sets the value of [read_replicas_mode][crate::model::Instance::read_replicas_mode].
541    pub fn set_read_replicas_mode<
542        T: std::convert::Into<crate::model::instance::ReadReplicasMode>,
543    >(
544        mut self,
545        v: T,
546    ) -> Self {
547        self.read_replicas_mode = v.into();
548        self
549    }
550
551    /// Sets the value of [customer_managed_key][crate::model::Instance::customer_managed_key].
552    pub fn set_customer_managed_key<T: std::convert::Into<std::string::String>>(
553        mut self,
554        v: T,
555    ) -> Self {
556        self.customer_managed_key = v.into();
557        self
558    }
559
560    /// Sets the value of [persistence_config][crate::model::Instance::persistence_config].
561    pub fn set_persistence_config<T>(mut self, v: T) -> Self
562    where
563        T: std::convert::Into<crate::model::PersistenceConfig>,
564    {
565        self.persistence_config = std::option::Option::Some(v.into());
566        self
567    }
568
569    /// Sets or clears the value of [persistence_config][crate::model::Instance::persistence_config].
570    pub fn set_or_clear_persistence_config<T>(mut self, v: std::option::Option<T>) -> Self
571    where
572        T: std::convert::Into<crate::model::PersistenceConfig>,
573    {
574        self.persistence_config = v.map(|x| x.into());
575        self
576    }
577
578    /// Sets the value of [suspension_reasons][crate::model::Instance::suspension_reasons].
579    pub fn set_suspension_reasons<T, V>(mut self, v: T) -> Self
580    where
581        T: std::iter::IntoIterator<Item = V>,
582        V: std::convert::Into<crate::model::instance::SuspensionReason>,
583    {
584        use std::iter::Iterator;
585        self.suspension_reasons = v.into_iter().map(|i| i.into()).collect();
586        self
587    }
588
589    /// Sets the value of [maintenance_version][crate::model::Instance::maintenance_version].
590    pub fn set_maintenance_version<T: std::convert::Into<std::string::String>>(
591        mut self,
592        v: T,
593    ) -> Self {
594        self.maintenance_version = v.into();
595        self
596    }
597
598    /// Sets the value of [available_maintenance_versions][crate::model::Instance::available_maintenance_versions].
599    pub fn set_available_maintenance_versions<T, V>(mut self, v: T) -> Self
600    where
601        T: std::iter::IntoIterator<Item = V>,
602        V: std::convert::Into<std::string::String>,
603    {
604        use std::iter::Iterator;
605        self.available_maintenance_versions = v.into_iter().map(|i| i.into()).collect();
606        self
607    }
608}
609
610impl wkt::message::Message for Instance {
611    fn typename() -> &'static str {
612        "type.googleapis.com/google.cloud.redis.v1.Instance"
613    }
614}
615
616/// Defines additional types related to [Instance].
617pub mod instance {
618    #[allow(unused_imports)]
619    use super::*;
620
621    /// Represents the different states of a Redis instance.
622    ///
623    /// # Working with unknown values
624    ///
625    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
626    /// additional enum variants at any time. Adding new variants is not considered
627    /// a breaking change. Applications should write their code in anticipation of:
628    ///
629    /// - New values appearing in future releases of the client library, **and**
630    /// - New values received dynamically, without application changes.
631    ///
632    /// Please consult the [Working with enums] section in the user guide for some
633    /// guidelines.
634    ///
635    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
636    #[derive(Clone, Debug, PartialEq)]
637    #[non_exhaustive]
638    pub enum State {
639        /// Not set.
640        Unspecified,
641        /// Redis instance is being created.
642        Creating,
643        /// Redis instance has been created and is fully usable.
644        Ready,
645        /// Redis instance configuration is being updated. Certain kinds of updates
646        /// may cause the instance to become unusable while the update is in
647        /// progress.
648        Updating,
649        /// Redis instance is being deleted.
650        Deleting,
651        /// Redis instance is being repaired and may be unusable.
652        Repairing,
653        /// Maintenance is being performed on this Redis instance.
654        Maintenance,
655        /// Redis instance is importing data (availability may be affected).
656        Importing,
657        /// Redis instance is failing over (availability may be affected).
658        FailingOver,
659        /// If set, the enum was initialized with an unknown value.
660        ///
661        /// Applications can examine the value using [State::value] or
662        /// [State::name].
663        UnknownValue(state::UnknownValue),
664    }
665
666    #[doc(hidden)]
667    pub mod state {
668        #[allow(unused_imports)]
669        use super::*;
670        #[derive(Clone, Debug, PartialEq)]
671        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
672    }
673
674    impl State {
675        /// Gets the enum value.
676        ///
677        /// Returns `None` if the enum contains an unknown value deserialized from
678        /// the string representation of enums.
679        pub fn value(&self) -> std::option::Option<i32> {
680            match self {
681                Self::Unspecified => std::option::Option::Some(0),
682                Self::Creating => std::option::Option::Some(1),
683                Self::Ready => std::option::Option::Some(2),
684                Self::Updating => std::option::Option::Some(3),
685                Self::Deleting => std::option::Option::Some(4),
686                Self::Repairing => std::option::Option::Some(5),
687                Self::Maintenance => std::option::Option::Some(6),
688                Self::Importing => std::option::Option::Some(8),
689                Self::FailingOver => std::option::Option::Some(9),
690                Self::UnknownValue(u) => u.0.value(),
691            }
692        }
693
694        /// Gets the enum value as a string.
695        ///
696        /// Returns `None` if the enum contains an unknown value deserialized from
697        /// the integer representation of enums.
698        pub fn name(&self) -> std::option::Option<&str> {
699            match self {
700                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
701                Self::Creating => std::option::Option::Some("CREATING"),
702                Self::Ready => std::option::Option::Some("READY"),
703                Self::Updating => std::option::Option::Some("UPDATING"),
704                Self::Deleting => std::option::Option::Some("DELETING"),
705                Self::Repairing => std::option::Option::Some("REPAIRING"),
706                Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
707                Self::Importing => std::option::Option::Some("IMPORTING"),
708                Self::FailingOver => std::option::Option::Some("FAILING_OVER"),
709                Self::UnknownValue(u) => u.0.name(),
710            }
711        }
712    }
713
714    impl std::default::Default for State {
715        fn default() -> Self {
716            use std::convert::From;
717            Self::from(0)
718        }
719    }
720
721    impl std::fmt::Display for State {
722        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
723            wkt::internal::display_enum(f, self.name(), self.value())
724        }
725    }
726
727    impl std::convert::From<i32> for State {
728        fn from(value: i32) -> Self {
729            match value {
730                0 => Self::Unspecified,
731                1 => Self::Creating,
732                2 => Self::Ready,
733                3 => Self::Updating,
734                4 => Self::Deleting,
735                5 => Self::Repairing,
736                6 => Self::Maintenance,
737                8 => Self::Importing,
738                9 => Self::FailingOver,
739                _ => Self::UnknownValue(state::UnknownValue(
740                    wkt::internal::UnknownEnumValue::Integer(value),
741                )),
742            }
743        }
744    }
745
746    impl std::convert::From<&str> for State {
747        fn from(value: &str) -> Self {
748            use std::string::ToString;
749            match value {
750                "STATE_UNSPECIFIED" => Self::Unspecified,
751                "CREATING" => Self::Creating,
752                "READY" => Self::Ready,
753                "UPDATING" => Self::Updating,
754                "DELETING" => Self::Deleting,
755                "REPAIRING" => Self::Repairing,
756                "MAINTENANCE" => Self::Maintenance,
757                "IMPORTING" => Self::Importing,
758                "FAILING_OVER" => Self::FailingOver,
759                _ => Self::UnknownValue(state::UnknownValue(
760                    wkt::internal::UnknownEnumValue::String(value.to_string()),
761                )),
762            }
763        }
764    }
765
766    impl serde::ser::Serialize for State {
767        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
768        where
769            S: serde::Serializer,
770        {
771            match self {
772                Self::Unspecified => serializer.serialize_i32(0),
773                Self::Creating => serializer.serialize_i32(1),
774                Self::Ready => serializer.serialize_i32(2),
775                Self::Updating => serializer.serialize_i32(3),
776                Self::Deleting => serializer.serialize_i32(4),
777                Self::Repairing => serializer.serialize_i32(5),
778                Self::Maintenance => serializer.serialize_i32(6),
779                Self::Importing => serializer.serialize_i32(8),
780                Self::FailingOver => serializer.serialize_i32(9),
781                Self::UnknownValue(u) => u.0.serialize(serializer),
782            }
783        }
784    }
785
786    impl<'de> serde::de::Deserialize<'de> for State {
787        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
788        where
789            D: serde::Deserializer<'de>,
790        {
791            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
792                ".google.cloud.redis.v1.Instance.State",
793            ))
794        }
795    }
796
797    /// Available service tiers to choose from
798    ///
799    /// # Working with unknown values
800    ///
801    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
802    /// additional enum variants at any time. Adding new variants is not considered
803    /// a breaking change. Applications should write their code in anticipation of:
804    ///
805    /// - New values appearing in future releases of the client library, **and**
806    /// - New values received dynamically, without application changes.
807    ///
808    /// Please consult the [Working with enums] section in the user guide for some
809    /// guidelines.
810    ///
811    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
812    #[derive(Clone, Debug, PartialEq)]
813    #[non_exhaustive]
814    pub enum Tier {
815        /// Not set.
816        Unspecified,
817        /// BASIC tier: standalone instance
818        Basic,
819        /// STANDARD_HA tier: highly available primary/replica instances
820        StandardHa,
821        /// If set, the enum was initialized with an unknown value.
822        ///
823        /// Applications can examine the value using [Tier::value] or
824        /// [Tier::name].
825        UnknownValue(tier::UnknownValue),
826    }
827
828    #[doc(hidden)]
829    pub mod tier {
830        #[allow(unused_imports)]
831        use super::*;
832        #[derive(Clone, Debug, PartialEq)]
833        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
834    }
835
836    impl Tier {
837        /// Gets the enum value.
838        ///
839        /// Returns `None` if the enum contains an unknown value deserialized from
840        /// the string representation of enums.
841        pub fn value(&self) -> std::option::Option<i32> {
842            match self {
843                Self::Unspecified => std::option::Option::Some(0),
844                Self::Basic => std::option::Option::Some(1),
845                Self::StandardHa => std::option::Option::Some(3),
846                Self::UnknownValue(u) => u.0.value(),
847            }
848        }
849
850        /// Gets the enum value as a string.
851        ///
852        /// Returns `None` if the enum contains an unknown value deserialized from
853        /// the integer representation of enums.
854        pub fn name(&self) -> std::option::Option<&str> {
855            match self {
856                Self::Unspecified => std::option::Option::Some("TIER_UNSPECIFIED"),
857                Self::Basic => std::option::Option::Some("BASIC"),
858                Self::StandardHa => std::option::Option::Some("STANDARD_HA"),
859                Self::UnknownValue(u) => u.0.name(),
860            }
861        }
862    }
863
864    impl std::default::Default for Tier {
865        fn default() -> Self {
866            use std::convert::From;
867            Self::from(0)
868        }
869    }
870
871    impl std::fmt::Display for Tier {
872        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
873            wkt::internal::display_enum(f, self.name(), self.value())
874        }
875    }
876
877    impl std::convert::From<i32> for Tier {
878        fn from(value: i32) -> Self {
879            match value {
880                0 => Self::Unspecified,
881                1 => Self::Basic,
882                3 => Self::StandardHa,
883                _ => Self::UnknownValue(tier::UnknownValue(
884                    wkt::internal::UnknownEnumValue::Integer(value),
885                )),
886            }
887        }
888    }
889
890    impl std::convert::From<&str> for Tier {
891        fn from(value: &str) -> Self {
892            use std::string::ToString;
893            match value {
894                "TIER_UNSPECIFIED" => Self::Unspecified,
895                "BASIC" => Self::Basic,
896                "STANDARD_HA" => Self::StandardHa,
897                _ => Self::UnknownValue(tier::UnknownValue(
898                    wkt::internal::UnknownEnumValue::String(value.to_string()),
899                )),
900            }
901        }
902    }
903
904    impl serde::ser::Serialize for Tier {
905        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
906        where
907            S: serde::Serializer,
908        {
909            match self {
910                Self::Unspecified => serializer.serialize_i32(0),
911                Self::Basic => serializer.serialize_i32(1),
912                Self::StandardHa => serializer.serialize_i32(3),
913                Self::UnknownValue(u) => u.0.serialize(serializer),
914            }
915        }
916    }
917
918    impl<'de> serde::de::Deserialize<'de> for Tier {
919        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
920        where
921            D: serde::Deserializer<'de>,
922        {
923            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Tier>::new(
924                ".google.cloud.redis.v1.Instance.Tier",
925            ))
926        }
927    }
928
929    /// Available connection modes.
930    ///
931    /// # Working with unknown values
932    ///
933    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
934    /// additional enum variants at any time. Adding new variants is not considered
935    /// a breaking change. Applications should write their code in anticipation of:
936    ///
937    /// - New values appearing in future releases of the client library, **and**
938    /// - New values received dynamically, without application changes.
939    ///
940    /// Please consult the [Working with enums] section in the user guide for some
941    /// guidelines.
942    ///
943    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
944    #[derive(Clone, Debug, PartialEq)]
945    #[non_exhaustive]
946    pub enum ConnectMode {
947        /// Not set.
948        Unspecified,
949        /// Connect via direct peering to the Memorystore for Redis hosted service.
950        DirectPeering,
951        /// Connect your Memorystore for Redis instance using Private Service
952        /// Access. Private services access provides an IP address range for multiple
953        /// Google Cloud services, including Memorystore.
954        PrivateServiceAccess,
955        /// If set, the enum was initialized with an unknown value.
956        ///
957        /// Applications can examine the value using [ConnectMode::value] or
958        /// [ConnectMode::name].
959        UnknownValue(connect_mode::UnknownValue),
960    }
961
962    #[doc(hidden)]
963    pub mod connect_mode {
964        #[allow(unused_imports)]
965        use super::*;
966        #[derive(Clone, Debug, PartialEq)]
967        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
968    }
969
970    impl ConnectMode {
971        /// Gets the enum value.
972        ///
973        /// Returns `None` if the enum contains an unknown value deserialized from
974        /// the string representation of enums.
975        pub fn value(&self) -> std::option::Option<i32> {
976            match self {
977                Self::Unspecified => std::option::Option::Some(0),
978                Self::DirectPeering => std::option::Option::Some(1),
979                Self::PrivateServiceAccess => std::option::Option::Some(2),
980                Self::UnknownValue(u) => u.0.value(),
981            }
982        }
983
984        /// Gets the enum value as a string.
985        ///
986        /// Returns `None` if the enum contains an unknown value deserialized from
987        /// the integer representation of enums.
988        pub fn name(&self) -> std::option::Option<&str> {
989            match self {
990                Self::Unspecified => std::option::Option::Some("CONNECT_MODE_UNSPECIFIED"),
991                Self::DirectPeering => std::option::Option::Some("DIRECT_PEERING"),
992                Self::PrivateServiceAccess => std::option::Option::Some("PRIVATE_SERVICE_ACCESS"),
993                Self::UnknownValue(u) => u.0.name(),
994            }
995        }
996    }
997
998    impl std::default::Default for ConnectMode {
999        fn default() -> Self {
1000            use std::convert::From;
1001            Self::from(0)
1002        }
1003    }
1004
1005    impl std::fmt::Display for ConnectMode {
1006        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1007            wkt::internal::display_enum(f, self.name(), self.value())
1008        }
1009    }
1010
1011    impl std::convert::From<i32> for ConnectMode {
1012        fn from(value: i32) -> Self {
1013            match value {
1014                0 => Self::Unspecified,
1015                1 => Self::DirectPeering,
1016                2 => Self::PrivateServiceAccess,
1017                _ => Self::UnknownValue(connect_mode::UnknownValue(
1018                    wkt::internal::UnknownEnumValue::Integer(value),
1019                )),
1020            }
1021        }
1022    }
1023
1024    impl std::convert::From<&str> for ConnectMode {
1025        fn from(value: &str) -> Self {
1026            use std::string::ToString;
1027            match value {
1028                "CONNECT_MODE_UNSPECIFIED" => Self::Unspecified,
1029                "DIRECT_PEERING" => Self::DirectPeering,
1030                "PRIVATE_SERVICE_ACCESS" => Self::PrivateServiceAccess,
1031                _ => Self::UnknownValue(connect_mode::UnknownValue(
1032                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1033                )),
1034            }
1035        }
1036    }
1037
1038    impl serde::ser::Serialize for ConnectMode {
1039        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1040        where
1041            S: serde::Serializer,
1042        {
1043            match self {
1044                Self::Unspecified => serializer.serialize_i32(0),
1045                Self::DirectPeering => serializer.serialize_i32(1),
1046                Self::PrivateServiceAccess => serializer.serialize_i32(2),
1047                Self::UnknownValue(u) => u.0.serialize(serializer),
1048            }
1049        }
1050    }
1051
1052    impl<'de> serde::de::Deserialize<'de> for ConnectMode {
1053        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1054        where
1055            D: serde::Deserializer<'de>,
1056        {
1057            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectMode>::new(
1058                ".google.cloud.redis.v1.Instance.ConnectMode",
1059            ))
1060        }
1061    }
1062
1063    /// Available TLS modes.
1064    ///
1065    /// # Working with unknown values
1066    ///
1067    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1068    /// additional enum variants at any time. Adding new variants is not considered
1069    /// a breaking change. Applications should write their code in anticipation of:
1070    ///
1071    /// - New values appearing in future releases of the client library, **and**
1072    /// - New values received dynamically, without application changes.
1073    ///
1074    /// Please consult the [Working with enums] section in the user guide for some
1075    /// guidelines.
1076    ///
1077    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1078    #[derive(Clone, Debug, PartialEq)]
1079    #[non_exhaustive]
1080    pub enum TransitEncryptionMode {
1081        /// Not set.
1082        Unspecified,
1083        /// Client to Server traffic encryption enabled with server authentication.
1084        ServerAuthentication,
1085        /// TLS is disabled for the instance.
1086        Disabled,
1087        /// If set, the enum was initialized with an unknown value.
1088        ///
1089        /// Applications can examine the value using [TransitEncryptionMode::value] or
1090        /// [TransitEncryptionMode::name].
1091        UnknownValue(transit_encryption_mode::UnknownValue),
1092    }
1093
1094    #[doc(hidden)]
1095    pub mod transit_encryption_mode {
1096        #[allow(unused_imports)]
1097        use super::*;
1098        #[derive(Clone, Debug, PartialEq)]
1099        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1100    }
1101
1102    impl TransitEncryptionMode {
1103        /// Gets the enum value.
1104        ///
1105        /// Returns `None` if the enum contains an unknown value deserialized from
1106        /// the string representation of enums.
1107        pub fn value(&self) -> std::option::Option<i32> {
1108            match self {
1109                Self::Unspecified => std::option::Option::Some(0),
1110                Self::ServerAuthentication => std::option::Option::Some(1),
1111                Self::Disabled => std::option::Option::Some(2),
1112                Self::UnknownValue(u) => u.0.value(),
1113            }
1114        }
1115
1116        /// Gets the enum value as a string.
1117        ///
1118        /// Returns `None` if the enum contains an unknown value deserialized from
1119        /// the integer representation of enums.
1120        pub fn name(&self) -> std::option::Option<&str> {
1121            match self {
1122                Self::Unspecified => {
1123                    std::option::Option::Some("TRANSIT_ENCRYPTION_MODE_UNSPECIFIED")
1124                }
1125                Self::ServerAuthentication => std::option::Option::Some("SERVER_AUTHENTICATION"),
1126                Self::Disabled => std::option::Option::Some("DISABLED"),
1127                Self::UnknownValue(u) => u.0.name(),
1128            }
1129        }
1130    }
1131
1132    impl std::default::Default for TransitEncryptionMode {
1133        fn default() -> Self {
1134            use std::convert::From;
1135            Self::from(0)
1136        }
1137    }
1138
1139    impl std::fmt::Display for TransitEncryptionMode {
1140        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1141            wkt::internal::display_enum(f, self.name(), self.value())
1142        }
1143    }
1144
1145    impl std::convert::From<i32> for TransitEncryptionMode {
1146        fn from(value: i32) -> Self {
1147            match value {
1148                0 => Self::Unspecified,
1149                1 => Self::ServerAuthentication,
1150                2 => Self::Disabled,
1151                _ => Self::UnknownValue(transit_encryption_mode::UnknownValue(
1152                    wkt::internal::UnknownEnumValue::Integer(value),
1153                )),
1154            }
1155        }
1156    }
1157
1158    impl std::convert::From<&str> for TransitEncryptionMode {
1159        fn from(value: &str) -> Self {
1160            use std::string::ToString;
1161            match value {
1162                "TRANSIT_ENCRYPTION_MODE_UNSPECIFIED" => Self::Unspecified,
1163                "SERVER_AUTHENTICATION" => Self::ServerAuthentication,
1164                "DISABLED" => Self::Disabled,
1165                _ => Self::UnknownValue(transit_encryption_mode::UnknownValue(
1166                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1167                )),
1168            }
1169        }
1170    }
1171
1172    impl serde::ser::Serialize for TransitEncryptionMode {
1173        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1174        where
1175            S: serde::Serializer,
1176        {
1177            match self {
1178                Self::Unspecified => serializer.serialize_i32(0),
1179                Self::ServerAuthentication => serializer.serialize_i32(1),
1180                Self::Disabled => serializer.serialize_i32(2),
1181                Self::UnknownValue(u) => u.0.serialize(serializer),
1182            }
1183        }
1184    }
1185
1186    impl<'de> serde::de::Deserialize<'de> for TransitEncryptionMode {
1187        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1188        where
1189            D: serde::Deserializer<'de>,
1190        {
1191            deserializer.deserialize_any(wkt::internal::EnumVisitor::<TransitEncryptionMode>::new(
1192                ".google.cloud.redis.v1.Instance.TransitEncryptionMode",
1193            ))
1194        }
1195    }
1196
1197    /// Read replicas mode.
1198    ///
1199    /// # Working with unknown values
1200    ///
1201    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1202    /// additional enum variants at any time. Adding new variants is not considered
1203    /// a breaking change. Applications should write their code in anticipation of:
1204    ///
1205    /// - New values appearing in future releases of the client library, **and**
1206    /// - New values received dynamically, without application changes.
1207    ///
1208    /// Please consult the [Working with enums] section in the user guide for some
1209    /// guidelines.
1210    ///
1211    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1212    #[derive(Clone, Debug, PartialEq)]
1213    #[non_exhaustive]
1214    pub enum ReadReplicasMode {
1215        /// If not set, Memorystore Redis backend will default to
1216        /// READ_REPLICAS_DISABLED.
1217        Unspecified,
1218        /// If disabled, read endpoint will not be provided and the instance cannot
1219        /// scale up or down the number of replicas.
1220        ReadReplicasDisabled,
1221        /// If enabled, read endpoint will be provided and the instance can scale
1222        /// up and down the number of replicas. Not valid for basic tier.
1223        ReadReplicasEnabled,
1224        /// If set, the enum was initialized with an unknown value.
1225        ///
1226        /// Applications can examine the value using [ReadReplicasMode::value] or
1227        /// [ReadReplicasMode::name].
1228        UnknownValue(read_replicas_mode::UnknownValue),
1229    }
1230
1231    #[doc(hidden)]
1232    pub mod read_replicas_mode {
1233        #[allow(unused_imports)]
1234        use super::*;
1235        #[derive(Clone, Debug, PartialEq)]
1236        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1237    }
1238
1239    impl ReadReplicasMode {
1240        /// Gets the enum value.
1241        ///
1242        /// Returns `None` if the enum contains an unknown value deserialized from
1243        /// the string representation of enums.
1244        pub fn value(&self) -> std::option::Option<i32> {
1245            match self {
1246                Self::Unspecified => std::option::Option::Some(0),
1247                Self::ReadReplicasDisabled => std::option::Option::Some(1),
1248                Self::ReadReplicasEnabled => std::option::Option::Some(2),
1249                Self::UnknownValue(u) => u.0.value(),
1250            }
1251        }
1252
1253        /// Gets the enum value as a string.
1254        ///
1255        /// Returns `None` if the enum contains an unknown value deserialized from
1256        /// the integer representation of enums.
1257        pub fn name(&self) -> std::option::Option<&str> {
1258            match self {
1259                Self::Unspecified => std::option::Option::Some("READ_REPLICAS_MODE_UNSPECIFIED"),
1260                Self::ReadReplicasDisabled => std::option::Option::Some("READ_REPLICAS_DISABLED"),
1261                Self::ReadReplicasEnabled => std::option::Option::Some("READ_REPLICAS_ENABLED"),
1262                Self::UnknownValue(u) => u.0.name(),
1263            }
1264        }
1265    }
1266
1267    impl std::default::Default for ReadReplicasMode {
1268        fn default() -> Self {
1269            use std::convert::From;
1270            Self::from(0)
1271        }
1272    }
1273
1274    impl std::fmt::Display for ReadReplicasMode {
1275        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1276            wkt::internal::display_enum(f, self.name(), self.value())
1277        }
1278    }
1279
1280    impl std::convert::From<i32> for ReadReplicasMode {
1281        fn from(value: i32) -> Self {
1282            match value {
1283                0 => Self::Unspecified,
1284                1 => Self::ReadReplicasDisabled,
1285                2 => Self::ReadReplicasEnabled,
1286                _ => Self::UnknownValue(read_replicas_mode::UnknownValue(
1287                    wkt::internal::UnknownEnumValue::Integer(value),
1288                )),
1289            }
1290        }
1291    }
1292
1293    impl std::convert::From<&str> for ReadReplicasMode {
1294        fn from(value: &str) -> Self {
1295            use std::string::ToString;
1296            match value {
1297                "READ_REPLICAS_MODE_UNSPECIFIED" => Self::Unspecified,
1298                "READ_REPLICAS_DISABLED" => Self::ReadReplicasDisabled,
1299                "READ_REPLICAS_ENABLED" => Self::ReadReplicasEnabled,
1300                _ => Self::UnknownValue(read_replicas_mode::UnknownValue(
1301                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1302                )),
1303            }
1304        }
1305    }
1306
1307    impl serde::ser::Serialize for ReadReplicasMode {
1308        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1309        where
1310            S: serde::Serializer,
1311        {
1312            match self {
1313                Self::Unspecified => serializer.serialize_i32(0),
1314                Self::ReadReplicasDisabled => serializer.serialize_i32(1),
1315                Self::ReadReplicasEnabled => serializer.serialize_i32(2),
1316                Self::UnknownValue(u) => u.0.serialize(serializer),
1317            }
1318        }
1319    }
1320
1321    impl<'de> serde::de::Deserialize<'de> for ReadReplicasMode {
1322        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1323        where
1324            D: serde::Deserializer<'de>,
1325        {
1326            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReadReplicasMode>::new(
1327                ".google.cloud.redis.v1.Instance.ReadReplicasMode",
1328            ))
1329        }
1330    }
1331
1332    /// Possible reasons for the instance to be in a "SUSPENDED" state.
1333    ///
1334    /// # Working with unknown values
1335    ///
1336    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1337    /// additional enum variants at any time. Adding new variants is not considered
1338    /// a breaking change. Applications should write their code in anticipation of:
1339    ///
1340    /// - New values appearing in future releases of the client library, **and**
1341    /// - New values received dynamically, without application changes.
1342    ///
1343    /// Please consult the [Working with enums] section in the user guide for some
1344    /// guidelines.
1345    ///
1346    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1347    #[derive(Clone, Debug, PartialEq)]
1348    #[non_exhaustive]
1349    pub enum SuspensionReason {
1350        /// Not set.
1351        Unspecified,
1352        /// Something wrong with the CMEK key provided by customer.
1353        CustomerManagedKeyIssue,
1354        /// If set, the enum was initialized with an unknown value.
1355        ///
1356        /// Applications can examine the value using [SuspensionReason::value] or
1357        /// [SuspensionReason::name].
1358        UnknownValue(suspension_reason::UnknownValue),
1359    }
1360
1361    #[doc(hidden)]
1362    pub mod suspension_reason {
1363        #[allow(unused_imports)]
1364        use super::*;
1365        #[derive(Clone, Debug, PartialEq)]
1366        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1367    }
1368
1369    impl SuspensionReason {
1370        /// Gets the enum value.
1371        ///
1372        /// Returns `None` if the enum contains an unknown value deserialized from
1373        /// the string representation of enums.
1374        pub fn value(&self) -> std::option::Option<i32> {
1375            match self {
1376                Self::Unspecified => std::option::Option::Some(0),
1377                Self::CustomerManagedKeyIssue => std::option::Option::Some(1),
1378                Self::UnknownValue(u) => u.0.value(),
1379            }
1380        }
1381
1382        /// Gets the enum value as a string.
1383        ///
1384        /// Returns `None` if the enum contains an unknown value deserialized from
1385        /// the integer representation of enums.
1386        pub fn name(&self) -> std::option::Option<&str> {
1387            match self {
1388                Self::Unspecified => std::option::Option::Some("SUSPENSION_REASON_UNSPECIFIED"),
1389                Self::CustomerManagedKeyIssue => {
1390                    std::option::Option::Some("CUSTOMER_MANAGED_KEY_ISSUE")
1391                }
1392                Self::UnknownValue(u) => u.0.name(),
1393            }
1394        }
1395    }
1396
1397    impl std::default::Default for SuspensionReason {
1398        fn default() -> Self {
1399            use std::convert::From;
1400            Self::from(0)
1401        }
1402    }
1403
1404    impl std::fmt::Display for SuspensionReason {
1405        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1406            wkt::internal::display_enum(f, self.name(), self.value())
1407        }
1408    }
1409
1410    impl std::convert::From<i32> for SuspensionReason {
1411        fn from(value: i32) -> Self {
1412            match value {
1413                0 => Self::Unspecified,
1414                1 => Self::CustomerManagedKeyIssue,
1415                _ => Self::UnknownValue(suspension_reason::UnknownValue(
1416                    wkt::internal::UnknownEnumValue::Integer(value),
1417                )),
1418            }
1419        }
1420    }
1421
1422    impl std::convert::From<&str> for SuspensionReason {
1423        fn from(value: &str) -> Self {
1424            use std::string::ToString;
1425            match value {
1426                "SUSPENSION_REASON_UNSPECIFIED" => Self::Unspecified,
1427                "CUSTOMER_MANAGED_KEY_ISSUE" => Self::CustomerManagedKeyIssue,
1428                _ => Self::UnknownValue(suspension_reason::UnknownValue(
1429                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1430                )),
1431            }
1432        }
1433    }
1434
1435    impl serde::ser::Serialize for SuspensionReason {
1436        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1437        where
1438            S: serde::Serializer,
1439        {
1440            match self {
1441                Self::Unspecified => serializer.serialize_i32(0),
1442                Self::CustomerManagedKeyIssue => serializer.serialize_i32(1),
1443                Self::UnknownValue(u) => u.0.serialize(serializer),
1444            }
1445        }
1446    }
1447
1448    impl<'de> serde::de::Deserialize<'de> for SuspensionReason {
1449        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1450        where
1451            D: serde::Deserializer<'de>,
1452        {
1453            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SuspensionReason>::new(
1454                ".google.cloud.redis.v1.Instance.SuspensionReason",
1455            ))
1456        }
1457    }
1458}
1459
1460/// Configuration of the persistence functionality.
1461#[derive(Clone, Default, PartialEq)]
1462#[non_exhaustive]
1463pub struct PersistenceConfig {
1464    /// Optional. Controls whether Persistence features are enabled.
1465    /// If not provided, the existing value will be used.
1466    pub persistence_mode: crate::model::persistence_config::PersistenceMode,
1467
1468    /// Optional. Period between RDB snapshots. Snapshots will be attempted every
1469    /// period starting from the provided snapshot start time. For example, a start
1470    /// time of 01/01/2033 06:45 and SIX_HOURS snapshot period will do nothing
1471    /// until 01/01/2033, and then trigger snapshots every day at 06:45, 12:45,
1472    /// 18:45, and 00:45 the next day, and so on. If not provided,
1473    /// TWENTY_FOUR_HOURS will be used as default.
1474    pub rdb_snapshot_period: crate::model::persistence_config::SnapshotPeriod,
1475
1476    /// Output only. The next time that a snapshot attempt is scheduled to occur.
1477    pub rdb_next_snapshot_time: std::option::Option<wkt::Timestamp>,
1478
1479    /// Optional. Date and time that the first snapshot was/will be attempted, and
1480    /// to which future snapshots will be aligned. If not provided, the current
1481    /// time will be used.
1482    pub rdb_snapshot_start_time: std::option::Option<wkt::Timestamp>,
1483
1484    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1485}
1486
1487impl PersistenceConfig {
1488    pub fn new() -> Self {
1489        std::default::Default::default()
1490    }
1491
1492    /// Sets the value of [persistence_mode][crate::model::PersistenceConfig::persistence_mode].
1493    pub fn set_persistence_mode<
1494        T: std::convert::Into<crate::model::persistence_config::PersistenceMode>,
1495    >(
1496        mut self,
1497        v: T,
1498    ) -> Self {
1499        self.persistence_mode = v.into();
1500        self
1501    }
1502
1503    /// Sets the value of [rdb_snapshot_period][crate::model::PersistenceConfig::rdb_snapshot_period].
1504    pub fn set_rdb_snapshot_period<
1505        T: std::convert::Into<crate::model::persistence_config::SnapshotPeriod>,
1506    >(
1507        mut self,
1508        v: T,
1509    ) -> Self {
1510        self.rdb_snapshot_period = v.into();
1511        self
1512    }
1513
1514    /// Sets the value of [rdb_next_snapshot_time][crate::model::PersistenceConfig::rdb_next_snapshot_time].
1515    pub fn set_rdb_next_snapshot_time<T>(mut self, v: T) -> Self
1516    where
1517        T: std::convert::Into<wkt::Timestamp>,
1518    {
1519        self.rdb_next_snapshot_time = std::option::Option::Some(v.into());
1520        self
1521    }
1522
1523    /// Sets or clears the value of [rdb_next_snapshot_time][crate::model::PersistenceConfig::rdb_next_snapshot_time].
1524    pub fn set_or_clear_rdb_next_snapshot_time<T>(mut self, v: std::option::Option<T>) -> Self
1525    where
1526        T: std::convert::Into<wkt::Timestamp>,
1527    {
1528        self.rdb_next_snapshot_time = v.map(|x| x.into());
1529        self
1530    }
1531
1532    /// Sets the value of [rdb_snapshot_start_time][crate::model::PersistenceConfig::rdb_snapshot_start_time].
1533    pub fn set_rdb_snapshot_start_time<T>(mut self, v: T) -> Self
1534    where
1535        T: std::convert::Into<wkt::Timestamp>,
1536    {
1537        self.rdb_snapshot_start_time = std::option::Option::Some(v.into());
1538        self
1539    }
1540
1541    /// Sets or clears the value of [rdb_snapshot_start_time][crate::model::PersistenceConfig::rdb_snapshot_start_time].
1542    pub fn set_or_clear_rdb_snapshot_start_time<T>(mut self, v: std::option::Option<T>) -> Self
1543    where
1544        T: std::convert::Into<wkt::Timestamp>,
1545    {
1546        self.rdb_snapshot_start_time = v.map(|x| x.into());
1547        self
1548    }
1549}
1550
1551impl wkt::message::Message for PersistenceConfig {
1552    fn typename() -> &'static str {
1553        "type.googleapis.com/google.cloud.redis.v1.PersistenceConfig"
1554    }
1555}
1556
1557/// Defines additional types related to [PersistenceConfig].
1558pub mod persistence_config {
1559    #[allow(unused_imports)]
1560    use super::*;
1561
1562    /// Available Persistence modes.
1563    ///
1564    /// # Working with unknown values
1565    ///
1566    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1567    /// additional enum variants at any time. Adding new variants is not considered
1568    /// a breaking change. Applications should write their code in anticipation of:
1569    ///
1570    /// - New values appearing in future releases of the client library, **and**
1571    /// - New values received dynamically, without application changes.
1572    ///
1573    /// Please consult the [Working with enums] section in the user guide for some
1574    /// guidelines.
1575    ///
1576    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1577    #[derive(Clone, Debug, PartialEq)]
1578    #[non_exhaustive]
1579    pub enum PersistenceMode {
1580        /// Not set.
1581        Unspecified,
1582        /// Persistence is disabled for the instance,
1583        /// and any existing snapshots are deleted.
1584        Disabled,
1585        /// RDB based Persistence is enabled.
1586        Rdb,
1587        /// If set, the enum was initialized with an unknown value.
1588        ///
1589        /// Applications can examine the value using [PersistenceMode::value] or
1590        /// [PersistenceMode::name].
1591        UnknownValue(persistence_mode::UnknownValue),
1592    }
1593
1594    #[doc(hidden)]
1595    pub mod persistence_mode {
1596        #[allow(unused_imports)]
1597        use super::*;
1598        #[derive(Clone, Debug, PartialEq)]
1599        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1600    }
1601
1602    impl PersistenceMode {
1603        /// Gets the enum value.
1604        ///
1605        /// Returns `None` if the enum contains an unknown value deserialized from
1606        /// the string representation of enums.
1607        pub fn value(&self) -> std::option::Option<i32> {
1608            match self {
1609                Self::Unspecified => std::option::Option::Some(0),
1610                Self::Disabled => std::option::Option::Some(1),
1611                Self::Rdb => std::option::Option::Some(2),
1612                Self::UnknownValue(u) => u.0.value(),
1613            }
1614        }
1615
1616        /// Gets the enum value as a string.
1617        ///
1618        /// Returns `None` if the enum contains an unknown value deserialized from
1619        /// the integer representation of enums.
1620        pub fn name(&self) -> std::option::Option<&str> {
1621            match self {
1622                Self::Unspecified => std::option::Option::Some("PERSISTENCE_MODE_UNSPECIFIED"),
1623                Self::Disabled => std::option::Option::Some("DISABLED"),
1624                Self::Rdb => std::option::Option::Some("RDB"),
1625                Self::UnknownValue(u) => u.0.name(),
1626            }
1627        }
1628    }
1629
1630    impl std::default::Default for PersistenceMode {
1631        fn default() -> Self {
1632            use std::convert::From;
1633            Self::from(0)
1634        }
1635    }
1636
1637    impl std::fmt::Display for PersistenceMode {
1638        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1639            wkt::internal::display_enum(f, self.name(), self.value())
1640        }
1641    }
1642
1643    impl std::convert::From<i32> for PersistenceMode {
1644        fn from(value: i32) -> Self {
1645            match value {
1646                0 => Self::Unspecified,
1647                1 => Self::Disabled,
1648                2 => Self::Rdb,
1649                _ => Self::UnknownValue(persistence_mode::UnknownValue(
1650                    wkt::internal::UnknownEnumValue::Integer(value),
1651                )),
1652            }
1653        }
1654    }
1655
1656    impl std::convert::From<&str> for PersistenceMode {
1657        fn from(value: &str) -> Self {
1658            use std::string::ToString;
1659            match value {
1660                "PERSISTENCE_MODE_UNSPECIFIED" => Self::Unspecified,
1661                "DISABLED" => Self::Disabled,
1662                "RDB" => Self::Rdb,
1663                _ => Self::UnknownValue(persistence_mode::UnknownValue(
1664                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1665                )),
1666            }
1667        }
1668    }
1669
1670    impl serde::ser::Serialize for PersistenceMode {
1671        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1672        where
1673            S: serde::Serializer,
1674        {
1675            match self {
1676                Self::Unspecified => serializer.serialize_i32(0),
1677                Self::Disabled => serializer.serialize_i32(1),
1678                Self::Rdb => serializer.serialize_i32(2),
1679                Self::UnknownValue(u) => u.0.serialize(serializer),
1680            }
1681        }
1682    }
1683
1684    impl<'de> serde::de::Deserialize<'de> for PersistenceMode {
1685        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1686        where
1687            D: serde::Deserializer<'de>,
1688        {
1689            deserializer.deserialize_any(wkt::internal::EnumVisitor::<PersistenceMode>::new(
1690                ".google.cloud.redis.v1.PersistenceConfig.PersistenceMode",
1691            ))
1692        }
1693    }
1694
1695    /// Available snapshot periods for scheduling.
1696    ///
1697    /// # Working with unknown values
1698    ///
1699    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1700    /// additional enum variants at any time. Adding new variants is not considered
1701    /// a breaking change. Applications should write their code in anticipation of:
1702    ///
1703    /// - New values appearing in future releases of the client library, **and**
1704    /// - New values received dynamically, without application changes.
1705    ///
1706    /// Please consult the [Working with enums] section in the user guide for some
1707    /// guidelines.
1708    ///
1709    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1710    #[derive(Clone, Debug, PartialEq)]
1711    #[non_exhaustive]
1712    pub enum SnapshotPeriod {
1713        /// Not set.
1714        Unspecified,
1715        /// Snapshot every 1 hour.
1716        OneHour,
1717        /// Snapshot every 6 hours.
1718        SixHours,
1719        /// Snapshot every 12 hours.
1720        TwelveHours,
1721        /// Snapshot every 24 hours.
1722        TwentyFourHours,
1723        /// If set, the enum was initialized with an unknown value.
1724        ///
1725        /// Applications can examine the value using [SnapshotPeriod::value] or
1726        /// [SnapshotPeriod::name].
1727        UnknownValue(snapshot_period::UnknownValue),
1728    }
1729
1730    #[doc(hidden)]
1731    pub mod snapshot_period {
1732        #[allow(unused_imports)]
1733        use super::*;
1734        #[derive(Clone, Debug, PartialEq)]
1735        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1736    }
1737
1738    impl SnapshotPeriod {
1739        /// Gets the enum value.
1740        ///
1741        /// Returns `None` if the enum contains an unknown value deserialized from
1742        /// the string representation of enums.
1743        pub fn value(&self) -> std::option::Option<i32> {
1744            match self {
1745                Self::Unspecified => std::option::Option::Some(0),
1746                Self::OneHour => std::option::Option::Some(3),
1747                Self::SixHours => std::option::Option::Some(4),
1748                Self::TwelveHours => std::option::Option::Some(5),
1749                Self::TwentyFourHours => std::option::Option::Some(6),
1750                Self::UnknownValue(u) => u.0.value(),
1751            }
1752        }
1753
1754        /// Gets the enum value as a string.
1755        ///
1756        /// Returns `None` if the enum contains an unknown value deserialized from
1757        /// the integer representation of enums.
1758        pub fn name(&self) -> std::option::Option<&str> {
1759            match self {
1760                Self::Unspecified => std::option::Option::Some("SNAPSHOT_PERIOD_UNSPECIFIED"),
1761                Self::OneHour => std::option::Option::Some("ONE_HOUR"),
1762                Self::SixHours => std::option::Option::Some("SIX_HOURS"),
1763                Self::TwelveHours => std::option::Option::Some("TWELVE_HOURS"),
1764                Self::TwentyFourHours => std::option::Option::Some("TWENTY_FOUR_HOURS"),
1765                Self::UnknownValue(u) => u.0.name(),
1766            }
1767        }
1768    }
1769
1770    impl std::default::Default for SnapshotPeriod {
1771        fn default() -> Self {
1772            use std::convert::From;
1773            Self::from(0)
1774        }
1775    }
1776
1777    impl std::fmt::Display for SnapshotPeriod {
1778        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1779            wkt::internal::display_enum(f, self.name(), self.value())
1780        }
1781    }
1782
1783    impl std::convert::From<i32> for SnapshotPeriod {
1784        fn from(value: i32) -> Self {
1785            match value {
1786                0 => Self::Unspecified,
1787                3 => Self::OneHour,
1788                4 => Self::SixHours,
1789                5 => Self::TwelveHours,
1790                6 => Self::TwentyFourHours,
1791                _ => Self::UnknownValue(snapshot_period::UnknownValue(
1792                    wkt::internal::UnknownEnumValue::Integer(value),
1793                )),
1794            }
1795        }
1796    }
1797
1798    impl std::convert::From<&str> for SnapshotPeriod {
1799        fn from(value: &str) -> Self {
1800            use std::string::ToString;
1801            match value {
1802                "SNAPSHOT_PERIOD_UNSPECIFIED" => Self::Unspecified,
1803                "ONE_HOUR" => Self::OneHour,
1804                "SIX_HOURS" => Self::SixHours,
1805                "TWELVE_HOURS" => Self::TwelveHours,
1806                "TWENTY_FOUR_HOURS" => Self::TwentyFourHours,
1807                _ => Self::UnknownValue(snapshot_period::UnknownValue(
1808                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1809                )),
1810            }
1811        }
1812    }
1813
1814    impl serde::ser::Serialize for SnapshotPeriod {
1815        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1816        where
1817            S: serde::Serializer,
1818        {
1819            match self {
1820                Self::Unspecified => serializer.serialize_i32(0),
1821                Self::OneHour => serializer.serialize_i32(3),
1822                Self::SixHours => serializer.serialize_i32(4),
1823                Self::TwelveHours => serializer.serialize_i32(5),
1824                Self::TwentyFourHours => serializer.serialize_i32(6),
1825                Self::UnknownValue(u) => u.0.serialize(serializer),
1826            }
1827        }
1828    }
1829
1830    impl<'de> serde::de::Deserialize<'de> for SnapshotPeriod {
1831        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1832        where
1833            D: serde::Deserializer<'de>,
1834        {
1835            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SnapshotPeriod>::new(
1836                ".google.cloud.redis.v1.PersistenceConfig.SnapshotPeriod",
1837            ))
1838        }
1839    }
1840}
1841
1842/// Request for
1843/// [RescheduleMaintenance][google.cloud.redis.v1.CloudRedis.RescheduleMaintenance].
1844///
1845/// [google.cloud.redis.v1.CloudRedis.RescheduleMaintenance]: crate::client::CloudRedis::reschedule_maintenance
1846#[derive(Clone, Default, PartialEq)]
1847#[non_exhaustive]
1848pub struct RescheduleMaintenanceRequest {
1849    /// Required. Redis instance resource name using the form:
1850    /// `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
1851    /// where `location_id` refers to a GCP region.
1852    pub name: std::string::String,
1853
1854    /// Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as
1855    /// well.
1856    pub reschedule_type: crate::model::reschedule_maintenance_request::RescheduleType,
1857
1858    /// Optional. Timestamp when the maintenance shall be rescheduled to if
1859    /// reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for
1860    /// example `2012-11-15T16:19:00.094Z`.
1861    pub schedule_time: std::option::Option<wkt::Timestamp>,
1862
1863    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1864}
1865
1866impl RescheduleMaintenanceRequest {
1867    pub fn new() -> Self {
1868        std::default::Default::default()
1869    }
1870
1871    /// Sets the value of [name][crate::model::RescheduleMaintenanceRequest::name].
1872    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1873        self.name = v.into();
1874        self
1875    }
1876
1877    /// Sets the value of [reschedule_type][crate::model::RescheduleMaintenanceRequest::reschedule_type].
1878    pub fn set_reschedule_type<
1879        T: std::convert::Into<crate::model::reschedule_maintenance_request::RescheduleType>,
1880    >(
1881        mut self,
1882        v: T,
1883    ) -> Self {
1884        self.reschedule_type = v.into();
1885        self
1886    }
1887
1888    /// Sets the value of [schedule_time][crate::model::RescheduleMaintenanceRequest::schedule_time].
1889    pub fn set_schedule_time<T>(mut self, v: T) -> Self
1890    where
1891        T: std::convert::Into<wkt::Timestamp>,
1892    {
1893        self.schedule_time = std::option::Option::Some(v.into());
1894        self
1895    }
1896
1897    /// Sets or clears the value of [schedule_time][crate::model::RescheduleMaintenanceRequest::schedule_time].
1898    pub fn set_or_clear_schedule_time<T>(mut self, v: std::option::Option<T>) -> Self
1899    where
1900        T: std::convert::Into<wkt::Timestamp>,
1901    {
1902        self.schedule_time = v.map(|x| x.into());
1903        self
1904    }
1905}
1906
1907impl wkt::message::Message for RescheduleMaintenanceRequest {
1908    fn typename() -> &'static str {
1909        "type.googleapis.com/google.cloud.redis.v1.RescheduleMaintenanceRequest"
1910    }
1911}
1912
1913/// Defines additional types related to [RescheduleMaintenanceRequest].
1914pub mod reschedule_maintenance_request {
1915    #[allow(unused_imports)]
1916    use super::*;
1917
1918    /// Reschedule options.
1919    ///
1920    /// # Working with unknown values
1921    ///
1922    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1923    /// additional enum variants at any time. Adding new variants is not considered
1924    /// a breaking change. Applications should write their code in anticipation of:
1925    ///
1926    /// - New values appearing in future releases of the client library, **and**
1927    /// - New values received dynamically, without application changes.
1928    ///
1929    /// Please consult the [Working with enums] section in the user guide for some
1930    /// guidelines.
1931    ///
1932    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1933    #[derive(Clone, Debug, PartialEq)]
1934    #[non_exhaustive]
1935    pub enum RescheduleType {
1936        /// Not set.
1937        Unspecified,
1938        /// If the user wants to schedule the maintenance to happen now.
1939        Immediate,
1940        /// If the user wants to use the existing maintenance policy to find the
1941        /// next available window.
1942        NextAvailableWindow,
1943        /// If the user wants to reschedule the maintenance to a specific time.
1944        SpecificTime,
1945        /// If set, the enum was initialized with an unknown value.
1946        ///
1947        /// Applications can examine the value using [RescheduleType::value] or
1948        /// [RescheduleType::name].
1949        UnknownValue(reschedule_type::UnknownValue),
1950    }
1951
1952    #[doc(hidden)]
1953    pub mod reschedule_type {
1954        #[allow(unused_imports)]
1955        use super::*;
1956        #[derive(Clone, Debug, PartialEq)]
1957        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1958    }
1959
1960    impl RescheduleType {
1961        /// Gets the enum value.
1962        ///
1963        /// Returns `None` if the enum contains an unknown value deserialized from
1964        /// the string representation of enums.
1965        pub fn value(&self) -> std::option::Option<i32> {
1966            match self {
1967                Self::Unspecified => std::option::Option::Some(0),
1968                Self::Immediate => std::option::Option::Some(1),
1969                Self::NextAvailableWindow => std::option::Option::Some(2),
1970                Self::SpecificTime => std::option::Option::Some(3),
1971                Self::UnknownValue(u) => u.0.value(),
1972            }
1973        }
1974
1975        /// Gets the enum value as a string.
1976        ///
1977        /// Returns `None` if the enum contains an unknown value deserialized from
1978        /// the integer representation of enums.
1979        pub fn name(&self) -> std::option::Option<&str> {
1980            match self {
1981                Self::Unspecified => std::option::Option::Some("RESCHEDULE_TYPE_UNSPECIFIED"),
1982                Self::Immediate => std::option::Option::Some("IMMEDIATE"),
1983                Self::NextAvailableWindow => std::option::Option::Some("NEXT_AVAILABLE_WINDOW"),
1984                Self::SpecificTime => std::option::Option::Some("SPECIFIC_TIME"),
1985                Self::UnknownValue(u) => u.0.name(),
1986            }
1987        }
1988    }
1989
1990    impl std::default::Default for RescheduleType {
1991        fn default() -> Self {
1992            use std::convert::From;
1993            Self::from(0)
1994        }
1995    }
1996
1997    impl std::fmt::Display for RescheduleType {
1998        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1999            wkt::internal::display_enum(f, self.name(), self.value())
2000        }
2001    }
2002
2003    impl std::convert::From<i32> for RescheduleType {
2004        fn from(value: i32) -> Self {
2005            match value {
2006                0 => Self::Unspecified,
2007                1 => Self::Immediate,
2008                2 => Self::NextAvailableWindow,
2009                3 => Self::SpecificTime,
2010                _ => Self::UnknownValue(reschedule_type::UnknownValue(
2011                    wkt::internal::UnknownEnumValue::Integer(value),
2012                )),
2013            }
2014        }
2015    }
2016
2017    impl std::convert::From<&str> for RescheduleType {
2018        fn from(value: &str) -> Self {
2019            use std::string::ToString;
2020            match value {
2021                "RESCHEDULE_TYPE_UNSPECIFIED" => Self::Unspecified,
2022                "IMMEDIATE" => Self::Immediate,
2023                "NEXT_AVAILABLE_WINDOW" => Self::NextAvailableWindow,
2024                "SPECIFIC_TIME" => Self::SpecificTime,
2025                _ => Self::UnknownValue(reschedule_type::UnknownValue(
2026                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2027                )),
2028            }
2029        }
2030    }
2031
2032    impl serde::ser::Serialize for RescheduleType {
2033        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2034        where
2035            S: serde::Serializer,
2036        {
2037            match self {
2038                Self::Unspecified => serializer.serialize_i32(0),
2039                Self::Immediate => serializer.serialize_i32(1),
2040                Self::NextAvailableWindow => serializer.serialize_i32(2),
2041                Self::SpecificTime => serializer.serialize_i32(3),
2042                Self::UnknownValue(u) => u.0.serialize(serializer),
2043            }
2044        }
2045    }
2046
2047    impl<'de> serde::de::Deserialize<'de> for RescheduleType {
2048        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2049        where
2050            D: serde::Deserializer<'de>,
2051        {
2052            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RescheduleType>::new(
2053                ".google.cloud.redis.v1.RescheduleMaintenanceRequest.RescheduleType",
2054            ))
2055        }
2056    }
2057}
2058
2059/// Maintenance policy for an instance.
2060#[derive(Clone, Default, PartialEq)]
2061#[non_exhaustive]
2062pub struct MaintenancePolicy {
2063    /// Output only. The time when the policy was created.
2064    pub create_time: std::option::Option<wkt::Timestamp>,
2065
2066    /// Output only. The time when the policy was last updated.
2067    pub update_time: std::option::Option<wkt::Timestamp>,
2068
2069    /// Optional. Description of what this policy is for. Create/Update methods
2070    /// return INVALID_ARGUMENT if the length is greater than 512.
2071    pub description: std::string::String,
2072
2073    /// Optional. Maintenance window that is applied to resources covered by this
2074    /// policy. Minimum 1. For the current version, the maximum number of
2075    /// weekly_window is expected to be one.
2076    pub weekly_maintenance_window: std::vec::Vec<crate::model::WeeklyMaintenanceWindow>,
2077
2078    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2079}
2080
2081impl MaintenancePolicy {
2082    pub fn new() -> Self {
2083        std::default::Default::default()
2084    }
2085
2086    /// Sets the value of [create_time][crate::model::MaintenancePolicy::create_time].
2087    pub fn set_create_time<T>(mut self, v: T) -> Self
2088    where
2089        T: std::convert::Into<wkt::Timestamp>,
2090    {
2091        self.create_time = std::option::Option::Some(v.into());
2092        self
2093    }
2094
2095    /// Sets or clears the value of [create_time][crate::model::MaintenancePolicy::create_time].
2096    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2097    where
2098        T: std::convert::Into<wkt::Timestamp>,
2099    {
2100        self.create_time = v.map(|x| x.into());
2101        self
2102    }
2103
2104    /// Sets the value of [update_time][crate::model::MaintenancePolicy::update_time].
2105    pub fn set_update_time<T>(mut self, v: T) -> Self
2106    where
2107        T: std::convert::Into<wkt::Timestamp>,
2108    {
2109        self.update_time = std::option::Option::Some(v.into());
2110        self
2111    }
2112
2113    /// Sets or clears the value of [update_time][crate::model::MaintenancePolicy::update_time].
2114    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2115    where
2116        T: std::convert::Into<wkt::Timestamp>,
2117    {
2118        self.update_time = v.map(|x| x.into());
2119        self
2120    }
2121
2122    /// Sets the value of [description][crate::model::MaintenancePolicy::description].
2123    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2124        self.description = v.into();
2125        self
2126    }
2127
2128    /// Sets the value of [weekly_maintenance_window][crate::model::MaintenancePolicy::weekly_maintenance_window].
2129    pub fn set_weekly_maintenance_window<T, V>(mut self, v: T) -> Self
2130    where
2131        T: std::iter::IntoIterator<Item = V>,
2132        V: std::convert::Into<crate::model::WeeklyMaintenanceWindow>,
2133    {
2134        use std::iter::Iterator;
2135        self.weekly_maintenance_window = v.into_iter().map(|i| i.into()).collect();
2136        self
2137    }
2138}
2139
2140impl wkt::message::Message for MaintenancePolicy {
2141    fn typename() -> &'static str {
2142        "type.googleapis.com/google.cloud.redis.v1.MaintenancePolicy"
2143    }
2144}
2145
2146/// Time window in which disruptive maintenance updates occur. Non-disruptive
2147/// updates can occur inside or outside this window.
2148#[derive(Clone, Default, PartialEq)]
2149#[non_exhaustive]
2150pub struct WeeklyMaintenanceWindow {
2151    /// Required. The day of week that maintenance updates occur.
2152    pub day: gtype::model::DayOfWeek,
2153
2154    /// Required. Start time of the window in UTC time.
2155    pub start_time: std::option::Option<gtype::model::TimeOfDay>,
2156
2157    /// Output only. Duration of the maintenance window. The current window is
2158    /// fixed at 1 hour.
2159    pub duration: std::option::Option<wkt::Duration>,
2160
2161    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2162}
2163
2164impl WeeklyMaintenanceWindow {
2165    pub fn new() -> Self {
2166        std::default::Default::default()
2167    }
2168
2169    /// Sets the value of [day][crate::model::WeeklyMaintenanceWindow::day].
2170    pub fn set_day<T: std::convert::Into<gtype::model::DayOfWeek>>(mut self, v: T) -> Self {
2171        self.day = v.into();
2172        self
2173    }
2174
2175    /// Sets the value of [start_time][crate::model::WeeklyMaintenanceWindow::start_time].
2176    pub fn set_start_time<T>(mut self, v: T) -> Self
2177    where
2178        T: std::convert::Into<gtype::model::TimeOfDay>,
2179    {
2180        self.start_time = std::option::Option::Some(v.into());
2181        self
2182    }
2183
2184    /// Sets or clears the value of [start_time][crate::model::WeeklyMaintenanceWindow::start_time].
2185    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
2186    where
2187        T: std::convert::Into<gtype::model::TimeOfDay>,
2188    {
2189        self.start_time = v.map(|x| x.into());
2190        self
2191    }
2192
2193    /// Sets the value of [duration][crate::model::WeeklyMaintenanceWindow::duration].
2194    pub fn set_duration<T>(mut self, v: T) -> Self
2195    where
2196        T: std::convert::Into<wkt::Duration>,
2197    {
2198        self.duration = std::option::Option::Some(v.into());
2199        self
2200    }
2201
2202    /// Sets or clears the value of [duration][crate::model::WeeklyMaintenanceWindow::duration].
2203    pub fn set_or_clear_duration<T>(mut self, v: std::option::Option<T>) -> Self
2204    where
2205        T: std::convert::Into<wkt::Duration>,
2206    {
2207        self.duration = v.map(|x| x.into());
2208        self
2209    }
2210}
2211
2212impl wkt::message::Message for WeeklyMaintenanceWindow {
2213    fn typename() -> &'static str {
2214        "type.googleapis.com/google.cloud.redis.v1.WeeklyMaintenanceWindow"
2215    }
2216}
2217
2218/// Upcoming maintenance schedule. If no maintenance is scheduled, fields are not
2219/// populated.
2220#[derive(Clone, Default, PartialEq)]
2221#[non_exhaustive]
2222pub struct MaintenanceSchedule {
2223    /// Output only. The start time of any upcoming scheduled maintenance for this
2224    /// instance.
2225    pub start_time: std::option::Option<wkt::Timestamp>,
2226
2227    /// Output only. The end time of any upcoming scheduled maintenance for this
2228    /// instance.
2229    pub end_time: std::option::Option<wkt::Timestamp>,
2230
2231    /// If the scheduled maintenance can be rescheduled, default is true.
2232    #[deprecated]
2233    pub can_reschedule: bool,
2234
2235    /// Output only. The deadline that the maintenance schedule start time can not
2236    /// go beyond, including reschedule.
2237    pub schedule_deadline_time: std::option::Option<wkt::Timestamp>,
2238
2239    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2240}
2241
2242impl MaintenanceSchedule {
2243    pub fn new() -> Self {
2244        std::default::Default::default()
2245    }
2246
2247    /// Sets the value of [start_time][crate::model::MaintenanceSchedule::start_time].
2248    pub fn set_start_time<T>(mut self, v: T) -> Self
2249    where
2250        T: std::convert::Into<wkt::Timestamp>,
2251    {
2252        self.start_time = std::option::Option::Some(v.into());
2253        self
2254    }
2255
2256    /// Sets or clears the value of [start_time][crate::model::MaintenanceSchedule::start_time].
2257    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
2258    where
2259        T: std::convert::Into<wkt::Timestamp>,
2260    {
2261        self.start_time = v.map(|x| x.into());
2262        self
2263    }
2264
2265    /// Sets the value of [end_time][crate::model::MaintenanceSchedule::end_time].
2266    pub fn set_end_time<T>(mut self, v: T) -> Self
2267    where
2268        T: std::convert::Into<wkt::Timestamp>,
2269    {
2270        self.end_time = std::option::Option::Some(v.into());
2271        self
2272    }
2273
2274    /// Sets or clears the value of [end_time][crate::model::MaintenanceSchedule::end_time].
2275    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2276    where
2277        T: std::convert::Into<wkt::Timestamp>,
2278    {
2279        self.end_time = v.map(|x| x.into());
2280        self
2281    }
2282
2283    /// Sets the value of [can_reschedule][crate::model::MaintenanceSchedule::can_reschedule].
2284    #[deprecated]
2285    pub fn set_can_reschedule<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2286        self.can_reschedule = v.into();
2287        self
2288    }
2289
2290    /// Sets the value of [schedule_deadline_time][crate::model::MaintenanceSchedule::schedule_deadline_time].
2291    pub fn set_schedule_deadline_time<T>(mut self, v: T) -> Self
2292    where
2293        T: std::convert::Into<wkt::Timestamp>,
2294    {
2295        self.schedule_deadline_time = std::option::Option::Some(v.into());
2296        self
2297    }
2298
2299    /// Sets or clears the value of [schedule_deadline_time][crate::model::MaintenanceSchedule::schedule_deadline_time].
2300    pub fn set_or_clear_schedule_deadline_time<T>(mut self, v: std::option::Option<T>) -> Self
2301    where
2302        T: std::convert::Into<wkt::Timestamp>,
2303    {
2304        self.schedule_deadline_time = v.map(|x| x.into());
2305        self
2306    }
2307}
2308
2309impl wkt::message::Message for MaintenanceSchedule {
2310    fn typename() -> &'static str {
2311        "type.googleapis.com/google.cloud.redis.v1.MaintenanceSchedule"
2312    }
2313}
2314
2315/// Request for [ListInstances][google.cloud.redis.v1.CloudRedis.ListInstances].
2316///
2317/// [google.cloud.redis.v1.CloudRedis.ListInstances]: crate::client::CloudRedis::list_instances
2318#[derive(Clone, Default, PartialEq)]
2319#[non_exhaustive]
2320pub struct ListInstancesRequest {
2321    /// Required. The resource name of the instance location using the form:
2322    /// `projects/{project_id}/locations/{location_id}`
2323    /// where `location_id` refers to a GCP region.
2324    pub parent: std::string::String,
2325
2326    /// The maximum number of items to return.
2327    ///
2328    /// If not specified, a default value of 1000 will be used by the service.
2329    /// Regardless of the page_size value, the response may include a partial list
2330    /// and a caller should only rely on response's
2331    /// [`next_page_token`][google.cloud.redis.v1.ListInstancesResponse.next_page_token]
2332    /// to determine if there are more instances left to be queried.
2333    ///
2334    /// [google.cloud.redis.v1.ListInstancesResponse.next_page_token]: crate::model::ListInstancesResponse::next_page_token
2335    pub page_size: i32,
2336
2337    /// The `next_page_token` value returned from a previous
2338    /// [ListInstances][google.cloud.redis.v1.CloudRedis.ListInstances] request, if
2339    /// any.
2340    ///
2341    /// [google.cloud.redis.v1.CloudRedis.ListInstances]: crate::client::CloudRedis::list_instances
2342    pub page_token: std::string::String,
2343
2344    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2345}
2346
2347impl ListInstancesRequest {
2348    pub fn new() -> Self {
2349        std::default::Default::default()
2350    }
2351
2352    /// Sets the value of [parent][crate::model::ListInstancesRequest::parent].
2353    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2354        self.parent = v.into();
2355        self
2356    }
2357
2358    /// Sets the value of [page_size][crate::model::ListInstancesRequest::page_size].
2359    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2360        self.page_size = v.into();
2361        self
2362    }
2363
2364    /// Sets the value of [page_token][crate::model::ListInstancesRequest::page_token].
2365    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2366        self.page_token = v.into();
2367        self
2368    }
2369}
2370
2371impl wkt::message::Message for ListInstancesRequest {
2372    fn typename() -> &'static str {
2373        "type.googleapis.com/google.cloud.redis.v1.ListInstancesRequest"
2374    }
2375}
2376
2377/// Response for [ListInstances][google.cloud.redis.v1.CloudRedis.ListInstances].
2378///
2379/// [google.cloud.redis.v1.CloudRedis.ListInstances]: crate::client::CloudRedis::list_instances
2380#[derive(Clone, Default, PartialEq)]
2381#[non_exhaustive]
2382pub struct ListInstancesResponse {
2383    /// A list of Redis instances in the project in the specified location,
2384    /// or across all locations.
2385    ///
2386    /// If the `location_id` in the parent field of the request is "-", all regions
2387    /// available to the project are queried, and the results aggregated.
2388    /// If in such an aggregated query a location is unavailable, a placeholder
2389    /// Redis entry is included in the response with the `name` field set to a
2390    /// value of the form
2391    /// `projects/{project_id}/locations/{location_id}/instances/`- and the
2392    /// `status` field set to ERROR and `status_message` field set to "location not
2393    /// available for ListInstances".
2394    pub instances: std::vec::Vec<crate::model::Instance>,
2395
2396    /// Token to retrieve the next page of results, or empty if there are no more
2397    /// results in the list.
2398    pub next_page_token: std::string::String,
2399
2400    /// Locations that could not be reached.
2401    pub unreachable: std::vec::Vec<std::string::String>,
2402
2403    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2404}
2405
2406impl ListInstancesResponse {
2407    pub fn new() -> Self {
2408        std::default::Default::default()
2409    }
2410
2411    /// Sets the value of [instances][crate::model::ListInstancesResponse::instances].
2412    pub fn set_instances<T, V>(mut self, v: T) -> Self
2413    where
2414        T: std::iter::IntoIterator<Item = V>,
2415        V: std::convert::Into<crate::model::Instance>,
2416    {
2417        use std::iter::Iterator;
2418        self.instances = v.into_iter().map(|i| i.into()).collect();
2419        self
2420    }
2421
2422    /// Sets the value of [next_page_token][crate::model::ListInstancesResponse::next_page_token].
2423    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2424        self.next_page_token = v.into();
2425        self
2426    }
2427
2428    /// Sets the value of [unreachable][crate::model::ListInstancesResponse::unreachable].
2429    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2430    where
2431        T: std::iter::IntoIterator<Item = V>,
2432        V: std::convert::Into<std::string::String>,
2433    {
2434        use std::iter::Iterator;
2435        self.unreachable = v.into_iter().map(|i| i.into()).collect();
2436        self
2437    }
2438}
2439
2440impl wkt::message::Message for ListInstancesResponse {
2441    fn typename() -> &'static str {
2442        "type.googleapis.com/google.cloud.redis.v1.ListInstancesResponse"
2443    }
2444}
2445
2446#[doc(hidden)]
2447impl gax::paginator::internal::PageableResponse for ListInstancesResponse {
2448    type PageItem = crate::model::Instance;
2449
2450    fn items(self) -> std::vec::Vec<Self::PageItem> {
2451        self.instances
2452    }
2453
2454    fn next_page_token(&self) -> std::string::String {
2455        use std::clone::Clone;
2456        self.next_page_token.clone()
2457    }
2458}
2459
2460/// Request for [GetInstance][google.cloud.redis.v1.CloudRedis.GetInstance].
2461///
2462/// [google.cloud.redis.v1.CloudRedis.GetInstance]: crate::client::CloudRedis::get_instance
2463#[derive(Clone, Default, PartialEq)]
2464#[non_exhaustive]
2465pub struct GetInstanceRequest {
2466    /// Required. Redis instance resource name using the form:
2467    /// `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
2468    /// where `location_id` refers to a GCP region.
2469    pub name: std::string::String,
2470
2471    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2472}
2473
2474impl GetInstanceRequest {
2475    pub fn new() -> Self {
2476        std::default::Default::default()
2477    }
2478
2479    /// Sets the value of [name][crate::model::GetInstanceRequest::name].
2480    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2481        self.name = v.into();
2482        self
2483    }
2484}
2485
2486impl wkt::message::Message for GetInstanceRequest {
2487    fn typename() -> &'static str {
2488        "type.googleapis.com/google.cloud.redis.v1.GetInstanceRequest"
2489    }
2490}
2491
2492/// Request for
2493/// [GetInstanceAuthString][google.cloud.redis.v1.CloudRedis.GetInstanceAuthString].
2494///
2495/// [google.cloud.redis.v1.CloudRedis.GetInstanceAuthString]: crate::client::CloudRedis::get_instance_auth_string
2496#[derive(Clone, Default, PartialEq)]
2497#[non_exhaustive]
2498pub struct GetInstanceAuthStringRequest {
2499    /// Required. Redis instance resource name using the form:
2500    /// `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
2501    /// where `location_id` refers to a GCP region.
2502    pub name: std::string::String,
2503
2504    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2505}
2506
2507impl GetInstanceAuthStringRequest {
2508    pub fn new() -> Self {
2509        std::default::Default::default()
2510    }
2511
2512    /// Sets the value of [name][crate::model::GetInstanceAuthStringRequest::name].
2513    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2514        self.name = v.into();
2515        self
2516    }
2517}
2518
2519impl wkt::message::Message for GetInstanceAuthStringRequest {
2520    fn typename() -> &'static str {
2521        "type.googleapis.com/google.cloud.redis.v1.GetInstanceAuthStringRequest"
2522    }
2523}
2524
2525/// Instance AUTH string details.
2526#[derive(Clone, Default, PartialEq)]
2527#[non_exhaustive]
2528pub struct InstanceAuthString {
2529    /// AUTH string set on the instance.
2530    pub auth_string: std::string::String,
2531
2532    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2533}
2534
2535impl InstanceAuthString {
2536    pub fn new() -> Self {
2537        std::default::Default::default()
2538    }
2539
2540    /// Sets the value of [auth_string][crate::model::InstanceAuthString::auth_string].
2541    pub fn set_auth_string<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2542        self.auth_string = v.into();
2543        self
2544    }
2545}
2546
2547impl wkt::message::Message for InstanceAuthString {
2548    fn typename() -> &'static str {
2549        "type.googleapis.com/google.cloud.redis.v1.InstanceAuthString"
2550    }
2551}
2552
2553/// Request for
2554/// [CreateInstance][google.cloud.redis.v1.CloudRedis.CreateInstance].
2555///
2556/// [google.cloud.redis.v1.CloudRedis.CreateInstance]: crate::client::CloudRedis::create_instance
2557#[derive(Clone, Default, PartialEq)]
2558#[non_exhaustive]
2559pub struct CreateInstanceRequest {
2560    /// Required. The resource name of the instance location using the form:
2561    /// `projects/{project_id}/locations/{location_id}`
2562    /// where `location_id` refers to a GCP region.
2563    pub parent: std::string::String,
2564
2565    /// Required. The logical name of the Redis instance in the customer project
2566    /// with the following restrictions:
2567    ///
2568    /// * Must contain only lowercase letters, numbers, and hyphens.
2569    /// * Must start with a letter.
2570    /// * Must be between 1-40 characters.
2571    /// * Must end with a number or a letter.
2572    /// * Must be unique within the customer project / location
2573    pub instance_id: std::string::String,
2574
2575    /// Required. A Redis [Instance] resource
2576    pub instance: std::option::Option<crate::model::Instance>,
2577
2578    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2579}
2580
2581impl CreateInstanceRequest {
2582    pub fn new() -> Self {
2583        std::default::Default::default()
2584    }
2585
2586    /// Sets the value of [parent][crate::model::CreateInstanceRequest::parent].
2587    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2588        self.parent = v.into();
2589        self
2590    }
2591
2592    /// Sets the value of [instance_id][crate::model::CreateInstanceRequest::instance_id].
2593    pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2594        self.instance_id = v.into();
2595        self
2596    }
2597
2598    /// Sets the value of [instance][crate::model::CreateInstanceRequest::instance].
2599    pub fn set_instance<T>(mut self, v: T) -> Self
2600    where
2601        T: std::convert::Into<crate::model::Instance>,
2602    {
2603        self.instance = std::option::Option::Some(v.into());
2604        self
2605    }
2606
2607    /// Sets or clears the value of [instance][crate::model::CreateInstanceRequest::instance].
2608    pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
2609    where
2610        T: std::convert::Into<crate::model::Instance>,
2611    {
2612        self.instance = v.map(|x| x.into());
2613        self
2614    }
2615}
2616
2617impl wkt::message::Message for CreateInstanceRequest {
2618    fn typename() -> &'static str {
2619        "type.googleapis.com/google.cloud.redis.v1.CreateInstanceRequest"
2620    }
2621}
2622
2623/// Request for
2624/// [UpdateInstance][google.cloud.redis.v1.CloudRedis.UpdateInstance].
2625///
2626/// [google.cloud.redis.v1.CloudRedis.UpdateInstance]: crate::client::CloudRedis::update_instance
2627#[derive(Clone, Default, PartialEq)]
2628#[non_exhaustive]
2629pub struct UpdateInstanceRequest {
2630    /// Required. Mask of fields to update. At least one path must be supplied in
2631    /// this field. The elements of the repeated paths field may only include these
2632    /// fields from [Instance][google.cloud.redis.v1.Instance]:
2633    ///
2634    /// * `displayName`
2635    /// * `labels`
2636    /// * `memorySizeGb`
2637    /// * `redisConfig`
2638    /// * `replica_count`
2639    ///
2640    /// [google.cloud.redis.v1.Instance]: crate::model::Instance
2641    pub update_mask: std::option::Option<wkt::FieldMask>,
2642
2643    /// Required. Update description.
2644    /// Only fields specified in update_mask are updated.
2645    pub instance: std::option::Option<crate::model::Instance>,
2646
2647    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2648}
2649
2650impl UpdateInstanceRequest {
2651    pub fn new() -> Self {
2652        std::default::Default::default()
2653    }
2654
2655    /// Sets the value of [update_mask][crate::model::UpdateInstanceRequest::update_mask].
2656    pub fn set_update_mask<T>(mut self, v: T) -> Self
2657    where
2658        T: std::convert::Into<wkt::FieldMask>,
2659    {
2660        self.update_mask = std::option::Option::Some(v.into());
2661        self
2662    }
2663
2664    /// Sets or clears the value of [update_mask][crate::model::UpdateInstanceRequest::update_mask].
2665    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2666    where
2667        T: std::convert::Into<wkt::FieldMask>,
2668    {
2669        self.update_mask = v.map(|x| x.into());
2670        self
2671    }
2672
2673    /// Sets the value of [instance][crate::model::UpdateInstanceRequest::instance].
2674    pub fn set_instance<T>(mut self, v: T) -> Self
2675    where
2676        T: std::convert::Into<crate::model::Instance>,
2677    {
2678        self.instance = std::option::Option::Some(v.into());
2679        self
2680    }
2681
2682    /// Sets or clears the value of [instance][crate::model::UpdateInstanceRequest::instance].
2683    pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
2684    where
2685        T: std::convert::Into<crate::model::Instance>,
2686    {
2687        self.instance = v.map(|x| x.into());
2688        self
2689    }
2690}
2691
2692impl wkt::message::Message for UpdateInstanceRequest {
2693    fn typename() -> &'static str {
2694        "type.googleapis.com/google.cloud.redis.v1.UpdateInstanceRequest"
2695    }
2696}
2697
2698/// Request for
2699/// [UpgradeInstance][google.cloud.redis.v1.CloudRedis.UpgradeInstance].
2700///
2701/// [google.cloud.redis.v1.CloudRedis.UpgradeInstance]: crate::client::CloudRedis::upgrade_instance
2702#[derive(Clone, Default, PartialEq)]
2703#[non_exhaustive]
2704pub struct UpgradeInstanceRequest {
2705    /// Required. Redis instance resource name using the form:
2706    /// `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
2707    /// where `location_id` refers to a GCP region.
2708    pub name: std::string::String,
2709
2710    /// Required. Specifies the target version of Redis software to upgrade to.
2711    pub redis_version: std::string::String,
2712
2713    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2714}
2715
2716impl UpgradeInstanceRequest {
2717    pub fn new() -> Self {
2718        std::default::Default::default()
2719    }
2720
2721    /// Sets the value of [name][crate::model::UpgradeInstanceRequest::name].
2722    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2723        self.name = v.into();
2724        self
2725    }
2726
2727    /// Sets the value of [redis_version][crate::model::UpgradeInstanceRequest::redis_version].
2728    pub fn set_redis_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2729        self.redis_version = v.into();
2730        self
2731    }
2732}
2733
2734impl wkt::message::Message for UpgradeInstanceRequest {
2735    fn typename() -> &'static str {
2736        "type.googleapis.com/google.cloud.redis.v1.UpgradeInstanceRequest"
2737    }
2738}
2739
2740/// Request for
2741/// [DeleteInstance][google.cloud.redis.v1.CloudRedis.DeleteInstance].
2742///
2743/// [google.cloud.redis.v1.CloudRedis.DeleteInstance]: crate::client::CloudRedis::delete_instance
2744#[derive(Clone, Default, PartialEq)]
2745#[non_exhaustive]
2746pub struct DeleteInstanceRequest {
2747    /// Required. Redis instance resource name using the form:
2748    /// `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
2749    /// where `location_id` refers to a GCP region.
2750    pub name: std::string::String,
2751
2752    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2753}
2754
2755impl DeleteInstanceRequest {
2756    pub fn new() -> Self {
2757        std::default::Default::default()
2758    }
2759
2760    /// Sets the value of [name][crate::model::DeleteInstanceRequest::name].
2761    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2762        self.name = v.into();
2763        self
2764    }
2765}
2766
2767impl wkt::message::Message for DeleteInstanceRequest {
2768    fn typename() -> &'static str {
2769        "type.googleapis.com/google.cloud.redis.v1.DeleteInstanceRequest"
2770    }
2771}
2772
2773/// The Cloud Storage location for the input content
2774#[derive(Clone, Default, PartialEq)]
2775#[non_exhaustive]
2776pub struct GcsSource {
2777    /// Required. Source data URI. (e.g. 'gs://my_bucket/my_object').
2778    pub uri: std::string::String,
2779
2780    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2781}
2782
2783impl GcsSource {
2784    pub fn new() -> Self {
2785        std::default::Default::default()
2786    }
2787
2788    /// Sets the value of [uri][crate::model::GcsSource::uri].
2789    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2790        self.uri = v.into();
2791        self
2792    }
2793}
2794
2795impl wkt::message::Message for GcsSource {
2796    fn typename() -> &'static str {
2797        "type.googleapis.com/google.cloud.redis.v1.GcsSource"
2798    }
2799}
2800
2801/// The input content
2802#[derive(Clone, Default, PartialEq)]
2803#[non_exhaustive]
2804pub struct InputConfig {
2805    /// Required. Specify source location of input data
2806    pub source: std::option::Option<crate::model::input_config::Source>,
2807
2808    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2809}
2810
2811impl InputConfig {
2812    pub fn new() -> Self {
2813        std::default::Default::default()
2814    }
2815
2816    /// Sets the value of [source][crate::model::InputConfig::source].
2817    ///
2818    /// Note that all the setters affecting `source` are mutually
2819    /// exclusive.
2820    pub fn set_source<
2821        T: std::convert::Into<std::option::Option<crate::model::input_config::Source>>,
2822    >(
2823        mut self,
2824        v: T,
2825    ) -> Self {
2826        self.source = v.into();
2827        self
2828    }
2829
2830    /// The value of [source][crate::model::InputConfig::source]
2831    /// if it holds a `GcsSource`, `None` if the field is not set or
2832    /// holds a different branch.
2833    pub fn gcs_source(&self) -> std::option::Option<&std::boxed::Box<crate::model::GcsSource>> {
2834        #[allow(unreachable_patterns)]
2835        self.source.as_ref().and_then(|v| match v {
2836            crate::model::input_config::Source::GcsSource(v) => std::option::Option::Some(v),
2837            _ => std::option::Option::None,
2838        })
2839    }
2840
2841    /// Sets the value of [source][crate::model::InputConfig::source]
2842    /// to hold a `GcsSource`.
2843    ///
2844    /// Note that all the setters affecting `source` are
2845    /// mutually exclusive.
2846    pub fn set_gcs_source<T: std::convert::Into<std::boxed::Box<crate::model::GcsSource>>>(
2847        mut self,
2848        v: T,
2849    ) -> Self {
2850        self.source =
2851            std::option::Option::Some(crate::model::input_config::Source::GcsSource(v.into()));
2852        self
2853    }
2854}
2855
2856impl wkt::message::Message for InputConfig {
2857    fn typename() -> &'static str {
2858        "type.googleapis.com/google.cloud.redis.v1.InputConfig"
2859    }
2860}
2861
2862/// Defines additional types related to [InputConfig].
2863pub mod input_config {
2864    #[allow(unused_imports)]
2865    use super::*;
2866
2867    /// Required. Specify source location of input data
2868    #[derive(Clone, Debug, PartialEq)]
2869    #[non_exhaustive]
2870    pub enum Source {
2871        /// Google Cloud Storage location where input content is located.
2872        GcsSource(std::boxed::Box<crate::model::GcsSource>),
2873    }
2874}
2875
2876/// Request for [Import][google.cloud.redis.v1.CloudRedis.ImportInstance].
2877///
2878/// [google.cloud.redis.v1.CloudRedis.ImportInstance]: crate::client::CloudRedis::import_instance
2879#[derive(Clone, Default, PartialEq)]
2880#[non_exhaustive]
2881pub struct ImportInstanceRequest {
2882    /// Required. Redis instance resource name using the form:
2883    /// `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
2884    /// where `location_id` refers to a GCP region.
2885    pub name: std::string::String,
2886
2887    /// Required. Specify data to be imported.
2888    pub input_config: std::option::Option<crate::model::InputConfig>,
2889
2890    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2891}
2892
2893impl ImportInstanceRequest {
2894    pub fn new() -> Self {
2895        std::default::Default::default()
2896    }
2897
2898    /// Sets the value of [name][crate::model::ImportInstanceRequest::name].
2899    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2900        self.name = v.into();
2901        self
2902    }
2903
2904    /// Sets the value of [input_config][crate::model::ImportInstanceRequest::input_config].
2905    pub fn set_input_config<T>(mut self, v: T) -> Self
2906    where
2907        T: std::convert::Into<crate::model::InputConfig>,
2908    {
2909        self.input_config = std::option::Option::Some(v.into());
2910        self
2911    }
2912
2913    /// Sets or clears the value of [input_config][crate::model::ImportInstanceRequest::input_config].
2914    pub fn set_or_clear_input_config<T>(mut self, v: std::option::Option<T>) -> Self
2915    where
2916        T: std::convert::Into<crate::model::InputConfig>,
2917    {
2918        self.input_config = v.map(|x| x.into());
2919        self
2920    }
2921}
2922
2923impl wkt::message::Message for ImportInstanceRequest {
2924    fn typename() -> &'static str {
2925        "type.googleapis.com/google.cloud.redis.v1.ImportInstanceRequest"
2926    }
2927}
2928
2929/// The Cloud Storage location for the output content
2930#[derive(Clone, Default, PartialEq)]
2931#[non_exhaustive]
2932pub struct GcsDestination {
2933    /// Required. Data destination URI (e.g.
2934    /// 'gs://my_bucket/my_object'). Existing files will be overwritten.
2935    pub uri: std::string::String,
2936
2937    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2938}
2939
2940impl GcsDestination {
2941    pub fn new() -> Self {
2942        std::default::Default::default()
2943    }
2944
2945    /// Sets the value of [uri][crate::model::GcsDestination::uri].
2946    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2947        self.uri = v.into();
2948        self
2949    }
2950}
2951
2952impl wkt::message::Message for GcsDestination {
2953    fn typename() -> &'static str {
2954        "type.googleapis.com/google.cloud.redis.v1.GcsDestination"
2955    }
2956}
2957
2958/// The output content
2959#[derive(Clone, Default, PartialEq)]
2960#[non_exhaustive]
2961pub struct OutputConfig {
2962    /// Required. Specify destination location of output data
2963    pub destination: std::option::Option<crate::model::output_config::Destination>,
2964
2965    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2966}
2967
2968impl OutputConfig {
2969    pub fn new() -> Self {
2970        std::default::Default::default()
2971    }
2972
2973    /// Sets the value of [destination][crate::model::OutputConfig::destination].
2974    ///
2975    /// Note that all the setters affecting `destination` are mutually
2976    /// exclusive.
2977    pub fn set_destination<
2978        T: std::convert::Into<std::option::Option<crate::model::output_config::Destination>>,
2979    >(
2980        mut self,
2981        v: T,
2982    ) -> Self {
2983        self.destination = v.into();
2984        self
2985    }
2986
2987    /// The value of [destination][crate::model::OutputConfig::destination]
2988    /// if it holds a `GcsDestination`, `None` if the field is not set or
2989    /// holds a different branch.
2990    pub fn gcs_destination(
2991        &self,
2992    ) -> std::option::Option<&std::boxed::Box<crate::model::GcsDestination>> {
2993        #[allow(unreachable_patterns)]
2994        self.destination.as_ref().and_then(|v| match v {
2995            crate::model::output_config::Destination::GcsDestination(v) => {
2996                std::option::Option::Some(v)
2997            }
2998            _ => std::option::Option::None,
2999        })
3000    }
3001
3002    /// Sets the value of [destination][crate::model::OutputConfig::destination]
3003    /// to hold a `GcsDestination`.
3004    ///
3005    /// Note that all the setters affecting `destination` are
3006    /// mutually exclusive.
3007    pub fn set_gcs_destination<
3008        T: std::convert::Into<std::boxed::Box<crate::model::GcsDestination>>,
3009    >(
3010        mut self,
3011        v: T,
3012    ) -> Self {
3013        self.destination = std::option::Option::Some(
3014            crate::model::output_config::Destination::GcsDestination(v.into()),
3015        );
3016        self
3017    }
3018}
3019
3020impl wkt::message::Message for OutputConfig {
3021    fn typename() -> &'static str {
3022        "type.googleapis.com/google.cloud.redis.v1.OutputConfig"
3023    }
3024}
3025
3026/// Defines additional types related to [OutputConfig].
3027pub mod output_config {
3028    #[allow(unused_imports)]
3029    use super::*;
3030
3031    /// Required. Specify destination location of output data
3032    #[derive(Clone, Debug, PartialEq)]
3033    #[non_exhaustive]
3034    pub enum Destination {
3035        /// Google Cloud Storage destination for output content.
3036        GcsDestination(std::boxed::Box<crate::model::GcsDestination>),
3037    }
3038}
3039
3040/// Request for [Export][google.cloud.redis.v1.CloudRedis.ExportInstance].
3041///
3042/// [google.cloud.redis.v1.CloudRedis.ExportInstance]: crate::client::CloudRedis::export_instance
3043#[derive(Clone, Default, PartialEq)]
3044#[non_exhaustive]
3045pub struct ExportInstanceRequest {
3046    /// Required. Redis instance resource name using the form:
3047    /// `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
3048    /// where `location_id` refers to a GCP region.
3049    pub name: std::string::String,
3050
3051    /// Required. Specify data to be exported.
3052    pub output_config: std::option::Option<crate::model::OutputConfig>,
3053
3054    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3055}
3056
3057impl ExportInstanceRequest {
3058    pub fn new() -> Self {
3059        std::default::Default::default()
3060    }
3061
3062    /// Sets the value of [name][crate::model::ExportInstanceRequest::name].
3063    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3064        self.name = v.into();
3065        self
3066    }
3067
3068    /// Sets the value of [output_config][crate::model::ExportInstanceRequest::output_config].
3069    pub fn set_output_config<T>(mut self, v: T) -> Self
3070    where
3071        T: std::convert::Into<crate::model::OutputConfig>,
3072    {
3073        self.output_config = std::option::Option::Some(v.into());
3074        self
3075    }
3076
3077    /// Sets or clears the value of [output_config][crate::model::ExportInstanceRequest::output_config].
3078    pub fn set_or_clear_output_config<T>(mut self, v: std::option::Option<T>) -> Self
3079    where
3080        T: std::convert::Into<crate::model::OutputConfig>,
3081    {
3082        self.output_config = v.map(|x| x.into());
3083        self
3084    }
3085}
3086
3087impl wkt::message::Message for ExportInstanceRequest {
3088    fn typename() -> &'static str {
3089        "type.googleapis.com/google.cloud.redis.v1.ExportInstanceRequest"
3090    }
3091}
3092
3093/// Request for [Failover][google.cloud.redis.v1.CloudRedis.FailoverInstance].
3094///
3095/// [google.cloud.redis.v1.CloudRedis.FailoverInstance]: crate::client::CloudRedis::failover_instance
3096#[derive(Clone, Default, PartialEq)]
3097#[non_exhaustive]
3098pub struct FailoverInstanceRequest {
3099    /// Required. Redis instance resource name using the form:
3100    /// `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
3101    /// where `location_id` refers to a GCP region.
3102    pub name: std::string::String,
3103
3104    /// Optional. Available data protection modes that the user can choose. If it's
3105    /// unspecified, data protection mode will be LIMITED_DATA_LOSS by default.
3106    pub data_protection_mode: crate::model::failover_instance_request::DataProtectionMode,
3107
3108    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3109}
3110
3111impl FailoverInstanceRequest {
3112    pub fn new() -> Self {
3113        std::default::Default::default()
3114    }
3115
3116    /// Sets the value of [name][crate::model::FailoverInstanceRequest::name].
3117    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3118        self.name = v.into();
3119        self
3120    }
3121
3122    /// Sets the value of [data_protection_mode][crate::model::FailoverInstanceRequest::data_protection_mode].
3123    pub fn set_data_protection_mode<
3124        T: std::convert::Into<crate::model::failover_instance_request::DataProtectionMode>,
3125    >(
3126        mut self,
3127        v: T,
3128    ) -> Self {
3129        self.data_protection_mode = v.into();
3130        self
3131    }
3132}
3133
3134impl wkt::message::Message for FailoverInstanceRequest {
3135    fn typename() -> &'static str {
3136        "type.googleapis.com/google.cloud.redis.v1.FailoverInstanceRequest"
3137    }
3138}
3139
3140/// Defines additional types related to [FailoverInstanceRequest].
3141pub mod failover_instance_request {
3142    #[allow(unused_imports)]
3143    use super::*;
3144
3145    /// Specifies different modes of operation in relation to the data retention.
3146    ///
3147    /// # Working with unknown values
3148    ///
3149    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3150    /// additional enum variants at any time. Adding new variants is not considered
3151    /// a breaking change. Applications should write their code in anticipation of:
3152    ///
3153    /// - New values appearing in future releases of the client library, **and**
3154    /// - New values received dynamically, without application changes.
3155    ///
3156    /// Please consult the [Working with enums] section in the user guide for some
3157    /// guidelines.
3158    ///
3159    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3160    #[derive(Clone, Debug, PartialEq)]
3161    #[non_exhaustive]
3162    pub enum DataProtectionMode {
3163        /// Defaults to LIMITED_DATA_LOSS if a data protection mode is not
3164        /// specified.
3165        Unspecified,
3166        /// Instance failover will be protected with data loss control. More
3167        /// specifically, the failover will only be performed if the current
3168        /// replication offset diff between primary and replica is under a certain
3169        /// threshold.
3170        LimitedDataLoss,
3171        /// Instance failover will be performed without data loss control.
3172        ForceDataLoss,
3173        /// If set, the enum was initialized with an unknown value.
3174        ///
3175        /// Applications can examine the value using [DataProtectionMode::value] or
3176        /// [DataProtectionMode::name].
3177        UnknownValue(data_protection_mode::UnknownValue),
3178    }
3179
3180    #[doc(hidden)]
3181    pub mod data_protection_mode {
3182        #[allow(unused_imports)]
3183        use super::*;
3184        #[derive(Clone, Debug, PartialEq)]
3185        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3186    }
3187
3188    impl DataProtectionMode {
3189        /// Gets the enum value.
3190        ///
3191        /// Returns `None` if the enum contains an unknown value deserialized from
3192        /// the string representation of enums.
3193        pub fn value(&self) -> std::option::Option<i32> {
3194            match self {
3195                Self::Unspecified => std::option::Option::Some(0),
3196                Self::LimitedDataLoss => std::option::Option::Some(1),
3197                Self::ForceDataLoss => std::option::Option::Some(2),
3198                Self::UnknownValue(u) => u.0.value(),
3199            }
3200        }
3201
3202        /// Gets the enum value as a string.
3203        ///
3204        /// Returns `None` if the enum contains an unknown value deserialized from
3205        /// the integer representation of enums.
3206        pub fn name(&self) -> std::option::Option<&str> {
3207            match self {
3208                Self::Unspecified => std::option::Option::Some("DATA_PROTECTION_MODE_UNSPECIFIED"),
3209                Self::LimitedDataLoss => std::option::Option::Some("LIMITED_DATA_LOSS"),
3210                Self::ForceDataLoss => std::option::Option::Some("FORCE_DATA_LOSS"),
3211                Self::UnknownValue(u) => u.0.name(),
3212            }
3213        }
3214    }
3215
3216    impl std::default::Default for DataProtectionMode {
3217        fn default() -> Self {
3218            use std::convert::From;
3219            Self::from(0)
3220        }
3221    }
3222
3223    impl std::fmt::Display for DataProtectionMode {
3224        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3225            wkt::internal::display_enum(f, self.name(), self.value())
3226        }
3227    }
3228
3229    impl std::convert::From<i32> for DataProtectionMode {
3230        fn from(value: i32) -> Self {
3231            match value {
3232                0 => Self::Unspecified,
3233                1 => Self::LimitedDataLoss,
3234                2 => Self::ForceDataLoss,
3235                _ => Self::UnknownValue(data_protection_mode::UnknownValue(
3236                    wkt::internal::UnknownEnumValue::Integer(value),
3237                )),
3238            }
3239        }
3240    }
3241
3242    impl std::convert::From<&str> for DataProtectionMode {
3243        fn from(value: &str) -> Self {
3244            use std::string::ToString;
3245            match value {
3246                "DATA_PROTECTION_MODE_UNSPECIFIED" => Self::Unspecified,
3247                "LIMITED_DATA_LOSS" => Self::LimitedDataLoss,
3248                "FORCE_DATA_LOSS" => Self::ForceDataLoss,
3249                _ => Self::UnknownValue(data_protection_mode::UnknownValue(
3250                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3251                )),
3252            }
3253        }
3254    }
3255
3256    impl serde::ser::Serialize for DataProtectionMode {
3257        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3258        where
3259            S: serde::Serializer,
3260        {
3261            match self {
3262                Self::Unspecified => serializer.serialize_i32(0),
3263                Self::LimitedDataLoss => serializer.serialize_i32(1),
3264                Self::ForceDataLoss => serializer.serialize_i32(2),
3265                Self::UnknownValue(u) => u.0.serialize(serializer),
3266            }
3267        }
3268    }
3269
3270    impl<'de> serde::de::Deserialize<'de> for DataProtectionMode {
3271        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3272        where
3273            D: serde::Deserializer<'de>,
3274        {
3275            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DataProtectionMode>::new(
3276                ".google.cloud.redis.v1.FailoverInstanceRequest.DataProtectionMode",
3277            ))
3278        }
3279    }
3280}
3281
3282/// Represents the v1 metadata of the long-running operation.
3283#[derive(Clone, Default, PartialEq)]
3284#[non_exhaustive]
3285pub struct OperationMetadata {
3286    /// Creation timestamp.
3287    pub create_time: std::option::Option<wkt::Timestamp>,
3288
3289    /// End timestamp.
3290    pub end_time: std::option::Option<wkt::Timestamp>,
3291
3292    /// Operation target.
3293    pub target: std::string::String,
3294
3295    /// Operation verb.
3296    pub verb: std::string::String,
3297
3298    /// Operation status details.
3299    pub status_detail: std::string::String,
3300
3301    /// Specifies if cancellation was requested for the operation.
3302    pub cancel_requested: bool,
3303
3304    /// API version.
3305    pub api_version: std::string::String,
3306
3307    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3308}
3309
3310impl OperationMetadata {
3311    pub fn new() -> Self {
3312        std::default::Default::default()
3313    }
3314
3315    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
3316    pub fn set_create_time<T>(mut self, v: T) -> Self
3317    where
3318        T: std::convert::Into<wkt::Timestamp>,
3319    {
3320        self.create_time = std::option::Option::Some(v.into());
3321        self
3322    }
3323
3324    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
3325    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3326    where
3327        T: std::convert::Into<wkt::Timestamp>,
3328    {
3329        self.create_time = v.map(|x| x.into());
3330        self
3331    }
3332
3333    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
3334    pub fn set_end_time<T>(mut self, v: T) -> Self
3335    where
3336        T: std::convert::Into<wkt::Timestamp>,
3337    {
3338        self.end_time = std::option::Option::Some(v.into());
3339        self
3340    }
3341
3342    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
3343    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
3344    where
3345        T: std::convert::Into<wkt::Timestamp>,
3346    {
3347        self.end_time = v.map(|x| x.into());
3348        self
3349    }
3350
3351    /// Sets the value of [target][crate::model::OperationMetadata::target].
3352    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3353        self.target = v.into();
3354        self
3355    }
3356
3357    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
3358    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3359        self.verb = v.into();
3360        self
3361    }
3362
3363    /// Sets the value of [status_detail][crate::model::OperationMetadata::status_detail].
3364    pub fn set_status_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3365        self.status_detail = v.into();
3366        self
3367    }
3368
3369    /// Sets the value of [cancel_requested][crate::model::OperationMetadata::cancel_requested].
3370    pub fn set_cancel_requested<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3371        self.cancel_requested = v.into();
3372        self
3373    }
3374
3375    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
3376    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3377        self.api_version = v.into();
3378        self
3379    }
3380}
3381
3382impl wkt::message::Message for OperationMetadata {
3383    fn typename() -> &'static str {
3384        "type.googleapis.com/google.cloud.redis.v1.OperationMetadata"
3385    }
3386}
3387
3388/// This location metadata represents additional configuration options for a
3389/// given location where a Redis instance may be created. All fields are output
3390/// only. It is returned as content of the
3391/// `google.cloud.location.Location.metadata` field.
3392#[derive(Clone, Default, PartialEq)]
3393#[non_exhaustive]
3394pub struct LocationMetadata {
3395    /// Output only. The set of available zones in the location. The map is keyed
3396    /// by the lowercase ID of each zone, as defined by GCE. These keys can be
3397    /// specified in `location_id` or `alternative_location_id` fields when
3398    /// creating a Redis instance.
3399    pub available_zones: std::collections::HashMap<std::string::String, crate::model::ZoneMetadata>,
3400
3401    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3402}
3403
3404impl LocationMetadata {
3405    pub fn new() -> Self {
3406        std::default::Default::default()
3407    }
3408
3409    /// Sets the value of [available_zones][crate::model::LocationMetadata::available_zones].
3410    pub fn set_available_zones<T, K, V>(mut self, v: T) -> Self
3411    where
3412        T: std::iter::IntoIterator<Item = (K, V)>,
3413        K: std::convert::Into<std::string::String>,
3414        V: std::convert::Into<crate::model::ZoneMetadata>,
3415    {
3416        use std::iter::Iterator;
3417        self.available_zones = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3418        self
3419    }
3420}
3421
3422impl wkt::message::Message for LocationMetadata {
3423    fn typename() -> &'static str {
3424        "type.googleapis.com/google.cloud.redis.v1.LocationMetadata"
3425    }
3426}
3427
3428/// Defines specific information for a particular zone. Currently empty and
3429/// reserved for future use only.
3430#[derive(Clone, Default, PartialEq)]
3431#[non_exhaustive]
3432pub struct ZoneMetadata {
3433    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3434}
3435
3436impl ZoneMetadata {
3437    pub fn new() -> Self {
3438        std::default::Default::default()
3439    }
3440}
3441
3442impl wkt::message::Message for ZoneMetadata {
3443    fn typename() -> &'static str {
3444        "type.googleapis.com/google.cloud.redis.v1.ZoneMetadata"
3445    }
3446}
3447
3448/// TlsCertificate Resource
3449#[derive(Clone, Default, PartialEq)]
3450#[non_exhaustive]
3451pub struct TlsCertificate {
3452    /// Serial number, as extracted from the certificate.
3453    pub serial_number: std::string::String,
3454
3455    /// PEM representation.
3456    pub cert: std::string::String,
3457
3458    /// Output only. The time when the certificate was created in [RFC
3459    /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
3460    /// `2020-05-18T00:00:00.094Z`.
3461    pub create_time: std::option::Option<wkt::Timestamp>,
3462
3463    /// Output only. The time when the certificate expires in [RFC
3464    /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
3465    /// `2020-05-18T00:00:00.094Z`.
3466    pub expire_time: std::option::Option<wkt::Timestamp>,
3467
3468    /// Sha1 Fingerprint of the certificate.
3469    pub sha1_fingerprint: std::string::String,
3470
3471    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3472}
3473
3474impl TlsCertificate {
3475    pub fn new() -> Self {
3476        std::default::Default::default()
3477    }
3478
3479    /// Sets the value of [serial_number][crate::model::TlsCertificate::serial_number].
3480    pub fn set_serial_number<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3481        self.serial_number = v.into();
3482        self
3483    }
3484
3485    /// Sets the value of [cert][crate::model::TlsCertificate::cert].
3486    pub fn set_cert<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3487        self.cert = v.into();
3488        self
3489    }
3490
3491    /// Sets the value of [create_time][crate::model::TlsCertificate::create_time].
3492    pub fn set_create_time<T>(mut self, v: T) -> Self
3493    where
3494        T: std::convert::Into<wkt::Timestamp>,
3495    {
3496        self.create_time = std::option::Option::Some(v.into());
3497        self
3498    }
3499
3500    /// Sets or clears the value of [create_time][crate::model::TlsCertificate::create_time].
3501    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3502    where
3503        T: std::convert::Into<wkt::Timestamp>,
3504    {
3505        self.create_time = v.map(|x| x.into());
3506        self
3507    }
3508
3509    /// Sets the value of [expire_time][crate::model::TlsCertificate::expire_time].
3510    pub fn set_expire_time<T>(mut self, v: T) -> Self
3511    where
3512        T: std::convert::Into<wkt::Timestamp>,
3513    {
3514        self.expire_time = std::option::Option::Some(v.into());
3515        self
3516    }
3517
3518    /// Sets or clears the value of [expire_time][crate::model::TlsCertificate::expire_time].
3519    pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
3520    where
3521        T: std::convert::Into<wkt::Timestamp>,
3522    {
3523        self.expire_time = v.map(|x| x.into());
3524        self
3525    }
3526
3527    /// Sets the value of [sha1_fingerprint][crate::model::TlsCertificate::sha1_fingerprint].
3528    pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
3529        mut self,
3530        v: T,
3531    ) -> Self {
3532        self.sha1_fingerprint = v.into();
3533        self
3534    }
3535}
3536
3537impl wkt::message::Message for TlsCertificate {
3538    fn typename() -> &'static str {
3539        "type.googleapis.com/google.cloud.redis.v1.TlsCertificate"
3540    }
3541}