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
// This file is @generated by prost-build.
/// A Memorystore for Memcached instance
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Instance {
    /// Required. Unique name of the resource in this scope including project and
    /// location using the form:
    ///      `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
    ///
    /// Note: Memcached instances are managed and addressed at the regional level
    /// so `location_id` here refers to a Google Cloud region; however, users may
    /// choose which zones Memcached nodes should be provisioned in within an
    /// instance. Refer to [zones][google.cloud.memcache.v1beta2.Instance.zones] field for more details.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// User provided name for the instance, which is only used for display
    /// purposes. Cannot be more than 80 characters.
    #[prost(string, tag = "2")]
    pub display_name: ::prost::alloc::string::String,
    /// Resource labels to represent user-provided metadata.
    /// Refer to cloud documentation on labels for more details.
    /// <https://cloud.google.com/compute/docs/labeling-resources>
    #[prost(btree_map = "string, string", tag = "3")]
    pub labels: ::prost::alloc::collections::BTreeMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    /// The full name of the Google Compute Engine
    /// [network](<https://cloud.google.com/vpc/docs/vpc>) to which the
    /// instance is connected. If left unspecified, the `default` network
    /// will be used.
    #[prost(string, tag = "4")]
    pub authorized_network: ::prost::alloc::string::String,
    /// Zones in which Memcached nodes should be provisioned.
    /// Memcached nodes will be equally distributed across these zones. If not
    /// provided, the service will by default create nodes in all zones in the
    /// region for the instance.
    #[prost(string, repeated, tag = "5")]
    pub zones: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Required. Number of nodes in the Memcached instance.
    #[prost(int32, tag = "6")]
    pub node_count: i32,
    /// Required. Configuration for Memcached nodes.
    #[prost(message, optional, tag = "7")]
    pub node_config: ::core::option::Option<instance::NodeConfig>,
    /// The major version of Memcached software.
    /// If not provided, latest supported version will be used. Currently the
    /// latest supported major version is `MEMCACHE_1_5`.
    /// The minor version will be automatically determined by our system based on
    /// the latest supported minor version.
    #[prost(enumeration = "MemcacheVersion", tag = "9")]
    pub memcache_version: i32,
    /// User defined parameters to apply to the memcached process
    /// on each node.
    #[prost(message, optional, tag = "11")]
    pub parameters: ::core::option::Option<MemcacheParameters>,
    /// Output only. List of Memcached nodes.
    /// Refer to [Node][google.cloud.memcache.v1beta2.Instance.Node] message for more details.
    #[prost(message, repeated, tag = "12")]
    pub memcache_nodes: ::prost::alloc::vec::Vec<instance::Node>,
    /// Output only. The time the instance was created.
    #[prost(message, optional, tag = "13")]
    pub create_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Output only. The time the instance was updated.
    #[prost(message, optional, tag = "14")]
    pub update_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Output only. The state of this Memcached instance.
    #[prost(enumeration = "instance::State", tag = "15")]
    pub state: i32,
    /// Output only. The full version of memcached server running on this instance.
    /// System automatically determines the full memcached version for an instance
    /// based on the input MemcacheVersion.
    /// The full version format will be "memcached-1.5.16".
    #[prost(string, tag = "18")]
    pub memcache_full_version: ::prost::alloc::string::String,
    /// List of messages that describe the current state of the Memcached instance.
    #[prost(message, repeated, tag = "19")]
    pub instance_messages: ::prost::alloc::vec::Vec<instance::InstanceMessage>,
    /// Output only. Endpoint for the Discovery API.
    #[prost(string, tag = "20")]
    pub discovery_endpoint: ::prost::alloc::string::String,
    /// Output only. Returns true if there is an update waiting to be applied
    #[prost(bool, tag = "21")]
    pub update_available: bool,
    /// The maintenance policy for the instance. If not provided,
    /// the maintenance event will be performed based on Memorystore
    /// internal rollout schedule.
    #[prost(message, optional, tag = "22")]
    pub maintenance_policy: ::core::option::Option<MaintenancePolicy>,
    /// Output only. Published maintenance schedule.
    #[prost(message, optional, tag = "23")]
    pub maintenance_schedule: ::core::option::Option<MaintenanceSchedule>,
}
/// Nested message and enum types in `Instance`.
pub mod instance {
    /// Configuration for a Memcached Node.
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct NodeConfig {
        /// Required. Number of cpus per Memcached node.
        #[prost(int32, tag = "1")]
        pub cpu_count: i32,
        /// Required. Memory size in MiB for each Memcached node.
        #[prost(int32, tag = "2")]
        pub memory_size_mb: i32,
    }
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct Node {
        /// Output only. Identifier of the Memcached node. The node id does not
        /// include project or location like the Memcached instance name.
        #[prost(string, tag = "1")]
        pub node_id: ::prost::alloc::string::String,
        /// Output only. Location (GCP Zone) for the Memcached node.
        #[prost(string, tag = "2")]
        pub zone: ::prost::alloc::string::String,
        /// Output only. Current state of the Memcached node.
        #[prost(enumeration = "node::State", tag = "3")]
        pub state: i32,
        /// Output only. Hostname or IP address of the Memcached node used by the
        /// clients to connect to the Memcached server on this node.
        #[prost(string, tag = "4")]
        pub host: ::prost::alloc::string::String,
        /// Output only. The port number of the Memcached server on this node.
        #[prost(int32, tag = "5")]
        pub port: i32,
        /// User defined parameters currently applied to the node.
        #[prost(message, optional, tag = "6")]
        pub parameters: ::core::option::Option<super::MemcacheParameters>,
        /// Output only. Returns true if there is an update waiting to be applied
        #[prost(bool, tag = "7")]
        pub update_available: bool,
    }
    /// Nested message and enum types in `Node`.
    pub mod node {
        /// Different states of a Memcached node.
        #[derive(
            Clone,
            Copy,
            Debug,
            PartialEq,
            Eq,
            Hash,
            PartialOrd,
            Ord,
            ::prost::Enumeration
        )]
        #[repr(i32)]
        pub enum State {
            /// Node state is not set.
            Unspecified = 0,
            /// Node is being created.
            Creating = 1,
            /// Node has been created and ready to be used.
            Ready = 2,
            /// Node is being deleted.
            Deleting = 3,
            /// Node is being updated.
            Updating = 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::Ready => "READY",
                    State::Deleting => "DELETING",
                    State::Updating => "UPDATING",
                }
            }
            /// 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),
                    "READY" => Some(Self::Ready),
                    "DELETING" => Some(Self::Deleting),
                    "UPDATING" => Some(Self::Updating),
                    _ => None,
                }
            }
        }
    }
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct InstanceMessage {
        /// A code that correspond to one type of user-facing message.
        #[prost(enumeration = "instance_message::Code", tag = "1")]
        pub code: i32,
        /// Message on memcached instance which will be exposed to users.
        #[prost(string, tag = "2")]
        pub message: ::prost::alloc::string::String,
    }
    /// Nested message and enum types in `InstanceMessage`.
    pub mod instance_message {
        #[derive(
            Clone,
            Copy,
            Debug,
            PartialEq,
            Eq,
            Hash,
            PartialOrd,
            Ord,
            ::prost::Enumeration
        )]
        #[repr(i32)]
        pub enum Code {
            /// Message Code not set.
            Unspecified = 0,
            /// Memcached nodes are distributed unevenly.
            ZoneDistributionUnbalanced = 1,
        }
        impl Code {
            /// 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 {
                    Code::Unspecified => "CODE_UNSPECIFIED",
                    Code::ZoneDistributionUnbalanced => "ZONE_DISTRIBUTION_UNBALANCED",
                }
            }
            /// Creates an enum from field names used in the ProtoBuf definition.
            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
                match value {
                    "CODE_UNSPECIFIED" => Some(Self::Unspecified),
                    "ZONE_DISTRIBUTION_UNBALANCED" => {
                        Some(Self::ZoneDistributionUnbalanced)
                    }
                    _ => None,
                }
            }
        }
    }
    /// Different states of a Memcached instance.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum State {
        /// State not set.
        Unspecified = 0,
        /// Memcached instance is being created.
        Creating = 1,
        /// Memcached instance has been created and ready to be used.
        Ready = 2,
        /// Memcached instance is updating configuration such as maintenance policy
        /// and schedule.
        Updating = 3,
        /// Memcached instance is being deleted.
        Deleting = 4,
        /// Memcached instance is going through maintenance, e.g. data plane rollout.
        PerformingMaintenance = 5,
    }
    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::Ready => "READY",
                State::Updating => "UPDATING",
                State::Deleting => "DELETING",
                State::PerformingMaintenance => "PERFORMING_MAINTENANCE",
            }
        }
        /// 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),
                "READY" => Some(Self::Ready),
                "UPDATING" => Some(Self::Updating),
                "DELETING" => Some(Self::Deleting),
                "PERFORMING_MAINTENANCE" => Some(Self::PerformingMaintenance),
                _ => None,
            }
        }
    }
}
/// Maintenance policy per instance.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MaintenancePolicy {
    /// Output only. The time when the policy was created.
    #[prost(message, optional, tag = "1")]
    pub create_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Output only. The time when the policy was updated.
    #[prost(message, optional, tag = "2")]
    pub update_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Description of what this policy is for. Create/Update methods
    /// return INVALID_ARGUMENT if the length is greater than 512.
    #[prost(string, tag = "3")]
    pub description: ::prost::alloc::string::String,
    /// Required. Maintenance window that is applied to resources covered by this
    /// policy. Minimum 1. For the current version, the maximum number of
    /// weekly_maintenance_windows is expected to be one.
    #[prost(message, repeated, tag = "4")]
    pub weekly_maintenance_window: ::prost::alloc::vec::Vec<WeeklyMaintenanceWindow>,
}
/// Time window specified for weekly operations.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WeeklyMaintenanceWindow {
    /// Required. Allows to define schedule that runs specified day of the week.
    #[prost(enumeration = "super::super::super::r#type::DayOfWeek", tag = "1")]
    pub day: i32,
    /// Required. Start time of the window in UTC.
    #[prost(message, optional, tag = "2")]
    pub start_time: ::core::option::Option<super::super::super::r#type::TimeOfDay>,
    /// Required. Duration of the time window.
    #[prost(message, optional, tag = "3")]
    pub duration: ::core::option::Option<::prost_types::Duration>,
}
/// Upcoming maintenance schedule.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MaintenanceSchedule {
    /// Output only. The start time of any upcoming scheduled maintenance for this instance.
    #[prost(message, optional, tag = "1")]
    pub start_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Output only. The end time of any upcoming scheduled maintenance for this instance.
    #[prost(message, optional, tag = "2")]
    pub end_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Output only. The deadline that the maintenance schedule start time can not go beyond,
    /// including reschedule.
    #[prost(message, optional, tag = "4")]
    pub schedule_deadline_time: ::core::option::Option<::prost_types::Timestamp>,
}
/// Request for [ListInstances][google.cloud.memcache.v1beta2.CloudMemcache.ListInstances].
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListInstancesRequest {
    /// Required. The resource name of the instance 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.memcache.v1beta2.ListInstancesResponse.next_page_token]
    /// to determine if there are more instances left to be queried.
    #[prost(int32, tag = "2")]
    pub page_size: i32,
    /// The `next_page_token` value returned from a previous List request, if any.
    #[prost(string, tag = "3")]
    pub page_token: ::prost::alloc::string::String,
    /// List filter. For example, exclude all Memcached instances with name as
    /// my-instance by specifying `"name != my-instance"`.
    #[prost(string, tag = "4")]
    pub filter: ::prost::alloc::string::String,
    /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
    #[prost(string, tag = "5")]
    pub order_by: ::prost::alloc::string::String,
}
/// Response for [ListInstances][google.cloud.memcache.v1beta2.CloudMemcache.ListInstances].
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListInstancesResponse {
    /// A list of Memcached instances 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.
    #[prost(message, repeated, tag = "1")]
    pub resources: ::prost::alloc::vec::Vec<Instance>,
    /// 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 [GetInstance][google.cloud.memcache.v1beta2.CloudMemcache.GetInstance].
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetInstanceRequest {
    /// Required. Memcached instance resource name in the format:
    ///      `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
    /// where `location_id` refers to a GCP region
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Request for [CreateInstance][google.cloud.memcache.v1beta2.CloudMemcache.CreateInstance].
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateInstanceRequest {
    /// Required. The resource name of the instance 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 Memcached instance in the user
    /// project with the following restrictions:
    ///
    /// * Must contain only lowercase letters, numbers, and hyphens.
    /// * Must start with a letter.
    /// * Must be between 1-40 characters.
    /// * Must end with a number or a letter.
    /// * Must be unique within the user project / location.
    ///
    /// If any of the above are not met, the API raises an invalid argument error.
    #[prost(string, tag = "2")]
    pub instance_id: ::prost::alloc::string::String,
    /// Required. A Memcached \[Instance\] resource
    #[prost(message, optional, tag = "3")]
    pub resource: ::core::option::Option<Instance>,
}
/// Request for [UpdateInstance][google.cloud.memcache.v1beta2.CloudMemcache.UpdateInstance].
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateInstanceRequest {
    /// Required. Mask of fields to update.
    ///
    ///   *  `displayName`
    #[prost(message, optional, tag = "1")]
    pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
    /// Required. A Memcached \[Instance\] resource.
    /// Only fields specified in update_mask are updated.
    #[prost(message, optional, tag = "2")]
    pub resource: ::core::option::Option<Instance>,
}
/// Request for [DeleteInstance][google.cloud.memcache.v1beta2.CloudMemcache.DeleteInstance].
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteInstanceRequest {
    /// Required. Memcached instance resource name in the format:
    ///      `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
    /// where `location_id` refers to a GCP region
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Request for [RescheduleMaintenance][google.cloud.memcache.v1beta2.CloudMemcache.RescheduleMaintenance].
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RescheduleMaintenanceRequest {
    /// Required. Memcache instance resource name using the form:
    ///      `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
    /// where `location_id` refers to a GCP region.
    #[prost(string, tag = "1")]
    pub instance: ::prost::alloc::string::String,
    /// Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as well.
    #[prost(enumeration = "reschedule_maintenance_request::RescheduleType", tag = "2")]
    pub reschedule_type: i32,
    /// Timestamp when the maintenance shall be rescheduled to if
    /// reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for
    /// example `2012-11-15T16:19:00.094Z`.
    #[prost(message, optional, tag = "3")]
    pub schedule_time: ::core::option::Option<::prost_types::Timestamp>,
}
/// Nested message and enum types in `RescheduleMaintenanceRequest`.
pub mod reschedule_maintenance_request {
    /// Reschedule options.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum RescheduleType {
        /// Not set.
        Unspecified = 0,
        /// If the user wants to schedule the maintenance to happen now.
        Immediate = 1,
        /// If the user wants to use the existing maintenance policy to find the
        /// next available window.
        NextAvailableWindow = 2,
        /// If the user wants to reschedule the maintenance to a specific time.
        SpecificTime = 3,
    }
    impl RescheduleType {
        /// 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 {
                RescheduleType::Unspecified => "RESCHEDULE_TYPE_UNSPECIFIED",
                RescheduleType::Immediate => "IMMEDIATE",
                RescheduleType::NextAvailableWindow => "NEXT_AVAILABLE_WINDOW",
                RescheduleType::SpecificTime => "SPECIFIC_TIME",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "RESCHEDULE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
                "IMMEDIATE" => Some(Self::Immediate),
                "NEXT_AVAILABLE_WINDOW" => Some(Self::NextAvailableWindow),
                "SPECIFIC_TIME" => Some(Self::SpecificTime),
                _ => None,
            }
        }
    }
}
/// Request for [ApplyParameters][google.cloud.memcache.v1beta2.CloudMemcache.ApplyParameters].
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ApplyParametersRequest {
    /// Required. Resource name of the Memcached instance for which parameter group updates
    /// should be applied.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Nodes to which the instance-level parameter group is applied.
    #[prost(string, repeated, tag = "2")]
    pub node_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Whether to apply instance-level parameter group to all nodes. If set to
    /// true, users are restricted from specifying individual nodes, and
    /// `ApplyParameters` updates all nodes within the instance.
    #[prost(bool, tag = "3")]
    pub apply_all: bool,
}
/// Request for [UpdateParameters][google.cloud.memcache.v1beta2.CloudMemcache.UpdateParameters].
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateParametersRequest {
    /// Required. Resource name of the Memcached instance for which the parameters should be
    /// updated.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Required. Mask of fields to update.
    #[prost(message, optional, tag = "2")]
    pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
    /// The parameters to apply to the instance.
    #[prost(message, optional, tag = "3")]
    pub parameters: ::core::option::Option<MemcacheParameters>,
}
/// Request for [ApplySoftwareUpdate][google.cloud.memcache.v1beta2.CloudMemcache.ApplySoftwareUpdate].
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ApplySoftwareUpdateRequest {
    /// Required. Resource name of the Memcached instance for which software update should be
    /// applied.
    #[prost(string, tag = "1")]
    pub instance: ::prost::alloc::string::String,
    /// Nodes to which we should apply the update to. Note all the selected nodes
    /// are updated in parallel.
    #[prost(string, repeated, tag = "2")]
    pub node_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Whether to apply the update to all nodes. If set to
    /// true, will explicitly restrict users from specifying any nodes, and apply
    /// software update to all nodes (where applicable) within the instance.
    #[prost(bool, tag = "3")]
    pub apply_all: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MemcacheParameters {
    /// Output only. The unique ID associated with this set of parameters. Users
    /// can use this id to determine if the parameters associated with the instance
    /// differ from the parameters associated with the nodes. A discrepancy between
    /// parameter ids can inform users that they may need to take action to apply
    /// parameters on nodes.
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    /// User defined set of parameters to use in the memcached process.
    #[prost(btree_map = "string, string", tag = "3")]
    pub params: ::prost::alloc::collections::BTreeMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
}
/// Represents the metadata of a long-running operation.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OperationMetadata {
    /// Output only. Time when the operation was created.
    #[prost(message, optional, tag = "1")]
    pub create_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Output only. Time when 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_detail: ::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 cancel_requested: bool,
    /// Output only. API version used to start the operation.
    #[prost(string, tag = "7")]
    pub api_version: ::prost::alloc::string::String,
}
/// Metadata for the given [google.cloud.location.Location][google.cloud.location.Location].
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LocationMetadata {
    /// Output only. The set of available zones in the location. The map is keyed
    /// by the lowercase ID of each zone, as defined by GCE. These keys can be
    /// specified in the `zones` field when creating a Memcached instance.
    #[prost(btree_map = "string, message", tag = "1")]
    pub available_zones: ::prost::alloc::collections::BTreeMap<
        ::prost::alloc::string::String,
        ZoneMetadata,
    >,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ZoneMetadata {}
/// Memcached versions supported by our service.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum MemcacheVersion {
    Unspecified = 0,
    /// Memcached 1.5 version.
    Memcache15 = 1,
}
impl MemcacheVersion {
    /// 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 {
            MemcacheVersion::Unspecified => "MEMCACHE_VERSION_UNSPECIFIED",
            MemcacheVersion::Memcache15 => "MEMCACHE_1_5",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "MEMCACHE_VERSION_UNSPECIFIED" => Some(Self::Unspecified),
            "MEMCACHE_1_5" => Some(Self::Memcache15),
            _ => None,
        }
    }
}
/// Generated client implementations.
pub mod cloud_memcache_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 Memcached instances.
    ///
    ///
    /// The `memcache.googleapis.com` service implements the Google Cloud Memorystore
    /// for Memcached API and defines the following resource model for managing
    /// Memorystore Memcached (also called Memcached below) instances:
    /// * 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 Memcached instances, named:
    /// `/instances/*`
    /// * As such, Memcached instances are resources of the form:
    ///   `/projects/{project_id}/locations/{location_id}/instances/{instance_id}`
    ///
    /// Note that location_id must be a GCP `region`; for example:
    /// * `projects/my-memcached-project/locations/us-central1/instances/my-memcached`
    #[derive(Debug, Clone)]
    pub struct CloudMemcacheClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl<T> CloudMemcacheClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::BoxBody>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + 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,
        ) -> CloudMemcacheClient<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> + Send + Sync,
        {
            CloudMemcacheClient::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 Instances in a given location.
        pub async fn list_instances(
            &mut self,
            request: impl tonic::IntoRequest<super::ListInstancesRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListInstancesResponse>,
            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.memcache.v1beta2.CloudMemcache/ListInstances",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.memcache.v1beta2.CloudMemcache",
                        "ListInstances",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Gets details of a single Instance.
        pub async fn get_instance(
            &mut self,
            request: impl tonic::IntoRequest<super::GetInstanceRequest>,
        ) -> std::result::Result<tonic::Response<super::Instance>, 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.memcache.v1beta2.CloudMemcache/GetInstance",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.memcache.v1beta2.CloudMemcache",
                        "GetInstance",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Creates a new Instance in a given location.
        pub async fn create_instance(
            &mut self,
            request: impl tonic::IntoRequest<super::CreateInstanceRequest>,
        ) -> std::result::Result<
            tonic::Response<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.memcache.v1beta2.CloudMemcache/CreateInstance",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.memcache.v1beta2.CloudMemcache",
                        "CreateInstance",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Updates an existing Instance in a given project and location.
        pub async fn update_instance(
            &mut self,
            request: impl tonic::IntoRequest<super::UpdateInstanceRequest>,
        ) -> std::result::Result<
            tonic::Response<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.memcache.v1beta2.CloudMemcache/UpdateInstance",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.memcache.v1beta2.CloudMemcache",
                        "UpdateInstance",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Updates the defined Memcached parameters for an existing instance.
        /// This method only stages the parameters, it must be followed by
        /// `ApplyParameters` to apply the parameters to nodes of the Memcached
        /// instance.
        pub async fn update_parameters(
            &mut self,
            request: impl tonic::IntoRequest<super::UpdateParametersRequest>,
        ) -> std::result::Result<
            tonic::Response<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.memcache.v1beta2.CloudMemcache/UpdateParameters",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.memcache.v1beta2.CloudMemcache",
                        "UpdateParameters",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Deletes a single Instance.
        pub async fn delete_instance(
            &mut self,
            request: impl tonic::IntoRequest<super::DeleteInstanceRequest>,
        ) -> std::result::Result<
            tonic::Response<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.memcache.v1beta2.CloudMemcache/DeleteInstance",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.memcache.v1beta2.CloudMemcache",
                        "DeleteInstance",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// `ApplyParameters` restarts the set of specified nodes in order to update
        /// them to the current set of parameters for the Memcached Instance.
        pub async fn apply_parameters(
            &mut self,
            request: impl tonic::IntoRequest<super::ApplyParametersRequest>,
        ) -> std::result::Result<
            tonic::Response<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.memcache.v1beta2.CloudMemcache/ApplyParameters",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.memcache.v1beta2.CloudMemcache",
                        "ApplyParameters",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Updates software on the selected nodes of the Instance.
        pub async fn apply_software_update(
            &mut self,
            request: impl tonic::IntoRequest<super::ApplySoftwareUpdateRequest>,
        ) -> std::result::Result<
            tonic::Response<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.memcache.v1beta2.CloudMemcache/ApplySoftwareUpdate",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.memcache.v1beta2.CloudMemcache",
                        "ApplySoftwareUpdate",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Performs the apply phase of the RescheduleMaintenance verb.
        pub async fn reschedule_maintenance(
            &mut self,
            request: impl tonic::IntoRequest<super::RescheduleMaintenanceRequest>,
        ) -> std::result::Result<
            tonic::Response<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.memcache.v1beta2.CloudMemcache/RescheduleMaintenance",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.memcache.v1beta2.CloudMemcache",
                        "RescheduleMaintenance",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}