bpfman_csi/
csi.v1.rs

1/// Intentionally empty.
2#[allow(clippy::derive_partial_eq_without_eq)]
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct GetPluginInfoRequest {}
5#[allow(clippy::derive_partial_eq_without_eq)]
6#[derive(Clone, PartialEq, ::prost::Message)]
7pub struct GetPluginInfoResponse {
8    /// The name MUST follow domain name notation format
9    /// (<https://tools.ietf.org/html/rfc1035#section-2.3.1>). It SHOULD
10    /// include the plugin's host company name and the plugin name,
11    /// to minimize the possibility of collisions. It MUST be 63
12    /// characters or less, beginning and ending with an alphanumeric
13    /// character (\[a-z0-9A-Z\]) with dashes (-), dots (.), and
14    /// alphanumerics between. This field is REQUIRED.
15    #[prost(string, tag = "1")]
16    pub name: ::prost::alloc::string::String,
17    /// This field is REQUIRED. Value of this field is opaque to the CO.
18    #[prost(string, tag = "2")]
19    pub vendor_version: ::prost::alloc::string::String,
20    /// This field is OPTIONAL. Values are opaque to the CO.
21    #[prost(map = "string, string", tag = "3")]
22    pub manifest: ::std::collections::HashMap<
23        ::prost::alloc::string::String,
24        ::prost::alloc::string::String,
25    >,
26}
27/// Intentionally empty.
28#[allow(clippy::derive_partial_eq_without_eq)]
29#[derive(Clone, PartialEq, ::prost::Message)]
30pub struct GetPluginCapabilitiesRequest {}
31#[allow(clippy::derive_partial_eq_without_eq)]
32#[derive(Clone, PartialEq, ::prost::Message)]
33pub struct GetPluginCapabilitiesResponse {
34    /// All the capabilities that the controller service supports. This
35    /// field is OPTIONAL.
36    #[prost(message, repeated, tag = "1")]
37    pub capabilities: ::prost::alloc::vec::Vec<PluginCapability>,
38}
39/// Specifies a capability of the plugin.
40#[allow(clippy::derive_partial_eq_without_eq)]
41#[derive(Clone, PartialEq, ::prost::Message)]
42pub struct PluginCapability {
43    #[prost(oneof = "plugin_capability::Type", tags = "1, 2")]
44    pub r#type: ::core::option::Option<plugin_capability::Type>,
45}
46/// Nested message and enum types in `PluginCapability`.
47pub mod plugin_capability {
48    #[allow(clippy::derive_partial_eq_without_eq)]
49    #[derive(Clone, PartialEq, ::prost::Message)]
50    pub struct Service {
51        #[prost(enumeration = "service::Type", tag = "1")]
52        pub r#type: i32,
53    }
54    /// Nested message and enum types in `Service`.
55    pub mod service {
56        #[derive(
57            Clone,
58            Copy,
59            Debug,
60            PartialEq,
61            Eq,
62            Hash,
63            PartialOrd,
64            Ord,
65            ::prost::Enumeration
66        )]
67        #[repr(i32)]
68        pub enum Type {
69            Unknown = 0,
70            /// CONTROLLER_SERVICE indicates that the Plugin provides RPCs for
71            /// the ControllerService. Plugins SHOULD provide this capability.
72            /// In rare cases certain plugins MAY wish to omit the
73            /// ControllerService entirely from their implementation, but such
74            /// SHOULD NOT be the common case.
75            /// The presence of this capability determines whether the CO will
76            /// attempt to invoke the REQUIRED ControllerService RPCs, as well
77            /// as specific RPCs as indicated by ControllerGetCapabilities.
78            ControllerService = 1,
79            /// VOLUME_ACCESSIBILITY_CONSTRAINTS indicates that the volumes for
80            /// this plugin MAY NOT be equally accessible by all nodes in the
81            /// cluster. The CO MUST use the topology information returned by
82            /// CreateVolumeRequest along with the topology information
83            /// returned by NodeGetInfo to ensure that a given volume is
84            /// accessible from a given node when scheduling workloads.
85            VolumeAccessibilityConstraints = 2,
86            /// GROUP_CONTROLLER_SERVICE indicates that the Plugin provides
87            /// RPCs for operating on groups of volumes. Plugins MAY provide
88            /// this capability.
89            /// The presence of this capability determines whether the CO will
90            /// attempt to invoke the REQUIRED GroupController service RPCs, as
91            /// well as specific RPCs as indicated by
92            /// GroupControllerGetCapabilities.
93            GroupControllerService = 3,
94        }
95        impl Type {
96            /// String value of the enum field names used in the ProtoBuf definition.
97            ///
98            /// The values are not transformed in any way and thus are considered stable
99            /// (if the ProtoBuf definition does not change) and safe for programmatic use.
100            pub fn as_str_name(&self) -> &'static str {
101                match self {
102                    Type::Unknown => "UNKNOWN",
103                    Type::ControllerService => "CONTROLLER_SERVICE",
104                    Type::VolumeAccessibilityConstraints => {
105                        "VOLUME_ACCESSIBILITY_CONSTRAINTS"
106                    }
107                    Type::GroupControllerService => "GROUP_CONTROLLER_SERVICE",
108                }
109            }
110            /// Creates an enum from field names used in the ProtoBuf definition.
111            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
112                match value {
113                    "UNKNOWN" => Some(Self::Unknown),
114                    "CONTROLLER_SERVICE" => Some(Self::ControllerService),
115                    "VOLUME_ACCESSIBILITY_CONSTRAINTS" => {
116                        Some(Self::VolumeAccessibilityConstraints)
117                    }
118                    "GROUP_CONTROLLER_SERVICE" => Some(Self::GroupControllerService),
119                    _ => None,
120                }
121            }
122        }
123    }
124    #[allow(clippy::derive_partial_eq_without_eq)]
125    #[derive(Clone, PartialEq, ::prost::Message)]
126    pub struct VolumeExpansion {
127        #[prost(enumeration = "volume_expansion::Type", tag = "1")]
128        pub r#type: i32,
129    }
130    /// Nested message and enum types in `VolumeExpansion`.
131    pub mod volume_expansion {
132        #[derive(
133            Clone,
134            Copy,
135            Debug,
136            PartialEq,
137            Eq,
138            Hash,
139            PartialOrd,
140            Ord,
141            ::prost::Enumeration
142        )]
143        #[repr(i32)]
144        pub enum Type {
145            Unknown = 0,
146            /// ONLINE indicates that volumes may be expanded when published to
147            /// a node. When a Plugin implements this capability it MUST
148            /// implement either the EXPAND_VOLUME controller capability or the
149            /// EXPAND_VOLUME node capability or both. When a plugin supports
150            /// ONLINE volume expansion and also has the EXPAND_VOLUME
151            /// controller capability then the plugin MUST support expansion of
152            /// volumes currently published and available on a node. When a
153            /// plugin supports ONLINE volume expansion and also has the
154            /// EXPAND_VOLUME node capability then the plugin MAY support
155            /// expansion of node-published volume via NodeExpandVolume.
156            ///
157            /// Example 1: Given a shared filesystem volume (e.g. GlusterFs),
158            ///    the Plugin may set the ONLINE volume expansion capability and
159            ///    implement ControllerExpandVolume but not NodeExpandVolume.
160            ///
161            /// Example 2: Given a block storage volume type (e.g. EBS), the
162            ///    Plugin may set the ONLINE volume expansion capability and
163            ///    implement both ControllerExpandVolume and NodeExpandVolume.
164            ///
165            /// Example 3: Given a Plugin that supports volume expansion only
166            ///    upon a node, the Plugin may set the ONLINE volume
167            ///    expansion capability and implement NodeExpandVolume but not
168            ///    ControllerExpandVolume.
169            Online = 1,
170            /// OFFLINE indicates that volumes currently published and
171            /// available on a node SHALL NOT be expanded via
172            /// ControllerExpandVolume. When a plugin supports OFFLINE volume
173            /// expansion it MUST implement either the EXPAND_VOLUME controller
174            /// capability or both the EXPAND_VOLUME controller capability and
175            /// the EXPAND_VOLUME node capability.
176            ///
177            /// Example 1: Given a block storage volume type (e.g. Azure Disk)
178            ///    that does not support expansion of "node-attached" (i.e.
179            ///    controller-published) volumes, the Plugin may indicate
180            ///    OFFLINE volume expansion support and implement both
181            ///    ControllerExpandVolume and NodeExpandVolume.
182            Offline = 2,
183        }
184        impl Type {
185            /// String value of the enum field names used in the ProtoBuf definition.
186            ///
187            /// The values are not transformed in any way and thus are considered stable
188            /// (if the ProtoBuf definition does not change) and safe for programmatic use.
189            pub fn as_str_name(&self) -> &'static str {
190                match self {
191                    Type::Unknown => "UNKNOWN",
192                    Type::Online => "ONLINE",
193                    Type::Offline => "OFFLINE",
194                }
195            }
196            /// Creates an enum from field names used in the ProtoBuf definition.
197            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
198                match value {
199                    "UNKNOWN" => Some(Self::Unknown),
200                    "ONLINE" => Some(Self::Online),
201                    "OFFLINE" => Some(Self::Offline),
202                    _ => None,
203                }
204            }
205        }
206    }
207    #[allow(clippy::derive_partial_eq_without_eq)]
208    #[derive(Clone, PartialEq, ::prost::Oneof)]
209    pub enum Type {
210        /// Service that the plugin supports.
211        #[prost(message, tag = "1")]
212        Service(Service),
213        #[prost(message, tag = "2")]
214        VolumeExpansion(VolumeExpansion),
215    }
216}
217/// Intentionally empty.
218#[allow(clippy::derive_partial_eq_without_eq)]
219#[derive(Clone, PartialEq, ::prost::Message)]
220pub struct ProbeRequest {}
221#[allow(clippy::derive_partial_eq_without_eq)]
222#[derive(Clone, PartialEq, ::prost::Message)]
223pub struct ProbeResponse {
224    /// Readiness allows a plugin to report its initialization status back
225    /// to the CO. Initialization for some plugins MAY be time consuming
226    /// and it is important for a CO to distinguish between the following
227    /// cases:
228    ///
229    /// 1) The plugin is in an unhealthy state and MAY need restarting. In
230    ///     this case a gRPC error code SHALL be returned.
231    /// 2) The plugin is still initializing, but is otherwise perfectly
232    ///     healthy. In this case a successful response SHALL be returned
233    ///     with a readiness value of `false`. Calls to the plugin's
234    ///     Controller and/or Node services MAY fail due to an incomplete
235    ///     initialization state.
236    /// 3) The plugin has finished initializing and is ready to service
237    ///     calls to its Controller and/or Node services. A successful
238    ///     response is returned with a readiness value of `true`.
239    ///
240    /// This field is OPTIONAL. If not present, the caller SHALL assume
241    /// that the plugin is in a ready state and is accepting calls to its
242    /// Controller and/or Node services (according to the plugin's reported
243    /// capabilities).
244    #[prost(message, optional, tag = "1")]
245    pub ready: ::core::option::Option<bool>,
246}
247#[allow(clippy::derive_partial_eq_without_eq)]
248#[derive(Clone, PartialEq, ::prost::Message)]
249pub struct CreateVolumeRequest {
250    /// The suggested name for the storage space. This field is REQUIRED.
251    /// It serves two purposes:
252    /// 1) Idempotency - This name is generated by the CO to achieve
253    ///     idempotency.  The Plugin SHOULD ensure that multiple
254    ///     `CreateVolume` calls for the same name do not result in more
255    ///     than one piece of storage provisioned corresponding to that
256    ///     name. If a Plugin is unable to enforce idempotency, the CO's
257    ///     error recovery logic could result in multiple (unused) volumes
258    ///     being provisioned.
259    ///     In the case of error, the CO MUST handle the gRPC error codes
260    ///     per the recovery behavior defined in the "CreateVolume Errors"
261    ///     section below.
262    ///     The CO is responsible for cleaning up volumes it provisioned
263    ///     that it no longer needs. If the CO is uncertain whether a volume
264    ///     was provisioned or not when a `CreateVolume` call fails, the CO
265    ///     MAY call `CreateVolume` again, with the same name, to ensure the
266    ///     volume exists and to retrieve the volume's `volume_id` (unless
267    ///     otherwise prohibited by "CreateVolume Errors").
268    /// 2) Suggested name - Some storage systems allow callers to specify
269    ///     an identifier by which to refer to the newly provisioned
270    ///     storage. If a storage system supports this, it can optionally
271    ///     use this name as the identifier for the new volume.
272    /// Any Unicode string that conforms to the length limit is allowed
273    /// except those containing the following banned characters:
274    /// U+0000-U+0008, U+000B, U+000C, U+000E-U+001F, U+007F-U+009F.
275    /// (These are control characters other than commonly used whitespace.)
276    #[prost(string, tag = "1")]
277    pub name: ::prost::alloc::string::String,
278    /// This field is OPTIONAL. This allows the CO to specify the capacity
279    /// requirement of the volume to be provisioned. If not specified, the
280    /// Plugin MAY choose an implementation-defined capacity range. If
281    /// specified it MUST always be honored, even when creating volumes
282    /// from a source; which MAY force some backends to internally extend
283    /// the volume after creating it.
284    #[prost(message, optional, tag = "2")]
285    pub capacity_range: ::core::option::Option<CapacityRange>,
286    /// The capabilities that the provisioned volume MUST have. SP MUST
287    /// provision a volume that will satisfy ALL of the capabilities
288    /// specified in this list. Otherwise SP MUST return the appropriate
289    /// gRPC error code.
290    /// The Plugin MUST assume that the CO MAY use the provisioned volume
291    /// with ANY of the capabilities specified in this list.
292    /// For example, a CO MAY specify two volume capabilities: one with
293    /// access mode SINGLE_NODE_WRITER and another with access mode
294    /// MULTI_NODE_READER_ONLY. In this case, the SP MUST verify that the
295    /// provisioned volume can be used in either mode.
296    /// This also enables the CO to do early validation: If ANY of the
297    /// specified volume capabilities are not supported by the SP, the call
298    /// MUST return the appropriate gRPC error code.
299    /// This field is REQUIRED.
300    #[prost(message, repeated, tag = "3")]
301    pub volume_capabilities: ::prost::alloc::vec::Vec<VolumeCapability>,
302    /// Plugin specific creation-time parameters passed in as opaque
303    /// key-value pairs. This field is OPTIONAL. The Plugin is responsible
304    /// for parsing and validating these parameters. COs will treat
305    /// these as opaque.
306    #[prost(map = "string, string", tag = "4")]
307    pub parameters: ::std::collections::HashMap<
308        ::prost::alloc::string::String,
309        ::prost::alloc::string::String,
310    >,
311    /// Secrets required by plugin to complete volume creation request.
312    /// This field is OPTIONAL. Refer to the `Secrets Requirements`
313    /// section on how to use this field.
314    #[prost(map = "string, string", tag = "5")]
315    pub secrets: ::std::collections::HashMap<
316        ::prost::alloc::string::String,
317        ::prost::alloc::string::String,
318    >,
319    /// If specified, the new volume will be pre-populated with data from
320    /// this source. This field is OPTIONAL.
321    #[prost(message, optional, tag = "6")]
322    pub volume_content_source: ::core::option::Option<VolumeContentSource>,
323    /// Specifies where (regions, zones, racks, etc.) the provisioned
324    /// volume MUST be accessible from.
325    /// An SP SHALL advertise the requirements for topological
326    /// accessibility information in documentation. COs SHALL only specify
327    /// topological accessibility information supported by the SP.
328    /// This field is OPTIONAL.
329    /// This field SHALL NOT be specified unless the SP has the
330    /// VOLUME_ACCESSIBILITY_CONSTRAINTS plugin capability.
331    /// If this field is not specified and the SP has the
332    /// VOLUME_ACCESSIBILITY_CONSTRAINTS plugin capability, the SP MAY
333    /// choose where the provisioned volume is accessible from.
334    #[prost(message, optional, tag = "7")]
335    pub accessibility_requirements: ::core::option::Option<TopologyRequirement>,
336    /// Plugins MUST treat these
337    /// as if they take precedence over the parameters field.
338    /// This field SHALL NOT be specified unless the SP has the
339    /// MODIFY_VOLUME plugin capability.
340    #[prost(map = "string, string", tag = "8")]
341    pub mutable_parameters: ::std::collections::HashMap<
342        ::prost::alloc::string::String,
343        ::prost::alloc::string::String,
344    >,
345}
346/// Specifies what source the volume will be created from. One of the
347/// type fields MUST be specified.
348#[allow(clippy::derive_partial_eq_without_eq)]
349#[derive(Clone, PartialEq, ::prost::Message)]
350pub struct VolumeContentSource {
351    #[prost(oneof = "volume_content_source::Type", tags = "1, 2")]
352    pub r#type: ::core::option::Option<volume_content_source::Type>,
353}
354/// Nested message and enum types in `VolumeContentSource`.
355pub mod volume_content_source {
356    #[allow(clippy::derive_partial_eq_without_eq)]
357    #[derive(Clone, PartialEq, ::prost::Message)]
358    pub struct SnapshotSource {
359        /// Contains identity information for the existing source snapshot.
360        /// This field is REQUIRED. Plugin is REQUIRED to support creating
361        /// volume from snapshot if it supports the capability
362        /// CREATE_DELETE_SNAPSHOT.
363        #[prost(string, tag = "1")]
364        pub snapshot_id: ::prost::alloc::string::String,
365    }
366    #[allow(clippy::derive_partial_eq_without_eq)]
367    #[derive(Clone, PartialEq, ::prost::Message)]
368    pub struct VolumeSource {
369        /// Contains identity information for the existing source volume.
370        /// This field is REQUIRED. Plugins reporting CLONE_VOLUME
371        /// capability MUST support creating a volume from another volume.
372        #[prost(string, tag = "1")]
373        pub volume_id: ::prost::alloc::string::String,
374    }
375    #[allow(clippy::derive_partial_eq_without_eq)]
376    #[derive(Clone, PartialEq, ::prost::Oneof)]
377    pub enum Type {
378        #[prost(message, tag = "1")]
379        Snapshot(SnapshotSource),
380        #[prost(message, tag = "2")]
381        Volume(VolumeSource),
382    }
383}
384#[allow(clippy::derive_partial_eq_without_eq)]
385#[derive(Clone, PartialEq, ::prost::Message)]
386pub struct CreateVolumeResponse {
387    /// Contains all attributes of the newly created volume that are
388    /// relevant to the CO along with information required by the Plugin
389    /// to uniquely identify the volume. This field is REQUIRED.
390    #[prost(message, optional, tag = "1")]
391    pub volume: ::core::option::Option<Volume>,
392}
393/// Specify a capability of a volume.
394#[allow(clippy::derive_partial_eq_without_eq)]
395#[derive(Clone, PartialEq, ::prost::Message)]
396pub struct VolumeCapability {
397    /// This is a REQUIRED field.
398    #[prost(message, optional, tag = "3")]
399    pub access_mode: ::core::option::Option<volume_capability::AccessMode>,
400    /// Specifies what API the volume will be accessed using. One of the
401    /// following fields MUST be specified.
402    #[prost(oneof = "volume_capability::AccessType", tags = "1, 2")]
403    pub access_type: ::core::option::Option<volume_capability::AccessType>,
404}
405/// Nested message and enum types in `VolumeCapability`.
406pub mod volume_capability {
407    /// Indicate that the volume will be accessed via the block device API.
408    ///
409    /// Intentionally empty, for now.
410    #[allow(clippy::derive_partial_eq_without_eq)]
411    #[derive(Clone, PartialEq, ::prost::Message)]
412    pub struct BlockVolume {}
413    /// Indicate that the volume will be accessed via the filesystem API.
414    #[allow(clippy::derive_partial_eq_without_eq)]
415    #[derive(Clone, PartialEq, ::prost::Message)]
416    pub struct MountVolume {
417        /// The filesystem type. This field is OPTIONAL.
418        /// An empty string is equal to an unspecified field value.
419        #[prost(string, tag = "1")]
420        pub fs_type: ::prost::alloc::string::String,
421        /// The mount options that can be used for the volume. This field is
422        /// OPTIONAL. `mount_flags` MAY contain sensitive information.
423        /// Therefore, the CO and the Plugin MUST NOT leak this information
424        /// to untrusted entities. The total size of this repeated field
425        /// SHALL NOT exceed 4 KiB.
426        #[prost(string, repeated, tag = "2")]
427        pub mount_flags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
428        /// If SP has VOLUME_MOUNT_GROUP node capability and CO provides
429        /// this field then SP MUST ensure that the volume_mount_group
430        /// parameter is passed as the group identifier to the underlying
431        /// operating system mount system call, with the understanding
432        /// that the set of available mount call parameters and/or
433        /// mount implementations may vary across operating systems.
434        /// Additionally, new file and/or directory entries written to
435        /// the underlying filesystem SHOULD be permission-labeled in such a
436        /// manner, unless otherwise modified by a workload, that they are
437        /// both readable and writable by said mount group identifier.
438        /// This is an OPTIONAL field.
439        #[prost(string, tag = "3")]
440        pub volume_mount_group: ::prost::alloc::string::String,
441    }
442    /// Specify how a volume can be accessed.
443    #[allow(clippy::derive_partial_eq_without_eq)]
444    #[derive(Clone, PartialEq, ::prost::Message)]
445    pub struct AccessMode {
446        /// This field is REQUIRED.
447        #[prost(enumeration = "access_mode::Mode", tag = "1")]
448        pub mode: i32,
449    }
450    /// Nested message and enum types in `AccessMode`.
451    pub mod access_mode {
452        #[derive(
453            Clone,
454            Copy,
455            Debug,
456            PartialEq,
457            Eq,
458            Hash,
459            PartialOrd,
460            Ord,
461            ::prost::Enumeration
462        )]
463        #[repr(i32)]
464        pub enum Mode {
465            Unknown = 0,
466            /// Can only be published once as read/write on a single node, at
467            /// any given time.
468            SingleNodeWriter = 1,
469            /// Can only be published once as readonly on a single node, at
470            /// any given time.
471            SingleNodeReaderOnly = 2,
472            /// Can be published as readonly at multiple nodes simultaneously.
473            MultiNodeReaderOnly = 3,
474            /// Can be published at multiple nodes simultaneously. Only one of
475            /// the node can be used as read/write. The rest will be readonly.
476            MultiNodeSingleWriter = 4,
477            /// Can be published as read/write at multiple nodes
478            /// simultaneously.
479            MultiNodeMultiWriter = 5,
480            /// Can only be published once as read/write at a single workload
481            /// on a single node, at any given time. SHOULD be used instead of
482            /// SINGLE_NODE_WRITER for COs using the experimental
483            /// SINGLE_NODE_MULTI_WRITER capability.
484            SingleNodeSingleWriter = 6,
485            /// Can be published as read/write at multiple workloads on a
486            /// single node simultaneously. SHOULD be used instead of
487            /// SINGLE_NODE_WRITER for COs using the experimental
488            /// SINGLE_NODE_MULTI_WRITER capability.
489            SingleNodeMultiWriter = 7,
490        }
491        impl Mode {
492            /// String value of the enum field names used in the ProtoBuf definition.
493            ///
494            /// The values are not transformed in any way and thus are considered stable
495            /// (if the ProtoBuf definition does not change) and safe for programmatic use.
496            pub fn as_str_name(&self) -> &'static str {
497                match self {
498                    Mode::Unknown => "UNKNOWN",
499                    Mode::SingleNodeWriter => "SINGLE_NODE_WRITER",
500                    Mode::SingleNodeReaderOnly => "SINGLE_NODE_READER_ONLY",
501                    Mode::MultiNodeReaderOnly => "MULTI_NODE_READER_ONLY",
502                    Mode::MultiNodeSingleWriter => "MULTI_NODE_SINGLE_WRITER",
503                    Mode::MultiNodeMultiWriter => "MULTI_NODE_MULTI_WRITER",
504                    Mode::SingleNodeSingleWriter => "SINGLE_NODE_SINGLE_WRITER",
505                    Mode::SingleNodeMultiWriter => "SINGLE_NODE_MULTI_WRITER",
506                }
507            }
508            /// Creates an enum from field names used in the ProtoBuf definition.
509            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
510                match value {
511                    "UNKNOWN" => Some(Self::Unknown),
512                    "SINGLE_NODE_WRITER" => Some(Self::SingleNodeWriter),
513                    "SINGLE_NODE_READER_ONLY" => Some(Self::SingleNodeReaderOnly),
514                    "MULTI_NODE_READER_ONLY" => Some(Self::MultiNodeReaderOnly),
515                    "MULTI_NODE_SINGLE_WRITER" => Some(Self::MultiNodeSingleWriter),
516                    "MULTI_NODE_MULTI_WRITER" => Some(Self::MultiNodeMultiWriter),
517                    "SINGLE_NODE_SINGLE_WRITER" => Some(Self::SingleNodeSingleWriter),
518                    "SINGLE_NODE_MULTI_WRITER" => Some(Self::SingleNodeMultiWriter),
519                    _ => None,
520                }
521            }
522        }
523    }
524    /// Specifies what API the volume will be accessed using. One of the
525    /// following fields MUST be specified.
526    #[allow(clippy::derive_partial_eq_without_eq)]
527    #[derive(Clone, PartialEq, ::prost::Oneof)]
528    pub enum AccessType {
529        #[prost(message, tag = "1")]
530        Block(BlockVolume),
531        #[prost(message, tag = "2")]
532        Mount(MountVolume),
533    }
534}
535/// The capacity of the storage space in bytes. To specify an exact size,
536/// `required_bytes` and `limit_bytes` SHALL be set to the same value. At
537/// least one of the these fields MUST be specified.
538#[allow(clippy::derive_partial_eq_without_eq)]
539#[derive(Clone, PartialEq, ::prost::Message)]
540pub struct CapacityRange {
541    /// Volume MUST be at least this big. This field is OPTIONAL.
542    /// A value of 0 is equal to an unspecified field value.
543    /// The value of this field MUST NOT be negative.
544    #[prost(int64, tag = "1")]
545    pub required_bytes: i64,
546    /// Volume MUST not be bigger than this. This field is OPTIONAL.
547    /// A value of 0 is equal to an unspecified field value.
548    /// The value of this field MUST NOT be negative.
549    #[prost(int64, tag = "2")]
550    pub limit_bytes: i64,
551}
552/// Information about a specific volume.
553#[allow(clippy::derive_partial_eq_without_eq)]
554#[derive(Clone, PartialEq, ::prost::Message)]
555pub struct Volume {
556    /// The capacity of the volume in bytes. This field is OPTIONAL. If not
557    /// set (value of 0), it indicates that the capacity of the volume is
558    /// unknown (e.g., NFS share).
559    /// The value of this field MUST NOT be negative.
560    #[prost(int64, tag = "1")]
561    pub capacity_bytes: i64,
562    /// The identifier for this volume, generated by the plugin.
563    /// This field is REQUIRED.
564    /// This field MUST contain enough information to uniquely identify
565    /// this specific volume vs all other volumes supported by this plugin.
566    /// This field SHALL be used by the CO in subsequent calls to refer to
567    /// this volume.
568    /// The SP is NOT responsible for global uniqueness of volume_id across
569    /// multiple SPs.
570    #[prost(string, tag = "2")]
571    pub volume_id: ::prost::alloc::string::String,
572    /// Opaque static properties of the volume. SP MAY use this field to
573    /// ensure subsequent volume validation and publishing calls have
574    /// contextual information.
575    /// The contents of this field SHALL be opaque to a CO.
576    /// The contents of this field SHALL NOT be mutable.
577    /// The contents of this field SHALL be safe for the CO to cache.
578    /// The contents of this field SHOULD NOT contain sensitive
579    /// information.
580    /// The contents of this field SHOULD NOT be used for uniquely
581    /// identifying a volume. The `volume_id` alone SHOULD be sufficient to
582    /// identify the volume.
583    /// A volume uniquely identified by `volume_id` SHALL always report the
584    /// same volume_context.
585    /// This field is OPTIONAL and when present MUST be passed to volume
586    /// validation and publishing calls.
587    #[prost(map = "string, string", tag = "3")]
588    pub volume_context: ::std::collections::HashMap<
589        ::prost::alloc::string::String,
590        ::prost::alloc::string::String,
591    >,
592    /// If specified, indicates that the volume is not empty and is
593    /// pre-populated with data from the specified source.
594    /// This field is OPTIONAL.
595    #[prost(message, optional, tag = "4")]
596    pub content_source: ::core::option::Option<VolumeContentSource>,
597    /// Specifies where (regions, zones, racks, etc.) the provisioned
598    /// volume is accessible from.
599    /// A plugin that returns this field MUST also set the
600    /// VOLUME_ACCESSIBILITY_CONSTRAINTS plugin capability.
601    /// An SP MAY specify multiple topologies to indicate the volume is
602    /// accessible from multiple locations.
603    /// COs MAY use this information along with the topology information
604    /// returned by NodeGetInfo to ensure that a given volume is accessible
605    /// from a given node when scheduling workloads.
606    /// This field is OPTIONAL. If it is not specified, the CO MAY assume
607    /// the volume is equally accessible from all nodes in the cluster and
608    /// MAY schedule workloads referencing the volume on any available
609    /// node.
610    ///
611    /// Example 1:
612    ///    accessible_topology = {"region": "R1", "zone": "Z2"}
613    /// Indicates a volume accessible only from the "region" "R1" and the
614    /// "zone" "Z2".
615    ///
616    /// Example 2:
617    ///    accessible_topology =
618    ///      {"region": "R1", "zone": "Z2"},
619    ///      {"region": "R1", "zone": "Z3"}
620    /// Indicates a volume accessible from both "zone" "Z2" and "zone" "Z3"
621    /// in the "region" "R1".
622    #[prost(message, repeated, tag = "5")]
623    pub accessible_topology: ::prost::alloc::vec::Vec<Topology>,
624}
625#[allow(clippy::derive_partial_eq_without_eq)]
626#[derive(Clone, PartialEq, ::prost::Message)]
627pub struct TopologyRequirement {
628    /// Specifies the list of topologies the provisioned volume MUST be
629    /// accessible from.
630    /// This field is OPTIONAL. If TopologyRequirement is specified either
631    /// requisite or preferred or both MUST be specified.
632    ///
633    /// If requisite is specified, the provisioned volume MUST be
634    /// accessible from at least one of the requisite topologies.
635    ///
636    /// Given
637    ///    x = number of topologies provisioned volume is accessible from
638    ///    n = number of requisite topologies
639    /// The CO MUST ensure n >= 1. The SP MUST ensure x >= 1
640    /// If x==n, then the SP MUST make the provisioned volume available to
641    /// all topologies from the list of requisite topologies. If it is
642    /// unable to do so, the SP MUST fail the CreateVolume call.
643    /// For example, if a volume should be accessible from a single zone,
644    /// and requisite =
645    ///    {"region": "R1", "zone": "Z2"}
646    /// then the provisioned volume MUST be accessible from the "region"
647    /// "R1" and the "zone" "Z2".
648    /// Similarly, if a volume should be accessible from two zones, and
649    /// requisite =
650    ///    {"region": "R1", "zone": "Z2"},
651    ///    {"region": "R1", "zone": "Z3"}
652    /// then the provisioned volume MUST be accessible from the "region"
653    /// "R1" and both "zone" "Z2" and "zone" "Z3".
654    ///
655    /// If x<n, then the SP SHALL choose x unique topologies from the list
656    /// of requisite topologies. If it is unable to do so, the SP MUST fail
657    /// the CreateVolume call.
658    /// For example, if a volume should be accessible from a single zone,
659    /// and requisite =
660    ///    {"region": "R1", "zone": "Z2"},
661    ///    {"region": "R1", "zone": "Z3"}
662    /// then the SP may choose to make the provisioned volume available in
663    /// either the "zone" "Z2" or the "zone" "Z3" in the "region" "R1".
664    /// Similarly, if a volume should be accessible from two zones, and
665    /// requisite =
666    ///    {"region": "R1", "zone": "Z2"},
667    ///    {"region": "R1", "zone": "Z3"},
668    ///    {"region": "R1", "zone": "Z4"}
669    /// then the provisioned volume MUST be accessible from any combination
670    /// of two unique topologies: e.g. "R1/Z2" and "R1/Z3", or "R1/Z2" and
671    ///   "R1/Z4", or "R1/Z3" and "R1/Z4".
672    ///
673    /// If x>n, then the SP MUST make the provisioned volume available from
674    /// all topologies from the list of requisite topologies and MAY choose
675    /// the remaining x-n unique topologies from the list of all possible
676    /// topologies. If it is unable to do so, the SP MUST fail the
677    /// CreateVolume call.
678    /// For example, if a volume should be accessible from two zones, and
679    /// requisite =
680    ///    {"region": "R1", "zone": "Z2"}
681    /// then the provisioned volume MUST be accessible from the "region"
682    /// "R1" and the "zone" "Z2" and the SP may select the second zone
683    /// independently, e.g. "R1/Z4".
684    #[prost(message, repeated, tag = "1")]
685    pub requisite: ::prost::alloc::vec::Vec<Topology>,
686    /// Specifies the list of topologies the CO would prefer the volume to
687    /// be provisioned in.
688    ///
689    /// This field is OPTIONAL. If TopologyRequirement is specified either
690    /// requisite or preferred or both MUST be specified.
691    ///
692    /// An SP MUST attempt to make the provisioned volume available using
693    /// the preferred topologies in order from first to last.
694    ///
695    /// If requisite is specified, all topologies in preferred list MUST
696    /// also be present in the list of requisite topologies.
697    ///
698    /// If the SP is unable to to make the provisioned volume available
699    /// from any of the preferred topologies, the SP MAY choose a topology
700    /// from the list of requisite topologies.
701    /// If the list of requisite topologies is not specified, then the SP
702    /// MAY choose from the list of all possible topologies.
703    /// If the list of requisite topologies is specified and the SP is
704    /// unable to to make the provisioned volume available from any of the
705    /// requisite topologies it MUST fail the CreateVolume call.
706    ///
707    /// Example 1:
708    /// Given a volume should be accessible from a single zone, and
709    /// requisite =
710    ///    {"region": "R1", "zone": "Z2"},
711    ///    {"region": "R1", "zone": "Z3"}
712    /// preferred =
713    ///    {"region": "R1", "zone": "Z3"}
714    /// then the SP SHOULD first attempt to make the provisioned volume
715    /// available from "zone" "Z3" in the "region" "R1" and fall back to
716    /// "zone" "Z2" in the "region" "R1" if that is not possible.
717    ///
718    /// Example 2:
719    /// Given a volume should be accessible from a single zone, and
720    /// requisite =
721    ///    {"region": "R1", "zone": "Z2"},
722    ///    {"region": "R1", "zone": "Z3"},
723    ///    {"region": "R1", "zone": "Z4"},
724    ///    {"region": "R1", "zone": "Z5"}
725    /// preferred =
726    ///    {"region": "R1", "zone": "Z4"},
727    ///    {"region": "R1", "zone": "Z2"}
728    /// then the SP SHOULD first attempt to make the provisioned volume
729    /// accessible from "zone" "Z4" in the "region" "R1" and fall back to
730    /// "zone" "Z2" in the "region" "R1" if that is not possible. If that
731    /// is not possible, the SP may choose between either the "zone"
732    /// "Z3" or "Z5" in the "region" "R1".
733    ///
734    /// Example 3:
735    /// Given a volume should be accessible from TWO zones (because an
736    /// opaque parameter in CreateVolumeRequest, for example, specifies
737    /// the volume is accessible from two zones, aka synchronously
738    /// replicated), and
739    /// requisite =
740    ///    {"region": "R1", "zone": "Z2"},
741    ///    {"region": "R1", "zone": "Z3"},
742    ///    {"region": "R1", "zone": "Z4"},
743    ///    {"region": "R1", "zone": "Z5"}
744    /// preferred =
745    ///    {"region": "R1", "zone": "Z5"},
746    ///    {"region": "R1", "zone": "Z3"}
747    /// then the SP SHOULD first attempt to make the provisioned volume
748    /// accessible from the combination of the two "zones" "Z5" and "Z3" in
749    /// the "region" "R1". If that's not possible, it should fall back to
750    /// a combination of "Z5" and other possibilities from the list of
751    /// requisite. If that's not possible, it should fall back  to a
752    /// combination of "Z3" and other possibilities from the list of
753    /// requisite. If that's not possible, it should fall back  to a
754    /// combination of other possibilities from the list of requisite.
755    #[prost(message, repeated, tag = "2")]
756    pub preferred: ::prost::alloc::vec::Vec<Topology>,
757}
758/// Topology is a map of topological domains to topological segments.
759/// A topological domain is a sub-division of a cluster, like "region",
760/// "zone", "rack", etc.
761/// A topological segment is a specific instance of a topological domain,
762/// like "zone3", "rack3", etc.
763/// For example {"com.company/zone": "Z1", "com.company/rack": "R3"}
764/// Valid keys have two segments: an OPTIONAL prefix and name, separated
765/// by a slash (/), for example: "com.company.example/zone".
766/// The key name segment is REQUIRED. The prefix is OPTIONAL.
767/// The key name MUST be 63 characters or less, begin and end with an
768/// alphanumeric character (\[a-z0-9A-Z\]), and contain only dashes (-),
769/// underscores (_), dots (.), or alphanumerics in between, for example
770/// "zone".
771/// The key prefix MUST be 63 characters or less, begin and end with a
772/// lower-case alphanumeric character (\[a-z0-9\]), contain only
773/// dashes (-), dots (.), or lower-case alphanumerics in between, and
774/// follow domain name notation format
775/// (<https://tools.ietf.org/html/rfc1035#section-2.3.1>).
776/// The key prefix SHOULD include the plugin's host company name and/or
777/// the plugin name, to minimize the possibility of collisions with keys
778/// from other plugins.
779/// If a key prefix is specified, it MUST be identical across all
780/// topology keys returned by the SP (across all RPCs).
781/// Keys MUST be case-insensitive. Meaning the keys "Zone" and "zone"
782/// MUST not both exist.
783/// Each value (topological segment) MUST contain 1 or more strings.
784/// Each string MUST be 63 characters or less and begin and end with an
785/// alphanumeric character with '-', '_', '.', or alphanumerics in
786/// between.
787#[allow(clippy::derive_partial_eq_without_eq)]
788#[derive(Clone, PartialEq, ::prost::Message)]
789pub struct Topology {
790    #[prost(map = "string, string", tag = "1")]
791    pub segments: ::std::collections::HashMap<
792        ::prost::alloc::string::String,
793        ::prost::alloc::string::String,
794    >,
795}
796#[allow(clippy::derive_partial_eq_without_eq)]
797#[derive(Clone, PartialEq, ::prost::Message)]
798pub struct DeleteVolumeRequest {
799    /// The ID of the volume to be deprovisioned.
800    /// This field is REQUIRED.
801    #[prost(string, tag = "1")]
802    pub volume_id: ::prost::alloc::string::String,
803    /// Secrets required by plugin to complete volume deletion request.
804    /// This field is OPTIONAL. Refer to the `Secrets Requirements`
805    /// section on how to use this field.
806    #[prost(map = "string, string", tag = "2")]
807    pub secrets: ::std::collections::HashMap<
808        ::prost::alloc::string::String,
809        ::prost::alloc::string::String,
810    >,
811}
812/// Intentionally empty.
813#[allow(clippy::derive_partial_eq_without_eq)]
814#[derive(Clone, PartialEq, ::prost::Message)]
815pub struct DeleteVolumeResponse {}
816#[allow(clippy::derive_partial_eq_without_eq)]
817#[derive(Clone, PartialEq, ::prost::Message)]
818pub struct ControllerPublishVolumeRequest {
819    /// The ID of the volume to be used on a node.
820    /// This field is REQUIRED.
821    #[prost(string, tag = "1")]
822    pub volume_id: ::prost::alloc::string::String,
823    /// The ID of the node. This field is REQUIRED. The CO SHALL set this
824    /// field to match the node ID returned by `NodeGetInfo`.
825    #[prost(string, tag = "2")]
826    pub node_id: ::prost::alloc::string::String,
827    /// Volume capability describing how the CO intends to use this volume.
828    /// SP MUST ensure the CO can use the published volume as described.
829    /// Otherwise SP MUST return the appropriate gRPC error code.
830    /// This is a REQUIRED field.
831    #[prost(message, optional, tag = "3")]
832    pub volume_capability: ::core::option::Option<VolumeCapability>,
833    /// Indicates SP MUST publish the volume in readonly mode.
834    /// CO MUST set this field to false if SP does not have the
835    /// PUBLISH_READONLY controller capability.
836    /// This is a REQUIRED field.
837    #[prost(bool, tag = "4")]
838    pub readonly: bool,
839    /// Secrets required by plugin to complete controller publish volume
840    /// request. This field is OPTIONAL. Refer to the
841    /// `Secrets Requirements` section on how to use this field.
842    #[prost(map = "string, string", tag = "5")]
843    pub secrets: ::std::collections::HashMap<
844        ::prost::alloc::string::String,
845        ::prost::alloc::string::String,
846    >,
847    /// Volume context as returned by SP in
848    /// CreateVolumeResponse.Volume.volume_context.
849    /// This field is OPTIONAL and MUST match the volume_context of the
850    /// volume identified by `volume_id`.
851    #[prost(map = "string, string", tag = "6")]
852    pub volume_context: ::std::collections::HashMap<
853        ::prost::alloc::string::String,
854        ::prost::alloc::string::String,
855    >,
856}
857#[allow(clippy::derive_partial_eq_without_eq)]
858#[derive(Clone, PartialEq, ::prost::Message)]
859pub struct ControllerPublishVolumeResponse {
860    /// Opaque static publish properties of the volume. SP MAY use this
861    /// field to ensure subsequent `NodeStageVolume` or `NodePublishVolume`
862    /// calls calls have contextual information.
863    /// The contents of this field SHALL be opaque to a CO.
864    /// The contents of this field SHALL NOT be mutable.
865    /// The contents of this field SHALL be safe for the CO to cache.
866    /// The contents of this field SHOULD NOT contain sensitive
867    /// information.
868    /// The contents of this field SHOULD NOT be used for uniquely
869    /// identifying a volume. The `volume_id` alone SHOULD be sufficient to
870    /// identify the volume.
871    /// This field is OPTIONAL and when present MUST be passed to
872    /// subsequent `NodeStageVolume` or `NodePublishVolume` calls
873    #[prost(map = "string, string", tag = "1")]
874    pub publish_context: ::std::collections::HashMap<
875        ::prost::alloc::string::String,
876        ::prost::alloc::string::String,
877    >,
878}
879#[allow(clippy::derive_partial_eq_without_eq)]
880#[derive(Clone, PartialEq, ::prost::Message)]
881pub struct ControllerUnpublishVolumeRequest {
882    /// The ID of the volume. This field is REQUIRED.
883    #[prost(string, tag = "1")]
884    pub volume_id: ::prost::alloc::string::String,
885    /// The ID of the node. This field is OPTIONAL. The CO SHOULD set this
886    /// field to match the node ID returned by `NodeGetInfo` or leave it
887    /// unset. If the value is set, the SP MUST unpublish the volume from
888    /// the specified node. If the value is unset, the SP MUST unpublish
889    /// the volume from all nodes it is published to.
890    #[prost(string, tag = "2")]
891    pub node_id: ::prost::alloc::string::String,
892    /// Secrets required by plugin to complete controller unpublish volume
893    /// request. This SHOULD be the same secrets passed to the
894    /// ControllerPublishVolume call for the specified volume.
895    /// This field is OPTIONAL. Refer to the `Secrets Requirements`
896    /// section on how to use this field.
897    #[prost(map = "string, string", tag = "3")]
898    pub secrets: ::std::collections::HashMap<
899        ::prost::alloc::string::String,
900        ::prost::alloc::string::String,
901    >,
902}
903/// Intentionally empty.
904#[allow(clippy::derive_partial_eq_without_eq)]
905#[derive(Clone, PartialEq, ::prost::Message)]
906pub struct ControllerUnpublishVolumeResponse {}
907#[allow(clippy::derive_partial_eq_without_eq)]
908#[derive(Clone, PartialEq, ::prost::Message)]
909pub struct ValidateVolumeCapabilitiesRequest {
910    /// The ID of the volume to check. This field is REQUIRED.
911    #[prost(string, tag = "1")]
912    pub volume_id: ::prost::alloc::string::String,
913    /// Volume context as returned by SP in
914    /// CreateVolumeResponse.Volume.volume_context.
915    /// This field is OPTIONAL and MUST match the volume_context of the
916    /// volume identified by `volume_id`.
917    #[prost(map = "string, string", tag = "2")]
918    pub volume_context: ::std::collections::HashMap<
919        ::prost::alloc::string::String,
920        ::prost::alloc::string::String,
921    >,
922    /// The capabilities that the CO wants to check for the volume. This
923    /// call SHALL return "confirmed" only if all the volume capabilities
924    /// specified below are supported. This field is REQUIRED.
925    #[prost(message, repeated, tag = "3")]
926    pub volume_capabilities: ::prost::alloc::vec::Vec<VolumeCapability>,
927    /// See CreateVolumeRequest.parameters.
928    /// This field is OPTIONAL.
929    #[prost(map = "string, string", tag = "4")]
930    pub parameters: ::std::collections::HashMap<
931        ::prost::alloc::string::String,
932        ::prost::alloc::string::String,
933    >,
934    /// Secrets required by plugin to complete volume validation request.
935    /// This field is OPTIONAL. Refer to the `Secrets Requirements`
936    /// section on how to use this field.
937    #[prost(map = "string, string", tag = "5")]
938    pub secrets: ::std::collections::HashMap<
939        ::prost::alloc::string::String,
940        ::prost::alloc::string::String,
941    >,
942    /// See CreateVolumeRequest.mutable_parameters.
943    /// This field is OPTIONAL.
944    #[prost(map = "string, string", tag = "6")]
945    pub mutable_parameters: ::std::collections::HashMap<
946        ::prost::alloc::string::String,
947        ::prost::alloc::string::String,
948    >,
949}
950#[allow(clippy::derive_partial_eq_without_eq)]
951#[derive(Clone, PartialEq, ::prost::Message)]
952pub struct ValidateVolumeCapabilitiesResponse {
953    /// Confirmed indicates to the CO the set of capabilities that the
954    /// plugin has validated. This field SHALL only be set to a non-empty
955    /// value for successful validation responses.
956    /// For successful validation responses, the CO SHALL compare the
957    /// fields of this message to the originally requested capabilities in
958    /// order to guard against an older plugin reporting "valid" for newer
959    /// capability fields that it does not yet understand.
960    /// This field is OPTIONAL.
961    #[prost(message, optional, tag = "1")]
962    pub confirmed: ::core::option::Option<
963        validate_volume_capabilities_response::Confirmed,
964    >,
965    /// Message to the CO if `confirmed` above is empty. This field is
966    /// OPTIONAL.
967    /// An empty string is equal to an unspecified field value.
968    #[prost(string, tag = "2")]
969    pub message: ::prost::alloc::string::String,
970}
971/// Nested message and enum types in `ValidateVolumeCapabilitiesResponse`.
972pub mod validate_volume_capabilities_response {
973    #[allow(clippy::derive_partial_eq_without_eq)]
974    #[derive(Clone, PartialEq, ::prost::Message)]
975    pub struct Confirmed {
976        /// Volume context validated by the plugin.
977        /// This field is OPTIONAL.
978        #[prost(map = "string, string", tag = "1")]
979        pub volume_context: ::std::collections::HashMap<
980            ::prost::alloc::string::String,
981            ::prost::alloc::string::String,
982        >,
983        /// Volume capabilities supported by the plugin.
984        /// This field is REQUIRED.
985        #[prost(message, repeated, tag = "2")]
986        pub volume_capabilities: ::prost::alloc::vec::Vec<super::VolumeCapability>,
987        /// The volume creation parameters validated by the plugin.
988        /// This field is OPTIONAL.
989        #[prost(map = "string, string", tag = "3")]
990        pub parameters: ::std::collections::HashMap<
991            ::prost::alloc::string::String,
992            ::prost::alloc::string::String,
993        >,
994        /// The volume creation mutable_parameters validated by the plugin.
995        /// This field is OPTIONAL.
996        #[prost(map = "string, string", tag = "4")]
997        pub mutable_parameters: ::std::collections::HashMap<
998            ::prost::alloc::string::String,
999            ::prost::alloc::string::String,
1000        >,
1001    }
1002}
1003#[allow(clippy::derive_partial_eq_without_eq)]
1004#[derive(Clone, PartialEq, ::prost::Message)]
1005pub struct ListVolumesRequest {
1006    /// If specified (non-zero value), the Plugin MUST NOT return more
1007    /// entries than this number in the response. If the actual number of
1008    /// entries is more than this number, the Plugin MUST set `next_token`
1009    /// in the response which can be used to get the next page of entries
1010    /// in the subsequent `ListVolumes` call. This field is OPTIONAL. If
1011    /// not specified (zero value), it means there is no restriction on the
1012    /// number of entries that can be returned.
1013    /// The value of this field MUST NOT be negative.
1014    #[prost(int32, tag = "1")]
1015    pub max_entries: i32,
1016    /// A token to specify where to start paginating. Set this field to
1017    /// `next_token` returned by a previous `ListVolumes` call to get the
1018    /// next page of entries. This field is OPTIONAL.
1019    /// An empty string is equal to an unspecified field value.
1020    #[prost(string, tag = "2")]
1021    pub starting_token: ::prost::alloc::string::String,
1022}
1023#[allow(clippy::derive_partial_eq_without_eq)]
1024#[derive(Clone, PartialEq, ::prost::Message)]
1025pub struct ListVolumesResponse {
1026    #[prost(message, repeated, tag = "1")]
1027    pub entries: ::prost::alloc::vec::Vec<list_volumes_response::Entry>,
1028    /// This token allows you to get the next page of entries for
1029    /// `ListVolumes` request. If the number of entries is larger than
1030    /// `max_entries`, use the `next_token` as a value for the
1031    /// `starting_token` field in the next `ListVolumes` request. This
1032    /// field is OPTIONAL.
1033    /// An empty string is equal to an unspecified field value.
1034    #[prost(string, tag = "2")]
1035    pub next_token: ::prost::alloc::string::String,
1036}
1037/// Nested message and enum types in `ListVolumesResponse`.
1038pub mod list_volumes_response {
1039    #[allow(clippy::derive_partial_eq_without_eq)]
1040    #[derive(Clone, PartialEq, ::prost::Message)]
1041    pub struct VolumeStatus {
1042        /// A list of all `node_id` of nodes that the volume in this entry
1043        /// is controller published on.
1044        /// This field is OPTIONAL. If it is not specified and the SP has
1045        /// the LIST_VOLUMES_PUBLISHED_NODES controller capability, the CO
1046        /// MAY assume the volume is not controller published to any nodes.
1047        /// If the field is not specified and the SP does not have the
1048        /// LIST_VOLUMES_PUBLISHED_NODES controller capability, the CO MUST
1049        /// not interpret this field.
1050        /// published_node_ids MAY include nodes not published to or
1051        /// reported by the SP. The CO MUST be resilient to that.
1052        #[prost(string, repeated, tag = "1")]
1053        pub published_node_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1054        /// Information about the current condition of the volume.
1055        /// This field is OPTIONAL.
1056        /// This field MUST be specified if the
1057        /// VOLUME_CONDITION controller capability is supported.
1058        #[prost(message, optional, tag = "2")]
1059        pub volume_condition: ::core::option::Option<super::VolumeCondition>,
1060    }
1061    #[allow(clippy::derive_partial_eq_without_eq)]
1062    #[derive(Clone, PartialEq, ::prost::Message)]
1063    pub struct Entry {
1064        /// This field is REQUIRED
1065        #[prost(message, optional, tag = "1")]
1066        pub volume: ::core::option::Option<super::Volume>,
1067        /// This field is OPTIONAL. This field MUST be specified if the
1068        /// LIST_VOLUMES_PUBLISHED_NODES controller capability is
1069        /// supported.
1070        #[prost(message, optional, tag = "2")]
1071        pub status: ::core::option::Option<VolumeStatus>,
1072    }
1073}
1074#[allow(clippy::derive_partial_eq_without_eq)]
1075#[derive(Clone, PartialEq, ::prost::Message)]
1076pub struct ControllerGetVolumeRequest {
1077    /// The ID of the volume to fetch current volume information for.
1078    /// This field is REQUIRED.
1079    #[prost(string, tag = "1")]
1080    pub volume_id: ::prost::alloc::string::String,
1081}
1082#[allow(clippy::derive_partial_eq_without_eq)]
1083#[derive(Clone, PartialEq, ::prost::Message)]
1084pub struct ControllerGetVolumeResponse {
1085    /// This field is REQUIRED
1086    #[prost(message, optional, tag = "1")]
1087    pub volume: ::core::option::Option<Volume>,
1088    /// This field is REQUIRED.
1089    #[prost(message, optional, tag = "2")]
1090    pub status: ::core::option::Option<controller_get_volume_response::VolumeStatus>,
1091}
1092/// Nested message and enum types in `ControllerGetVolumeResponse`.
1093pub mod controller_get_volume_response {
1094    #[allow(clippy::derive_partial_eq_without_eq)]
1095    #[derive(Clone, PartialEq, ::prost::Message)]
1096    pub struct VolumeStatus {
1097        /// A list of all the `node_id` of nodes that this volume is
1098        /// controller published on.
1099        /// This field is OPTIONAL.
1100        /// This field MUST be specified if the LIST_VOLUMES_PUBLISHED_NODES
1101        /// controller capability is supported.
1102        /// published_node_ids MAY include nodes not published to or
1103        /// reported by the SP. The CO MUST be resilient to that.
1104        #[prost(string, repeated, tag = "1")]
1105        pub published_node_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1106        /// Information about the current condition of the volume.
1107        /// This field is OPTIONAL.
1108        /// This field MUST be specified if the
1109        /// VOLUME_CONDITION controller capability is supported.
1110        #[prost(message, optional, tag = "2")]
1111        pub volume_condition: ::core::option::Option<super::VolumeCondition>,
1112    }
1113}
1114#[allow(clippy::derive_partial_eq_without_eq)]
1115#[derive(Clone, PartialEq, ::prost::Message)]
1116pub struct ControllerModifyVolumeRequest {
1117    /// Contains identity information for the existing volume.
1118    /// This field is REQUIRED.
1119    #[prost(string, tag = "1")]
1120    pub volume_id: ::prost::alloc::string::String,
1121    /// Secrets required by plugin to complete modify volume request.
1122    /// This field is OPTIONAL. Refer to the `Secrets Requirements`
1123    /// section on how to use this field.
1124    #[prost(map = "string, string", tag = "2")]
1125    pub secrets: ::std::collections::HashMap<
1126        ::prost::alloc::string::String,
1127        ::prost::alloc::string::String,
1128    >,
1129    /// Plugin specific volume attributes to mutate, passed in as
1130    /// opaque key-value pairs.
1131    /// This field is REQUIRED. The Plugin is responsible for
1132    /// parsing and validating these parameters. COs will treat these
1133    /// as opaque. The CO SHOULD specify the intended values of all mutable
1134    /// parameters it intends to modify. SPs MUST NOT modify volumes based
1135    /// on the absence of keys, only keys that are specified should result
1136    /// in modifications to the volume.
1137    #[prost(map = "string, string", tag = "3")]
1138    pub mutable_parameters: ::std::collections::HashMap<
1139        ::prost::alloc::string::String,
1140        ::prost::alloc::string::String,
1141    >,
1142}
1143#[allow(clippy::derive_partial_eq_without_eq)]
1144#[derive(Clone, PartialEq, ::prost::Message)]
1145pub struct ControllerModifyVolumeResponse {}
1146#[allow(clippy::derive_partial_eq_without_eq)]
1147#[derive(Clone, PartialEq, ::prost::Message)]
1148pub struct GetCapacityRequest {
1149    /// If specified, the Plugin SHALL report the capacity of the storage
1150    /// that can be used to provision volumes that satisfy ALL of the
1151    /// specified `volume_capabilities`. These are the same
1152    /// `volume_capabilities` the CO will use in `CreateVolumeRequest`.
1153    /// This field is OPTIONAL.
1154    #[prost(message, repeated, tag = "1")]
1155    pub volume_capabilities: ::prost::alloc::vec::Vec<VolumeCapability>,
1156    /// If specified, the Plugin SHALL report the capacity of the storage
1157    /// that can be used to provision volumes with the given Plugin
1158    /// specific `parameters`. These are the same `parameters` the CO will
1159    /// use in `CreateVolumeRequest`. This field is OPTIONAL.
1160    #[prost(map = "string, string", tag = "2")]
1161    pub parameters: ::std::collections::HashMap<
1162        ::prost::alloc::string::String,
1163        ::prost::alloc::string::String,
1164    >,
1165    /// If specified, the Plugin SHALL report the capacity of the storage
1166    /// that can be used to provision volumes that in the specified
1167    /// `accessible_topology`. This is the same as the
1168    /// `accessible_topology` the CO returns in a `CreateVolumeResponse`.
1169    /// This field is OPTIONAL. This field SHALL NOT be set unless the
1170    /// plugin advertises the VOLUME_ACCESSIBILITY_CONSTRAINTS capability.
1171    #[prost(message, optional, tag = "3")]
1172    pub accessible_topology: ::core::option::Option<Topology>,
1173}
1174#[allow(clippy::derive_partial_eq_without_eq)]
1175#[derive(Clone, PartialEq, ::prost::Message)]
1176pub struct GetCapacityResponse {
1177    /// The available capacity, in bytes, of the storage that can be used
1178    /// to provision volumes. If `volume_capabilities` or `parameters` is
1179    /// specified in the request, the Plugin SHALL take those into
1180    /// consideration when calculating the available capacity of the
1181    /// storage. This field is REQUIRED.
1182    /// The value of this field MUST NOT be negative.
1183    #[prost(int64, tag = "1")]
1184    pub available_capacity: i64,
1185    /// The largest size that may be used in a
1186    /// CreateVolumeRequest.capacity_range.required_bytes field
1187    /// to create a volume with the same parameters as those in
1188    /// GetCapacityRequest.
1189    ///
1190    /// If `volume_capabilities` or `parameters` is
1191    /// specified in the request, the Plugin SHALL take those into
1192    /// consideration when calculating the minimum volume size of the
1193    /// storage.
1194    ///
1195    /// This field is OPTIONAL. MUST NOT be negative.
1196    /// The Plugin SHOULD provide a value for this field if it has
1197    /// a maximum size for individual volumes and leave it unset
1198    /// otherwise. COs MAY use it to make decision about
1199    /// where to create volumes.
1200    #[prost(message, optional, tag = "2")]
1201    pub maximum_volume_size: ::core::option::Option<i64>,
1202    /// The smallest size that may be used in a
1203    /// CreateVolumeRequest.capacity_range.limit_bytes field
1204    /// to create a volume with the same parameters as those in
1205    /// GetCapacityRequest.
1206    ///
1207    /// If `volume_capabilities` or `parameters` is
1208    /// specified in the request, the Plugin SHALL take those into
1209    /// consideration when calculating the maximum volume size of the
1210    /// storage.
1211    ///
1212    /// This field is OPTIONAL. MUST NOT be negative.
1213    /// The Plugin SHOULD provide a value for this field if it has
1214    /// a minimum size for individual volumes and leave it unset
1215    /// otherwise. COs MAY use it to make decision about
1216    /// where to create volumes.
1217    #[prost(message, optional, tag = "3")]
1218    pub minimum_volume_size: ::core::option::Option<i64>,
1219}
1220/// Intentionally empty.
1221#[allow(clippy::derive_partial_eq_without_eq)]
1222#[derive(Clone, PartialEq, ::prost::Message)]
1223pub struct ControllerGetCapabilitiesRequest {}
1224#[allow(clippy::derive_partial_eq_without_eq)]
1225#[derive(Clone, PartialEq, ::prost::Message)]
1226pub struct ControllerGetCapabilitiesResponse {
1227    /// All the capabilities that the controller service supports. This
1228    /// field is OPTIONAL.
1229    #[prost(message, repeated, tag = "1")]
1230    pub capabilities: ::prost::alloc::vec::Vec<ControllerServiceCapability>,
1231}
1232/// Specifies a capability of the controller service.
1233#[allow(clippy::derive_partial_eq_without_eq)]
1234#[derive(Clone, PartialEq, ::prost::Message)]
1235pub struct ControllerServiceCapability {
1236    #[prost(oneof = "controller_service_capability::Type", tags = "1")]
1237    pub r#type: ::core::option::Option<controller_service_capability::Type>,
1238}
1239/// Nested message and enum types in `ControllerServiceCapability`.
1240pub mod controller_service_capability {
1241    #[allow(clippy::derive_partial_eq_without_eq)]
1242    #[derive(Clone, PartialEq, ::prost::Message)]
1243    pub struct Rpc {
1244        #[prost(enumeration = "rpc::Type", tag = "1")]
1245        pub r#type: i32,
1246    }
1247    /// Nested message and enum types in `RPC`.
1248    pub mod rpc {
1249        #[derive(
1250            Clone,
1251            Copy,
1252            Debug,
1253            PartialEq,
1254            Eq,
1255            Hash,
1256            PartialOrd,
1257            Ord,
1258            ::prost::Enumeration
1259        )]
1260        #[repr(i32)]
1261        pub enum Type {
1262            Unknown = 0,
1263            CreateDeleteVolume = 1,
1264            PublishUnpublishVolume = 2,
1265            ListVolumes = 3,
1266            GetCapacity = 4,
1267            /// Currently the only way to consume a snapshot is to create
1268            /// a volume from it. Therefore plugins supporting
1269            /// CREATE_DELETE_SNAPSHOT MUST support creating volume from
1270            /// snapshot.
1271            CreateDeleteSnapshot = 5,
1272            ListSnapshots = 6,
1273            /// Plugins supporting volume cloning at the storage level MAY
1274            /// report this capability. The source volume MUST be managed by
1275            /// the same plugin. Not all volume sources and parameters
1276            /// combinations MAY work.
1277            CloneVolume = 7,
1278            /// Indicates the SP supports ControllerPublishVolume.readonly
1279            /// field.
1280            PublishReadonly = 8,
1281            /// See VolumeExpansion for details.
1282            ExpandVolume = 9,
1283            /// Indicates the SP supports the
1284            /// ListVolumesResponse.entry.published_node_ids field and the
1285            /// ControllerGetVolumeResponse.published_node_ids field.
1286            /// The SP MUST also support PUBLISH_UNPUBLISH_VOLUME.
1287            ListVolumesPublishedNodes = 10,
1288            /// Indicates that the Controller service can report volume
1289            /// conditions.
1290            /// An SP MAY implement `VolumeCondition` in only the Controller
1291            /// Plugin, only the Node Plugin, or both.
1292            /// If `VolumeCondition` is implemented in both the Controller and
1293            /// Node Plugins, it SHALL report from different perspectives.
1294            /// If for some reason Controller and Node Plugins report
1295            /// misaligned volume conditions, CO SHALL assume the worst case
1296            /// is the truth.
1297            /// Note that, for alpha, `VolumeCondition` is intended be
1298            /// informative for humans only, not for automation.
1299            VolumeCondition = 11,
1300            /// Indicates the SP supports the ControllerGetVolume RPC.
1301            /// This enables COs to, for example, fetch per volume
1302            /// condition after a volume is provisioned.
1303            GetVolume = 12,
1304            /// Indicates the SP supports the SINGLE_NODE_SINGLE_WRITER and/or
1305            /// SINGLE_NODE_MULTI_WRITER access modes.
1306            /// These access modes are intended to replace the
1307            /// SINGLE_NODE_WRITER access mode to clarify the number of writers
1308            /// for a volume on a single node. Plugins MUST accept and allow
1309            /// use of the SINGLE_NODE_WRITER access mode when either
1310            /// SINGLE_NODE_SINGLE_WRITER and/or SINGLE_NODE_MULTI_WRITER are
1311            /// supported, in order to permit older COs to continue working.
1312            SingleNodeMultiWriter = 13,
1313            /// Indicates the SP supports modifying volume with mutable
1314            /// parameters. See ControllerModifyVolume for details.
1315            ModifyVolume = 14,
1316        }
1317        impl Type {
1318            /// String value of the enum field names used in the ProtoBuf definition.
1319            ///
1320            /// The values are not transformed in any way and thus are considered stable
1321            /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1322            pub fn as_str_name(&self) -> &'static str {
1323                match self {
1324                    Type::Unknown => "UNKNOWN",
1325                    Type::CreateDeleteVolume => "CREATE_DELETE_VOLUME",
1326                    Type::PublishUnpublishVolume => "PUBLISH_UNPUBLISH_VOLUME",
1327                    Type::ListVolumes => "LIST_VOLUMES",
1328                    Type::GetCapacity => "GET_CAPACITY",
1329                    Type::CreateDeleteSnapshot => "CREATE_DELETE_SNAPSHOT",
1330                    Type::ListSnapshots => "LIST_SNAPSHOTS",
1331                    Type::CloneVolume => "CLONE_VOLUME",
1332                    Type::PublishReadonly => "PUBLISH_READONLY",
1333                    Type::ExpandVolume => "EXPAND_VOLUME",
1334                    Type::ListVolumesPublishedNodes => "LIST_VOLUMES_PUBLISHED_NODES",
1335                    Type::VolumeCondition => "VOLUME_CONDITION",
1336                    Type::GetVolume => "GET_VOLUME",
1337                    Type::SingleNodeMultiWriter => "SINGLE_NODE_MULTI_WRITER",
1338                    Type::ModifyVolume => "MODIFY_VOLUME",
1339                }
1340            }
1341            /// Creates an enum from field names used in the ProtoBuf definition.
1342            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1343                match value {
1344                    "UNKNOWN" => Some(Self::Unknown),
1345                    "CREATE_DELETE_VOLUME" => Some(Self::CreateDeleteVolume),
1346                    "PUBLISH_UNPUBLISH_VOLUME" => Some(Self::PublishUnpublishVolume),
1347                    "LIST_VOLUMES" => Some(Self::ListVolumes),
1348                    "GET_CAPACITY" => Some(Self::GetCapacity),
1349                    "CREATE_DELETE_SNAPSHOT" => Some(Self::CreateDeleteSnapshot),
1350                    "LIST_SNAPSHOTS" => Some(Self::ListSnapshots),
1351                    "CLONE_VOLUME" => Some(Self::CloneVolume),
1352                    "PUBLISH_READONLY" => Some(Self::PublishReadonly),
1353                    "EXPAND_VOLUME" => Some(Self::ExpandVolume),
1354                    "LIST_VOLUMES_PUBLISHED_NODES" => {
1355                        Some(Self::ListVolumesPublishedNodes)
1356                    }
1357                    "VOLUME_CONDITION" => Some(Self::VolumeCondition),
1358                    "GET_VOLUME" => Some(Self::GetVolume),
1359                    "SINGLE_NODE_MULTI_WRITER" => Some(Self::SingleNodeMultiWriter),
1360                    "MODIFY_VOLUME" => Some(Self::ModifyVolume),
1361                    _ => None,
1362                }
1363            }
1364        }
1365    }
1366    #[allow(clippy::derive_partial_eq_without_eq)]
1367    #[derive(Clone, PartialEq, ::prost::Oneof)]
1368    pub enum Type {
1369        /// RPC that the controller supports.
1370        #[prost(message, tag = "1")]
1371        Rpc(Rpc),
1372    }
1373}
1374#[allow(clippy::derive_partial_eq_without_eq)]
1375#[derive(Clone, PartialEq, ::prost::Message)]
1376pub struct CreateSnapshotRequest {
1377    /// The ID of the source volume to be snapshotted.
1378    /// This field is REQUIRED.
1379    #[prost(string, tag = "1")]
1380    pub source_volume_id: ::prost::alloc::string::String,
1381    /// The suggested name for the snapshot. This field is REQUIRED for
1382    /// idempotency.
1383    /// Any Unicode string that conforms to the length limit is allowed
1384    /// except those containing the following banned characters:
1385    /// U+0000-U+0008, U+000B, U+000C, U+000E-U+001F, U+007F-U+009F.
1386    /// (These are control characters other than commonly used whitespace.)
1387    #[prost(string, tag = "2")]
1388    pub name: ::prost::alloc::string::String,
1389    /// Secrets required by plugin to complete snapshot creation request.
1390    /// This field is OPTIONAL. Refer to the `Secrets Requirements`
1391    /// section on how to use this field.
1392    #[prost(map = "string, string", tag = "3")]
1393    pub secrets: ::std::collections::HashMap<
1394        ::prost::alloc::string::String,
1395        ::prost::alloc::string::String,
1396    >,
1397    /// Plugin specific parameters passed in as opaque key-value pairs.
1398    /// This field is OPTIONAL. The Plugin is responsible for parsing and
1399    /// validating these parameters. COs will treat these as opaque.
1400    /// Use cases for opaque parameters:
1401    /// - Specify a policy to automatically clean up the snapshot.
1402    /// - Specify an expiration date for the snapshot.
1403    /// - Specify whether the snapshot is readonly or read/write.
1404    /// - Specify if the snapshot should be replicated to some place.
1405    /// - Specify primary or secondary for replication systems that
1406    ///    support snapshotting only on primary.
1407    #[prost(map = "string, string", tag = "4")]
1408    pub parameters: ::std::collections::HashMap<
1409        ::prost::alloc::string::String,
1410        ::prost::alloc::string::String,
1411    >,
1412}
1413#[allow(clippy::derive_partial_eq_without_eq)]
1414#[derive(Clone, PartialEq, ::prost::Message)]
1415pub struct CreateSnapshotResponse {
1416    /// Contains all attributes of the newly created snapshot that are
1417    /// relevant to the CO along with information required by the Plugin
1418    /// to uniquely identify the snapshot. This field is REQUIRED.
1419    #[prost(message, optional, tag = "1")]
1420    pub snapshot: ::core::option::Option<Snapshot>,
1421}
1422/// Information about a specific snapshot.
1423#[allow(clippy::derive_partial_eq_without_eq)]
1424#[derive(Clone, PartialEq, ::prost::Message)]
1425pub struct Snapshot {
1426    /// This is the complete size of the snapshot in bytes. The purpose of
1427    /// this field is to give CO guidance on how much space is needed to
1428    /// create a volume from this snapshot. The size of the volume MUST NOT
1429    /// be less than the size of the source snapshot. This field is
1430    /// OPTIONAL. If this field is not set, it indicates that this size is
1431    /// unknown. The value of this field MUST NOT be negative and a size of
1432    /// zero means it is unspecified.
1433    #[prost(int64, tag = "1")]
1434    pub size_bytes: i64,
1435    /// The identifier for this snapshot, generated by the plugin.
1436    /// This field is REQUIRED.
1437    /// This field MUST contain enough information to uniquely identify
1438    /// this specific snapshot vs all other snapshots supported by this
1439    /// plugin.
1440    /// This field SHALL be used by the CO in subsequent calls to refer to
1441    /// this snapshot.
1442    /// The SP is NOT responsible for global uniqueness of snapshot_id
1443    /// across multiple SPs.
1444    #[prost(string, tag = "2")]
1445    pub snapshot_id: ::prost::alloc::string::String,
1446    /// Identity information for the source volume. Note that creating a
1447    /// snapshot from a snapshot is not supported here so the source has to
1448    /// be a volume. This field is REQUIRED.
1449    #[prost(string, tag = "3")]
1450    pub source_volume_id: ::prost::alloc::string::String,
1451    /// Timestamp when the point-in-time snapshot is taken on the storage
1452    /// system. This field is REQUIRED.
1453    #[prost(message, optional, tag = "4")]
1454    pub creation_time: ::core::option::Option<::prost_types::Timestamp>,
1455    /// Indicates if a snapshot is ready to use as a
1456    /// `volume_content_source` in a `CreateVolumeRequest`. The default
1457    /// value is false. This field is REQUIRED.
1458    #[prost(bool, tag = "5")]
1459    pub ready_to_use: bool,
1460    /// The ID of the volume group snapshot that this snapshot is part of.
1461    /// It uniquely identifies the group snapshot on the storage system.
1462    /// This field is OPTIONAL.
1463    /// If this snapshot is a member of a volume group snapshot, and it
1464    /// MUST NOT be deleted as a stand alone snapshot, then the SP
1465    /// MUST provide the ID of the volume group snapshot in this field.
1466    /// If provided, CO MUST use this field in subsequent volume group
1467    /// snapshot operations to indicate that this snapshot is part of the
1468    /// specified group snapshot.
1469    /// If not provided, CO SHALL treat the snapshot as independent,
1470    /// and SP SHALL allow it to be deleted separately.
1471    /// If this message is inside a VolumeGroupSnapshot message, the value
1472    /// MUST be the same as the group_snapshot_id in that message.
1473    #[prost(string, tag = "6")]
1474    pub group_snapshot_id: ::prost::alloc::string::String,
1475}
1476#[allow(clippy::derive_partial_eq_without_eq)]
1477#[derive(Clone, PartialEq, ::prost::Message)]
1478pub struct DeleteSnapshotRequest {
1479    /// The ID of the snapshot to be deleted.
1480    /// This field is REQUIRED.
1481    #[prost(string, tag = "1")]
1482    pub snapshot_id: ::prost::alloc::string::String,
1483    /// Secrets required by plugin to complete snapshot deletion request.
1484    /// This field is OPTIONAL. Refer to the `Secrets Requirements`
1485    /// section on how to use this field.
1486    #[prost(map = "string, string", tag = "2")]
1487    pub secrets: ::std::collections::HashMap<
1488        ::prost::alloc::string::String,
1489        ::prost::alloc::string::String,
1490    >,
1491}
1492#[allow(clippy::derive_partial_eq_without_eq)]
1493#[derive(Clone, PartialEq, ::prost::Message)]
1494pub struct DeleteSnapshotResponse {}
1495/// List all snapshots on the storage system regardless of how they were
1496/// created.
1497#[allow(clippy::derive_partial_eq_without_eq)]
1498#[derive(Clone, PartialEq, ::prost::Message)]
1499pub struct ListSnapshotsRequest {
1500    /// If specified (non-zero value), the Plugin MUST NOT return more
1501    /// entries than this number in the response. If the actual number of
1502    /// entries is more than this number, the Plugin MUST set `next_token`
1503    /// in the response which can be used to get the next page of entries
1504    /// in the subsequent `ListSnapshots` call. This field is OPTIONAL. If
1505    /// not specified (zero value), it means there is no restriction on the
1506    /// number of entries that can be returned.
1507    /// The value of this field MUST NOT be negative.
1508    #[prost(int32, tag = "1")]
1509    pub max_entries: i32,
1510    /// A token to specify where to start paginating. Set this field to
1511    /// `next_token` returned by a previous `ListSnapshots` call to get the
1512    /// next page of entries. This field is OPTIONAL.
1513    /// An empty string is equal to an unspecified field value.
1514    #[prost(string, tag = "2")]
1515    pub starting_token: ::prost::alloc::string::String,
1516    /// Identity information for the source volume. This field is OPTIONAL.
1517    /// It can be used to list snapshots by volume.
1518    #[prost(string, tag = "3")]
1519    pub source_volume_id: ::prost::alloc::string::String,
1520    /// Identity information for a specific snapshot. This field is
1521    /// OPTIONAL. It can be used to list only a specific snapshot.
1522    /// ListSnapshots will return with current snapshot information
1523    /// and will not block if the snapshot is being processed after
1524    /// it is cut.
1525    #[prost(string, tag = "4")]
1526    pub snapshot_id: ::prost::alloc::string::String,
1527    /// Secrets required by plugin to complete ListSnapshot request.
1528    /// This field is OPTIONAL. Refer to the `Secrets Requirements`
1529    /// section on how to use this field.
1530    #[prost(map = "string, string", tag = "5")]
1531    pub secrets: ::std::collections::HashMap<
1532        ::prost::alloc::string::String,
1533        ::prost::alloc::string::String,
1534    >,
1535}
1536#[allow(clippy::derive_partial_eq_without_eq)]
1537#[derive(Clone, PartialEq, ::prost::Message)]
1538pub struct ListSnapshotsResponse {
1539    #[prost(message, repeated, tag = "1")]
1540    pub entries: ::prost::alloc::vec::Vec<list_snapshots_response::Entry>,
1541    /// This token allows you to get the next page of entries for
1542    /// `ListSnapshots` request. If the number of entries is larger than
1543    /// `max_entries`, use the `next_token` as a value for the
1544    /// `starting_token` field in the next `ListSnapshots` request. This
1545    /// field is OPTIONAL.
1546    /// An empty string is equal to an unspecified field value.
1547    #[prost(string, tag = "2")]
1548    pub next_token: ::prost::alloc::string::String,
1549}
1550/// Nested message and enum types in `ListSnapshotsResponse`.
1551pub mod list_snapshots_response {
1552    #[allow(clippy::derive_partial_eq_without_eq)]
1553    #[derive(Clone, PartialEq, ::prost::Message)]
1554    pub struct Entry {
1555        #[prost(message, optional, tag = "1")]
1556        pub snapshot: ::core::option::Option<super::Snapshot>,
1557    }
1558}
1559#[allow(clippy::derive_partial_eq_without_eq)]
1560#[derive(Clone, PartialEq, ::prost::Message)]
1561pub struct ControllerExpandVolumeRequest {
1562    /// The ID of the volume to expand. This field is REQUIRED.
1563    #[prost(string, tag = "1")]
1564    pub volume_id: ::prost::alloc::string::String,
1565    /// This allows CO to specify the capacity requirements of the volume
1566    /// after expansion. This field is REQUIRED.
1567    #[prost(message, optional, tag = "2")]
1568    pub capacity_range: ::core::option::Option<CapacityRange>,
1569    /// Secrets required by the plugin for expanding the volume.
1570    /// This field is OPTIONAL.
1571    #[prost(map = "string, string", tag = "3")]
1572    pub secrets: ::std::collections::HashMap<
1573        ::prost::alloc::string::String,
1574        ::prost::alloc::string::String,
1575    >,
1576    /// Volume capability describing how the CO intends to use this volume.
1577    /// This allows SP to determine if volume is being used as a block
1578    /// device or mounted file system. For example - if volume is
1579    /// being used as a block device - the SP MAY set
1580    /// node_expansion_required to false in ControllerExpandVolumeResponse
1581    /// to skip invocation of NodeExpandVolume on the node by the CO.
1582    /// This is an OPTIONAL field.
1583    #[prost(message, optional, tag = "4")]
1584    pub volume_capability: ::core::option::Option<VolumeCapability>,
1585}
1586#[allow(clippy::derive_partial_eq_without_eq)]
1587#[derive(Clone, PartialEq, ::prost::Message)]
1588pub struct ControllerExpandVolumeResponse {
1589    /// Capacity of volume after expansion. This field is REQUIRED.
1590    #[prost(int64, tag = "1")]
1591    pub capacity_bytes: i64,
1592    /// Whether node expansion is required for the volume. When true
1593    /// the CO MUST make NodeExpandVolume RPC call on the node. This field
1594    /// is REQUIRED.
1595    #[prost(bool, tag = "2")]
1596    pub node_expansion_required: bool,
1597}
1598#[allow(clippy::derive_partial_eq_without_eq)]
1599#[derive(Clone, PartialEq, ::prost::Message)]
1600pub struct NodeStageVolumeRequest {
1601    /// The ID of the volume to publish. This field is REQUIRED.
1602    #[prost(string, tag = "1")]
1603    pub volume_id: ::prost::alloc::string::String,
1604    /// The CO SHALL set this field to the value returned by
1605    /// `ControllerPublishVolume` if the corresponding Controller Plugin
1606    /// has `PUBLISH_UNPUBLISH_VOLUME` controller capability, and SHALL be
1607    /// left unset if the corresponding Controller Plugin does not have
1608    /// this capability. This is an OPTIONAL field.
1609    #[prost(map = "string, string", tag = "2")]
1610    pub publish_context: ::std::collections::HashMap<
1611        ::prost::alloc::string::String,
1612        ::prost::alloc::string::String,
1613    >,
1614    /// The path to which the volume MAY be staged. It MUST be an
1615    /// absolute path in the root filesystem of the process serving this
1616    /// request, and MUST be a directory. The CO SHALL ensure that there
1617    /// is only one `staging_target_path` per volume. The CO SHALL ensure
1618    /// that the path is directory and that the process serving the
1619    /// request has `read` and `write` permission to that directory. The
1620    /// CO SHALL be responsible for creating the directory if it does not
1621    /// exist.
1622    /// This is a REQUIRED field.
1623    /// This field overrides the general CSI size limit.
1624    /// SP SHOULD support the maximum path length allowed by the operating
1625    /// system/filesystem, but, at a minimum, SP MUST accept a max path
1626    /// length of at least 128 bytes.
1627    #[prost(string, tag = "3")]
1628    pub staging_target_path: ::prost::alloc::string::String,
1629    /// Volume capability describing how the CO intends to use this volume.
1630    /// SP MUST ensure the CO can use the staged volume as described.
1631    /// Otherwise SP MUST return the appropriate gRPC error code.
1632    /// This is a REQUIRED field.
1633    #[prost(message, optional, tag = "4")]
1634    pub volume_capability: ::core::option::Option<VolumeCapability>,
1635    /// Secrets required by plugin to complete node stage volume request.
1636    /// This field is OPTIONAL. Refer to the `Secrets Requirements`
1637    /// section on how to use this field.
1638    #[prost(map = "string, string", tag = "5")]
1639    pub secrets: ::std::collections::HashMap<
1640        ::prost::alloc::string::String,
1641        ::prost::alloc::string::String,
1642    >,
1643    /// Volume context as returned by SP in
1644    /// CreateVolumeResponse.Volume.volume_context.
1645    /// This field is OPTIONAL and MUST match the volume_context of the
1646    /// volume identified by `volume_id`.
1647    #[prost(map = "string, string", tag = "6")]
1648    pub volume_context: ::std::collections::HashMap<
1649        ::prost::alloc::string::String,
1650        ::prost::alloc::string::String,
1651    >,
1652}
1653/// Intentionally empty.
1654#[allow(clippy::derive_partial_eq_without_eq)]
1655#[derive(Clone, PartialEq, ::prost::Message)]
1656pub struct NodeStageVolumeResponse {}
1657#[allow(clippy::derive_partial_eq_without_eq)]
1658#[derive(Clone, PartialEq, ::prost::Message)]
1659pub struct NodeUnstageVolumeRequest {
1660    /// The ID of the volume. This field is REQUIRED.
1661    #[prost(string, tag = "1")]
1662    pub volume_id: ::prost::alloc::string::String,
1663    /// The path at which the volume was staged. It MUST be an absolute
1664    /// path in the root filesystem of the process serving this request.
1665    /// This is a REQUIRED field.
1666    /// This field overrides the general CSI size limit.
1667    /// SP SHOULD support the maximum path length allowed by the operating
1668    /// system/filesystem, but, at a minimum, SP MUST accept a max path
1669    /// length of at least 128 bytes.
1670    #[prost(string, tag = "2")]
1671    pub staging_target_path: ::prost::alloc::string::String,
1672}
1673/// Intentionally empty.
1674#[allow(clippy::derive_partial_eq_without_eq)]
1675#[derive(Clone, PartialEq, ::prost::Message)]
1676pub struct NodeUnstageVolumeResponse {}
1677#[allow(clippy::derive_partial_eq_without_eq)]
1678#[derive(Clone, PartialEq, ::prost::Message)]
1679pub struct NodePublishVolumeRequest {
1680    /// The ID of the volume to publish. This field is REQUIRED.
1681    #[prost(string, tag = "1")]
1682    pub volume_id: ::prost::alloc::string::String,
1683    /// The CO SHALL set this field to the value returned by
1684    /// `ControllerPublishVolume` if the corresponding Controller Plugin
1685    /// has `PUBLISH_UNPUBLISH_VOLUME` controller capability, and SHALL be
1686    /// left unset if the corresponding Controller Plugin does not have
1687    /// this capability. This is an OPTIONAL field.
1688    #[prost(map = "string, string", tag = "2")]
1689    pub publish_context: ::std::collections::HashMap<
1690        ::prost::alloc::string::String,
1691        ::prost::alloc::string::String,
1692    >,
1693    /// The path to which the volume was staged by `NodeStageVolume`.
1694    /// It MUST be an absolute path in the root filesystem of the process
1695    /// serving this request.
1696    /// It MUST be set if the Node Plugin implements the
1697    /// `STAGE_UNSTAGE_VOLUME` node capability.
1698    /// This is an OPTIONAL field.
1699    /// This field overrides the general CSI size limit.
1700    /// SP SHOULD support the maximum path length allowed by the operating
1701    /// system/filesystem, but, at a minimum, SP MUST accept a max path
1702    /// length of at least 128 bytes.
1703    #[prost(string, tag = "3")]
1704    pub staging_target_path: ::prost::alloc::string::String,
1705    /// The path to which the volume will be published. It MUST be an
1706    /// absolute path in the root filesystem of the process serving this
1707    /// request. The CO SHALL ensure uniqueness of target_path per volume.
1708    /// The CO SHALL ensure that the parent directory of this path exists
1709    /// and that the process serving the request has `read` and `write`
1710    /// permissions to that parent directory.
1711    /// For volumes with an access type of block, the SP SHALL place the
1712    /// block device at target_path.
1713    /// For volumes with an access type of mount, the SP SHALL place the
1714    /// mounted directory at target_path.
1715    /// Creation of target_path is the responsibility of the SP.
1716    /// This is a REQUIRED field.
1717    /// This field overrides the general CSI size limit.
1718    /// SP SHOULD support the maximum path length allowed by the operating
1719    /// system/filesystem, but, at a minimum, SP MUST accept a max path
1720    /// length of at least 128 bytes.
1721    #[prost(string, tag = "4")]
1722    pub target_path: ::prost::alloc::string::String,
1723    /// Volume capability describing how the CO intends to use this volume.
1724    /// SP MUST ensure the CO can use the published volume as described.
1725    /// Otherwise SP MUST return the appropriate gRPC error code.
1726    /// This is a REQUIRED field.
1727    #[prost(message, optional, tag = "5")]
1728    pub volume_capability: ::core::option::Option<VolumeCapability>,
1729    /// Indicates SP MUST publish the volume in readonly mode.
1730    /// This field is REQUIRED.
1731    #[prost(bool, tag = "6")]
1732    pub readonly: bool,
1733    /// Secrets required by plugin to complete node publish volume request.
1734    /// This field is OPTIONAL. Refer to the `Secrets Requirements`
1735    /// section on how to use this field.
1736    #[prost(map = "string, string", tag = "7")]
1737    pub secrets: ::std::collections::HashMap<
1738        ::prost::alloc::string::String,
1739        ::prost::alloc::string::String,
1740    >,
1741    /// Volume context as returned by SP in
1742    /// CreateVolumeResponse.Volume.volume_context.
1743    /// This field is OPTIONAL and MUST match the volume_context of the
1744    /// volume identified by `volume_id`.
1745    #[prost(map = "string, string", tag = "8")]
1746    pub volume_context: ::std::collections::HashMap<
1747        ::prost::alloc::string::String,
1748        ::prost::alloc::string::String,
1749    >,
1750}
1751/// Intentionally empty.
1752#[allow(clippy::derive_partial_eq_without_eq)]
1753#[derive(Clone, PartialEq, ::prost::Message)]
1754pub struct NodePublishVolumeResponse {}
1755#[allow(clippy::derive_partial_eq_without_eq)]
1756#[derive(Clone, PartialEq, ::prost::Message)]
1757pub struct NodeUnpublishVolumeRequest {
1758    /// The ID of the volume. This field is REQUIRED.
1759    #[prost(string, tag = "1")]
1760    pub volume_id: ::prost::alloc::string::String,
1761    /// The path at which the volume was published. It MUST be an absolute
1762    /// path in the root filesystem of the process serving this request.
1763    /// The SP MUST delete the file or directory it created at this path.
1764    /// This is a REQUIRED field.
1765    /// This field overrides the general CSI size limit.
1766    /// SP SHOULD support the maximum path length allowed by the operating
1767    /// system/filesystem, but, at a minimum, SP MUST accept a max path
1768    /// length of at least 128 bytes.
1769    #[prost(string, tag = "2")]
1770    pub target_path: ::prost::alloc::string::String,
1771}
1772/// Intentionally empty.
1773#[allow(clippy::derive_partial_eq_without_eq)]
1774#[derive(Clone, PartialEq, ::prost::Message)]
1775pub struct NodeUnpublishVolumeResponse {}
1776#[allow(clippy::derive_partial_eq_without_eq)]
1777#[derive(Clone, PartialEq, ::prost::Message)]
1778pub struct NodeGetVolumeStatsRequest {
1779    /// The ID of the volume. This field is REQUIRED.
1780    #[prost(string, tag = "1")]
1781    pub volume_id: ::prost::alloc::string::String,
1782    /// It can be any valid path where volume was previously
1783    /// staged or published.
1784    /// It MUST be an absolute path in the root filesystem of
1785    /// the process serving this request.
1786    /// This is a REQUIRED field.
1787    /// This field overrides the general CSI size limit.
1788    /// SP SHOULD support the maximum path length allowed by the operating
1789    /// system/filesystem, but, at a minimum, SP MUST accept a max path
1790    /// length of at least 128 bytes.
1791    #[prost(string, tag = "2")]
1792    pub volume_path: ::prost::alloc::string::String,
1793    /// The path where the volume is staged, if the plugin has the
1794    /// STAGE_UNSTAGE_VOLUME capability, otherwise empty.
1795    /// If not empty, it MUST be an absolute path in the root
1796    /// filesystem of the process serving this request.
1797    /// This field is OPTIONAL.
1798    /// This field overrides the general CSI size limit.
1799    /// SP SHOULD support the maximum path length allowed by the operating
1800    /// system/filesystem, but, at a minimum, SP MUST accept a max path
1801    /// length of at least 128 bytes.
1802    #[prost(string, tag = "3")]
1803    pub staging_target_path: ::prost::alloc::string::String,
1804}
1805#[allow(clippy::derive_partial_eq_without_eq)]
1806#[derive(Clone, PartialEq, ::prost::Message)]
1807pub struct NodeGetVolumeStatsResponse {
1808    /// This field is OPTIONAL.
1809    #[prost(message, repeated, tag = "1")]
1810    pub usage: ::prost::alloc::vec::Vec<VolumeUsage>,
1811    /// Information about the current condition of the volume.
1812    /// This field is OPTIONAL.
1813    /// This field MUST be specified if the VOLUME_CONDITION node
1814    /// capability is supported.
1815    #[prost(message, optional, tag = "2")]
1816    pub volume_condition: ::core::option::Option<VolumeCondition>,
1817}
1818#[allow(clippy::derive_partial_eq_without_eq)]
1819#[derive(Clone, PartialEq, ::prost::Message)]
1820pub struct VolumeUsage {
1821    /// The available capacity in specified Unit. This field is OPTIONAL.
1822    /// The value of this field MUST NOT be negative.
1823    #[prost(int64, tag = "1")]
1824    pub available: i64,
1825    /// The total capacity in specified Unit. This field is REQUIRED.
1826    /// The value of this field MUST NOT be negative.
1827    #[prost(int64, tag = "2")]
1828    pub total: i64,
1829    /// The used capacity in specified Unit. This field is OPTIONAL.
1830    /// The value of this field MUST NOT be negative.
1831    #[prost(int64, tag = "3")]
1832    pub used: i64,
1833    /// Units by which values are measured. This field is REQUIRED.
1834    #[prost(enumeration = "volume_usage::Unit", tag = "4")]
1835    pub unit: i32,
1836}
1837/// Nested message and enum types in `VolumeUsage`.
1838pub mod volume_usage {
1839    #[derive(
1840        Clone,
1841        Copy,
1842        Debug,
1843        PartialEq,
1844        Eq,
1845        Hash,
1846        PartialOrd,
1847        Ord,
1848        ::prost::Enumeration
1849    )]
1850    #[repr(i32)]
1851    pub enum Unit {
1852        Unknown = 0,
1853        Bytes = 1,
1854        Inodes = 2,
1855    }
1856    impl Unit {
1857        /// String value of the enum field names used in the ProtoBuf definition.
1858        ///
1859        /// The values are not transformed in any way and thus are considered stable
1860        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1861        pub fn as_str_name(&self) -> &'static str {
1862            match self {
1863                Unit::Unknown => "UNKNOWN",
1864                Unit::Bytes => "BYTES",
1865                Unit::Inodes => "INODES",
1866            }
1867        }
1868        /// Creates an enum from field names used in the ProtoBuf definition.
1869        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1870            match value {
1871                "UNKNOWN" => Some(Self::Unknown),
1872                "BYTES" => Some(Self::Bytes),
1873                "INODES" => Some(Self::Inodes),
1874                _ => None,
1875            }
1876        }
1877    }
1878}
1879/// VolumeCondition represents the current condition of a volume.
1880#[allow(clippy::derive_partial_eq_without_eq)]
1881#[derive(Clone, PartialEq, ::prost::Message)]
1882pub struct VolumeCondition {
1883    /// Normal volumes are available for use and operating optimally.
1884    /// An abnormal volume does not meet these criteria.
1885    /// This field is REQUIRED.
1886    #[prost(bool, tag = "1")]
1887    pub abnormal: bool,
1888    /// The message describing the condition of the volume.
1889    /// This field is REQUIRED.
1890    #[prost(string, tag = "2")]
1891    pub message: ::prost::alloc::string::String,
1892}
1893/// Intentionally empty.
1894#[allow(clippy::derive_partial_eq_without_eq)]
1895#[derive(Clone, PartialEq, ::prost::Message)]
1896pub struct NodeGetCapabilitiesRequest {}
1897#[allow(clippy::derive_partial_eq_without_eq)]
1898#[derive(Clone, PartialEq, ::prost::Message)]
1899pub struct NodeGetCapabilitiesResponse {
1900    /// All the capabilities that the node service supports. This field
1901    /// is OPTIONAL.
1902    #[prost(message, repeated, tag = "1")]
1903    pub capabilities: ::prost::alloc::vec::Vec<NodeServiceCapability>,
1904}
1905/// Specifies a capability of the node service.
1906#[allow(clippy::derive_partial_eq_without_eq)]
1907#[derive(Clone, PartialEq, ::prost::Message)]
1908pub struct NodeServiceCapability {
1909    #[prost(oneof = "node_service_capability::Type", tags = "1")]
1910    pub r#type: ::core::option::Option<node_service_capability::Type>,
1911}
1912/// Nested message and enum types in `NodeServiceCapability`.
1913pub mod node_service_capability {
1914    #[allow(clippy::derive_partial_eq_without_eq)]
1915    #[derive(Clone, PartialEq, ::prost::Message)]
1916    pub struct Rpc {
1917        #[prost(enumeration = "rpc::Type", tag = "1")]
1918        pub r#type: i32,
1919    }
1920    /// Nested message and enum types in `RPC`.
1921    pub mod rpc {
1922        #[derive(
1923            Clone,
1924            Copy,
1925            Debug,
1926            PartialEq,
1927            Eq,
1928            Hash,
1929            PartialOrd,
1930            Ord,
1931            ::prost::Enumeration
1932        )]
1933        #[repr(i32)]
1934        pub enum Type {
1935            Unknown = 0,
1936            StageUnstageVolume = 1,
1937            /// If Plugin implements GET_VOLUME_STATS capability
1938            /// then it MUST implement NodeGetVolumeStats RPC
1939            /// call for fetching volume statistics.
1940            GetVolumeStats = 2,
1941            /// See VolumeExpansion for details.
1942            ExpandVolume = 3,
1943            /// Indicates that the Node service can report volume conditions.
1944            /// An SP MAY implement `VolumeCondition` in only the Node
1945            /// Plugin, only the Controller Plugin, or both.
1946            /// If `VolumeCondition` is implemented in both the Node and
1947            /// Controller Plugins, it SHALL report from different
1948            /// perspectives.
1949            /// If for some reason Node and Controller Plugins report
1950            /// misaligned volume conditions, CO SHALL assume the worst case
1951            /// is the truth.
1952            /// Note that, for alpha, `VolumeCondition` is intended to be
1953            /// informative for humans only, not for automation.
1954            VolumeCondition = 4,
1955            /// Indicates the SP supports the SINGLE_NODE_SINGLE_WRITER and/or
1956            /// SINGLE_NODE_MULTI_WRITER access modes.
1957            /// These access modes are intended to replace the
1958            /// SINGLE_NODE_WRITER access mode to clarify the number of writers
1959            /// for a volume on a single node. Plugins MUST accept and allow
1960            /// use of the SINGLE_NODE_WRITER access mode (subject to the
1961            /// processing rules for NodePublishVolume), when either
1962            /// SINGLE_NODE_SINGLE_WRITER and/or SINGLE_NODE_MULTI_WRITER are
1963            /// supported, in order to permit older COs to continue working.
1964            SingleNodeMultiWriter = 5,
1965            /// Indicates that Node service supports mounting volumes
1966            /// with provided volume group identifier during node stage
1967            /// or node publish RPC calls.
1968            VolumeMountGroup = 6,
1969        }
1970        impl Type {
1971            /// String value of the enum field names used in the ProtoBuf definition.
1972            ///
1973            /// The values are not transformed in any way and thus are considered stable
1974            /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1975            pub fn as_str_name(&self) -> &'static str {
1976                match self {
1977                    Type::Unknown => "UNKNOWN",
1978                    Type::StageUnstageVolume => "STAGE_UNSTAGE_VOLUME",
1979                    Type::GetVolumeStats => "GET_VOLUME_STATS",
1980                    Type::ExpandVolume => "EXPAND_VOLUME",
1981                    Type::VolumeCondition => "VOLUME_CONDITION",
1982                    Type::SingleNodeMultiWriter => "SINGLE_NODE_MULTI_WRITER",
1983                    Type::VolumeMountGroup => "VOLUME_MOUNT_GROUP",
1984                }
1985            }
1986            /// Creates an enum from field names used in the ProtoBuf definition.
1987            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1988                match value {
1989                    "UNKNOWN" => Some(Self::Unknown),
1990                    "STAGE_UNSTAGE_VOLUME" => Some(Self::StageUnstageVolume),
1991                    "GET_VOLUME_STATS" => Some(Self::GetVolumeStats),
1992                    "EXPAND_VOLUME" => Some(Self::ExpandVolume),
1993                    "VOLUME_CONDITION" => Some(Self::VolumeCondition),
1994                    "SINGLE_NODE_MULTI_WRITER" => Some(Self::SingleNodeMultiWriter),
1995                    "VOLUME_MOUNT_GROUP" => Some(Self::VolumeMountGroup),
1996                    _ => None,
1997                }
1998            }
1999        }
2000    }
2001    #[allow(clippy::derive_partial_eq_without_eq)]
2002    #[derive(Clone, PartialEq, ::prost::Oneof)]
2003    pub enum Type {
2004        /// RPC that the controller supports.
2005        #[prost(message, tag = "1")]
2006        Rpc(Rpc),
2007    }
2008}
2009#[allow(clippy::derive_partial_eq_without_eq)]
2010#[derive(Clone, PartialEq, ::prost::Message)]
2011pub struct NodeGetInfoRequest {}
2012#[allow(clippy::derive_partial_eq_without_eq)]
2013#[derive(Clone, PartialEq, ::prost::Message)]
2014pub struct NodeGetInfoResponse {
2015    /// The identifier of the node as understood by the SP.
2016    /// This field is REQUIRED.
2017    /// This field MUST contain enough information to uniquely identify
2018    /// this specific node vs all other nodes supported by this plugin.
2019    /// This field SHALL be used by the CO in subsequent calls, including
2020    /// `ControllerPublishVolume`, to refer to this node.
2021    /// The SP is NOT responsible for global uniqueness of node_id across
2022    /// multiple SPs.
2023    /// This field overrides the general CSI size limit.
2024    /// The size of this field SHALL NOT exceed 256 bytes. The general
2025    /// CSI size limit, 128 byte, is RECOMMENDED for best backwards
2026    /// compatibility.
2027    #[prost(string, tag = "1")]
2028    pub node_id: ::prost::alloc::string::String,
2029    /// Maximum number of volumes that controller can publish to the node.
2030    /// If value is not set or zero CO SHALL decide how many volumes of
2031    /// this type can be published by the controller to the node. The
2032    /// plugin MUST NOT set negative values here.
2033    /// This field is OPTIONAL.
2034    #[prost(int64, tag = "2")]
2035    pub max_volumes_per_node: i64,
2036    /// Specifies where (regions, zones, racks, etc.) the node is
2037    /// accessible from.
2038    /// A plugin that returns this field MUST also set the
2039    /// VOLUME_ACCESSIBILITY_CONSTRAINTS plugin capability.
2040    /// COs MAY use this information along with the topology information
2041    /// returned in CreateVolumeResponse to ensure that a given volume is
2042    /// accessible from a given node when scheduling workloads.
2043    /// This field is OPTIONAL. If it is not specified, the CO MAY assume
2044    /// the node is not subject to any topological constraint, and MAY
2045    /// schedule workloads that reference any volume V, such that there are
2046    /// no topological constraints declared for V.
2047    ///
2048    /// Example 1:
2049    ///    accessible_topology =
2050    ///      {"region": "R1", "zone": "Z2"}
2051    /// Indicates the node exists within the "region" "R1" and the "zone"
2052    /// "Z2".
2053    #[prost(message, optional, tag = "3")]
2054    pub accessible_topology: ::core::option::Option<Topology>,
2055}
2056#[allow(clippy::derive_partial_eq_without_eq)]
2057#[derive(Clone, PartialEq, ::prost::Message)]
2058pub struct NodeExpandVolumeRequest {
2059    /// The ID of the volume. This field is REQUIRED.
2060    #[prost(string, tag = "1")]
2061    pub volume_id: ::prost::alloc::string::String,
2062    /// The path on which volume is available. This field is REQUIRED.
2063    /// This field overrides the general CSI size limit.
2064    /// SP SHOULD support the maximum path length allowed by the operating
2065    /// system/filesystem, but, at a minimum, SP MUST accept a max path
2066    /// length of at least 128 bytes.
2067    #[prost(string, tag = "2")]
2068    pub volume_path: ::prost::alloc::string::String,
2069    /// This allows CO to specify the capacity requirements of the volume
2070    /// after expansion. If capacity_range is omitted then a plugin MAY
2071    /// inspect the file system of the volume to determine the maximum
2072    /// capacity to which the volume can be expanded. In such cases a
2073    /// plugin MAY expand the volume to its maximum capacity.
2074    /// This field is OPTIONAL.
2075    #[prost(message, optional, tag = "3")]
2076    pub capacity_range: ::core::option::Option<CapacityRange>,
2077    /// The path where the volume is staged, if the plugin has the
2078    /// STAGE_UNSTAGE_VOLUME capability, otherwise empty.
2079    /// If not empty, it MUST be an absolute path in the root
2080    /// filesystem of the process serving this request.
2081    /// This field is OPTIONAL.
2082    /// This field overrides the general CSI size limit.
2083    /// SP SHOULD support the maximum path length allowed by the operating
2084    /// system/filesystem, but, at a minimum, SP MUST accept a max path
2085    /// length of at least 128 bytes.
2086    #[prost(string, tag = "4")]
2087    pub staging_target_path: ::prost::alloc::string::String,
2088    /// Volume capability describing how the CO intends to use this volume.
2089    /// This allows SP to determine if volume is being used as a block
2090    /// device or mounted file system. For example - if volume is being
2091    /// used as a block device the SP MAY choose to skip expanding the
2092    /// filesystem in NodeExpandVolume implementation but still perform
2093    /// rest of the housekeeping needed for expanding the volume. If
2094    /// volume_capability is omitted the SP MAY determine
2095    /// access_type from given volume_path for the volume and perform
2096    /// node expansion. This is an OPTIONAL field.
2097    #[prost(message, optional, tag = "5")]
2098    pub volume_capability: ::core::option::Option<VolumeCapability>,
2099    /// Secrets required by plugin to complete node expand volume request.
2100    /// This field is OPTIONAL. Refer to the `Secrets Requirements`
2101    /// section on how to use this field.
2102    #[prost(map = "string, string", tag = "6")]
2103    pub secrets: ::std::collections::HashMap<
2104        ::prost::alloc::string::String,
2105        ::prost::alloc::string::String,
2106    >,
2107}
2108#[allow(clippy::derive_partial_eq_without_eq)]
2109#[derive(Clone, PartialEq, ::prost::Message)]
2110pub struct NodeExpandVolumeResponse {
2111    /// The capacity of the volume in bytes. This field is OPTIONAL.
2112    #[prost(int64, tag = "1")]
2113    pub capacity_bytes: i64,
2114}
2115#[allow(clippy::derive_partial_eq_without_eq)]
2116#[derive(Clone, PartialEq, ::prost::Message)]
2117pub struct GroupControllerGetCapabilitiesRequest {}
2118#[allow(clippy::derive_partial_eq_without_eq)]
2119#[derive(Clone, PartialEq, ::prost::Message)]
2120pub struct GroupControllerGetCapabilitiesResponse {
2121    /// All the capabilities that the group controller service supports.
2122    /// This field is OPTIONAL.
2123    #[prost(message, repeated, tag = "1")]
2124    pub capabilities: ::prost::alloc::vec::Vec<GroupControllerServiceCapability>,
2125}
2126/// Specifies a capability of the group controller service.
2127#[allow(clippy::derive_partial_eq_without_eq)]
2128#[derive(Clone, PartialEq, ::prost::Message)]
2129pub struct GroupControllerServiceCapability {
2130    #[prost(oneof = "group_controller_service_capability::Type", tags = "1")]
2131    pub r#type: ::core::option::Option<group_controller_service_capability::Type>,
2132}
2133/// Nested message and enum types in `GroupControllerServiceCapability`.
2134pub mod group_controller_service_capability {
2135    #[allow(clippy::derive_partial_eq_without_eq)]
2136    #[derive(Clone, PartialEq, ::prost::Message)]
2137    pub struct Rpc {
2138        #[prost(enumeration = "rpc::Type", tag = "1")]
2139        pub r#type: i32,
2140    }
2141    /// Nested message and enum types in `RPC`.
2142    pub mod rpc {
2143        #[derive(
2144            Clone,
2145            Copy,
2146            Debug,
2147            PartialEq,
2148            Eq,
2149            Hash,
2150            PartialOrd,
2151            Ord,
2152            ::prost::Enumeration
2153        )]
2154        #[repr(i32)]
2155        pub enum Type {
2156            Unknown = 0,
2157            /// Indicates that the group controller plugin supports
2158            /// creating, deleting, and getting details of a volume
2159            /// group snapshot.
2160            CreateDeleteGetVolumeGroupSnapshot = 1,
2161        }
2162        impl Type {
2163            /// String value of the enum field names used in the ProtoBuf definition.
2164            ///
2165            /// The values are not transformed in any way and thus are considered stable
2166            /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2167            pub fn as_str_name(&self) -> &'static str {
2168                match self {
2169                    Type::Unknown => "UNKNOWN",
2170                    Type::CreateDeleteGetVolumeGroupSnapshot => {
2171                        "CREATE_DELETE_GET_VOLUME_GROUP_SNAPSHOT"
2172                    }
2173                }
2174            }
2175            /// Creates an enum from field names used in the ProtoBuf definition.
2176            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2177                match value {
2178                    "UNKNOWN" => Some(Self::Unknown),
2179                    "CREATE_DELETE_GET_VOLUME_GROUP_SNAPSHOT" => {
2180                        Some(Self::CreateDeleteGetVolumeGroupSnapshot)
2181                    }
2182                    _ => None,
2183                }
2184            }
2185        }
2186    }
2187    #[allow(clippy::derive_partial_eq_without_eq)]
2188    #[derive(Clone, PartialEq, ::prost::Oneof)]
2189    pub enum Type {
2190        /// RPC that the controller supports.
2191        #[prost(message, tag = "1")]
2192        Rpc(Rpc),
2193    }
2194}
2195#[allow(clippy::derive_partial_eq_without_eq)]
2196#[derive(Clone, PartialEq, ::prost::Message)]
2197pub struct CreateVolumeGroupSnapshotRequest {
2198    /// The suggested name for the group snapshot. This field is REQUIRED
2199    /// for idempotency.
2200    /// Any Unicode string that conforms to the length limit is allowed
2201    /// except those containing the following banned characters:
2202    /// U+0000-U+0008, U+000B, U+000C, U+000E-U+001F, U+007F-U+009F.
2203    /// (These are control characters other than commonly used whitespace.)
2204    #[prost(string, tag = "1")]
2205    pub name: ::prost::alloc::string::String,
2206    /// volume IDs of the source volumes to be snapshotted together.
2207    /// This field is REQUIRED.
2208    #[prost(string, repeated, tag = "2")]
2209    pub source_volume_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2210    /// Secrets required by plugin to complete
2211    /// ControllerCreateVolumeGroupSnapshot request.
2212    /// This field is OPTIONAL. Refer to the `Secrets Requirements`
2213    /// section on how to use this field.
2214    /// The secrets provided in this field SHOULD be the same for
2215    /// all group snapshot operations on the same group snapshot.
2216    #[prost(map = "string, string", tag = "3")]
2217    pub secrets: ::std::collections::HashMap<
2218        ::prost::alloc::string::String,
2219        ::prost::alloc::string::String,
2220    >,
2221    /// Plugin specific parameters passed in as opaque key-value pairs.
2222    /// This field is OPTIONAL. The Plugin is responsible for parsing and
2223    /// validating these parameters. COs will treat these as opaque.
2224    #[prost(map = "string, string", tag = "4")]
2225    pub parameters: ::std::collections::HashMap<
2226        ::prost::alloc::string::String,
2227        ::prost::alloc::string::String,
2228    >,
2229}
2230#[allow(clippy::derive_partial_eq_without_eq)]
2231#[derive(Clone, PartialEq, ::prost::Message)]
2232pub struct CreateVolumeGroupSnapshotResponse {
2233    /// Contains all attributes of the newly created group snapshot.
2234    /// This field is REQUIRED.
2235    #[prost(message, optional, tag = "1")]
2236    pub group_snapshot: ::core::option::Option<VolumeGroupSnapshot>,
2237}
2238#[allow(clippy::derive_partial_eq_without_eq)]
2239#[derive(Clone, PartialEq, ::prost::Message)]
2240pub struct VolumeGroupSnapshot {
2241    /// The identifier for this group snapshot, generated by the plugin.
2242    /// This field MUST contain enough information to uniquely identify
2243    /// this specific snapshot vs all other group snapshots supported by
2244    /// this plugin.
2245    /// This field SHALL be used by the CO in subsequent calls to refer to
2246    /// this group snapshot.
2247    /// The SP is NOT responsible for global uniqueness of
2248    /// group_snapshot_id across multiple SPs.
2249    /// This field is REQUIRED.
2250    #[prost(string, tag = "1")]
2251    pub group_snapshot_id: ::prost::alloc::string::String,
2252    /// A list of snapshots belonging to this group.
2253    /// This field is REQUIRED.
2254    #[prost(message, repeated, tag = "2")]
2255    pub snapshots: ::prost::alloc::vec::Vec<Snapshot>,
2256    /// Timestamp of when the volume group snapshot was taken.
2257    /// This field is REQUIRED.
2258    #[prost(message, optional, tag = "3")]
2259    pub creation_time: ::core::option::Option<::prost_types::Timestamp>,
2260    /// Indicates if all individual snapshots in the group snapshot
2261    /// are ready to use as a `volume_content_source` in a
2262    /// `CreateVolumeRequest`. The default value is false.
2263    /// If any snapshot in the list of snapshots in this message have
2264    /// ready_to_use set to false, the SP MUST set this field to false.
2265    /// If all of the snapshots in the list of snapshots in this message
2266    /// have ready_to_use set to true, the SP SHOULD set this field to
2267    /// true.
2268    /// This field is REQUIRED.
2269    #[prost(bool, tag = "4")]
2270    pub ready_to_use: bool,
2271}
2272#[allow(clippy::derive_partial_eq_without_eq)]
2273#[derive(Clone, PartialEq, ::prost::Message)]
2274pub struct DeleteVolumeGroupSnapshotRequest {
2275    /// The ID of the group snapshot to be deleted.
2276    /// This field is REQUIRED.
2277    #[prost(string, tag = "1")]
2278    pub group_snapshot_id: ::prost::alloc::string::String,
2279    /// A list of snapshot IDs that are part of this group snapshot.
2280    /// If SP does not need to rely on this field to delete the snapshots
2281    /// in the group, it SHOULD check this field and report an error
2282    /// if it has the ability to detect a mismatch.
2283    /// Some SPs require this list to delete the snapshots in the group.
2284    /// If SP needs to use this field to delete the snapshots in the
2285    /// group, it MUST report an error if it has the ability to detect
2286    /// a mismatch.
2287    /// This field is REQUIRED.
2288    #[prost(string, repeated, tag = "2")]
2289    pub snapshot_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2290    /// Secrets required by plugin to complete group snapshot deletion
2291    /// request.
2292    /// This field is OPTIONAL. Refer to the `Secrets Requirements`
2293    /// section on how to use this field.
2294    /// The secrets provided in this field SHOULD be the same for
2295    /// all group snapshot operations on the same group snapshot.
2296    #[prost(map = "string, string", tag = "3")]
2297    pub secrets: ::std::collections::HashMap<
2298        ::prost::alloc::string::String,
2299        ::prost::alloc::string::String,
2300    >,
2301}
2302#[allow(clippy::derive_partial_eq_without_eq)]
2303#[derive(Clone, PartialEq, ::prost::Message)]
2304pub struct DeleteVolumeGroupSnapshotResponse {}
2305#[allow(clippy::derive_partial_eq_without_eq)]
2306#[derive(Clone, PartialEq, ::prost::Message)]
2307pub struct GetVolumeGroupSnapshotRequest {
2308    /// The ID of the group snapshot to fetch current group snapshot
2309    /// information for.
2310    /// This field is REQUIRED.
2311    #[prost(string, tag = "1")]
2312    pub group_snapshot_id: ::prost::alloc::string::String,
2313    /// A list of snapshot IDs that are part of this group snapshot.
2314    /// If SP does not need to rely on this field to get the snapshots
2315    /// in the group, it SHOULD check this field and report an error
2316    /// if it has the ability to detect a mismatch.
2317    /// Some SPs require this list to get the snapshots in the group.
2318    /// If SP needs to use this field to get the snapshots in the
2319    /// group, it MUST report an error if it has the ability to detect
2320    /// a mismatch.
2321    /// This field is REQUIRED.
2322    #[prost(string, repeated, tag = "2")]
2323    pub snapshot_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2324    /// Secrets required by plugin to complete
2325    /// GetVolumeGroupSnapshot request.
2326    /// This field is OPTIONAL. Refer to the `Secrets Requirements`
2327    /// section on how to use this field.
2328    /// The secrets provided in this field SHOULD be the same for
2329    /// all group snapshot operations on the same group snapshot.
2330    #[prost(map = "string, string", tag = "3")]
2331    pub secrets: ::std::collections::HashMap<
2332        ::prost::alloc::string::String,
2333        ::prost::alloc::string::String,
2334    >,
2335}
2336#[allow(clippy::derive_partial_eq_without_eq)]
2337#[derive(Clone, PartialEq, ::prost::Message)]
2338pub struct GetVolumeGroupSnapshotResponse {
2339    /// This field is REQUIRED
2340    #[prost(message, optional, tag = "1")]
2341    pub group_snapshot: ::core::option::Option<VolumeGroupSnapshot>,
2342}
2343/// Generated client implementations.
2344pub mod identity_client {
2345    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
2346    use tonic::codegen::*;
2347    use tonic::codegen::http::Uri;
2348    #[derive(Debug, Clone)]
2349    pub struct IdentityClient<T> {
2350        inner: tonic::client::Grpc<T>,
2351    }
2352    impl<T> IdentityClient<T>
2353    where
2354        T: tonic::client::GrpcService<tonic::body::BoxBody>,
2355        T::Error: Into<StdError>,
2356        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
2357        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
2358    {
2359        pub fn new(inner: T) -> Self {
2360            let inner = tonic::client::Grpc::new(inner);
2361            Self { inner }
2362        }
2363        pub fn with_origin(inner: T, origin: Uri) -> Self {
2364            let inner = tonic::client::Grpc::with_origin(inner, origin);
2365            Self { inner }
2366        }
2367        pub fn with_interceptor<F>(
2368            inner: T,
2369            interceptor: F,
2370        ) -> IdentityClient<InterceptedService<T, F>>
2371        where
2372            F: tonic::service::Interceptor,
2373            T::ResponseBody: Default,
2374            T: tonic::codegen::Service<
2375                http::Request<tonic::body::BoxBody>,
2376                Response = http::Response<
2377                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
2378                >,
2379            >,
2380            <T as tonic::codegen::Service<
2381                http::Request<tonic::body::BoxBody>,
2382            >>::Error: Into<StdError> + Send + Sync,
2383        {
2384            IdentityClient::new(InterceptedService::new(inner, interceptor))
2385        }
2386        /// Compress requests with the given encoding.
2387        ///
2388        /// This requires the server to support it otherwise it might respond with an
2389        /// error.
2390        #[must_use]
2391        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2392            self.inner = self.inner.send_compressed(encoding);
2393            self
2394        }
2395        /// Enable decompressing responses.
2396        #[must_use]
2397        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2398            self.inner = self.inner.accept_compressed(encoding);
2399            self
2400        }
2401        /// Limits the maximum size of a decoded message.
2402        ///
2403        /// Default: `4MB`
2404        #[must_use]
2405        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2406            self.inner = self.inner.max_decoding_message_size(limit);
2407            self
2408        }
2409        /// Limits the maximum size of an encoded message.
2410        ///
2411        /// Default: `usize::MAX`
2412        #[must_use]
2413        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2414            self.inner = self.inner.max_encoding_message_size(limit);
2415            self
2416        }
2417        pub async fn get_plugin_info(
2418            &mut self,
2419            request: impl tonic::IntoRequest<super::GetPluginInfoRequest>,
2420        ) -> std::result::Result<
2421            tonic::Response<super::GetPluginInfoResponse>,
2422            tonic::Status,
2423        > {
2424            self.inner
2425                .ready()
2426                .await
2427                .map_err(|e| {
2428                    tonic::Status::new(
2429                        tonic::Code::Unknown,
2430                        format!("Service was not ready: {}", e.into()),
2431                    )
2432                })?;
2433            let codec = tonic::codec::ProstCodec::default();
2434            let path = http::uri::PathAndQuery::from_static(
2435                "/csi.v1.Identity/GetPluginInfo",
2436            );
2437            let mut req = request.into_request();
2438            req.extensions_mut()
2439                .insert(GrpcMethod::new("csi.v1.Identity", "GetPluginInfo"));
2440            self.inner.unary(req, path, codec).await
2441        }
2442        pub async fn get_plugin_capabilities(
2443            &mut self,
2444            request: impl tonic::IntoRequest<super::GetPluginCapabilitiesRequest>,
2445        ) -> std::result::Result<
2446            tonic::Response<super::GetPluginCapabilitiesResponse>,
2447            tonic::Status,
2448        > {
2449            self.inner
2450                .ready()
2451                .await
2452                .map_err(|e| {
2453                    tonic::Status::new(
2454                        tonic::Code::Unknown,
2455                        format!("Service was not ready: {}", e.into()),
2456                    )
2457                })?;
2458            let codec = tonic::codec::ProstCodec::default();
2459            let path = http::uri::PathAndQuery::from_static(
2460                "/csi.v1.Identity/GetPluginCapabilities",
2461            );
2462            let mut req = request.into_request();
2463            req.extensions_mut()
2464                .insert(GrpcMethod::new("csi.v1.Identity", "GetPluginCapabilities"));
2465            self.inner.unary(req, path, codec).await
2466        }
2467        pub async fn probe(
2468            &mut self,
2469            request: impl tonic::IntoRequest<super::ProbeRequest>,
2470        ) -> std::result::Result<tonic::Response<super::ProbeResponse>, tonic::Status> {
2471            self.inner
2472                .ready()
2473                .await
2474                .map_err(|e| {
2475                    tonic::Status::new(
2476                        tonic::Code::Unknown,
2477                        format!("Service was not ready: {}", e.into()),
2478                    )
2479                })?;
2480            let codec = tonic::codec::ProstCodec::default();
2481            let path = http::uri::PathAndQuery::from_static("/csi.v1.Identity/Probe");
2482            let mut req = request.into_request();
2483            req.extensions_mut().insert(GrpcMethod::new("csi.v1.Identity", "Probe"));
2484            self.inner.unary(req, path, codec).await
2485        }
2486    }
2487}
2488/// Generated client implementations.
2489pub mod controller_client {
2490    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
2491    use tonic::codegen::*;
2492    use tonic::codegen::http::Uri;
2493    #[derive(Debug, Clone)]
2494    pub struct ControllerClient<T> {
2495        inner: tonic::client::Grpc<T>,
2496    }
2497    impl<T> ControllerClient<T>
2498    where
2499        T: tonic::client::GrpcService<tonic::body::BoxBody>,
2500        T::Error: Into<StdError>,
2501        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
2502        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
2503    {
2504        pub fn new(inner: T) -> Self {
2505            let inner = tonic::client::Grpc::new(inner);
2506            Self { inner }
2507        }
2508        pub fn with_origin(inner: T, origin: Uri) -> Self {
2509            let inner = tonic::client::Grpc::with_origin(inner, origin);
2510            Self { inner }
2511        }
2512        pub fn with_interceptor<F>(
2513            inner: T,
2514            interceptor: F,
2515        ) -> ControllerClient<InterceptedService<T, F>>
2516        where
2517            F: tonic::service::Interceptor,
2518            T::ResponseBody: Default,
2519            T: tonic::codegen::Service<
2520                http::Request<tonic::body::BoxBody>,
2521                Response = http::Response<
2522                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
2523                >,
2524            >,
2525            <T as tonic::codegen::Service<
2526                http::Request<tonic::body::BoxBody>,
2527            >>::Error: Into<StdError> + Send + Sync,
2528        {
2529            ControllerClient::new(InterceptedService::new(inner, interceptor))
2530        }
2531        /// Compress requests with the given encoding.
2532        ///
2533        /// This requires the server to support it otherwise it might respond with an
2534        /// error.
2535        #[must_use]
2536        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2537            self.inner = self.inner.send_compressed(encoding);
2538            self
2539        }
2540        /// Enable decompressing responses.
2541        #[must_use]
2542        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2543            self.inner = self.inner.accept_compressed(encoding);
2544            self
2545        }
2546        /// Limits the maximum size of a decoded message.
2547        ///
2548        /// Default: `4MB`
2549        #[must_use]
2550        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2551            self.inner = self.inner.max_decoding_message_size(limit);
2552            self
2553        }
2554        /// Limits the maximum size of an encoded message.
2555        ///
2556        /// Default: `usize::MAX`
2557        #[must_use]
2558        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2559            self.inner = self.inner.max_encoding_message_size(limit);
2560            self
2561        }
2562        pub async fn create_volume(
2563            &mut self,
2564            request: impl tonic::IntoRequest<super::CreateVolumeRequest>,
2565        ) -> std::result::Result<
2566            tonic::Response<super::CreateVolumeResponse>,
2567            tonic::Status,
2568        > {
2569            self.inner
2570                .ready()
2571                .await
2572                .map_err(|e| {
2573                    tonic::Status::new(
2574                        tonic::Code::Unknown,
2575                        format!("Service was not ready: {}", e.into()),
2576                    )
2577                })?;
2578            let codec = tonic::codec::ProstCodec::default();
2579            let path = http::uri::PathAndQuery::from_static(
2580                "/csi.v1.Controller/CreateVolume",
2581            );
2582            let mut req = request.into_request();
2583            req.extensions_mut()
2584                .insert(GrpcMethod::new("csi.v1.Controller", "CreateVolume"));
2585            self.inner.unary(req, path, codec).await
2586        }
2587        pub async fn delete_volume(
2588            &mut self,
2589            request: impl tonic::IntoRequest<super::DeleteVolumeRequest>,
2590        ) -> std::result::Result<
2591            tonic::Response<super::DeleteVolumeResponse>,
2592            tonic::Status,
2593        > {
2594            self.inner
2595                .ready()
2596                .await
2597                .map_err(|e| {
2598                    tonic::Status::new(
2599                        tonic::Code::Unknown,
2600                        format!("Service was not ready: {}", e.into()),
2601                    )
2602                })?;
2603            let codec = tonic::codec::ProstCodec::default();
2604            let path = http::uri::PathAndQuery::from_static(
2605                "/csi.v1.Controller/DeleteVolume",
2606            );
2607            let mut req = request.into_request();
2608            req.extensions_mut()
2609                .insert(GrpcMethod::new("csi.v1.Controller", "DeleteVolume"));
2610            self.inner.unary(req, path, codec).await
2611        }
2612        pub async fn controller_publish_volume(
2613            &mut self,
2614            request: impl tonic::IntoRequest<super::ControllerPublishVolumeRequest>,
2615        ) -> std::result::Result<
2616            tonic::Response<super::ControllerPublishVolumeResponse>,
2617            tonic::Status,
2618        > {
2619            self.inner
2620                .ready()
2621                .await
2622                .map_err(|e| {
2623                    tonic::Status::new(
2624                        tonic::Code::Unknown,
2625                        format!("Service was not ready: {}", e.into()),
2626                    )
2627                })?;
2628            let codec = tonic::codec::ProstCodec::default();
2629            let path = http::uri::PathAndQuery::from_static(
2630                "/csi.v1.Controller/ControllerPublishVolume",
2631            );
2632            let mut req = request.into_request();
2633            req.extensions_mut()
2634                .insert(GrpcMethod::new("csi.v1.Controller", "ControllerPublishVolume"));
2635            self.inner.unary(req, path, codec).await
2636        }
2637        pub async fn controller_unpublish_volume(
2638            &mut self,
2639            request: impl tonic::IntoRequest<super::ControllerUnpublishVolumeRequest>,
2640        ) -> std::result::Result<
2641            tonic::Response<super::ControllerUnpublishVolumeResponse>,
2642            tonic::Status,
2643        > {
2644            self.inner
2645                .ready()
2646                .await
2647                .map_err(|e| {
2648                    tonic::Status::new(
2649                        tonic::Code::Unknown,
2650                        format!("Service was not ready: {}", e.into()),
2651                    )
2652                })?;
2653            let codec = tonic::codec::ProstCodec::default();
2654            let path = http::uri::PathAndQuery::from_static(
2655                "/csi.v1.Controller/ControllerUnpublishVolume",
2656            );
2657            let mut req = request.into_request();
2658            req.extensions_mut()
2659                .insert(
2660                    GrpcMethod::new("csi.v1.Controller", "ControllerUnpublishVolume"),
2661                );
2662            self.inner.unary(req, path, codec).await
2663        }
2664        pub async fn validate_volume_capabilities(
2665            &mut self,
2666            request: impl tonic::IntoRequest<super::ValidateVolumeCapabilitiesRequest>,
2667        ) -> std::result::Result<
2668            tonic::Response<super::ValidateVolumeCapabilitiesResponse>,
2669            tonic::Status,
2670        > {
2671            self.inner
2672                .ready()
2673                .await
2674                .map_err(|e| {
2675                    tonic::Status::new(
2676                        tonic::Code::Unknown,
2677                        format!("Service was not ready: {}", e.into()),
2678                    )
2679                })?;
2680            let codec = tonic::codec::ProstCodec::default();
2681            let path = http::uri::PathAndQuery::from_static(
2682                "/csi.v1.Controller/ValidateVolumeCapabilities",
2683            );
2684            let mut req = request.into_request();
2685            req.extensions_mut()
2686                .insert(
2687                    GrpcMethod::new("csi.v1.Controller", "ValidateVolumeCapabilities"),
2688                );
2689            self.inner.unary(req, path, codec).await
2690        }
2691        pub async fn list_volumes(
2692            &mut self,
2693            request: impl tonic::IntoRequest<super::ListVolumesRequest>,
2694        ) -> std::result::Result<
2695            tonic::Response<super::ListVolumesResponse>,
2696            tonic::Status,
2697        > {
2698            self.inner
2699                .ready()
2700                .await
2701                .map_err(|e| {
2702                    tonic::Status::new(
2703                        tonic::Code::Unknown,
2704                        format!("Service was not ready: {}", e.into()),
2705                    )
2706                })?;
2707            let codec = tonic::codec::ProstCodec::default();
2708            let path = http::uri::PathAndQuery::from_static(
2709                "/csi.v1.Controller/ListVolumes",
2710            );
2711            let mut req = request.into_request();
2712            req.extensions_mut()
2713                .insert(GrpcMethod::new("csi.v1.Controller", "ListVolumes"));
2714            self.inner.unary(req, path, codec).await
2715        }
2716        pub async fn get_capacity(
2717            &mut self,
2718            request: impl tonic::IntoRequest<super::GetCapacityRequest>,
2719        ) -> std::result::Result<
2720            tonic::Response<super::GetCapacityResponse>,
2721            tonic::Status,
2722        > {
2723            self.inner
2724                .ready()
2725                .await
2726                .map_err(|e| {
2727                    tonic::Status::new(
2728                        tonic::Code::Unknown,
2729                        format!("Service was not ready: {}", e.into()),
2730                    )
2731                })?;
2732            let codec = tonic::codec::ProstCodec::default();
2733            let path = http::uri::PathAndQuery::from_static(
2734                "/csi.v1.Controller/GetCapacity",
2735            );
2736            let mut req = request.into_request();
2737            req.extensions_mut()
2738                .insert(GrpcMethod::new("csi.v1.Controller", "GetCapacity"));
2739            self.inner.unary(req, path, codec).await
2740        }
2741        pub async fn controller_get_capabilities(
2742            &mut self,
2743            request: impl tonic::IntoRequest<super::ControllerGetCapabilitiesRequest>,
2744        ) -> std::result::Result<
2745            tonic::Response<super::ControllerGetCapabilitiesResponse>,
2746            tonic::Status,
2747        > {
2748            self.inner
2749                .ready()
2750                .await
2751                .map_err(|e| {
2752                    tonic::Status::new(
2753                        tonic::Code::Unknown,
2754                        format!("Service was not ready: {}", e.into()),
2755                    )
2756                })?;
2757            let codec = tonic::codec::ProstCodec::default();
2758            let path = http::uri::PathAndQuery::from_static(
2759                "/csi.v1.Controller/ControllerGetCapabilities",
2760            );
2761            let mut req = request.into_request();
2762            req.extensions_mut()
2763                .insert(
2764                    GrpcMethod::new("csi.v1.Controller", "ControllerGetCapabilities"),
2765                );
2766            self.inner.unary(req, path, codec).await
2767        }
2768        pub async fn create_snapshot(
2769            &mut self,
2770            request: impl tonic::IntoRequest<super::CreateSnapshotRequest>,
2771        ) -> std::result::Result<
2772            tonic::Response<super::CreateSnapshotResponse>,
2773            tonic::Status,
2774        > {
2775            self.inner
2776                .ready()
2777                .await
2778                .map_err(|e| {
2779                    tonic::Status::new(
2780                        tonic::Code::Unknown,
2781                        format!("Service was not ready: {}", e.into()),
2782                    )
2783                })?;
2784            let codec = tonic::codec::ProstCodec::default();
2785            let path = http::uri::PathAndQuery::from_static(
2786                "/csi.v1.Controller/CreateSnapshot",
2787            );
2788            let mut req = request.into_request();
2789            req.extensions_mut()
2790                .insert(GrpcMethod::new("csi.v1.Controller", "CreateSnapshot"));
2791            self.inner.unary(req, path, codec).await
2792        }
2793        pub async fn delete_snapshot(
2794            &mut self,
2795            request: impl tonic::IntoRequest<super::DeleteSnapshotRequest>,
2796        ) -> std::result::Result<
2797            tonic::Response<super::DeleteSnapshotResponse>,
2798            tonic::Status,
2799        > {
2800            self.inner
2801                .ready()
2802                .await
2803                .map_err(|e| {
2804                    tonic::Status::new(
2805                        tonic::Code::Unknown,
2806                        format!("Service was not ready: {}", e.into()),
2807                    )
2808                })?;
2809            let codec = tonic::codec::ProstCodec::default();
2810            let path = http::uri::PathAndQuery::from_static(
2811                "/csi.v1.Controller/DeleteSnapshot",
2812            );
2813            let mut req = request.into_request();
2814            req.extensions_mut()
2815                .insert(GrpcMethod::new("csi.v1.Controller", "DeleteSnapshot"));
2816            self.inner.unary(req, path, codec).await
2817        }
2818        pub async fn list_snapshots(
2819            &mut self,
2820            request: impl tonic::IntoRequest<super::ListSnapshotsRequest>,
2821        ) -> std::result::Result<
2822            tonic::Response<super::ListSnapshotsResponse>,
2823            tonic::Status,
2824        > {
2825            self.inner
2826                .ready()
2827                .await
2828                .map_err(|e| {
2829                    tonic::Status::new(
2830                        tonic::Code::Unknown,
2831                        format!("Service was not ready: {}", e.into()),
2832                    )
2833                })?;
2834            let codec = tonic::codec::ProstCodec::default();
2835            let path = http::uri::PathAndQuery::from_static(
2836                "/csi.v1.Controller/ListSnapshots",
2837            );
2838            let mut req = request.into_request();
2839            req.extensions_mut()
2840                .insert(GrpcMethod::new("csi.v1.Controller", "ListSnapshots"));
2841            self.inner.unary(req, path, codec).await
2842        }
2843        pub async fn controller_expand_volume(
2844            &mut self,
2845            request: impl tonic::IntoRequest<super::ControllerExpandVolumeRequest>,
2846        ) -> std::result::Result<
2847            tonic::Response<super::ControllerExpandVolumeResponse>,
2848            tonic::Status,
2849        > {
2850            self.inner
2851                .ready()
2852                .await
2853                .map_err(|e| {
2854                    tonic::Status::new(
2855                        tonic::Code::Unknown,
2856                        format!("Service was not ready: {}", e.into()),
2857                    )
2858                })?;
2859            let codec = tonic::codec::ProstCodec::default();
2860            let path = http::uri::PathAndQuery::from_static(
2861                "/csi.v1.Controller/ControllerExpandVolume",
2862            );
2863            let mut req = request.into_request();
2864            req.extensions_mut()
2865                .insert(GrpcMethod::new("csi.v1.Controller", "ControllerExpandVolume"));
2866            self.inner.unary(req, path, codec).await
2867        }
2868        pub async fn controller_get_volume(
2869            &mut self,
2870            request: impl tonic::IntoRequest<super::ControllerGetVolumeRequest>,
2871        ) -> std::result::Result<
2872            tonic::Response<super::ControllerGetVolumeResponse>,
2873            tonic::Status,
2874        > {
2875            self.inner
2876                .ready()
2877                .await
2878                .map_err(|e| {
2879                    tonic::Status::new(
2880                        tonic::Code::Unknown,
2881                        format!("Service was not ready: {}", e.into()),
2882                    )
2883                })?;
2884            let codec = tonic::codec::ProstCodec::default();
2885            let path = http::uri::PathAndQuery::from_static(
2886                "/csi.v1.Controller/ControllerGetVolume",
2887            );
2888            let mut req = request.into_request();
2889            req.extensions_mut()
2890                .insert(GrpcMethod::new("csi.v1.Controller", "ControllerGetVolume"));
2891            self.inner.unary(req, path, codec).await
2892        }
2893        pub async fn controller_modify_volume(
2894            &mut self,
2895            request: impl tonic::IntoRequest<super::ControllerModifyVolumeRequest>,
2896        ) -> std::result::Result<
2897            tonic::Response<super::ControllerModifyVolumeResponse>,
2898            tonic::Status,
2899        > {
2900            self.inner
2901                .ready()
2902                .await
2903                .map_err(|e| {
2904                    tonic::Status::new(
2905                        tonic::Code::Unknown,
2906                        format!("Service was not ready: {}", e.into()),
2907                    )
2908                })?;
2909            let codec = tonic::codec::ProstCodec::default();
2910            let path = http::uri::PathAndQuery::from_static(
2911                "/csi.v1.Controller/ControllerModifyVolume",
2912            );
2913            let mut req = request.into_request();
2914            req.extensions_mut()
2915                .insert(GrpcMethod::new("csi.v1.Controller", "ControllerModifyVolume"));
2916            self.inner.unary(req, path, codec).await
2917        }
2918    }
2919}
2920/// Generated client implementations.
2921pub mod group_controller_client {
2922    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
2923    use tonic::codegen::*;
2924    use tonic::codegen::http::Uri;
2925    #[derive(Debug, Clone)]
2926    pub struct GroupControllerClient<T> {
2927        inner: tonic::client::Grpc<T>,
2928    }
2929    impl<T> GroupControllerClient<T>
2930    where
2931        T: tonic::client::GrpcService<tonic::body::BoxBody>,
2932        T::Error: Into<StdError>,
2933        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
2934        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
2935    {
2936        pub fn new(inner: T) -> Self {
2937            let inner = tonic::client::Grpc::new(inner);
2938            Self { inner }
2939        }
2940        pub fn with_origin(inner: T, origin: Uri) -> Self {
2941            let inner = tonic::client::Grpc::with_origin(inner, origin);
2942            Self { inner }
2943        }
2944        pub fn with_interceptor<F>(
2945            inner: T,
2946            interceptor: F,
2947        ) -> GroupControllerClient<InterceptedService<T, F>>
2948        where
2949            F: tonic::service::Interceptor,
2950            T::ResponseBody: Default,
2951            T: tonic::codegen::Service<
2952                http::Request<tonic::body::BoxBody>,
2953                Response = http::Response<
2954                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
2955                >,
2956            >,
2957            <T as tonic::codegen::Service<
2958                http::Request<tonic::body::BoxBody>,
2959            >>::Error: Into<StdError> + Send + Sync,
2960        {
2961            GroupControllerClient::new(InterceptedService::new(inner, interceptor))
2962        }
2963        /// Compress requests with the given encoding.
2964        ///
2965        /// This requires the server to support it otherwise it might respond with an
2966        /// error.
2967        #[must_use]
2968        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2969            self.inner = self.inner.send_compressed(encoding);
2970            self
2971        }
2972        /// Enable decompressing responses.
2973        #[must_use]
2974        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2975            self.inner = self.inner.accept_compressed(encoding);
2976            self
2977        }
2978        /// Limits the maximum size of a decoded message.
2979        ///
2980        /// Default: `4MB`
2981        #[must_use]
2982        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2983            self.inner = self.inner.max_decoding_message_size(limit);
2984            self
2985        }
2986        /// Limits the maximum size of an encoded message.
2987        ///
2988        /// Default: `usize::MAX`
2989        #[must_use]
2990        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2991            self.inner = self.inner.max_encoding_message_size(limit);
2992            self
2993        }
2994        pub async fn group_controller_get_capabilities(
2995            &mut self,
2996            request: impl tonic::IntoRequest<
2997                super::GroupControllerGetCapabilitiesRequest,
2998            >,
2999        ) -> std::result::Result<
3000            tonic::Response<super::GroupControllerGetCapabilitiesResponse>,
3001            tonic::Status,
3002        > {
3003            self.inner
3004                .ready()
3005                .await
3006                .map_err(|e| {
3007                    tonic::Status::new(
3008                        tonic::Code::Unknown,
3009                        format!("Service was not ready: {}", e.into()),
3010                    )
3011                })?;
3012            let codec = tonic::codec::ProstCodec::default();
3013            let path = http::uri::PathAndQuery::from_static(
3014                "/csi.v1.GroupController/GroupControllerGetCapabilities",
3015            );
3016            let mut req = request.into_request();
3017            req.extensions_mut()
3018                .insert(
3019                    GrpcMethod::new(
3020                        "csi.v1.GroupController",
3021                        "GroupControllerGetCapabilities",
3022                    ),
3023                );
3024            self.inner.unary(req, path, codec).await
3025        }
3026        pub async fn create_volume_group_snapshot(
3027            &mut self,
3028            request: impl tonic::IntoRequest<super::CreateVolumeGroupSnapshotRequest>,
3029        ) -> std::result::Result<
3030            tonic::Response<super::CreateVolumeGroupSnapshotResponse>,
3031            tonic::Status,
3032        > {
3033            self.inner
3034                .ready()
3035                .await
3036                .map_err(|e| {
3037                    tonic::Status::new(
3038                        tonic::Code::Unknown,
3039                        format!("Service was not ready: {}", e.into()),
3040                    )
3041                })?;
3042            let codec = tonic::codec::ProstCodec::default();
3043            let path = http::uri::PathAndQuery::from_static(
3044                "/csi.v1.GroupController/CreateVolumeGroupSnapshot",
3045            );
3046            let mut req = request.into_request();
3047            req.extensions_mut()
3048                .insert(
3049                    GrpcMethod::new(
3050                        "csi.v1.GroupController",
3051                        "CreateVolumeGroupSnapshot",
3052                    ),
3053                );
3054            self.inner.unary(req, path, codec).await
3055        }
3056        pub async fn delete_volume_group_snapshot(
3057            &mut self,
3058            request: impl tonic::IntoRequest<super::DeleteVolumeGroupSnapshotRequest>,
3059        ) -> std::result::Result<
3060            tonic::Response<super::DeleteVolumeGroupSnapshotResponse>,
3061            tonic::Status,
3062        > {
3063            self.inner
3064                .ready()
3065                .await
3066                .map_err(|e| {
3067                    tonic::Status::new(
3068                        tonic::Code::Unknown,
3069                        format!("Service was not ready: {}", e.into()),
3070                    )
3071                })?;
3072            let codec = tonic::codec::ProstCodec::default();
3073            let path = http::uri::PathAndQuery::from_static(
3074                "/csi.v1.GroupController/DeleteVolumeGroupSnapshot",
3075            );
3076            let mut req = request.into_request();
3077            req.extensions_mut()
3078                .insert(
3079                    GrpcMethod::new(
3080                        "csi.v1.GroupController",
3081                        "DeleteVolumeGroupSnapshot",
3082                    ),
3083                );
3084            self.inner.unary(req, path, codec).await
3085        }
3086        pub async fn get_volume_group_snapshot(
3087            &mut self,
3088            request: impl tonic::IntoRequest<super::GetVolumeGroupSnapshotRequest>,
3089        ) -> std::result::Result<
3090            tonic::Response<super::GetVolumeGroupSnapshotResponse>,
3091            tonic::Status,
3092        > {
3093            self.inner
3094                .ready()
3095                .await
3096                .map_err(|e| {
3097                    tonic::Status::new(
3098                        tonic::Code::Unknown,
3099                        format!("Service was not ready: {}", e.into()),
3100                    )
3101                })?;
3102            let codec = tonic::codec::ProstCodec::default();
3103            let path = http::uri::PathAndQuery::from_static(
3104                "/csi.v1.GroupController/GetVolumeGroupSnapshot",
3105            );
3106            let mut req = request.into_request();
3107            req.extensions_mut()
3108                .insert(
3109                    GrpcMethod::new("csi.v1.GroupController", "GetVolumeGroupSnapshot"),
3110                );
3111            self.inner.unary(req, path, codec).await
3112        }
3113    }
3114}
3115/// Generated client implementations.
3116pub mod node_client {
3117    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
3118    use tonic::codegen::*;
3119    use tonic::codegen::http::Uri;
3120    #[derive(Debug, Clone)]
3121    pub struct NodeClient<T> {
3122        inner: tonic::client::Grpc<T>,
3123    }
3124    impl<T> NodeClient<T>
3125    where
3126        T: tonic::client::GrpcService<tonic::body::BoxBody>,
3127        T::Error: Into<StdError>,
3128        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
3129        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
3130    {
3131        pub fn new(inner: T) -> Self {
3132            let inner = tonic::client::Grpc::new(inner);
3133            Self { inner }
3134        }
3135        pub fn with_origin(inner: T, origin: Uri) -> Self {
3136            let inner = tonic::client::Grpc::with_origin(inner, origin);
3137            Self { inner }
3138        }
3139        pub fn with_interceptor<F>(
3140            inner: T,
3141            interceptor: F,
3142        ) -> NodeClient<InterceptedService<T, F>>
3143        where
3144            F: tonic::service::Interceptor,
3145            T::ResponseBody: Default,
3146            T: tonic::codegen::Service<
3147                http::Request<tonic::body::BoxBody>,
3148                Response = http::Response<
3149                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
3150                >,
3151            >,
3152            <T as tonic::codegen::Service<
3153                http::Request<tonic::body::BoxBody>,
3154            >>::Error: Into<StdError> + Send + Sync,
3155        {
3156            NodeClient::new(InterceptedService::new(inner, interceptor))
3157        }
3158        /// Compress requests with the given encoding.
3159        ///
3160        /// This requires the server to support it otherwise it might respond with an
3161        /// error.
3162        #[must_use]
3163        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3164            self.inner = self.inner.send_compressed(encoding);
3165            self
3166        }
3167        /// Enable decompressing responses.
3168        #[must_use]
3169        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3170            self.inner = self.inner.accept_compressed(encoding);
3171            self
3172        }
3173        /// Limits the maximum size of a decoded message.
3174        ///
3175        /// Default: `4MB`
3176        #[must_use]
3177        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3178            self.inner = self.inner.max_decoding_message_size(limit);
3179            self
3180        }
3181        /// Limits the maximum size of an encoded message.
3182        ///
3183        /// Default: `usize::MAX`
3184        #[must_use]
3185        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3186            self.inner = self.inner.max_encoding_message_size(limit);
3187            self
3188        }
3189        pub async fn node_stage_volume(
3190            &mut self,
3191            request: impl tonic::IntoRequest<super::NodeStageVolumeRequest>,
3192        ) -> std::result::Result<
3193            tonic::Response<super::NodeStageVolumeResponse>,
3194            tonic::Status,
3195        > {
3196            self.inner
3197                .ready()
3198                .await
3199                .map_err(|e| {
3200                    tonic::Status::new(
3201                        tonic::Code::Unknown,
3202                        format!("Service was not ready: {}", e.into()),
3203                    )
3204                })?;
3205            let codec = tonic::codec::ProstCodec::default();
3206            let path = http::uri::PathAndQuery::from_static(
3207                "/csi.v1.Node/NodeStageVolume",
3208            );
3209            let mut req = request.into_request();
3210            req.extensions_mut()
3211                .insert(GrpcMethod::new("csi.v1.Node", "NodeStageVolume"));
3212            self.inner.unary(req, path, codec).await
3213        }
3214        pub async fn node_unstage_volume(
3215            &mut self,
3216            request: impl tonic::IntoRequest<super::NodeUnstageVolumeRequest>,
3217        ) -> std::result::Result<
3218            tonic::Response<super::NodeUnstageVolumeResponse>,
3219            tonic::Status,
3220        > {
3221            self.inner
3222                .ready()
3223                .await
3224                .map_err(|e| {
3225                    tonic::Status::new(
3226                        tonic::Code::Unknown,
3227                        format!("Service was not ready: {}", e.into()),
3228                    )
3229                })?;
3230            let codec = tonic::codec::ProstCodec::default();
3231            let path = http::uri::PathAndQuery::from_static(
3232                "/csi.v1.Node/NodeUnstageVolume",
3233            );
3234            let mut req = request.into_request();
3235            req.extensions_mut()
3236                .insert(GrpcMethod::new("csi.v1.Node", "NodeUnstageVolume"));
3237            self.inner.unary(req, path, codec).await
3238        }
3239        pub async fn node_publish_volume(
3240            &mut self,
3241            request: impl tonic::IntoRequest<super::NodePublishVolumeRequest>,
3242        ) -> std::result::Result<
3243            tonic::Response<super::NodePublishVolumeResponse>,
3244            tonic::Status,
3245        > {
3246            self.inner
3247                .ready()
3248                .await
3249                .map_err(|e| {
3250                    tonic::Status::new(
3251                        tonic::Code::Unknown,
3252                        format!("Service was not ready: {}", e.into()),
3253                    )
3254                })?;
3255            let codec = tonic::codec::ProstCodec::default();
3256            let path = http::uri::PathAndQuery::from_static(
3257                "/csi.v1.Node/NodePublishVolume",
3258            );
3259            let mut req = request.into_request();
3260            req.extensions_mut()
3261                .insert(GrpcMethod::new("csi.v1.Node", "NodePublishVolume"));
3262            self.inner.unary(req, path, codec).await
3263        }
3264        pub async fn node_unpublish_volume(
3265            &mut self,
3266            request: impl tonic::IntoRequest<super::NodeUnpublishVolumeRequest>,
3267        ) -> std::result::Result<
3268            tonic::Response<super::NodeUnpublishVolumeResponse>,
3269            tonic::Status,
3270        > {
3271            self.inner
3272                .ready()
3273                .await
3274                .map_err(|e| {
3275                    tonic::Status::new(
3276                        tonic::Code::Unknown,
3277                        format!("Service was not ready: {}", e.into()),
3278                    )
3279                })?;
3280            let codec = tonic::codec::ProstCodec::default();
3281            let path = http::uri::PathAndQuery::from_static(
3282                "/csi.v1.Node/NodeUnpublishVolume",
3283            );
3284            let mut req = request.into_request();
3285            req.extensions_mut()
3286                .insert(GrpcMethod::new("csi.v1.Node", "NodeUnpublishVolume"));
3287            self.inner.unary(req, path, codec).await
3288        }
3289        pub async fn node_get_volume_stats(
3290            &mut self,
3291            request: impl tonic::IntoRequest<super::NodeGetVolumeStatsRequest>,
3292        ) -> std::result::Result<
3293            tonic::Response<super::NodeGetVolumeStatsResponse>,
3294            tonic::Status,
3295        > {
3296            self.inner
3297                .ready()
3298                .await
3299                .map_err(|e| {
3300                    tonic::Status::new(
3301                        tonic::Code::Unknown,
3302                        format!("Service was not ready: {}", e.into()),
3303                    )
3304                })?;
3305            let codec = tonic::codec::ProstCodec::default();
3306            let path = http::uri::PathAndQuery::from_static(
3307                "/csi.v1.Node/NodeGetVolumeStats",
3308            );
3309            let mut req = request.into_request();
3310            req.extensions_mut()
3311                .insert(GrpcMethod::new("csi.v1.Node", "NodeGetVolumeStats"));
3312            self.inner.unary(req, path, codec).await
3313        }
3314        pub async fn node_expand_volume(
3315            &mut self,
3316            request: impl tonic::IntoRequest<super::NodeExpandVolumeRequest>,
3317        ) -> std::result::Result<
3318            tonic::Response<super::NodeExpandVolumeResponse>,
3319            tonic::Status,
3320        > {
3321            self.inner
3322                .ready()
3323                .await
3324                .map_err(|e| {
3325                    tonic::Status::new(
3326                        tonic::Code::Unknown,
3327                        format!("Service was not ready: {}", e.into()),
3328                    )
3329                })?;
3330            let codec = tonic::codec::ProstCodec::default();
3331            let path = http::uri::PathAndQuery::from_static(
3332                "/csi.v1.Node/NodeExpandVolume",
3333            );
3334            let mut req = request.into_request();
3335            req.extensions_mut()
3336                .insert(GrpcMethod::new("csi.v1.Node", "NodeExpandVolume"));
3337            self.inner.unary(req, path, codec).await
3338        }
3339        pub async fn node_get_capabilities(
3340            &mut self,
3341            request: impl tonic::IntoRequest<super::NodeGetCapabilitiesRequest>,
3342        ) -> std::result::Result<
3343            tonic::Response<super::NodeGetCapabilitiesResponse>,
3344            tonic::Status,
3345        > {
3346            self.inner
3347                .ready()
3348                .await
3349                .map_err(|e| {
3350                    tonic::Status::new(
3351                        tonic::Code::Unknown,
3352                        format!("Service was not ready: {}", e.into()),
3353                    )
3354                })?;
3355            let codec = tonic::codec::ProstCodec::default();
3356            let path = http::uri::PathAndQuery::from_static(
3357                "/csi.v1.Node/NodeGetCapabilities",
3358            );
3359            let mut req = request.into_request();
3360            req.extensions_mut()
3361                .insert(GrpcMethod::new("csi.v1.Node", "NodeGetCapabilities"));
3362            self.inner.unary(req, path, codec).await
3363        }
3364        pub async fn node_get_info(
3365            &mut self,
3366            request: impl tonic::IntoRequest<super::NodeGetInfoRequest>,
3367        ) -> std::result::Result<
3368            tonic::Response<super::NodeGetInfoResponse>,
3369            tonic::Status,
3370        > {
3371            self.inner
3372                .ready()
3373                .await
3374                .map_err(|e| {
3375                    tonic::Status::new(
3376                        tonic::Code::Unknown,
3377                        format!("Service was not ready: {}", e.into()),
3378                    )
3379                })?;
3380            let codec = tonic::codec::ProstCodec::default();
3381            let path = http::uri::PathAndQuery::from_static("/csi.v1.Node/NodeGetInfo");
3382            let mut req = request.into_request();
3383            req.extensions_mut().insert(GrpcMethod::new("csi.v1.Node", "NodeGetInfo"));
3384            self.inner.unary(req, path, codec).await
3385        }
3386    }
3387}
3388/// Generated server implementations.
3389pub mod identity_server {
3390    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
3391    use tonic::codegen::*;
3392    /// Generated trait containing gRPC methods that should be implemented for use with IdentityServer.
3393    #[async_trait]
3394    pub trait Identity: Send + Sync + 'static {
3395        async fn get_plugin_info(
3396            &self,
3397            request: tonic::Request<super::GetPluginInfoRequest>,
3398        ) -> std::result::Result<
3399            tonic::Response<super::GetPluginInfoResponse>,
3400            tonic::Status,
3401        >;
3402        async fn get_plugin_capabilities(
3403            &self,
3404            request: tonic::Request<super::GetPluginCapabilitiesRequest>,
3405        ) -> std::result::Result<
3406            tonic::Response<super::GetPluginCapabilitiesResponse>,
3407            tonic::Status,
3408        >;
3409        async fn probe(
3410            &self,
3411            request: tonic::Request<super::ProbeRequest>,
3412        ) -> std::result::Result<tonic::Response<super::ProbeResponse>, tonic::Status>;
3413    }
3414    #[derive(Debug)]
3415    pub struct IdentityServer<T: Identity> {
3416        inner: _Inner<T>,
3417        accept_compression_encodings: EnabledCompressionEncodings,
3418        send_compression_encodings: EnabledCompressionEncodings,
3419        max_decoding_message_size: Option<usize>,
3420        max_encoding_message_size: Option<usize>,
3421    }
3422    struct _Inner<T>(Arc<T>);
3423    impl<T: Identity> IdentityServer<T> {
3424        pub fn new(inner: T) -> Self {
3425            Self::from_arc(Arc::new(inner))
3426        }
3427        pub fn from_arc(inner: Arc<T>) -> Self {
3428            let inner = _Inner(inner);
3429            Self {
3430                inner,
3431                accept_compression_encodings: Default::default(),
3432                send_compression_encodings: Default::default(),
3433                max_decoding_message_size: None,
3434                max_encoding_message_size: None,
3435            }
3436        }
3437        pub fn with_interceptor<F>(
3438            inner: T,
3439            interceptor: F,
3440        ) -> InterceptedService<Self, F>
3441        where
3442            F: tonic::service::Interceptor,
3443        {
3444            InterceptedService::new(Self::new(inner), interceptor)
3445        }
3446        /// Enable decompressing requests with the given encoding.
3447        #[must_use]
3448        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3449            self.accept_compression_encodings.enable(encoding);
3450            self
3451        }
3452        /// Compress responses with the given encoding, if the client supports it.
3453        #[must_use]
3454        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3455            self.send_compression_encodings.enable(encoding);
3456            self
3457        }
3458        /// Limits the maximum size of a decoded message.
3459        ///
3460        /// Default: `4MB`
3461        #[must_use]
3462        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3463            self.max_decoding_message_size = Some(limit);
3464            self
3465        }
3466        /// Limits the maximum size of an encoded message.
3467        ///
3468        /// Default: `usize::MAX`
3469        #[must_use]
3470        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3471            self.max_encoding_message_size = Some(limit);
3472            self
3473        }
3474    }
3475    impl<T, B> tonic::codegen::Service<http::Request<B>> for IdentityServer<T>
3476    where
3477        T: Identity,
3478        B: Body + Send + 'static,
3479        B::Error: Into<StdError> + Send + 'static,
3480    {
3481        type Response = http::Response<tonic::body::BoxBody>;
3482        type Error = std::convert::Infallible;
3483        type Future = BoxFuture<Self::Response, Self::Error>;
3484        fn poll_ready(
3485            &mut self,
3486            _cx: &mut Context<'_>,
3487        ) -> Poll<std::result::Result<(), Self::Error>> {
3488            Poll::Ready(Ok(()))
3489        }
3490        fn call(&mut self, req: http::Request<B>) -> Self::Future {
3491            let inner = self.inner.clone();
3492            match req.uri().path() {
3493                "/csi.v1.Identity/GetPluginInfo" => {
3494                    #[allow(non_camel_case_types)]
3495                    struct GetPluginInfoSvc<T: Identity>(pub Arc<T>);
3496                    impl<
3497                        T: Identity,
3498                    > tonic::server::UnaryService<super::GetPluginInfoRequest>
3499                    for GetPluginInfoSvc<T> {
3500                        type Response = super::GetPluginInfoResponse;
3501                        type Future = BoxFuture<
3502                            tonic::Response<Self::Response>,
3503                            tonic::Status,
3504                        >;
3505                        fn call(
3506                            &mut self,
3507                            request: tonic::Request<super::GetPluginInfoRequest>,
3508                        ) -> Self::Future {
3509                            let inner = Arc::clone(&self.0);
3510                            let fut = async move {
3511                                <T as Identity>::get_plugin_info(&inner, request).await
3512                            };
3513                            Box::pin(fut)
3514                        }
3515                    }
3516                    let accept_compression_encodings = self.accept_compression_encodings;
3517                    let send_compression_encodings = self.send_compression_encodings;
3518                    let max_decoding_message_size = self.max_decoding_message_size;
3519                    let max_encoding_message_size = self.max_encoding_message_size;
3520                    let inner = self.inner.clone();
3521                    let fut = async move {
3522                        let inner = inner.0;
3523                        let method = GetPluginInfoSvc(inner);
3524                        let codec = tonic::codec::ProstCodec::default();
3525                        let mut grpc = tonic::server::Grpc::new(codec)
3526                            .apply_compression_config(
3527                                accept_compression_encodings,
3528                                send_compression_encodings,
3529                            )
3530                            .apply_max_message_size_config(
3531                                max_decoding_message_size,
3532                                max_encoding_message_size,
3533                            );
3534                        let res = grpc.unary(method, req).await;
3535                        Ok(res)
3536                    };
3537                    Box::pin(fut)
3538                }
3539                "/csi.v1.Identity/GetPluginCapabilities" => {
3540                    #[allow(non_camel_case_types)]
3541                    struct GetPluginCapabilitiesSvc<T: Identity>(pub Arc<T>);
3542                    impl<
3543                        T: Identity,
3544                    > tonic::server::UnaryService<super::GetPluginCapabilitiesRequest>
3545                    for GetPluginCapabilitiesSvc<T> {
3546                        type Response = super::GetPluginCapabilitiesResponse;
3547                        type Future = BoxFuture<
3548                            tonic::Response<Self::Response>,
3549                            tonic::Status,
3550                        >;
3551                        fn call(
3552                            &mut self,
3553                            request: tonic::Request<super::GetPluginCapabilitiesRequest>,
3554                        ) -> Self::Future {
3555                            let inner = Arc::clone(&self.0);
3556                            let fut = async move {
3557                                <T as Identity>::get_plugin_capabilities(&inner, request)
3558                                    .await
3559                            };
3560                            Box::pin(fut)
3561                        }
3562                    }
3563                    let accept_compression_encodings = self.accept_compression_encodings;
3564                    let send_compression_encodings = self.send_compression_encodings;
3565                    let max_decoding_message_size = self.max_decoding_message_size;
3566                    let max_encoding_message_size = self.max_encoding_message_size;
3567                    let inner = self.inner.clone();
3568                    let fut = async move {
3569                        let inner = inner.0;
3570                        let method = GetPluginCapabilitiesSvc(inner);
3571                        let codec = tonic::codec::ProstCodec::default();
3572                        let mut grpc = tonic::server::Grpc::new(codec)
3573                            .apply_compression_config(
3574                                accept_compression_encodings,
3575                                send_compression_encodings,
3576                            )
3577                            .apply_max_message_size_config(
3578                                max_decoding_message_size,
3579                                max_encoding_message_size,
3580                            );
3581                        let res = grpc.unary(method, req).await;
3582                        Ok(res)
3583                    };
3584                    Box::pin(fut)
3585                }
3586                "/csi.v1.Identity/Probe" => {
3587                    #[allow(non_camel_case_types)]
3588                    struct ProbeSvc<T: Identity>(pub Arc<T>);
3589                    impl<T: Identity> tonic::server::UnaryService<super::ProbeRequest>
3590                    for ProbeSvc<T> {
3591                        type Response = super::ProbeResponse;
3592                        type Future = BoxFuture<
3593                            tonic::Response<Self::Response>,
3594                            tonic::Status,
3595                        >;
3596                        fn call(
3597                            &mut self,
3598                            request: tonic::Request<super::ProbeRequest>,
3599                        ) -> Self::Future {
3600                            let inner = Arc::clone(&self.0);
3601                            let fut = async move {
3602                                <T as Identity>::probe(&inner, request).await
3603                            };
3604                            Box::pin(fut)
3605                        }
3606                    }
3607                    let accept_compression_encodings = self.accept_compression_encodings;
3608                    let send_compression_encodings = self.send_compression_encodings;
3609                    let max_decoding_message_size = self.max_decoding_message_size;
3610                    let max_encoding_message_size = self.max_encoding_message_size;
3611                    let inner = self.inner.clone();
3612                    let fut = async move {
3613                        let inner = inner.0;
3614                        let method = ProbeSvc(inner);
3615                        let codec = tonic::codec::ProstCodec::default();
3616                        let mut grpc = tonic::server::Grpc::new(codec)
3617                            .apply_compression_config(
3618                                accept_compression_encodings,
3619                                send_compression_encodings,
3620                            )
3621                            .apply_max_message_size_config(
3622                                max_decoding_message_size,
3623                                max_encoding_message_size,
3624                            );
3625                        let res = grpc.unary(method, req).await;
3626                        Ok(res)
3627                    };
3628                    Box::pin(fut)
3629                }
3630                _ => {
3631                    Box::pin(async move {
3632                        Ok(
3633                            http::Response::builder()
3634                                .status(200)
3635                                .header("grpc-status", "12")
3636                                .header("content-type", "application/grpc")
3637                                .body(empty_body())
3638                                .unwrap(),
3639                        )
3640                    })
3641                }
3642            }
3643        }
3644    }
3645    impl<T: Identity> Clone for IdentityServer<T> {
3646        fn clone(&self) -> Self {
3647            let inner = self.inner.clone();
3648            Self {
3649                inner,
3650                accept_compression_encodings: self.accept_compression_encodings,
3651                send_compression_encodings: self.send_compression_encodings,
3652                max_decoding_message_size: self.max_decoding_message_size,
3653                max_encoding_message_size: self.max_encoding_message_size,
3654            }
3655        }
3656    }
3657    impl<T: Identity> Clone for _Inner<T> {
3658        fn clone(&self) -> Self {
3659            Self(Arc::clone(&self.0))
3660        }
3661    }
3662    impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
3663        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3664            write!(f, "{:?}", self.0)
3665        }
3666    }
3667    impl<T: Identity> tonic::server::NamedService for IdentityServer<T> {
3668        const NAME: &'static str = "csi.v1.Identity";
3669    }
3670}
3671/// Generated server implementations.
3672pub mod controller_server {
3673    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
3674    use tonic::codegen::*;
3675    /// Generated trait containing gRPC methods that should be implemented for use with ControllerServer.
3676    #[async_trait]
3677    pub trait Controller: Send + Sync + 'static {
3678        async fn create_volume(
3679            &self,
3680            request: tonic::Request<super::CreateVolumeRequest>,
3681        ) -> std::result::Result<
3682            tonic::Response<super::CreateVolumeResponse>,
3683            tonic::Status,
3684        >;
3685        async fn delete_volume(
3686            &self,
3687            request: tonic::Request<super::DeleteVolumeRequest>,
3688        ) -> std::result::Result<
3689            tonic::Response<super::DeleteVolumeResponse>,
3690            tonic::Status,
3691        >;
3692        async fn controller_publish_volume(
3693            &self,
3694            request: tonic::Request<super::ControllerPublishVolumeRequest>,
3695        ) -> std::result::Result<
3696            tonic::Response<super::ControllerPublishVolumeResponse>,
3697            tonic::Status,
3698        >;
3699        async fn controller_unpublish_volume(
3700            &self,
3701            request: tonic::Request<super::ControllerUnpublishVolumeRequest>,
3702        ) -> std::result::Result<
3703            tonic::Response<super::ControllerUnpublishVolumeResponse>,
3704            tonic::Status,
3705        >;
3706        async fn validate_volume_capabilities(
3707            &self,
3708            request: tonic::Request<super::ValidateVolumeCapabilitiesRequest>,
3709        ) -> std::result::Result<
3710            tonic::Response<super::ValidateVolumeCapabilitiesResponse>,
3711            tonic::Status,
3712        >;
3713        async fn list_volumes(
3714            &self,
3715            request: tonic::Request<super::ListVolumesRequest>,
3716        ) -> std::result::Result<
3717            tonic::Response<super::ListVolumesResponse>,
3718            tonic::Status,
3719        >;
3720        async fn get_capacity(
3721            &self,
3722            request: tonic::Request<super::GetCapacityRequest>,
3723        ) -> std::result::Result<
3724            tonic::Response<super::GetCapacityResponse>,
3725            tonic::Status,
3726        >;
3727        async fn controller_get_capabilities(
3728            &self,
3729            request: tonic::Request<super::ControllerGetCapabilitiesRequest>,
3730        ) -> std::result::Result<
3731            tonic::Response<super::ControllerGetCapabilitiesResponse>,
3732            tonic::Status,
3733        >;
3734        async fn create_snapshot(
3735            &self,
3736            request: tonic::Request<super::CreateSnapshotRequest>,
3737        ) -> std::result::Result<
3738            tonic::Response<super::CreateSnapshotResponse>,
3739            tonic::Status,
3740        >;
3741        async fn delete_snapshot(
3742            &self,
3743            request: tonic::Request<super::DeleteSnapshotRequest>,
3744        ) -> std::result::Result<
3745            tonic::Response<super::DeleteSnapshotResponse>,
3746            tonic::Status,
3747        >;
3748        async fn list_snapshots(
3749            &self,
3750            request: tonic::Request<super::ListSnapshotsRequest>,
3751        ) -> std::result::Result<
3752            tonic::Response<super::ListSnapshotsResponse>,
3753            tonic::Status,
3754        >;
3755        async fn controller_expand_volume(
3756            &self,
3757            request: tonic::Request<super::ControllerExpandVolumeRequest>,
3758        ) -> std::result::Result<
3759            tonic::Response<super::ControllerExpandVolumeResponse>,
3760            tonic::Status,
3761        >;
3762        async fn controller_get_volume(
3763            &self,
3764            request: tonic::Request<super::ControllerGetVolumeRequest>,
3765        ) -> std::result::Result<
3766            tonic::Response<super::ControllerGetVolumeResponse>,
3767            tonic::Status,
3768        >;
3769        async fn controller_modify_volume(
3770            &self,
3771            request: tonic::Request<super::ControllerModifyVolumeRequest>,
3772        ) -> std::result::Result<
3773            tonic::Response<super::ControllerModifyVolumeResponse>,
3774            tonic::Status,
3775        >;
3776    }
3777    #[derive(Debug)]
3778    pub struct ControllerServer<T: Controller> {
3779        inner: _Inner<T>,
3780        accept_compression_encodings: EnabledCompressionEncodings,
3781        send_compression_encodings: EnabledCompressionEncodings,
3782        max_decoding_message_size: Option<usize>,
3783        max_encoding_message_size: Option<usize>,
3784    }
3785    struct _Inner<T>(Arc<T>);
3786    impl<T: Controller> ControllerServer<T> {
3787        pub fn new(inner: T) -> Self {
3788            Self::from_arc(Arc::new(inner))
3789        }
3790        pub fn from_arc(inner: Arc<T>) -> Self {
3791            let inner = _Inner(inner);
3792            Self {
3793                inner,
3794                accept_compression_encodings: Default::default(),
3795                send_compression_encodings: Default::default(),
3796                max_decoding_message_size: None,
3797                max_encoding_message_size: None,
3798            }
3799        }
3800        pub fn with_interceptor<F>(
3801            inner: T,
3802            interceptor: F,
3803        ) -> InterceptedService<Self, F>
3804        where
3805            F: tonic::service::Interceptor,
3806        {
3807            InterceptedService::new(Self::new(inner), interceptor)
3808        }
3809        /// Enable decompressing requests with the given encoding.
3810        #[must_use]
3811        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3812            self.accept_compression_encodings.enable(encoding);
3813            self
3814        }
3815        /// Compress responses with the given encoding, if the client supports it.
3816        #[must_use]
3817        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3818            self.send_compression_encodings.enable(encoding);
3819            self
3820        }
3821        /// Limits the maximum size of a decoded message.
3822        ///
3823        /// Default: `4MB`
3824        #[must_use]
3825        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3826            self.max_decoding_message_size = Some(limit);
3827            self
3828        }
3829        /// Limits the maximum size of an encoded message.
3830        ///
3831        /// Default: `usize::MAX`
3832        #[must_use]
3833        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3834            self.max_encoding_message_size = Some(limit);
3835            self
3836        }
3837    }
3838    impl<T, B> tonic::codegen::Service<http::Request<B>> for ControllerServer<T>
3839    where
3840        T: Controller,
3841        B: Body + Send + 'static,
3842        B::Error: Into<StdError> + Send + 'static,
3843    {
3844        type Response = http::Response<tonic::body::BoxBody>;
3845        type Error = std::convert::Infallible;
3846        type Future = BoxFuture<Self::Response, Self::Error>;
3847        fn poll_ready(
3848            &mut self,
3849            _cx: &mut Context<'_>,
3850        ) -> Poll<std::result::Result<(), Self::Error>> {
3851            Poll::Ready(Ok(()))
3852        }
3853        fn call(&mut self, req: http::Request<B>) -> Self::Future {
3854            let inner = self.inner.clone();
3855            match req.uri().path() {
3856                "/csi.v1.Controller/CreateVolume" => {
3857                    #[allow(non_camel_case_types)]
3858                    struct CreateVolumeSvc<T: Controller>(pub Arc<T>);
3859                    impl<
3860                        T: Controller,
3861                    > tonic::server::UnaryService<super::CreateVolumeRequest>
3862                    for CreateVolumeSvc<T> {
3863                        type Response = super::CreateVolumeResponse;
3864                        type Future = BoxFuture<
3865                            tonic::Response<Self::Response>,
3866                            tonic::Status,
3867                        >;
3868                        fn call(
3869                            &mut self,
3870                            request: tonic::Request<super::CreateVolumeRequest>,
3871                        ) -> Self::Future {
3872                            let inner = Arc::clone(&self.0);
3873                            let fut = async move {
3874                                <T as Controller>::create_volume(&inner, request).await
3875                            };
3876                            Box::pin(fut)
3877                        }
3878                    }
3879                    let accept_compression_encodings = self.accept_compression_encodings;
3880                    let send_compression_encodings = self.send_compression_encodings;
3881                    let max_decoding_message_size = self.max_decoding_message_size;
3882                    let max_encoding_message_size = self.max_encoding_message_size;
3883                    let inner = self.inner.clone();
3884                    let fut = async move {
3885                        let inner = inner.0;
3886                        let method = CreateVolumeSvc(inner);
3887                        let codec = tonic::codec::ProstCodec::default();
3888                        let mut grpc = tonic::server::Grpc::new(codec)
3889                            .apply_compression_config(
3890                                accept_compression_encodings,
3891                                send_compression_encodings,
3892                            )
3893                            .apply_max_message_size_config(
3894                                max_decoding_message_size,
3895                                max_encoding_message_size,
3896                            );
3897                        let res = grpc.unary(method, req).await;
3898                        Ok(res)
3899                    };
3900                    Box::pin(fut)
3901                }
3902                "/csi.v1.Controller/DeleteVolume" => {
3903                    #[allow(non_camel_case_types)]
3904                    struct DeleteVolumeSvc<T: Controller>(pub Arc<T>);
3905                    impl<
3906                        T: Controller,
3907                    > tonic::server::UnaryService<super::DeleteVolumeRequest>
3908                    for DeleteVolumeSvc<T> {
3909                        type Response = super::DeleteVolumeResponse;
3910                        type Future = BoxFuture<
3911                            tonic::Response<Self::Response>,
3912                            tonic::Status,
3913                        >;
3914                        fn call(
3915                            &mut self,
3916                            request: tonic::Request<super::DeleteVolumeRequest>,
3917                        ) -> Self::Future {
3918                            let inner = Arc::clone(&self.0);
3919                            let fut = async move {
3920                                <T as Controller>::delete_volume(&inner, request).await
3921                            };
3922                            Box::pin(fut)
3923                        }
3924                    }
3925                    let accept_compression_encodings = self.accept_compression_encodings;
3926                    let send_compression_encodings = self.send_compression_encodings;
3927                    let max_decoding_message_size = self.max_decoding_message_size;
3928                    let max_encoding_message_size = self.max_encoding_message_size;
3929                    let inner = self.inner.clone();
3930                    let fut = async move {
3931                        let inner = inner.0;
3932                        let method = DeleteVolumeSvc(inner);
3933                        let codec = tonic::codec::ProstCodec::default();
3934                        let mut grpc = tonic::server::Grpc::new(codec)
3935                            .apply_compression_config(
3936                                accept_compression_encodings,
3937                                send_compression_encodings,
3938                            )
3939                            .apply_max_message_size_config(
3940                                max_decoding_message_size,
3941                                max_encoding_message_size,
3942                            );
3943                        let res = grpc.unary(method, req).await;
3944                        Ok(res)
3945                    };
3946                    Box::pin(fut)
3947                }
3948                "/csi.v1.Controller/ControllerPublishVolume" => {
3949                    #[allow(non_camel_case_types)]
3950                    struct ControllerPublishVolumeSvc<T: Controller>(pub Arc<T>);
3951                    impl<
3952                        T: Controller,
3953                    > tonic::server::UnaryService<super::ControllerPublishVolumeRequest>
3954                    for ControllerPublishVolumeSvc<T> {
3955                        type Response = super::ControllerPublishVolumeResponse;
3956                        type Future = BoxFuture<
3957                            tonic::Response<Self::Response>,
3958                            tonic::Status,
3959                        >;
3960                        fn call(
3961                            &mut self,
3962                            request: tonic::Request<
3963                                super::ControllerPublishVolumeRequest,
3964                            >,
3965                        ) -> Self::Future {
3966                            let inner = Arc::clone(&self.0);
3967                            let fut = async move {
3968                                <T as Controller>::controller_publish_volume(
3969                                        &inner,
3970                                        request,
3971                                    )
3972                                    .await
3973                            };
3974                            Box::pin(fut)
3975                        }
3976                    }
3977                    let accept_compression_encodings = self.accept_compression_encodings;
3978                    let send_compression_encodings = self.send_compression_encodings;
3979                    let max_decoding_message_size = self.max_decoding_message_size;
3980                    let max_encoding_message_size = self.max_encoding_message_size;
3981                    let inner = self.inner.clone();
3982                    let fut = async move {
3983                        let inner = inner.0;
3984                        let method = ControllerPublishVolumeSvc(inner);
3985                        let codec = tonic::codec::ProstCodec::default();
3986                        let mut grpc = tonic::server::Grpc::new(codec)
3987                            .apply_compression_config(
3988                                accept_compression_encodings,
3989                                send_compression_encodings,
3990                            )
3991                            .apply_max_message_size_config(
3992                                max_decoding_message_size,
3993                                max_encoding_message_size,
3994                            );
3995                        let res = grpc.unary(method, req).await;
3996                        Ok(res)
3997                    };
3998                    Box::pin(fut)
3999                }
4000                "/csi.v1.Controller/ControllerUnpublishVolume" => {
4001                    #[allow(non_camel_case_types)]
4002                    struct ControllerUnpublishVolumeSvc<T: Controller>(pub Arc<T>);
4003                    impl<
4004                        T: Controller,
4005                    > tonic::server::UnaryService<
4006                        super::ControllerUnpublishVolumeRequest,
4007                    > for ControllerUnpublishVolumeSvc<T> {
4008                        type Response = super::ControllerUnpublishVolumeResponse;
4009                        type Future = BoxFuture<
4010                            tonic::Response<Self::Response>,
4011                            tonic::Status,
4012                        >;
4013                        fn call(
4014                            &mut self,
4015                            request: tonic::Request<
4016                                super::ControllerUnpublishVolumeRequest,
4017                            >,
4018                        ) -> Self::Future {
4019                            let inner = Arc::clone(&self.0);
4020                            let fut = async move {
4021                                <T as Controller>::controller_unpublish_volume(
4022                                        &inner,
4023                                        request,
4024                                    )
4025                                    .await
4026                            };
4027                            Box::pin(fut)
4028                        }
4029                    }
4030                    let accept_compression_encodings = self.accept_compression_encodings;
4031                    let send_compression_encodings = self.send_compression_encodings;
4032                    let max_decoding_message_size = self.max_decoding_message_size;
4033                    let max_encoding_message_size = self.max_encoding_message_size;
4034                    let inner = self.inner.clone();
4035                    let fut = async move {
4036                        let inner = inner.0;
4037                        let method = ControllerUnpublishVolumeSvc(inner);
4038                        let codec = tonic::codec::ProstCodec::default();
4039                        let mut grpc = tonic::server::Grpc::new(codec)
4040                            .apply_compression_config(
4041                                accept_compression_encodings,
4042                                send_compression_encodings,
4043                            )
4044                            .apply_max_message_size_config(
4045                                max_decoding_message_size,
4046                                max_encoding_message_size,
4047                            );
4048                        let res = grpc.unary(method, req).await;
4049                        Ok(res)
4050                    };
4051                    Box::pin(fut)
4052                }
4053                "/csi.v1.Controller/ValidateVolumeCapabilities" => {
4054                    #[allow(non_camel_case_types)]
4055                    struct ValidateVolumeCapabilitiesSvc<T: Controller>(pub Arc<T>);
4056                    impl<
4057                        T: Controller,
4058                    > tonic::server::UnaryService<
4059                        super::ValidateVolumeCapabilitiesRequest,
4060                    > for ValidateVolumeCapabilitiesSvc<T> {
4061                        type Response = super::ValidateVolumeCapabilitiesResponse;
4062                        type Future = BoxFuture<
4063                            tonic::Response<Self::Response>,
4064                            tonic::Status,
4065                        >;
4066                        fn call(
4067                            &mut self,
4068                            request: tonic::Request<
4069                                super::ValidateVolumeCapabilitiesRequest,
4070                            >,
4071                        ) -> Self::Future {
4072                            let inner = Arc::clone(&self.0);
4073                            let fut = async move {
4074                                <T as Controller>::validate_volume_capabilities(
4075                                        &inner,
4076                                        request,
4077                                    )
4078                                    .await
4079                            };
4080                            Box::pin(fut)
4081                        }
4082                    }
4083                    let accept_compression_encodings = self.accept_compression_encodings;
4084                    let send_compression_encodings = self.send_compression_encodings;
4085                    let max_decoding_message_size = self.max_decoding_message_size;
4086                    let max_encoding_message_size = self.max_encoding_message_size;
4087                    let inner = self.inner.clone();
4088                    let fut = async move {
4089                        let inner = inner.0;
4090                        let method = ValidateVolumeCapabilitiesSvc(inner);
4091                        let codec = tonic::codec::ProstCodec::default();
4092                        let mut grpc = tonic::server::Grpc::new(codec)
4093                            .apply_compression_config(
4094                                accept_compression_encodings,
4095                                send_compression_encodings,
4096                            )
4097                            .apply_max_message_size_config(
4098                                max_decoding_message_size,
4099                                max_encoding_message_size,
4100                            );
4101                        let res = grpc.unary(method, req).await;
4102                        Ok(res)
4103                    };
4104                    Box::pin(fut)
4105                }
4106                "/csi.v1.Controller/ListVolumes" => {
4107                    #[allow(non_camel_case_types)]
4108                    struct ListVolumesSvc<T: Controller>(pub Arc<T>);
4109                    impl<
4110                        T: Controller,
4111                    > tonic::server::UnaryService<super::ListVolumesRequest>
4112                    for ListVolumesSvc<T> {
4113                        type Response = super::ListVolumesResponse;
4114                        type Future = BoxFuture<
4115                            tonic::Response<Self::Response>,
4116                            tonic::Status,
4117                        >;
4118                        fn call(
4119                            &mut self,
4120                            request: tonic::Request<super::ListVolumesRequest>,
4121                        ) -> Self::Future {
4122                            let inner = Arc::clone(&self.0);
4123                            let fut = async move {
4124                                <T as Controller>::list_volumes(&inner, request).await
4125                            };
4126                            Box::pin(fut)
4127                        }
4128                    }
4129                    let accept_compression_encodings = self.accept_compression_encodings;
4130                    let send_compression_encodings = self.send_compression_encodings;
4131                    let max_decoding_message_size = self.max_decoding_message_size;
4132                    let max_encoding_message_size = self.max_encoding_message_size;
4133                    let inner = self.inner.clone();
4134                    let fut = async move {
4135                        let inner = inner.0;
4136                        let method = ListVolumesSvc(inner);
4137                        let codec = tonic::codec::ProstCodec::default();
4138                        let mut grpc = tonic::server::Grpc::new(codec)
4139                            .apply_compression_config(
4140                                accept_compression_encodings,
4141                                send_compression_encodings,
4142                            )
4143                            .apply_max_message_size_config(
4144                                max_decoding_message_size,
4145                                max_encoding_message_size,
4146                            );
4147                        let res = grpc.unary(method, req).await;
4148                        Ok(res)
4149                    };
4150                    Box::pin(fut)
4151                }
4152                "/csi.v1.Controller/GetCapacity" => {
4153                    #[allow(non_camel_case_types)]
4154                    struct GetCapacitySvc<T: Controller>(pub Arc<T>);
4155                    impl<
4156                        T: Controller,
4157                    > tonic::server::UnaryService<super::GetCapacityRequest>
4158                    for GetCapacitySvc<T> {
4159                        type Response = super::GetCapacityResponse;
4160                        type Future = BoxFuture<
4161                            tonic::Response<Self::Response>,
4162                            tonic::Status,
4163                        >;
4164                        fn call(
4165                            &mut self,
4166                            request: tonic::Request<super::GetCapacityRequest>,
4167                        ) -> Self::Future {
4168                            let inner = Arc::clone(&self.0);
4169                            let fut = async move {
4170                                <T as Controller>::get_capacity(&inner, request).await
4171                            };
4172                            Box::pin(fut)
4173                        }
4174                    }
4175                    let accept_compression_encodings = self.accept_compression_encodings;
4176                    let send_compression_encodings = self.send_compression_encodings;
4177                    let max_decoding_message_size = self.max_decoding_message_size;
4178                    let max_encoding_message_size = self.max_encoding_message_size;
4179                    let inner = self.inner.clone();
4180                    let fut = async move {
4181                        let inner = inner.0;
4182                        let method = GetCapacitySvc(inner);
4183                        let codec = tonic::codec::ProstCodec::default();
4184                        let mut grpc = tonic::server::Grpc::new(codec)
4185                            .apply_compression_config(
4186                                accept_compression_encodings,
4187                                send_compression_encodings,
4188                            )
4189                            .apply_max_message_size_config(
4190                                max_decoding_message_size,
4191                                max_encoding_message_size,
4192                            );
4193                        let res = grpc.unary(method, req).await;
4194                        Ok(res)
4195                    };
4196                    Box::pin(fut)
4197                }
4198                "/csi.v1.Controller/ControllerGetCapabilities" => {
4199                    #[allow(non_camel_case_types)]
4200                    struct ControllerGetCapabilitiesSvc<T: Controller>(pub Arc<T>);
4201                    impl<
4202                        T: Controller,
4203                    > tonic::server::UnaryService<
4204                        super::ControllerGetCapabilitiesRequest,
4205                    > for ControllerGetCapabilitiesSvc<T> {
4206                        type Response = super::ControllerGetCapabilitiesResponse;
4207                        type Future = BoxFuture<
4208                            tonic::Response<Self::Response>,
4209                            tonic::Status,
4210                        >;
4211                        fn call(
4212                            &mut self,
4213                            request: tonic::Request<
4214                                super::ControllerGetCapabilitiesRequest,
4215                            >,
4216                        ) -> Self::Future {
4217                            let inner = Arc::clone(&self.0);
4218                            let fut = async move {
4219                                <T as Controller>::controller_get_capabilities(
4220                                        &inner,
4221                                        request,
4222                                    )
4223                                    .await
4224                            };
4225                            Box::pin(fut)
4226                        }
4227                    }
4228                    let accept_compression_encodings = self.accept_compression_encodings;
4229                    let send_compression_encodings = self.send_compression_encodings;
4230                    let max_decoding_message_size = self.max_decoding_message_size;
4231                    let max_encoding_message_size = self.max_encoding_message_size;
4232                    let inner = self.inner.clone();
4233                    let fut = async move {
4234                        let inner = inner.0;
4235                        let method = ControllerGetCapabilitiesSvc(inner);
4236                        let codec = tonic::codec::ProstCodec::default();
4237                        let mut grpc = tonic::server::Grpc::new(codec)
4238                            .apply_compression_config(
4239                                accept_compression_encodings,
4240                                send_compression_encodings,
4241                            )
4242                            .apply_max_message_size_config(
4243                                max_decoding_message_size,
4244                                max_encoding_message_size,
4245                            );
4246                        let res = grpc.unary(method, req).await;
4247                        Ok(res)
4248                    };
4249                    Box::pin(fut)
4250                }
4251                "/csi.v1.Controller/CreateSnapshot" => {
4252                    #[allow(non_camel_case_types)]
4253                    struct CreateSnapshotSvc<T: Controller>(pub Arc<T>);
4254                    impl<
4255                        T: Controller,
4256                    > tonic::server::UnaryService<super::CreateSnapshotRequest>
4257                    for CreateSnapshotSvc<T> {
4258                        type Response = super::CreateSnapshotResponse;
4259                        type Future = BoxFuture<
4260                            tonic::Response<Self::Response>,
4261                            tonic::Status,
4262                        >;
4263                        fn call(
4264                            &mut self,
4265                            request: tonic::Request<super::CreateSnapshotRequest>,
4266                        ) -> Self::Future {
4267                            let inner = Arc::clone(&self.0);
4268                            let fut = async move {
4269                                <T as Controller>::create_snapshot(&inner, request).await
4270                            };
4271                            Box::pin(fut)
4272                        }
4273                    }
4274                    let accept_compression_encodings = self.accept_compression_encodings;
4275                    let send_compression_encodings = self.send_compression_encodings;
4276                    let max_decoding_message_size = self.max_decoding_message_size;
4277                    let max_encoding_message_size = self.max_encoding_message_size;
4278                    let inner = self.inner.clone();
4279                    let fut = async move {
4280                        let inner = inner.0;
4281                        let method = CreateSnapshotSvc(inner);
4282                        let codec = tonic::codec::ProstCodec::default();
4283                        let mut grpc = tonic::server::Grpc::new(codec)
4284                            .apply_compression_config(
4285                                accept_compression_encodings,
4286                                send_compression_encodings,
4287                            )
4288                            .apply_max_message_size_config(
4289                                max_decoding_message_size,
4290                                max_encoding_message_size,
4291                            );
4292                        let res = grpc.unary(method, req).await;
4293                        Ok(res)
4294                    };
4295                    Box::pin(fut)
4296                }
4297                "/csi.v1.Controller/DeleteSnapshot" => {
4298                    #[allow(non_camel_case_types)]
4299                    struct DeleteSnapshotSvc<T: Controller>(pub Arc<T>);
4300                    impl<
4301                        T: Controller,
4302                    > tonic::server::UnaryService<super::DeleteSnapshotRequest>
4303                    for DeleteSnapshotSvc<T> {
4304                        type Response = super::DeleteSnapshotResponse;
4305                        type Future = BoxFuture<
4306                            tonic::Response<Self::Response>,
4307                            tonic::Status,
4308                        >;
4309                        fn call(
4310                            &mut self,
4311                            request: tonic::Request<super::DeleteSnapshotRequest>,
4312                        ) -> Self::Future {
4313                            let inner = Arc::clone(&self.0);
4314                            let fut = async move {
4315                                <T as Controller>::delete_snapshot(&inner, request).await
4316                            };
4317                            Box::pin(fut)
4318                        }
4319                    }
4320                    let accept_compression_encodings = self.accept_compression_encodings;
4321                    let send_compression_encodings = self.send_compression_encodings;
4322                    let max_decoding_message_size = self.max_decoding_message_size;
4323                    let max_encoding_message_size = self.max_encoding_message_size;
4324                    let inner = self.inner.clone();
4325                    let fut = async move {
4326                        let inner = inner.0;
4327                        let method = DeleteSnapshotSvc(inner);
4328                        let codec = tonic::codec::ProstCodec::default();
4329                        let mut grpc = tonic::server::Grpc::new(codec)
4330                            .apply_compression_config(
4331                                accept_compression_encodings,
4332                                send_compression_encodings,
4333                            )
4334                            .apply_max_message_size_config(
4335                                max_decoding_message_size,
4336                                max_encoding_message_size,
4337                            );
4338                        let res = grpc.unary(method, req).await;
4339                        Ok(res)
4340                    };
4341                    Box::pin(fut)
4342                }
4343                "/csi.v1.Controller/ListSnapshots" => {
4344                    #[allow(non_camel_case_types)]
4345                    struct ListSnapshotsSvc<T: Controller>(pub Arc<T>);
4346                    impl<
4347                        T: Controller,
4348                    > tonic::server::UnaryService<super::ListSnapshotsRequest>
4349                    for ListSnapshotsSvc<T> {
4350                        type Response = super::ListSnapshotsResponse;
4351                        type Future = BoxFuture<
4352                            tonic::Response<Self::Response>,
4353                            tonic::Status,
4354                        >;
4355                        fn call(
4356                            &mut self,
4357                            request: tonic::Request<super::ListSnapshotsRequest>,
4358                        ) -> Self::Future {
4359                            let inner = Arc::clone(&self.0);
4360                            let fut = async move {
4361                                <T as Controller>::list_snapshots(&inner, request).await
4362                            };
4363                            Box::pin(fut)
4364                        }
4365                    }
4366                    let accept_compression_encodings = self.accept_compression_encodings;
4367                    let send_compression_encodings = self.send_compression_encodings;
4368                    let max_decoding_message_size = self.max_decoding_message_size;
4369                    let max_encoding_message_size = self.max_encoding_message_size;
4370                    let inner = self.inner.clone();
4371                    let fut = async move {
4372                        let inner = inner.0;
4373                        let method = ListSnapshotsSvc(inner);
4374                        let codec = tonic::codec::ProstCodec::default();
4375                        let mut grpc = tonic::server::Grpc::new(codec)
4376                            .apply_compression_config(
4377                                accept_compression_encodings,
4378                                send_compression_encodings,
4379                            )
4380                            .apply_max_message_size_config(
4381                                max_decoding_message_size,
4382                                max_encoding_message_size,
4383                            );
4384                        let res = grpc.unary(method, req).await;
4385                        Ok(res)
4386                    };
4387                    Box::pin(fut)
4388                }
4389                "/csi.v1.Controller/ControllerExpandVolume" => {
4390                    #[allow(non_camel_case_types)]
4391                    struct ControllerExpandVolumeSvc<T: Controller>(pub Arc<T>);
4392                    impl<
4393                        T: Controller,
4394                    > tonic::server::UnaryService<super::ControllerExpandVolumeRequest>
4395                    for ControllerExpandVolumeSvc<T> {
4396                        type Response = super::ControllerExpandVolumeResponse;
4397                        type Future = BoxFuture<
4398                            tonic::Response<Self::Response>,
4399                            tonic::Status,
4400                        >;
4401                        fn call(
4402                            &mut self,
4403                            request: tonic::Request<super::ControllerExpandVolumeRequest>,
4404                        ) -> Self::Future {
4405                            let inner = Arc::clone(&self.0);
4406                            let fut = async move {
4407                                <T as Controller>::controller_expand_volume(&inner, request)
4408                                    .await
4409                            };
4410                            Box::pin(fut)
4411                        }
4412                    }
4413                    let accept_compression_encodings = self.accept_compression_encodings;
4414                    let send_compression_encodings = self.send_compression_encodings;
4415                    let max_decoding_message_size = self.max_decoding_message_size;
4416                    let max_encoding_message_size = self.max_encoding_message_size;
4417                    let inner = self.inner.clone();
4418                    let fut = async move {
4419                        let inner = inner.0;
4420                        let method = ControllerExpandVolumeSvc(inner);
4421                        let codec = tonic::codec::ProstCodec::default();
4422                        let mut grpc = tonic::server::Grpc::new(codec)
4423                            .apply_compression_config(
4424                                accept_compression_encodings,
4425                                send_compression_encodings,
4426                            )
4427                            .apply_max_message_size_config(
4428                                max_decoding_message_size,
4429                                max_encoding_message_size,
4430                            );
4431                        let res = grpc.unary(method, req).await;
4432                        Ok(res)
4433                    };
4434                    Box::pin(fut)
4435                }
4436                "/csi.v1.Controller/ControllerGetVolume" => {
4437                    #[allow(non_camel_case_types)]
4438                    struct ControllerGetVolumeSvc<T: Controller>(pub Arc<T>);
4439                    impl<
4440                        T: Controller,
4441                    > tonic::server::UnaryService<super::ControllerGetVolumeRequest>
4442                    for ControllerGetVolumeSvc<T> {
4443                        type Response = super::ControllerGetVolumeResponse;
4444                        type Future = BoxFuture<
4445                            tonic::Response<Self::Response>,
4446                            tonic::Status,
4447                        >;
4448                        fn call(
4449                            &mut self,
4450                            request: tonic::Request<super::ControllerGetVolumeRequest>,
4451                        ) -> Self::Future {
4452                            let inner = Arc::clone(&self.0);
4453                            let fut = async move {
4454                                <T as Controller>::controller_get_volume(&inner, request)
4455                                    .await
4456                            };
4457                            Box::pin(fut)
4458                        }
4459                    }
4460                    let accept_compression_encodings = self.accept_compression_encodings;
4461                    let send_compression_encodings = self.send_compression_encodings;
4462                    let max_decoding_message_size = self.max_decoding_message_size;
4463                    let max_encoding_message_size = self.max_encoding_message_size;
4464                    let inner = self.inner.clone();
4465                    let fut = async move {
4466                        let inner = inner.0;
4467                        let method = ControllerGetVolumeSvc(inner);
4468                        let codec = tonic::codec::ProstCodec::default();
4469                        let mut grpc = tonic::server::Grpc::new(codec)
4470                            .apply_compression_config(
4471                                accept_compression_encodings,
4472                                send_compression_encodings,
4473                            )
4474                            .apply_max_message_size_config(
4475                                max_decoding_message_size,
4476                                max_encoding_message_size,
4477                            );
4478                        let res = grpc.unary(method, req).await;
4479                        Ok(res)
4480                    };
4481                    Box::pin(fut)
4482                }
4483                "/csi.v1.Controller/ControllerModifyVolume" => {
4484                    #[allow(non_camel_case_types)]
4485                    struct ControllerModifyVolumeSvc<T: Controller>(pub Arc<T>);
4486                    impl<
4487                        T: Controller,
4488                    > tonic::server::UnaryService<super::ControllerModifyVolumeRequest>
4489                    for ControllerModifyVolumeSvc<T> {
4490                        type Response = super::ControllerModifyVolumeResponse;
4491                        type Future = BoxFuture<
4492                            tonic::Response<Self::Response>,
4493                            tonic::Status,
4494                        >;
4495                        fn call(
4496                            &mut self,
4497                            request: tonic::Request<super::ControllerModifyVolumeRequest>,
4498                        ) -> Self::Future {
4499                            let inner = Arc::clone(&self.0);
4500                            let fut = async move {
4501                                <T as Controller>::controller_modify_volume(&inner, request)
4502                                    .await
4503                            };
4504                            Box::pin(fut)
4505                        }
4506                    }
4507                    let accept_compression_encodings = self.accept_compression_encodings;
4508                    let send_compression_encodings = self.send_compression_encodings;
4509                    let max_decoding_message_size = self.max_decoding_message_size;
4510                    let max_encoding_message_size = self.max_encoding_message_size;
4511                    let inner = self.inner.clone();
4512                    let fut = async move {
4513                        let inner = inner.0;
4514                        let method = ControllerModifyVolumeSvc(inner);
4515                        let codec = tonic::codec::ProstCodec::default();
4516                        let mut grpc = tonic::server::Grpc::new(codec)
4517                            .apply_compression_config(
4518                                accept_compression_encodings,
4519                                send_compression_encodings,
4520                            )
4521                            .apply_max_message_size_config(
4522                                max_decoding_message_size,
4523                                max_encoding_message_size,
4524                            );
4525                        let res = grpc.unary(method, req).await;
4526                        Ok(res)
4527                    };
4528                    Box::pin(fut)
4529                }
4530                _ => {
4531                    Box::pin(async move {
4532                        Ok(
4533                            http::Response::builder()
4534                                .status(200)
4535                                .header("grpc-status", "12")
4536                                .header("content-type", "application/grpc")
4537                                .body(empty_body())
4538                                .unwrap(),
4539                        )
4540                    })
4541                }
4542            }
4543        }
4544    }
4545    impl<T: Controller> Clone for ControllerServer<T> {
4546        fn clone(&self) -> Self {
4547            let inner = self.inner.clone();
4548            Self {
4549                inner,
4550                accept_compression_encodings: self.accept_compression_encodings,
4551                send_compression_encodings: self.send_compression_encodings,
4552                max_decoding_message_size: self.max_decoding_message_size,
4553                max_encoding_message_size: self.max_encoding_message_size,
4554            }
4555        }
4556    }
4557    impl<T: Controller> Clone for _Inner<T> {
4558        fn clone(&self) -> Self {
4559            Self(Arc::clone(&self.0))
4560        }
4561    }
4562    impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
4563        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4564            write!(f, "{:?}", self.0)
4565        }
4566    }
4567    impl<T: Controller> tonic::server::NamedService for ControllerServer<T> {
4568        const NAME: &'static str = "csi.v1.Controller";
4569    }
4570}
4571/// Generated server implementations.
4572pub mod group_controller_server {
4573    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
4574    use tonic::codegen::*;
4575    /// Generated trait containing gRPC methods that should be implemented for use with GroupControllerServer.
4576    #[async_trait]
4577    pub trait GroupController: Send + Sync + 'static {
4578        async fn group_controller_get_capabilities(
4579            &self,
4580            request: tonic::Request<super::GroupControllerGetCapabilitiesRequest>,
4581        ) -> std::result::Result<
4582            tonic::Response<super::GroupControllerGetCapabilitiesResponse>,
4583            tonic::Status,
4584        >;
4585        async fn create_volume_group_snapshot(
4586            &self,
4587            request: tonic::Request<super::CreateVolumeGroupSnapshotRequest>,
4588        ) -> std::result::Result<
4589            tonic::Response<super::CreateVolumeGroupSnapshotResponse>,
4590            tonic::Status,
4591        >;
4592        async fn delete_volume_group_snapshot(
4593            &self,
4594            request: tonic::Request<super::DeleteVolumeGroupSnapshotRequest>,
4595        ) -> std::result::Result<
4596            tonic::Response<super::DeleteVolumeGroupSnapshotResponse>,
4597            tonic::Status,
4598        >;
4599        async fn get_volume_group_snapshot(
4600            &self,
4601            request: tonic::Request<super::GetVolumeGroupSnapshotRequest>,
4602        ) -> std::result::Result<
4603            tonic::Response<super::GetVolumeGroupSnapshotResponse>,
4604            tonic::Status,
4605        >;
4606    }
4607    #[derive(Debug)]
4608    pub struct GroupControllerServer<T: GroupController> {
4609        inner: _Inner<T>,
4610        accept_compression_encodings: EnabledCompressionEncodings,
4611        send_compression_encodings: EnabledCompressionEncodings,
4612        max_decoding_message_size: Option<usize>,
4613        max_encoding_message_size: Option<usize>,
4614    }
4615    struct _Inner<T>(Arc<T>);
4616    impl<T: GroupController> GroupControllerServer<T> {
4617        pub fn new(inner: T) -> Self {
4618            Self::from_arc(Arc::new(inner))
4619        }
4620        pub fn from_arc(inner: Arc<T>) -> Self {
4621            let inner = _Inner(inner);
4622            Self {
4623                inner,
4624                accept_compression_encodings: Default::default(),
4625                send_compression_encodings: Default::default(),
4626                max_decoding_message_size: None,
4627                max_encoding_message_size: None,
4628            }
4629        }
4630        pub fn with_interceptor<F>(
4631            inner: T,
4632            interceptor: F,
4633        ) -> InterceptedService<Self, F>
4634        where
4635            F: tonic::service::Interceptor,
4636        {
4637            InterceptedService::new(Self::new(inner), interceptor)
4638        }
4639        /// Enable decompressing requests with the given encoding.
4640        #[must_use]
4641        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4642            self.accept_compression_encodings.enable(encoding);
4643            self
4644        }
4645        /// Compress responses with the given encoding, if the client supports it.
4646        #[must_use]
4647        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4648            self.send_compression_encodings.enable(encoding);
4649            self
4650        }
4651        /// Limits the maximum size of a decoded message.
4652        ///
4653        /// Default: `4MB`
4654        #[must_use]
4655        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4656            self.max_decoding_message_size = Some(limit);
4657            self
4658        }
4659        /// Limits the maximum size of an encoded message.
4660        ///
4661        /// Default: `usize::MAX`
4662        #[must_use]
4663        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4664            self.max_encoding_message_size = Some(limit);
4665            self
4666        }
4667    }
4668    impl<T, B> tonic::codegen::Service<http::Request<B>> for GroupControllerServer<T>
4669    where
4670        T: GroupController,
4671        B: Body + Send + 'static,
4672        B::Error: Into<StdError> + Send + 'static,
4673    {
4674        type Response = http::Response<tonic::body::BoxBody>;
4675        type Error = std::convert::Infallible;
4676        type Future = BoxFuture<Self::Response, Self::Error>;
4677        fn poll_ready(
4678            &mut self,
4679            _cx: &mut Context<'_>,
4680        ) -> Poll<std::result::Result<(), Self::Error>> {
4681            Poll::Ready(Ok(()))
4682        }
4683        fn call(&mut self, req: http::Request<B>) -> Self::Future {
4684            let inner = self.inner.clone();
4685            match req.uri().path() {
4686                "/csi.v1.GroupController/GroupControllerGetCapabilities" => {
4687                    #[allow(non_camel_case_types)]
4688                    struct GroupControllerGetCapabilitiesSvc<T: GroupController>(
4689                        pub Arc<T>,
4690                    );
4691                    impl<
4692                        T: GroupController,
4693                    > tonic::server::UnaryService<
4694                        super::GroupControllerGetCapabilitiesRequest,
4695                    > for GroupControllerGetCapabilitiesSvc<T> {
4696                        type Response = super::GroupControllerGetCapabilitiesResponse;
4697                        type Future = BoxFuture<
4698                            tonic::Response<Self::Response>,
4699                            tonic::Status,
4700                        >;
4701                        fn call(
4702                            &mut self,
4703                            request: tonic::Request<
4704                                super::GroupControllerGetCapabilitiesRequest,
4705                            >,
4706                        ) -> Self::Future {
4707                            let inner = Arc::clone(&self.0);
4708                            let fut = async move {
4709                                <T as GroupController>::group_controller_get_capabilities(
4710                                        &inner,
4711                                        request,
4712                                    )
4713                                    .await
4714                            };
4715                            Box::pin(fut)
4716                        }
4717                    }
4718                    let accept_compression_encodings = self.accept_compression_encodings;
4719                    let send_compression_encodings = self.send_compression_encodings;
4720                    let max_decoding_message_size = self.max_decoding_message_size;
4721                    let max_encoding_message_size = self.max_encoding_message_size;
4722                    let inner = self.inner.clone();
4723                    let fut = async move {
4724                        let inner = inner.0;
4725                        let method = GroupControllerGetCapabilitiesSvc(inner);
4726                        let codec = tonic::codec::ProstCodec::default();
4727                        let mut grpc = tonic::server::Grpc::new(codec)
4728                            .apply_compression_config(
4729                                accept_compression_encodings,
4730                                send_compression_encodings,
4731                            )
4732                            .apply_max_message_size_config(
4733                                max_decoding_message_size,
4734                                max_encoding_message_size,
4735                            );
4736                        let res = grpc.unary(method, req).await;
4737                        Ok(res)
4738                    };
4739                    Box::pin(fut)
4740                }
4741                "/csi.v1.GroupController/CreateVolumeGroupSnapshot" => {
4742                    #[allow(non_camel_case_types)]
4743                    struct CreateVolumeGroupSnapshotSvc<T: GroupController>(pub Arc<T>);
4744                    impl<
4745                        T: GroupController,
4746                    > tonic::server::UnaryService<
4747                        super::CreateVolumeGroupSnapshotRequest,
4748                    > for CreateVolumeGroupSnapshotSvc<T> {
4749                        type Response = super::CreateVolumeGroupSnapshotResponse;
4750                        type Future = BoxFuture<
4751                            tonic::Response<Self::Response>,
4752                            tonic::Status,
4753                        >;
4754                        fn call(
4755                            &mut self,
4756                            request: tonic::Request<
4757                                super::CreateVolumeGroupSnapshotRequest,
4758                            >,
4759                        ) -> Self::Future {
4760                            let inner = Arc::clone(&self.0);
4761                            let fut = async move {
4762                                <T as GroupController>::create_volume_group_snapshot(
4763                                        &inner,
4764                                        request,
4765                                    )
4766                                    .await
4767                            };
4768                            Box::pin(fut)
4769                        }
4770                    }
4771                    let accept_compression_encodings = self.accept_compression_encodings;
4772                    let send_compression_encodings = self.send_compression_encodings;
4773                    let max_decoding_message_size = self.max_decoding_message_size;
4774                    let max_encoding_message_size = self.max_encoding_message_size;
4775                    let inner = self.inner.clone();
4776                    let fut = async move {
4777                        let inner = inner.0;
4778                        let method = CreateVolumeGroupSnapshotSvc(inner);
4779                        let codec = tonic::codec::ProstCodec::default();
4780                        let mut grpc = tonic::server::Grpc::new(codec)
4781                            .apply_compression_config(
4782                                accept_compression_encodings,
4783                                send_compression_encodings,
4784                            )
4785                            .apply_max_message_size_config(
4786                                max_decoding_message_size,
4787                                max_encoding_message_size,
4788                            );
4789                        let res = grpc.unary(method, req).await;
4790                        Ok(res)
4791                    };
4792                    Box::pin(fut)
4793                }
4794                "/csi.v1.GroupController/DeleteVolumeGroupSnapshot" => {
4795                    #[allow(non_camel_case_types)]
4796                    struct DeleteVolumeGroupSnapshotSvc<T: GroupController>(pub Arc<T>);
4797                    impl<
4798                        T: GroupController,
4799                    > tonic::server::UnaryService<
4800                        super::DeleteVolumeGroupSnapshotRequest,
4801                    > for DeleteVolumeGroupSnapshotSvc<T> {
4802                        type Response = super::DeleteVolumeGroupSnapshotResponse;
4803                        type Future = BoxFuture<
4804                            tonic::Response<Self::Response>,
4805                            tonic::Status,
4806                        >;
4807                        fn call(
4808                            &mut self,
4809                            request: tonic::Request<
4810                                super::DeleteVolumeGroupSnapshotRequest,
4811                            >,
4812                        ) -> Self::Future {
4813                            let inner = Arc::clone(&self.0);
4814                            let fut = async move {
4815                                <T as GroupController>::delete_volume_group_snapshot(
4816                                        &inner,
4817                                        request,
4818                                    )
4819                                    .await
4820                            };
4821                            Box::pin(fut)
4822                        }
4823                    }
4824                    let accept_compression_encodings = self.accept_compression_encodings;
4825                    let send_compression_encodings = self.send_compression_encodings;
4826                    let max_decoding_message_size = self.max_decoding_message_size;
4827                    let max_encoding_message_size = self.max_encoding_message_size;
4828                    let inner = self.inner.clone();
4829                    let fut = async move {
4830                        let inner = inner.0;
4831                        let method = DeleteVolumeGroupSnapshotSvc(inner);
4832                        let codec = tonic::codec::ProstCodec::default();
4833                        let mut grpc = tonic::server::Grpc::new(codec)
4834                            .apply_compression_config(
4835                                accept_compression_encodings,
4836                                send_compression_encodings,
4837                            )
4838                            .apply_max_message_size_config(
4839                                max_decoding_message_size,
4840                                max_encoding_message_size,
4841                            );
4842                        let res = grpc.unary(method, req).await;
4843                        Ok(res)
4844                    };
4845                    Box::pin(fut)
4846                }
4847                "/csi.v1.GroupController/GetVolumeGroupSnapshot" => {
4848                    #[allow(non_camel_case_types)]
4849                    struct GetVolumeGroupSnapshotSvc<T: GroupController>(pub Arc<T>);
4850                    impl<
4851                        T: GroupController,
4852                    > tonic::server::UnaryService<super::GetVolumeGroupSnapshotRequest>
4853                    for GetVolumeGroupSnapshotSvc<T> {
4854                        type Response = super::GetVolumeGroupSnapshotResponse;
4855                        type Future = BoxFuture<
4856                            tonic::Response<Self::Response>,
4857                            tonic::Status,
4858                        >;
4859                        fn call(
4860                            &mut self,
4861                            request: tonic::Request<super::GetVolumeGroupSnapshotRequest>,
4862                        ) -> Self::Future {
4863                            let inner = Arc::clone(&self.0);
4864                            let fut = async move {
4865                                <T as GroupController>::get_volume_group_snapshot(
4866                                        &inner,
4867                                        request,
4868                                    )
4869                                    .await
4870                            };
4871                            Box::pin(fut)
4872                        }
4873                    }
4874                    let accept_compression_encodings = self.accept_compression_encodings;
4875                    let send_compression_encodings = self.send_compression_encodings;
4876                    let max_decoding_message_size = self.max_decoding_message_size;
4877                    let max_encoding_message_size = self.max_encoding_message_size;
4878                    let inner = self.inner.clone();
4879                    let fut = async move {
4880                        let inner = inner.0;
4881                        let method = GetVolumeGroupSnapshotSvc(inner);
4882                        let codec = tonic::codec::ProstCodec::default();
4883                        let mut grpc = tonic::server::Grpc::new(codec)
4884                            .apply_compression_config(
4885                                accept_compression_encodings,
4886                                send_compression_encodings,
4887                            )
4888                            .apply_max_message_size_config(
4889                                max_decoding_message_size,
4890                                max_encoding_message_size,
4891                            );
4892                        let res = grpc.unary(method, req).await;
4893                        Ok(res)
4894                    };
4895                    Box::pin(fut)
4896                }
4897                _ => {
4898                    Box::pin(async move {
4899                        Ok(
4900                            http::Response::builder()
4901                                .status(200)
4902                                .header("grpc-status", "12")
4903                                .header("content-type", "application/grpc")
4904                                .body(empty_body())
4905                                .unwrap(),
4906                        )
4907                    })
4908                }
4909            }
4910        }
4911    }
4912    impl<T: GroupController> Clone for GroupControllerServer<T> {
4913        fn clone(&self) -> Self {
4914            let inner = self.inner.clone();
4915            Self {
4916                inner,
4917                accept_compression_encodings: self.accept_compression_encodings,
4918                send_compression_encodings: self.send_compression_encodings,
4919                max_decoding_message_size: self.max_decoding_message_size,
4920                max_encoding_message_size: self.max_encoding_message_size,
4921            }
4922        }
4923    }
4924    impl<T: GroupController> Clone for _Inner<T> {
4925        fn clone(&self) -> Self {
4926            Self(Arc::clone(&self.0))
4927        }
4928    }
4929    impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
4930        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4931            write!(f, "{:?}", self.0)
4932        }
4933    }
4934    impl<T: GroupController> tonic::server::NamedService for GroupControllerServer<T> {
4935        const NAME: &'static str = "csi.v1.GroupController";
4936    }
4937}
4938/// Generated server implementations.
4939pub mod node_server {
4940    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
4941    use tonic::codegen::*;
4942    /// Generated trait containing gRPC methods that should be implemented for use with NodeServer.
4943    #[async_trait]
4944    pub trait Node: Send + Sync + 'static {
4945        async fn node_stage_volume(
4946            &self,
4947            request: tonic::Request<super::NodeStageVolumeRequest>,
4948        ) -> std::result::Result<
4949            tonic::Response<super::NodeStageVolumeResponse>,
4950            tonic::Status,
4951        >;
4952        async fn node_unstage_volume(
4953            &self,
4954            request: tonic::Request<super::NodeUnstageVolumeRequest>,
4955        ) -> std::result::Result<
4956            tonic::Response<super::NodeUnstageVolumeResponse>,
4957            tonic::Status,
4958        >;
4959        async fn node_publish_volume(
4960            &self,
4961            request: tonic::Request<super::NodePublishVolumeRequest>,
4962        ) -> std::result::Result<
4963            tonic::Response<super::NodePublishVolumeResponse>,
4964            tonic::Status,
4965        >;
4966        async fn node_unpublish_volume(
4967            &self,
4968            request: tonic::Request<super::NodeUnpublishVolumeRequest>,
4969        ) -> std::result::Result<
4970            tonic::Response<super::NodeUnpublishVolumeResponse>,
4971            tonic::Status,
4972        >;
4973        async fn node_get_volume_stats(
4974            &self,
4975            request: tonic::Request<super::NodeGetVolumeStatsRequest>,
4976        ) -> std::result::Result<
4977            tonic::Response<super::NodeGetVolumeStatsResponse>,
4978            tonic::Status,
4979        >;
4980        async fn node_expand_volume(
4981            &self,
4982            request: tonic::Request<super::NodeExpandVolumeRequest>,
4983        ) -> std::result::Result<
4984            tonic::Response<super::NodeExpandVolumeResponse>,
4985            tonic::Status,
4986        >;
4987        async fn node_get_capabilities(
4988            &self,
4989            request: tonic::Request<super::NodeGetCapabilitiesRequest>,
4990        ) -> std::result::Result<
4991            tonic::Response<super::NodeGetCapabilitiesResponse>,
4992            tonic::Status,
4993        >;
4994        async fn node_get_info(
4995            &self,
4996            request: tonic::Request<super::NodeGetInfoRequest>,
4997        ) -> std::result::Result<
4998            tonic::Response<super::NodeGetInfoResponse>,
4999            tonic::Status,
5000        >;
5001    }
5002    #[derive(Debug)]
5003    pub struct NodeServer<T: Node> {
5004        inner: _Inner<T>,
5005        accept_compression_encodings: EnabledCompressionEncodings,
5006        send_compression_encodings: EnabledCompressionEncodings,
5007        max_decoding_message_size: Option<usize>,
5008        max_encoding_message_size: Option<usize>,
5009    }
5010    struct _Inner<T>(Arc<T>);
5011    impl<T: Node> NodeServer<T> {
5012        pub fn new(inner: T) -> Self {
5013            Self::from_arc(Arc::new(inner))
5014        }
5015        pub fn from_arc(inner: Arc<T>) -> Self {
5016            let inner = _Inner(inner);
5017            Self {
5018                inner,
5019                accept_compression_encodings: Default::default(),
5020                send_compression_encodings: Default::default(),
5021                max_decoding_message_size: None,
5022                max_encoding_message_size: None,
5023            }
5024        }
5025        pub fn with_interceptor<F>(
5026            inner: T,
5027            interceptor: F,
5028        ) -> InterceptedService<Self, F>
5029        where
5030            F: tonic::service::Interceptor,
5031        {
5032            InterceptedService::new(Self::new(inner), interceptor)
5033        }
5034        /// Enable decompressing requests with the given encoding.
5035        #[must_use]
5036        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5037            self.accept_compression_encodings.enable(encoding);
5038            self
5039        }
5040        /// Compress responses with the given encoding, if the client supports it.
5041        #[must_use]
5042        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5043            self.send_compression_encodings.enable(encoding);
5044            self
5045        }
5046        /// Limits the maximum size of a decoded message.
5047        ///
5048        /// Default: `4MB`
5049        #[must_use]
5050        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5051            self.max_decoding_message_size = Some(limit);
5052            self
5053        }
5054        /// Limits the maximum size of an encoded message.
5055        ///
5056        /// Default: `usize::MAX`
5057        #[must_use]
5058        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5059            self.max_encoding_message_size = Some(limit);
5060            self
5061        }
5062    }
5063    impl<T, B> tonic::codegen::Service<http::Request<B>> for NodeServer<T>
5064    where
5065        T: Node,
5066        B: Body + Send + 'static,
5067        B::Error: Into<StdError> + Send + 'static,
5068    {
5069        type Response = http::Response<tonic::body::BoxBody>;
5070        type Error = std::convert::Infallible;
5071        type Future = BoxFuture<Self::Response, Self::Error>;
5072        fn poll_ready(
5073            &mut self,
5074            _cx: &mut Context<'_>,
5075        ) -> Poll<std::result::Result<(), Self::Error>> {
5076            Poll::Ready(Ok(()))
5077        }
5078        fn call(&mut self, req: http::Request<B>) -> Self::Future {
5079            let inner = self.inner.clone();
5080            match req.uri().path() {
5081                "/csi.v1.Node/NodeStageVolume" => {
5082                    #[allow(non_camel_case_types)]
5083                    struct NodeStageVolumeSvc<T: Node>(pub Arc<T>);
5084                    impl<
5085                        T: Node,
5086                    > tonic::server::UnaryService<super::NodeStageVolumeRequest>
5087                    for NodeStageVolumeSvc<T> {
5088                        type Response = super::NodeStageVolumeResponse;
5089                        type Future = BoxFuture<
5090                            tonic::Response<Self::Response>,
5091                            tonic::Status,
5092                        >;
5093                        fn call(
5094                            &mut self,
5095                            request: tonic::Request<super::NodeStageVolumeRequest>,
5096                        ) -> Self::Future {
5097                            let inner = Arc::clone(&self.0);
5098                            let fut = async move {
5099                                <T as Node>::node_stage_volume(&inner, request).await
5100                            };
5101                            Box::pin(fut)
5102                        }
5103                    }
5104                    let accept_compression_encodings = self.accept_compression_encodings;
5105                    let send_compression_encodings = self.send_compression_encodings;
5106                    let max_decoding_message_size = self.max_decoding_message_size;
5107                    let max_encoding_message_size = self.max_encoding_message_size;
5108                    let inner = self.inner.clone();
5109                    let fut = async move {
5110                        let inner = inner.0;
5111                        let method = NodeStageVolumeSvc(inner);
5112                        let codec = tonic::codec::ProstCodec::default();
5113                        let mut grpc = tonic::server::Grpc::new(codec)
5114                            .apply_compression_config(
5115                                accept_compression_encodings,
5116                                send_compression_encodings,
5117                            )
5118                            .apply_max_message_size_config(
5119                                max_decoding_message_size,
5120                                max_encoding_message_size,
5121                            );
5122                        let res = grpc.unary(method, req).await;
5123                        Ok(res)
5124                    };
5125                    Box::pin(fut)
5126                }
5127                "/csi.v1.Node/NodeUnstageVolume" => {
5128                    #[allow(non_camel_case_types)]
5129                    struct NodeUnstageVolumeSvc<T: Node>(pub Arc<T>);
5130                    impl<
5131                        T: Node,
5132                    > tonic::server::UnaryService<super::NodeUnstageVolumeRequest>
5133                    for NodeUnstageVolumeSvc<T> {
5134                        type Response = super::NodeUnstageVolumeResponse;
5135                        type Future = BoxFuture<
5136                            tonic::Response<Self::Response>,
5137                            tonic::Status,
5138                        >;
5139                        fn call(
5140                            &mut self,
5141                            request: tonic::Request<super::NodeUnstageVolumeRequest>,
5142                        ) -> Self::Future {
5143                            let inner = Arc::clone(&self.0);
5144                            let fut = async move {
5145                                <T as Node>::node_unstage_volume(&inner, request).await
5146                            };
5147                            Box::pin(fut)
5148                        }
5149                    }
5150                    let accept_compression_encodings = self.accept_compression_encodings;
5151                    let send_compression_encodings = self.send_compression_encodings;
5152                    let max_decoding_message_size = self.max_decoding_message_size;
5153                    let max_encoding_message_size = self.max_encoding_message_size;
5154                    let inner = self.inner.clone();
5155                    let fut = async move {
5156                        let inner = inner.0;
5157                        let method = NodeUnstageVolumeSvc(inner);
5158                        let codec = tonic::codec::ProstCodec::default();
5159                        let mut grpc = tonic::server::Grpc::new(codec)
5160                            .apply_compression_config(
5161                                accept_compression_encodings,
5162                                send_compression_encodings,
5163                            )
5164                            .apply_max_message_size_config(
5165                                max_decoding_message_size,
5166                                max_encoding_message_size,
5167                            );
5168                        let res = grpc.unary(method, req).await;
5169                        Ok(res)
5170                    };
5171                    Box::pin(fut)
5172                }
5173                "/csi.v1.Node/NodePublishVolume" => {
5174                    #[allow(non_camel_case_types)]
5175                    struct NodePublishVolumeSvc<T: Node>(pub Arc<T>);
5176                    impl<
5177                        T: Node,
5178                    > tonic::server::UnaryService<super::NodePublishVolumeRequest>
5179                    for NodePublishVolumeSvc<T> {
5180                        type Response = super::NodePublishVolumeResponse;
5181                        type Future = BoxFuture<
5182                            tonic::Response<Self::Response>,
5183                            tonic::Status,
5184                        >;
5185                        fn call(
5186                            &mut self,
5187                            request: tonic::Request<super::NodePublishVolumeRequest>,
5188                        ) -> Self::Future {
5189                            let inner = Arc::clone(&self.0);
5190                            let fut = async move {
5191                                <T as Node>::node_publish_volume(&inner, request).await
5192                            };
5193                            Box::pin(fut)
5194                        }
5195                    }
5196                    let accept_compression_encodings = self.accept_compression_encodings;
5197                    let send_compression_encodings = self.send_compression_encodings;
5198                    let max_decoding_message_size = self.max_decoding_message_size;
5199                    let max_encoding_message_size = self.max_encoding_message_size;
5200                    let inner = self.inner.clone();
5201                    let fut = async move {
5202                        let inner = inner.0;
5203                        let method = NodePublishVolumeSvc(inner);
5204                        let codec = tonic::codec::ProstCodec::default();
5205                        let mut grpc = tonic::server::Grpc::new(codec)
5206                            .apply_compression_config(
5207                                accept_compression_encodings,
5208                                send_compression_encodings,
5209                            )
5210                            .apply_max_message_size_config(
5211                                max_decoding_message_size,
5212                                max_encoding_message_size,
5213                            );
5214                        let res = grpc.unary(method, req).await;
5215                        Ok(res)
5216                    };
5217                    Box::pin(fut)
5218                }
5219                "/csi.v1.Node/NodeUnpublishVolume" => {
5220                    #[allow(non_camel_case_types)]
5221                    struct NodeUnpublishVolumeSvc<T: Node>(pub Arc<T>);
5222                    impl<
5223                        T: Node,
5224                    > tonic::server::UnaryService<super::NodeUnpublishVolumeRequest>
5225                    for NodeUnpublishVolumeSvc<T> {
5226                        type Response = super::NodeUnpublishVolumeResponse;
5227                        type Future = BoxFuture<
5228                            tonic::Response<Self::Response>,
5229                            tonic::Status,
5230                        >;
5231                        fn call(
5232                            &mut self,
5233                            request: tonic::Request<super::NodeUnpublishVolumeRequest>,
5234                        ) -> Self::Future {
5235                            let inner = Arc::clone(&self.0);
5236                            let fut = async move {
5237                                <T as Node>::node_unpublish_volume(&inner, request).await
5238                            };
5239                            Box::pin(fut)
5240                        }
5241                    }
5242                    let accept_compression_encodings = self.accept_compression_encodings;
5243                    let send_compression_encodings = self.send_compression_encodings;
5244                    let max_decoding_message_size = self.max_decoding_message_size;
5245                    let max_encoding_message_size = self.max_encoding_message_size;
5246                    let inner = self.inner.clone();
5247                    let fut = async move {
5248                        let inner = inner.0;
5249                        let method = NodeUnpublishVolumeSvc(inner);
5250                        let codec = tonic::codec::ProstCodec::default();
5251                        let mut grpc = tonic::server::Grpc::new(codec)
5252                            .apply_compression_config(
5253                                accept_compression_encodings,
5254                                send_compression_encodings,
5255                            )
5256                            .apply_max_message_size_config(
5257                                max_decoding_message_size,
5258                                max_encoding_message_size,
5259                            );
5260                        let res = grpc.unary(method, req).await;
5261                        Ok(res)
5262                    };
5263                    Box::pin(fut)
5264                }
5265                "/csi.v1.Node/NodeGetVolumeStats" => {
5266                    #[allow(non_camel_case_types)]
5267                    struct NodeGetVolumeStatsSvc<T: Node>(pub Arc<T>);
5268                    impl<
5269                        T: Node,
5270                    > tonic::server::UnaryService<super::NodeGetVolumeStatsRequest>
5271                    for NodeGetVolumeStatsSvc<T> {
5272                        type Response = super::NodeGetVolumeStatsResponse;
5273                        type Future = BoxFuture<
5274                            tonic::Response<Self::Response>,
5275                            tonic::Status,
5276                        >;
5277                        fn call(
5278                            &mut self,
5279                            request: tonic::Request<super::NodeGetVolumeStatsRequest>,
5280                        ) -> Self::Future {
5281                            let inner = Arc::clone(&self.0);
5282                            let fut = async move {
5283                                <T as Node>::node_get_volume_stats(&inner, request).await
5284                            };
5285                            Box::pin(fut)
5286                        }
5287                    }
5288                    let accept_compression_encodings = self.accept_compression_encodings;
5289                    let send_compression_encodings = self.send_compression_encodings;
5290                    let max_decoding_message_size = self.max_decoding_message_size;
5291                    let max_encoding_message_size = self.max_encoding_message_size;
5292                    let inner = self.inner.clone();
5293                    let fut = async move {
5294                        let inner = inner.0;
5295                        let method = NodeGetVolumeStatsSvc(inner);
5296                        let codec = tonic::codec::ProstCodec::default();
5297                        let mut grpc = tonic::server::Grpc::new(codec)
5298                            .apply_compression_config(
5299                                accept_compression_encodings,
5300                                send_compression_encodings,
5301                            )
5302                            .apply_max_message_size_config(
5303                                max_decoding_message_size,
5304                                max_encoding_message_size,
5305                            );
5306                        let res = grpc.unary(method, req).await;
5307                        Ok(res)
5308                    };
5309                    Box::pin(fut)
5310                }
5311                "/csi.v1.Node/NodeExpandVolume" => {
5312                    #[allow(non_camel_case_types)]
5313                    struct NodeExpandVolumeSvc<T: Node>(pub Arc<T>);
5314                    impl<
5315                        T: Node,
5316                    > tonic::server::UnaryService<super::NodeExpandVolumeRequest>
5317                    for NodeExpandVolumeSvc<T> {
5318                        type Response = super::NodeExpandVolumeResponse;
5319                        type Future = BoxFuture<
5320                            tonic::Response<Self::Response>,
5321                            tonic::Status,
5322                        >;
5323                        fn call(
5324                            &mut self,
5325                            request: tonic::Request<super::NodeExpandVolumeRequest>,
5326                        ) -> Self::Future {
5327                            let inner = Arc::clone(&self.0);
5328                            let fut = async move {
5329                                <T as Node>::node_expand_volume(&inner, request).await
5330                            };
5331                            Box::pin(fut)
5332                        }
5333                    }
5334                    let accept_compression_encodings = self.accept_compression_encodings;
5335                    let send_compression_encodings = self.send_compression_encodings;
5336                    let max_decoding_message_size = self.max_decoding_message_size;
5337                    let max_encoding_message_size = self.max_encoding_message_size;
5338                    let inner = self.inner.clone();
5339                    let fut = async move {
5340                        let inner = inner.0;
5341                        let method = NodeExpandVolumeSvc(inner);
5342                        let codec = tonic::codec::ProstCodec::default();
5343                        let mut grpc = tonic::server::Grpc::new(codec)
5344                            .apply_compression_config(
5345                                accept_compression_encodings,
5346                                send_compression_encodings,
5347                            )
5348                            .apply_max_message_size_config(
5349                                max_decoding_message_size,
5350                                max_encoding_message_size,
5351                            );
5352                        let res = grpc.unary(method, req).await;
5353                        Ok(res)
5354                    };
5355                    Box::pin(fut)
5356                }
5357                "/csi.v1.Node/NodeGetCapabilities" => {
5358                    #[allow(non_camel_case_types)]
5359                    struct NodeGetCapabilitiesSvc<T: Node>(pub Arc<T>);
5360                    impl<
5361                        T: Node,
5362                    > tonic::server::UnaryService<super::NodeGetCapabilitiesRequest>
5363                    for NodeGetCapabilitiesSvc<T> {
5364                        type Response = super::NodeGetCapabilitiesResponse;
5365                        type Future = BoxFuture<
5366                            tonic::Response<Self::Response>,
5367                            tonic::Status,
5368                        >;
5369                        fn call(
5370                            &mut self,
5371                            request: tonic::Request<super::NodeGetCapabilitiesRequest>,
5372                        ) -> Self::Future {
5373                            let inner = Arc::clone(&self.0);
5374                            let fut = async move {
5375                                <T as Node>::node_get_capabilities(&inner, request).await
5376                            };
5377                            Box::pin(fut)
5378                        }
5379                    }
5380                    let accept_compression_encodings = self.accept_compression_encodings;
5381                    let send_compression_encodings = self.send_compression_encodings;
5382                    let max_decoding_message_size = self.max_decoding_message_size;
5383                    let max_encoding_message_size = self.max_encoding_message_size;
5384                    let inner = self.inner.clone();
5385                    let fut = async move {
5386                        let inner = inner.0;
5387                        let method = NodeGetCapabilitiesSvc(inner);
5388                        let codec = tonic::codec::ProstCodec::default();
5389                        let mut grpc = tonic::server::Grpc::new(codec)
5390                            .apply_compression_config(
5391                                accept_compression_encodings,
5392                                send_compression_encodings,
5393                            )
5394                            .apply_max_message_size_config(
5395                                max_decoding_message_size,
5396                                max_encoding_message_size,
5397                            );
5398                        let res = grpc.unary(method, req).await;
5399                        Ok(res)
5400                    };
5401                    Box::pin(fut)
5402                }
5403                "/csi.v1.Node/NodeGetInfo" => {
5404                    #[allow(non_camel_case_types)]
5405                    struct NodeGetInfoSvc<T: Node>(pub Arc<T>);
5406                    impl<T: Node> tonic::server::UnaryService<super::NodeGetInfoRequest>
5407                    for NodeGetInfoSvc<T> {
5408                        type Response = super::NodeGetInfoResponse;
5409                        type Future = BoxFuture<
5410                            tonic::Response<Self::Response>,
5411                            tonic::Status,
5412                        >;
5413                        fn call(
5414                            &mut self,
5415                            request: tonic::Request<super::NodeGetInfoRequest>,
5416                        ) -> Self::Future {
5417                            let inner = Arc::clone(&self.0);
5418                            let fut = async move {
5419                                <T as Node>::node_get_info(&inner, request).await
5420                            };
5421                            Box::pin(fut)
5422                        }
5423                    }
5424                    let accept_compression_encodings = self.accept_compression_encodings;
5425                    let send_compression_encodings = self.send_compression_encodings;
5426                    let max_decoding_message_size = self.max_decoding_message_size;
5427                    let max_encoding_message_size = self.max_encoding_message_size;
5428                    let inner = self.inner.clone();
5429                    let fut = async move {
5430                        let inner = inner.0;
5431                        let method = NodeGetInfoSvc(inner);
5432                        let codec = tonic::codec::ProstCodec::default();
5433                        let mut grpc = tonic::server::Grpc::new(codec)
5434                            .apply_compression_config(
5435                                accept_compression_encodings,
5436                                send_compression_encodings,
5437                            )
5438                            .apply_max_message_size_config(
5439                                max_decoding_message_size,
5440                                max_encoding_message_size,
5441                            );
5442                        let res = grpc.unary(method, req).await;
5443                        Ok(res)
5444                    };
5445                    Box::pin(fut)
5446                }
5447                _ => {
5448                    Box::pin(async move {
5449                        Ok(
5450                            http::Response::builder()
5451                                .status(200)
5452                                .header("grpc-status", "12")
5453                                .header("content-type", "application/grpc")
5454                                .body(empty_body())
5455                                .unwrap(),
5456                        )
5457                    })
5458                }
5459            }
5460        }
5461    }
5462    impl<T: Node> Clone for NodeServer<T> {
5463        fn clone(&self) -> Self {
5464            let inner = self.inner.clone();
5465            Self {
5466                inner,
5467                accept_compression_encodings: self.accept_compression_encodings,
5468                send_compression_encodings: self.send_compression_encodings,
5469                max_decoding_message_size: self.max_decoding_message_size,
5470                max_encoding_message_size: self.max_encoding_message_size,
5471            }
5472        }
5473    }
5474    impl<T: Node> Clone for _Inner<T> {
5475        fn clone(&self) -> Self {
5476            Self(Arc::clone(&self.0))
5477        }
5478    }
5479    impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
5480        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5481            write!(f, "{:?}", self.0)
5482        }
5483    }
5484    impl<T: Node> tonic::server::NamedService for NodeServer<T> {
5485        const NAME: &'static str = "csi.v1.Node";
5486    }
5487}