1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
// This file is @generated by prost-build.
/// Request for [CreateCluster][CloudRedis.CreateCluster].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateClusterRequest {
    /// Required. The resource name of the cluster location using the form:
    ///      `projects/{project_id}/locations/{location_id}`
    /// where `location_id` refers to a GCP region.
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Required. The logical name of the Redis cluster in the customer project
    /// with the following restrictions:
    ///
    /// * Must contain only lowercase letters, numbers, and hyphens.
    /// * Must start with a letter.
    /// * Must be between 1-63 characters.
    /// * Must end with a number or a letter.
    /// * Must be unique within the customer project / location
    #[prost(string, tag = "2")]
    pub cluster_id: ::prost::alloc::string::String,
    /// Required. The cluster that is to be created.
    #[prost(message, optional, tag = "3")]
    pub cluster: ::core::option::Option<Cluster>,
    /// Idempotent request UUID.
    #[prost(string, tag = "4")]
    pub request_id: ::prost::alloc::string::String,
}
/// Request for [ListClusters][CloudRedis.ListClusters].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListClustersRequest {
    /// Required. The resource name of the cluster location using the form:
    ///      `projects/{project_id}/locations/{location_id}`
    /// where `location_id` refers to a GCP region.
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// The maximum number of items to return.
    ///
    /// If not specified, a default value of 1000 will be used by the service.
    /// Regardless of the page_size value, the response may include a partial list
    /// and a caller should only rely on response's
    /// [`next_page_token`][google.cloud.redis.cluster.v1.ListClustersResponse.next_page_token]
    /// to determine if there are more clusters left to be queried.
    #[prost(int32, tag = "2")]
    pub page_size: i32,
    /// The `next_page_token` value returned from a previous
    /// [ListClusters][CloudRedis.ListClusters] request, if any.
    #[prost(string, tag = "3")]
    pub page_token: ::prost::alloc::string::String,
}
/// Response for [ListClusters][CloudRedis.ListClusters].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListClustersResponse {
    /// A list of Redis clusters in the project in the specified location,
    /// or across all locations.
    ///
    /// If the `location_id` in the parent field of the request is "-", all regions
    /// available to the project are queried, and the results aggregated.
    /// If in such an aggregated query a location is unavailable, a placeholder
    /// Redis entry is included in the response with the `name` field set to a
    /// value of the form
    /// `projects/{project_id}/locations/{location_id}/clusters/`- and the
    /// `status` field set to ERROR and `status_message` field set to "location not
    /// available for ListClusters".
    #[prost(message, repeated, tag = "1")]
    pub clusters: ::prost::alloc::vec::Vec<Cluster>,
    /// Token to retrieve the next page of results, or empty if there are no more
    /// results in the list.
    #[prost(string, tag = "2")]
    pub next_page_token: ::prost::alloc::string::String,
    /// Locations that could not be reached.
    #[prost(string, repeated, tag = "3")]
    pub unreachable: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Request for [UpdateCluster][CloudRedis.UpdateCluster].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateClusterRequest {
    /// Required. Mask of fields to update. At least one path must be supplied in
    /// this field. The elements of the repeated paths field may only include these
    /// fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]:
    ///
    ///   *   `size_gb`
    ///   *   `replica_count`
    #[prost(message, optional, tag = "1")]
    pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
    /// Required. Update description.
    /// Only fields specified in update_mask are updated.
    #[prost(message, optional, tag = "2")]
    pub cluster: ::core::option::Option<Cluster>,
    /// Idempotent request UUID.
    #[prost(string, tag = "3")]
    pub request_id: ::prost::alloc::string::String,
}
/// Request for [GetCluster][CloudRedis.GetCluster].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetClusterRequest {
    /// Required. Redis cluster resource name using the form:
    ///      `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
    /// where `location_id` refers to a GCP region.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Request for [DeleteCluster][CloudRedis.DeleteCluster].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteClusterRequest {
    /// Required. Redis cluster resource name using the form:
    ///      `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
    /// where `location_id` refers to a GCP region.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Idempotent request UUID.
    #[prost(string, tag = "2")]
    pub request_id: ::prost::alloc::string::String,
}
/// Request for
/// [GetClusterCertificateAuthorityRequest][CloudRedis.GetClusterCertificateAuthorityRequest].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetClusterCertificateAuthorityRequest {
    /// Required. Redis cluster certificate authority resource name using the form:
    ///      `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority`
    /// where `location_id` refers to a GCP region.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// A cluster instance.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Cluster {
    /// Required. Unique name of the resource in this scope including project and
    /// location using the form:
    ///      `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Output only. The timestamp associated with the cluster creation request.
    #[prost(message, optional, tag = "3")]
    pub create_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Output only. The current state of this cluster.
    /// Can be CREATING, READY, UPDATING, DELETING and SUSPENDED
    #[prost(enumeration = "cluster::State", tag = "4")]
    pub state: i32,
    /// Output only. System assigned, unique identifier for the cluster.
    #[prost(string, tag = "5")]
    pub uid: ::prost::alloc::string::String,
    /// Optional. The number of replica nodes per shard.
    #[prost(int32, optional, tag = "8")]
    pub replica_count: ::core::option::Option<i32>,
    /// Optional. The authorization mode of the Redis cluster.
    /// If not provided, auth feature is disabled for the cluster.
    #[prost(enumeration = "AuthorizationMode", tag = "11")]
    pub authorization_mode: i32,
    /// Optional. The in-transit encryption for the Redis cluster.
    /// If not provided, encryption  is disabled for the cluster.
    #[prost(enumeration = "TransitEncryptionMode", tag = "12")]
    pub transit_encryption_mode: i32,
    /// Output only. Redis memory size in GB for the entire cluster rounded up to
    /// the next integer.
    #[prost(int32, optional, tag = "13")]
    pub size_gb: ::core::option::Option<i32>,
    /// Required. Number of shards for the Redis cluster.
    #[prost(int32, optional, tag = "14")]
    pub shard_count: ::core::option::Option<i32>,
    /// Required. Each PscConfig configures the consumer network where IPs will
    /// be designated to the cluster for client access through Private Service
    /// Connect Automation. Currently, only one PscConfig is supported.
    #[prost(message, repeated, tag = "15")]
    pub psc_configs: ::prost::alloc::vec::Vec<PscConfig>,
    /// Output only. Endpoints created on each given network, for Redis clients to
    /// connect to the cluster. Currently only one discovery endpoint is supported.
    #[prost(message, repeated, tag = "16")]
    pub discovery_endpoints: ::prost::alloc::vec::Vec<DiscoveryEndpoint>,
    /// Output only. PSC connections for discovery of the cluster topology and
    /// accessing the cluster.
    #[prost(message, repeated, tag = "17")]
    pub psc_connections: ::prost::alloc::vec::Vec<PscConnection>,
    /// Output only. Additional information about the current state of the cluster.
    #[prost(message, optional, tag = "18")]
    pub state_info: ::core::option::Option<cluster::StateInfo>,
    /// Optional. The type of a redis node in the cluster. NodeType determines the
    /// underlying machine-type of a redis node.
    #[prost(enumeration = "NodeType", tag = "19")]
    pub node_type: i32,
    /// Optional. Persistence config (RDB, AOF) for the cluster.
    #[prost(message, optional, tag = "20")]
    pub persistence_config: ::core::option::Option<ClusterPersistenceConfig>,
    /// Optional. Key/Value pairs of customer overrides for mutable Redis Configs
    #[prost(btree_map = "string, string", tag = "21")]
    pub redis_configs: ::prost::alloc::collections::BTreeMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    /// Output only. Precise value of redis memory size in GB for the entire
    /// cluster.
    #[prost(double, optional, tag = "22")]
    pub precise_size_gb: ::core::option::Option<f64>,
    /// Optional. This config will be used to determine how the customer wants us
    /// to distribute cluster resources within the region.
    #[prost(message, optional, tag = "23")]
    pub zone_distribution_config: ::core::option::Option<ZoneDistributionConfig>,
    /// Optional. The delete operation will fail when the value is set to true.
    #[prost(bool, optional, tag = "25")]
    pub deletion_protection_enabled: ::core::option::Option<bool>,
}
/// Nested message and enum types in `Cluster`.
pub mod cluster {
    /// Represents additional information about the state of the cluster.
    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
    pub struct StateInfo {
        #[prost(oneof = "state_info::Info", tags = "1")]
        pub info: ::core::option::Option<state_info::Info>,
    }
    /// Nested message and enum types in `StateInfo`.
    pub mod state_info {
        /// Represents information about an updating cluster.
        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
        pub struct UpdateInfo {
            /// Target number of shards for redis cluster
            #[prost(int32, optional, tag = "1")]
            pub target_shard_count: ::core::option::Option<i32>,
            /// Target number of replica nodes per shard.
            #[prost(int32, optional, tag = "2")]
            pub target_replica_count: ::core::option::Option<i32>,
        }
        #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
        pub enum Info {
            /// Describes ongoing update on the cluster when cluster state is UPDATING.
            #[prost(message, tag = "1")]
            UpdateInfo(UpdateInfo),
        }
    }
    /// Represents the different states of a Redis cluster.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum State {
        /// Not set.
        Unspecified = 0,
        /// Redis cluster is being created.
        Creating = 1,
        /// Redis cluster has been created and is fully usable.
        Active = 2,
        /// Redis cluster configuration is being updated.
        Updating = 3,
        /// Redis cluster is being deleted.
        Deleting = 4,
    }
    impl State {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                State::Unspecified => "STATE_UNSPECIFIED",
                State::Creating => "CREATING",
                State::Active => "ACTIVE",
                State::Updating => "UPDATING",
                State::Deleting => "DELETING",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "STATE_UNSPECIFIED" => Some(Self::Unspecified),
                "CREATING" => Some(Self::Creating),
                "ACTIVE" => Some(Self::Active),
                "UPDATING" => Some(Self::Updating),
                "DELETING" => Some(Self::Deleting),
                _ => None,
            }
        }
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PscConfig {
    /// Required. The network where the IP address of the discovery endpoint will
    /// be reserved, in the form of
    /// projects/{network_project}/global/networks/{network_id}.
    #[prost(string, tag = "2")]
    pub network: ::prost::alloc::string::String,
}
/// Endpoints on each network, for Redis clients to connect to the cluster.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DiscoveryEndpoint {
    /// Output only. Address of the exposed Redis endpoint used by clients to
    /// connect to the service. The address could be either IP or hostname.
    #[prost(string, tag = "1")]
    pub address: ::prost::alloc::string::String,
    /// Output only. The port number of the exposed Redis endpoint.
    #[prost(int32, tag = "2")]
    pub port: i32,
    /// Output only. Customer configuration for where the endpoint is created and
    /// accessed from.
    #[prost(message, optional, tag = "3")]
    pub psc_config: ::core::option::Option<PscConfig>,
}
/// Details of consumer resources in a PSC connection.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PscConnection {
    /// Output only. The PSC connection id of the forwarding rule connected to the
    /// service attachment.
    #[prost(string, tag = "1")]
    pub psc_connection_id: ::prost::alloc::string::String,
    /// Output only. The IP allocated on the consumer network for the PSC
    /// forwarding rule.
    #[prost(string, tag = "2")]
    pub address: ::prost::alloc::string::String,
    /// Output only. The URI of the consumer side forwarding rule.
    /// Example:
    /// projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}.
    #[prost(string, tag = "3")]
    pub forwarding_rule: ::prost::alloc::string::String,
    /// Output only. The consumer project_id where the forwarding rule is created
    /// from.
    #[prost(string, tag = "4")]
    pub project_id: ::prost::alloc::string::String,
    /// The consumer network where the IP address resides, in the form of
    /// projects/{project_id}/global/networks/{network_id}.
    #[prost(string, tag = "5")]
    pub network: ::prost::alloc::string::String,
}
/// Pre-defined metadata fields.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OperationMetadata {
    /// Output only. The time the operation was created.
    #[prost(message, optional, tag = "1")]
    pub create_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Output only. The time the operation finished running.
    #[prost(message, optional, tag = "2")]
    pub end_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Output only. Server-defined resource path for the target of the operation.
    #[prost(string, tag = "3")]
    pub target: ::prost::alloc::string::String,
    /// Output only. Name of the verb executed by the operation.
    #[prost(string, tag = "4")]
    pub verb: ::prost::alloc::string::String,
    /// Output only. Human-readable status of the operation, if any.
    #[prost(string, tag = "5")]
    pub status_message: ::prost::alloc::string::String,
    /// Output only. Identifies whether the user has requested cancellation
    /// of the operation. Operations that have successfully been cancelled
    /// have [Operation.error][] value with a
    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
    /// `Code.CANCELLED`.
    #[prost(bool, tag = "6")]
    pub requested_cancellation: bool,
    /// Output only. API version used to start the operation.
    #[prost(string, tag = "7")]
    pub api_version: ::prost::alloc::string::String,
}
/// Redis cluster certificate authority
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CertificateAuthority {
    /// Identifier. Unique name of the resource in this scope including project,
    /// location and cluster using the form:
    ///      `projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority`
    #[prost(string, tag = "2")]
    pub name: ::prost::alloc::string::String,
    /// server ca information
    #[prost(oneof = "certificate_authority::ServerCa", tags = "1")]
    pub server_ca: ::core::option::Option<certificate_authority::ServerCa>,
}
/// Nested message and enum types in `CertificateAuthority`.
pub mod certificate_authority {
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct ManagedCertificateAuthority {
        /// The PEM encoded CA certificate chains for redis managed
        /// server authentication
        #[prost(message, repeated, tag = "1")]
        pub ca_certs: ::prost::alloc::vec::Vec<managed_certificate_authority::CertChain>,
    }
    /// Nested message and enum types in `ManagedCertificateAuthority`.
    pub mod managed_certificate_authority {
        #[derive(Clone, PartialEq, ::prost::Message)]
        pub struct CertChain {
            /// The certificates that form the CA chain, from leaf to root order.
            #[prost(string, repeated, tag = "1")]
            pub certificates: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
        }
    }
    /// server ca information
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum ServerCa {
        #[prost(message, tag = "1")]
        ManagedServerCa(ManagedCertificateAuthority),
    }
}
/// Configuration of the persistence functionality.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ClusterPersistenceConfig {
    /// Optional. The mode of persistence.
    #[prost(enumeration = "cluster_persistence_config::PersistenceMode", tag = "1")]
    pub mode: i32,
    /// Optional. RDB configuration. This field will be ignored if mode is not RDB.
    #[prost(message, optional, tag = "2")]
    pub rdb_config: ::core::option::Option<cluster_persistence_config::RdbConfig>,
    /// Optional. AOF configuration. This field will be ignored if mode is not AOF.
    #[prost(message, optional, tag = "3")]
    pub aof_config: ::core::option::Option<cluster_persistence_config::AofConfig>,
}
/// Nested message and enum types in `ClusterPersistenceConfig`.
pub mod cluster_persistence_config {
    /// Configuration of the RDB based persistence.
    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
    pub struct RdbConfig {
        /// Optional. Period between RDB snapshots.
        #[prost(enumeration = "rdb_config::SnapshotPeriod", tag = "1")]
        pub rdb_snapshot_period: i32,
        /// Optional. The time that the first snapshot was/will be attempted, and to
        /// which future snapshots will be aligned. If not provided, the current time
        /// will be used.
        #[prost(message, optional, tag = "2")]
        pub rdb_snapshot_start_time: ::core::option::Option<::prost_types::Timestamp>,
    }
    /// Nested message and enum types in `RDBConfig`.
    pub mod rdb_config {
        /// Available snapshot periods.
        #[derive(
            Clone,
            Copy,
            Debug,
            PartialEq,
            Eq,
            Hash,
            PartialOrd,
            Ord,
            ::prost::Enumeration
        )]
        #[repr(i32)]
        pub enum SnapshotPeriod {
            /// Not set.
            Unspecified = 0,
            /// One hour.
            OneHour = 1,
            /// Six hours.
            SixHours = 2,
            /// Twelve hours.
            TwelveHours = 3,
            /// Twenty four hours.
            TwentyFourHours = 4,
        }
        impl SnapshotPeriod {
            /// String value of the enum field names used in the ProtoBuf definition.
            ///
            /// The values are not transformed in any way and thus are considered stable
            /// (if the ProtoBuf definition does not change) and safe for programmatic use.
            pub fn as_str_name(&self) -> &'static str {
                match self {
                    SnapshotPeriod::Unspecified => "SNAPSHOT_PERIOD_UNSPECIFIED",
                    SnapshotPeriod::OneHour => "ONE_HOUR",
                    SnapshotPeriod::SixHours => "SIX_HOURS",
                    SnapshotPeriod::TwelveHours => "TWELVE_HOURS",
                    SnapshotPeriod::TwentyFourHours => "TWENTY_FOUR_HOURS",
                }
            }
            /// Creates an enum from field names used in the ProtoBuf definition.
            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
                match value {
                    "SNAPSHOT_PERIOD_UNSPECIFIED" => Some(Self::Unspecified),
                    "ONE_HOUR" => Some(Self::OneHour),
                    "SIX_HOURS" => Some(Self::SixHours),
                    "TWELVE_HOURS" => Some(Self::TwelveHours),
                    "TWENTY_FOUR_HOURS" => Some(Self::TwentyFourHours),
                    _ => None,
                }
            }
        }
    }
    /// Configuration of the AOF based persistence.
    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
    pub struct AofConfig {
        /// Optional. fsync configuration.
        #[prost(enumeration = "aof_config::AppendFsync", tag = "1")]
        pub append_fsync: i32,
    }
    /// Nested message and enum types in `AOFConfig`.
    pub mod aof_config {
        /// Available fsync modes.
        #[derive(
            Clone,
            Copy,
            Debug,
            PartialEq,
            Eq,
            Hash,
            PartialOrd,
            Ord,
            ::prost::Enumeration
        )]
        #[repr(i32)]
        pub enum AppendFsync {
            /// Not set. Default: EVERYSEC
            Unspecified = 0,
            /// Never fsync. Normally Linux will flush data every 30 seconds with this
            /// configuration, but it's up to the kernel's exact tuning.
            No = 1,
            /// fsync every second. Fast enough, and you may lose 1 second of data if
            /// there is a disaster
            Everysec = 2,
            /// fsync every time new commands are appended to the AOF. It has the best
            /// data loss protection at the cost of performance
            Always = 3,
        }
        impl AppendFsync {
            /// String value of the enum field names used in the ProtoBuf definition.
            ///
            /// The values are not transformed in any way and thus are considered stable
            /// (if the ProtoBuf definition does not change) and safe for programmatic use.
            pub fn as_str_name(&self) -> &'static str {
                match self {
                    AppendFsync::Unspecified => "APPEND_FSYNC_UNSPECIFIED",
                    AppendFsync::No => "NO",
                    AppendFsync::Everysec => "EVERYSEC",
                    AppendFsync::Always => "ALWAYS",
                }
            }
            /// Creates an enum from field names used in the ProtoBuf definition.
            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
                match value {
                    "APPEND_FSYNC_UNSPECIFIED" => Some(Self::Unspecified),
                    "NO" => Some(Self::No),
                    "EVERYSEC" => Some(Self::Everysec),
                    "ALWAYS" => Some(Self::Always),
                    _ => None,
                }
            }
        }
    }
    /// Available persistence modes.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum PersistenceMode {
        /// Not set.
        Unspecified = 0,
        /// Persistence is disabled, and any snapshot data is deleted.
        Disabled = 1,
        /// RDB based persistence is enabled.
        Rdb = 2,
        /// AOF based persistence is enabled.
        Aof = 3,
    }
    impl PersistenceMode {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                PersistenceMode::Unspecified => "PERSISTENCE_MODE_UNSPECIFIED",
                PersistenceMode::Disabled => "DISABLED",
                PersistenceMode::Rdb => "RDB",
                PersistenceMode::Aof => "AOF",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "PERSISTENCE_MODE_UNSPECIFIED" => Some(Self::Unspecified),
                "DISABLED" => Some(Self::Disabled),
                "RDB" => Some(Self::Rdb),
                "AOF" => Some(Self::Aof),
                _ => None,
            }
        }
    }
}
/// Zone distribution config for allocation of cluster resources.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ZoneDistributionConfig {
    /// Optional. The mode of zone distribution. Defaults to MULTI_ZONE, when not
    /// specified.
    #[prost(enumeration = "zone_distribution_config::ZoneDistributionMode", tag = "1")]
    pub mode: i32,
    /// Optional. When SINGLE ZONE distribution is selected, zone field would be
    /// used to allocate all resources in that zone. This is not applicable to
    /// MULTI_ZONE, and would be ignored for MULTI_ZONE clusters.
    #[prost(string, tag = "2")]
    pub zone: ::prost::alloc::string::String,
}
/// Nested message and enum types in `ZoneDistributionConfig`.
pub mod zone_distribution_config {
    /// Defines various modes of zone distribution.
    /// Currently supports two modes, can be expanded in future to support more
    /// types of distribution modes.
    /// design doc: go/same-zone-cluster
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum ZoneDistributionMode {
        /// Not Set. Default: MULTI_ZONE
        Unspecified = 0,
        /// Distribute all resources across 3 zones picked at random, within the
        /// region.
        MultiZone = 1,
        /// Distribute all resources in a single zone. The zone field must be
        /// specified, when this mode is selected.
        SingleZone = 2,
    }
    impl ZoneDistributionMode {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                ZoneDistributionMode::Unspecified => "ZONE_DISTRIBUTION_MODE_UNSPECIFIED",
                ZoneDistributionMode::MultiZone => "MULTI_ZONE",
                ZoneDistributionMode::SingleZone => "SINGLE_ZONE",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "ZONE_DISTRIBUTION_MODE_UNSPECIFIED" => Some(Self::Unspecified),
                "MULTI_ZONE" => Some(Self::MultiZone),
                "SINGLE_ZONE" => Some(Self::SingleZone),
                _ => None,
            }
        }
    }
}
/// Available authorization mode of a Redis cluster.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum AuthorizationMode {
    /// Not set.
    AuthModeUnspecified = 0,
    /// IAM basic authorization mode
    AuthModeIamAuth = 1,
    /// Authorization disabled mode
    AuthModeDisabled = 2,
}
impl AuthorizationMode {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            AuthorizationMode::AuthModeUnspecified => "AUTH_MODE_UNSPECIFIED",
            AuthorizationMode::AuthModeIamAuth => "AUTH_MODE_IAM_AUTH",
            AuthorizationMode::AuthModeDisabled => "AUTH_MODE_DISABLED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "AUTH_MODE_UNSPECIFIED" => Some(Self::AuthModeUnspecified),
            "AUTH_MODE_IAM_AUTH" => Some(Self::AuthModeIamAuth),
            "AUTH_MODE_DISABLED" => Some(Self::AuthModeDisabled),
            _ => None,
        }
    }
}
/// NodeType of a redis cluster node,
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum NodeType {
    Unspecified = 0,
    /// Redis shared core nano node_type.
    RedisSharedCoreNano = 1,
    /// Redis highmem medium node_type.
    RedisHighmemMedium = 2,
    /// Redis highmem xlarge node_type.
    RedisHighmemXlarge = 3,
    /// Redis standard small node_type.
    RedisStandardSmall = 4,
}
impl NodeType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            NodeType::Unspecified => "NODE_TYPE_UNSPECIFIED",
            NodeType::RedisSharedCoreNano => "REDIS_SHARED_CORE_NANO",
            NodeType::RedisHighmemMedium => "REDIS_HIGHMEM_MEDIUM",
            NodeType::RedisHighmemXlarge => "REDIS_HIGHMEM_XLARGE",
            NodeType::RedisStandardSmall => "REDIS_STANDARD_SMALL",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "NODE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "REDIS_SHARED_CORE_NANO" => Some(Self::RedisSharedCoreNano),
            "REDIS_HIGHMEM_MEDIUM" => Some(Self::RedisHighmemMedium),
            "REDIS_HIGHMEM_XLARGE" => Some(Self::RedisHighmemXlarge),
            "REDIS_STANDARD_SMALL" => Some(Self::RedisStandardSmall),
            _ => None,
        }
    }
}
/// Available mode of in-transit encryption.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TransitEncryptionMode {
    /// In-transit encryption not set.
    Unspecified = 0,
    /// In-transit encryption disabled.
    Disabled = 1,
    /// Use server managed encryption for in-transit encryption.
    ServerAuthentication = 2,
}
impl TransitEncryptionMode {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            TransitEncryptionMode::Unspecified => "TRANSIT_ENCRYPTION_MODE_UNSPECIFIED",
            TransitEncryptionMode::Disabled => "TRANSIT_ENCRYPTION_MODE_DISABLED",
            TransitEncryptionMode::ServerAuthentication => {
                "TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION"
            }
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "TRANSIT_ENCRYPTION_MODE_UNSPECIFIED" => Some(Self::Unspecified),
            "TRANSIT_ENCRYPTION_MODE_DISABLED" => Some(Self::Disabled),
            "TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION" => {
                Some(Self::ServerAuthentication)
            }
            _ => None,
        }
    }
}
/// Generated client implementations.
pub mod cloud_redis_cluster_client {
    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// Configures and manages Cloud Memorystore for Redis clusters
    ///
    /// Google Cloud Memorystore for Redis Cluster
    ///
    /// The `redis.googleapis.com` service implements the Google Cloud Memorystore
    /// for Redis API and defines the following resource model for managing Redis
    /// clusters:
    /// * The service works with a collection of cloud projects, named: `/projects/*`
    /// * Each project has a collection of available locations, named: `/locations/*`
    /// * Each location has a collection of Redis clusters, named: `/clusters/*`
    /// * As such, Redis clusters are resources of the form:
    ///   `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}`
    ///
    /// Note that location_id must be a GCP `region`; for example:
    /// * `projects/redpepper-1290/locations/us-central1/clusters/my-redis`
    ///
    /// We use API version selector for Flex APIs
    /// * The versioning strategy is release-based versioning
    /// * Our backend CLH only deals with the superset version (called v1main)
    /// * Existing backend for Redis Gen1 and MRR is not touched.
    /// * More details in go/redis-flex-api-versioning
    #[derive(Debug, Clone)]
    pub struct CloudRedisClusterClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl<T> CloudRedisClusterClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::BoxBody>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> CloudRedisClusterClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            CloudRedisClusterClient::new(InterceptedService::new(inner, interceptor))
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// Lists all Redis clusters owned by a project in either the specified
        /// location (region) or all locations.
        ///
        /// The location should have the following format:
        ///
        /// * `projects/{project_id}/locations/{location_id}`
        ///
        /// If `location_id` is specified as `-` (wildcard), then all regions
        /// available to the project are queried, and the results are aggregated.
        pub async fn list_clusters(
            &mut self,
            request: impl tonic::IntoRequest<super::ListClustersRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListClustersResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.redis.cluster.v1.CloudRedisCluster/ListClusters",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.redis.cluster.v1.CloudRedisCluster",
                        "ListClusters",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Gets the details of a specific Redis cluster.
        pub async fn get_cluster(
            &mut self,
            request: impl tonic::IntoRequest<super::GetClusterRequest>,
        ) -> std::result::Result<tonic::Response<super::Cluster>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.redis.cluster.v1.CloudRedisCluster/GetCluster",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.redis.cluster.v1.CloudRedisCluster",
                        "GetCluster",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Updates the metadata and configuration of a specific Redis cluster.
        ///
        /// Completed longrunning.Operation will contain the new cluster object
        /// in the response field. The returned operation is automatically deleted
        /// after a few hours, so there is no need to call DeleteOperation.
        pub async fn update_cluster(
            &mut self,
            request: impl tonic::IntoRequest<super::UpdateClusterRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::super::longrunning::Operation>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.redis.cluster.v1.CloudRedisCluster/UpdateCluster",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.redis.cluster.v1.CloudRedisCluster",
                        "UpdateCluster",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Deletes a specific Redis cluster. Cluster stops serving and data is
        /// deleted.
        pub async fn delete_cluster(
            &mut self,
            request: impl tonic::IntoRequest<super::DeleteClusterRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::super::longrunning::Operation>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.redis.cluster.v1.CloudRedisCluster/DeleteCluster",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.redis.cluster.v1.CloudRedisCluster",
                        "DeleteCluster",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Creates a Redis cluster based on the specified properties.
        /// The creation is executed asynchronously and callers may check the returned
        /// operation to track its progress. Once the operation is completed the Redis
        /// cluster will be fully functional. The completed longrunning.Operation will
        /// contain the new cluster object in the response field.
        ///
        /// The returned operation is automatically deleted after a few hours, so there
        /// is no need to call DeleteOperation.
        pub async fn create_cluster(
            &mut self,
            request: impl tonic::IntoRequest<super::CreateClusterRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::super::longrunning::Operation>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.redis.cluster.v1.CloudRedisCluster/CreateCluster",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.redis.cluster.v1.CloudRedisCluster",
                        "CreateCluster",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Gets the details of certificate authority information for Redis cluster.
        pub async fn get_cluster_certificate_authority(
            &mut self,
            request: impl tonic::IntoRequest<
                super::GetClusterCertificateAuthorityRequest,
            >,
        ) -> std::result::Result<
            tonic::Response<super::CertificateAuthority>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.redis.cluster.v1.CloudRedisCluster/GetClusterCertificateAuthority",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.redis.cluster.v1.CloudRedisCluster",
                        "GetClusterCertificateAuthority",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}