yandex_cloud/
yandex.cloud.k8s.marketplace.v1.rs

1/// A Helm Release.
2#[allow(clippy::derive_partial_eq_without_eq)]
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct HelmRelease {
5    /// ID of a helm release.
6    #[prost(string, tag = "1")]
7    pub id: ::prost::alloc::string::String,
8    /// ID of the Kubernetes cluster.
9    #[prost(string, tag = "2")]
10    pub cluster_id: ::prost::alloc::string::String,
11    /// Name of the application.
12    #[prost(string, tag = "3")]
13    pub app_name: ::prost::alloc::string::String,
14    /// Namespace of the application.
15    #[prost(string, tag = "4")]
16    pub app_namespace: ::prost::alloc::string::String,
17    /// Kubernetes marketplace product id.
18    #[prost(string, tag = "5")]
19    pub product_id: ::prost::alloc::string::String,
20    /// Kubernetes marketplace product name.
21    #[prost(string, tag = "6")]
22    pub product_name: ::prost::alloc::string::String,
23    /// Kubernetes marketplace product version.
24    #[prost(string, tag = "10")]
25    pub product_version: ::prost::alloc::string::String,
26    /// Status of a helm release.
27    #[prost(enumeration = "helm_release::Status", tag = "7")]
28    pub status: i32,
29    /// Creation timestamp.
30    #[prost(message, optional, tag = "8")]
31    pub created_at: ::core::option::Option<::prost_types::Timestamp>,
32}
33/// Nested message and enum types in `HelmRelease`.
34pub mod helm_release {
35    #[derive(
36        Clone,
37        Copy,
38        Debug,
39        PartialEq,
40        Eq,
41        Hash,
42        PartialOrd,
43        Ord,
44        ::prost::Enumeration
45    )]
46    #[repr(i32)]
47    pub enum Status {
48        Unspecified = 0,
49        /// Helm release status is unknown
50        Unknown = 1,
51        /// Helm release deployed.
52        Deployed = 2,
53        /// Helm release uninstalled.
54        Uninstalled = 3,
55        /// Helm release superseded.
56        Superseded = 4,
57        /// Helm release installation failed.
58        Failed = 5,
59        /// Helm release is being uninstalled.
60        Uninstalling = 6,
61        /// Helm release is to be installed.
62        PendingInstall = 7,
63        /// Helm release is to be updated.
64        PendingUpgrade = 8,
65        /// Helm release is to be rolled back.
66        PendingRollback = 9,
67    }
68    impl Status {
69        /// String value of the enum field names used in the ProtoBuf definition.
70        ///
71        /// The values are not transformed in any way and thus are considered stable
72        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
73        pub fn as_str_name(&self) -> &'static str {
74            match self {
75                Status::Unspecified => "STATUS_UNSPECIFIED",
76                Status::Unknown => "UNKNOWN",
77                Status::Deployed => "DEPLOYED",
78                Status::Uninstalled => "UNINSTALLED",
79                Status::Superseded => "SUPERSEDED",
80                Status::Failed => "FAILED",
81                Status::Uninstalling => "UNINSTALLING",
82                Status::PendingInstall => "PENDING_INSTALL",
83                Status::PendingUpgrade => "PENDING_UPGRADE",
84                Status::PendingRollback => "PENDING_ROLLBACK",
85            }
86        }
87        /// Creates an enum from field names used in the ProtoBuf definition.
88        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
89            match value {
90                "STATUS_UNSPECIFIED" => Some(Self::Unspecified),
91                "UNKNOWN" => Some(Self::Unknown),
92                "DEPLOYED" => Some(Self::Deployed),
93                "UNINSTALLED" => Some(Self::Uninstalled),
94                "SUPERSEDED" => Some(Self::Superseded),
95                "FAILED" => Some(Self::Failed),
96                "UNINSTALLING" => Some(Self::Uninstalling),
97                "PENDING_INSTALL" => Some(Self::PendingInstall),
98                "PENDING_UPGRADE" => Some(Self::PendingUpgrade),
99                "PENDING_ROLLBACK" => Some(Self::PendingRollback),
100                _ => None,
101            }
102        }
103    }
104}
105#[allow(clippy::derive_partial_eq_without_eq)]
106#[derive(Clone, PartialEq, ::prost::Message)]
107pub struct ListHelmReleasesRequest {
108    /// The ID of the Kubernetes cluster to list Helm releases from.
109    #[prost(string, tag = "1")]
110    pub cluster_id: ::prost::alloc::string::String,
111    /// The maximum number of results per page that should be returned.
112    #[prost(int64, tag = "2")]
113    pub page_size: i64,
114    /// Token for pagination to retrieve the next page of results.
115    #[prost(string, tag = "3")]
116    pub page_token: ::prost::alloc::string::String,
117}
118#[allow(clippy::derive_partial_eq_without_eq)]
119#[derive(Clone, PartialEq, ::prost::Message)]
120pub struct ListHelmReleasesResponse {
121    /// List of Helm releases in the Kubernetes cluster.
122    #[prost(message, repeated, tag = "1")]
123    pub helm_releases: ::prost::alloc::vec::Vec<HelmRelease>,
124    /// Token for retrieving the next page of Helm releases.
125    #[prost(string, tag = "2")]
126    pub next_page_token: ::prost::alloc::string::String,
127}
128#[allow(clippy::derive_partial_eq_without_eq)]
129#[derive(Clone, PartialEq, ::prost::Message)]
130pub struct GetHelmReleaseRequest {
131    /// The ID of the Helm release to retrieve.
132    #[prost(string, tag = "1")]
133    pub id: ::prost::alloc::string::String,
134}
135#[allow(clippy::derive_partial_eq_without_eq)]
136#[derive(Clone, PartialEq, ::prost::Message)]
137pub struct InstallHelmReleaseRequest {
138    /// The ID of the Kubernetes cluster where the Helm release is to be installed.
139    #[prost(string, tag = "1")]
140    pub cluster_id: ::prost::alloc::string::String,
141    /// The product version ID to install.
142    #[prost(string, tag = "2")]
143    pub product_version_id: ::prost::alloc::string::String,
144    /// User-defined values for the Helm chart during installation.
145    #[prost(message, repeated, tag = "3")]
146    pub user_values: ::prost::alloc::vec::Vec<ValueWithKey>,
147}
148#[allow(clippy::derive_partial_eq_without_eq)]
149#[derive(Clone, PartialEq, ::prost::Message)]
150pub struct InstallHelmReleaseMetadata {
151    /// The ID of the Kubernetes cluster where the Helm release is being installed.
152    #[prost(string, tag = "1")]
153    pub cluster_id: ::prost::alloc::string::String,
154    /// The ID of the Helm release being installed.
155    #[prost(string, tag = "2")]
156    pub helm_release_id: ::prost::alloc::string::String,
157    /// The ID of the product version being deployed.
158    #[prost(string, tag = "3")]
159    pub product_version_id: ::prost::alloc::string::String,
160}
161#[allow(clippy::derive_partial_eq_without_eq)]
162#[derive(Clone, PartialEq, ::prost::Message)]
163pub struct UpdateHelmReleaseRequest {
164    /// The ID of the Helm release to update.
165    #[prost(string, tag = "1")]
166    pub id: ::prost::alloc::string::String,
167    /// The ID of the new product version for the release.
168    #[prost(string, tag = "2")]
169    pub product_version_id: ::prost::alloc::string::String,
170    /// Custom user values to apply during the update.
171    #[prost(message, repeated, tag = "3")]
172    pub user_values: ::prost::alloc::vec::Vec<ValueWithKey>,
173}
174#[allow(clippy::derive_partial_eq_without_eq)]
175#[derive(Clone, PartialEq, ::prost::Message)]
176pub struct UpdateHelmReleaseMetadata {
177    /// The ID of the Kubernetes cluster where the Helm release is being updated.
178    #[prost(string, tag = "1")]
179    pub cluster_id: ::prost::alloc::string::String,
180    /// The ID of the Helm release being updated.
181    #[prost(string, tag = "2")]
182    pub helm_release_id: ::prost::alloc::string::String,
183    /// The ID of the new product version to update the Helm release to.
184    #[prost(string, tag = "3")]
185    pub product_version_id: ::prost::alloc::string::String,
186}
187#[allow(clippy::derive_partial_eq_without_eq)]
188#[derive(Clone, PartialEq, ::prost::Message)]
189pub struct UninstallHelmReleaseRequest {
190    /// The ID of the Helm release to retrieve.
191    #[prost(string, tag = "1")]
192    pub id: ::prost::alloc::string::String,
193}
194#[allow(clippy::derive_partial_eq_without_eq)]
195#[derive(Clone, PartialEq, ::prost::Message)]
196pub struct UninstallHelmReleaseMetadata {
197    /// The ID of the Kubernetes cluster where the release is being uninstalled.
198    #[prost(string, tag = "1")]
199    pub cluster_id: ::prost::alloc::string::String,
200    /// The ID of the Helm release being uninstalled.
201    #[prost(string, tag = "2")]
202    pub helm_release_id: ::prost::alloc::string::String,
203}
204#[allow(clippy::derive_partial_eq_without_eq)]
205#[derive(Clone, PartialEq, ::prost::Message)]
206pub struct ValueWithKey {
207    /// The key associated with the value.
208    #[prost(string, tag = "1")]
209    pub key: ::prost::alloc::string::String,
210    /// The value associated with the key.
211    #[prost(message, optional, tag = "2")]
212    pub value: ::core::option::Option<Value>,
213}
214#[allow(clippy::derive_partial_eq_without_eq)]
215#[derive(Clone, PartialEq, ::prost::Message)]
216pub struct Value {
217    #[prost(oneof = "value::Value", tags = "1")]
218    pub value: ::core::option::Option<value::Value>,
219}
220/// Nested message and enum types in `Value`.
221pub mod value {
222    #[allow(clippy::derive_partial_eq_without_eq)]
223    #[derive(Clone, PartialEq, ::prost::Oneof)]
224    pub enum Value {
225        /// The typed string value.
226        #[prost(string, tag = "1")]
227        TypedValue(::prost::alloc::string::String),
228    }
229}
230/// Generated client implementations.
231pub mod helm_release_service_client {
232    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
233    use tonic::codegen::*;
234    use tonic::codegen::http::Uri;
235    /// A set of methods for managing Helm release.
236    #[derive(Debug, Clone)]
237    pub struct HelmReleaseServiceClient<T> {
238        inner: tonic::client::Grpc<T>,
239    }
240    impl HelmReleaseServiceClient<tonic::transport::Channel> {
241        /// Attempt to create a new client by connecting to a given endpoint.
242        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
243        where
244            D: TryInto<tonic::transport::Endpoint>,
245            D::Error: Into<StdError>,
246        {
247            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
248            Ok(Self::new(conn))
249        }
250    }
251    impl<T> HelmReleaseServiceClient<T>
252    where
253        T: tonic::client::GrpcService<tonic::body::BoxBody>,
254        T::Error: Into<StdError>,
255        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
256        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
257    {
258        pub fn new(inner: T) -> Self {
259            let inner = tonic::client::Grpc::new(inner);
260            Self { inner }
261        }
262        pub fn with_origin(inner: T, origin: Uri) -> Self {
263            let inner = tonic::client::Grpc::with_origin(inner, origin);
264            Self { inner }
265        }
266        pub fn with_interceptor<F>(
267            inner: T,
268            interceptor: F,
269        ) -> HelmReleaseServiceClient<InterceptedService<T, F>>
270        where
271            F: tonic::service::Interceptor,
272            T::ResponseBody: Default,
273            T: tonic::codegen::Service<
274                http::Request<tonic::body::BoxBody>,
275                Response = http::Response<
276                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
277                >,
278            >,
279            <T as tonic::codegen::Service<
280                http::Request<tonic::body::BoxBody>,
281            >>::Error: Into<StdError> + Send + Sync,
282        {
283            HelmReleaseServiceClient::new(InterceptedService::new(inner, interceptor))
284        }
285        /// Compress requests with the given encoding.
286        ///
287        /// This requires the server to support it otherwise it might respond with an
288        /// error.
289        #[must_use]
290        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
291            self.inner = self.inner.send_compressed(encoding);
292            self
293        }
294        /// Enable decompressing responses.
295        #[must_use]
296        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
297            self.inner = self.inner.accept_compressed(encoding);
298            self
299        }
300        /// Limits the maximum size of a decoded message.
301        ///
302        /// Default: `4MB`
303        #[must_use]
304        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
305            self.inner = self.inner.max_decoding_message_size(limit);
306            self
307        }
308        /// Limits the maximum size of an encoded message.
309        ///
310        /// Default: `usize::MAX`
311        #[must_use]
312        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
313            self.inner = self.inner.max_encoding_message_size(limit);
314            self
315        }
316        /// Retrieves the list of Helm releases in the specified Kubernetes Cluster.
317        pub async fn list(
318            &mut self,
319            request: impl tonic::IntoRequest<super::ListHelmReleasesRequest>,
320        ) -> std::result::Result<
321            tonic::Response<super::ListHelmReleasesResponse>,
322            tonic::Status,
323        > {
324            self.inner
325                .ready()
326                .await
327                .map_err(|e| {
328                    tonic::Status::new(
329                        tonic::Code::Unknown,
330                        format!("Service was not ready: {}", e.into()),
331                    )
332                })?;
333            let codec = tonic::codec::ProstCodec::default();
334            let path = http::uri::PathAndQuery::from_static(
335                "/yandex.cloud.k8s.marketplace.v1.HelmReleaseService/List",
336            );
337            let mut req = request.into_request();
338            req.extensions_mut()
339                .insert(
340                    GrpcMethod::new(
341                        "yandex.cloud.k8s.marketplace.v1.HelmReleaseService",
342                        "List",
343                    ),
344                );
345            self.inner.unary(req, path, codec).await
346        }
347        /// Returns the specified Helm release.
348        pub async fn get(
349            &mut self,
350            request: impl tonic::IntoRequest<super::GetHelmReleaseRequest>,
351        ) -> std::result::Result<tonic::Response<super::HelmRelease>, tonic::Status> {
352            self.inner
353                .ready()
354                .await
355                .map_err(|e| {
356                    tonic::Status::new(
357                        tonic::Code::Unknown,
358                        format!("Service was not ready: {}", e.into()),
359                    )
360                })?;
361            let codec = tonic::codec::ProstCodec::default();
362            let path = http::uri::PathAndQuery::from_static(
363                "/yandex.cloud.k8s.marketplace.v1.HelmReleaseService/Get",
364            );
365            let mut req = request.into_request();
366            req.extensions_mut()
367                .insert(
368                    GrpcMethod::new(
369                        "yandex.cloud.k8s.marketplace.v1.HelmReleaseService",
370                        "Get",
371                    ),
372                );
373            self.inner.unary(req, path, codec).await
374        }
375        /// Installs helm release into specified Kubernetes Cluster.
376        pub async fn install(
377            &mut self,
378            request: impl tonic::IntoRequest<super::InstallHelmReleaseRequest>,
379        ) -> std::result::Result<
380            tonic::Response<super::super::super::super::operation::Operation>,
381            tonic::Status,
382        > {
383            self.inner
384                .ready()
385                .await
386                .map_err(|e| {
387                    tonic::Status::new(
388                        tonic::Code::Unknown,
389                        format!("Service was not ready: {}", e.into()),
390                    )
391                })?;
392            let codec = tonic::codec::ProstCodec::default();
393            let path = http::uri::PathAndQuery::from_static(
394                "/yandex.cloud.k8s.marketplace.v1.HelmReleaseService/Install",
395            );
396            let mut req = request.into_request();
397            req.extensions_mut()
398                .insert(
399                    GrpcMethod::new(
400                        "yandex.cloud.k8s.marketplace.v1.HelmReleaseService",
401                        "Install",
402                    ),
403                );
404            self.inner.unary(req, path, codec).await
405        }
406        /// Updates helm release.
407        pub async fn update(
408            &mut self,
409            request: impl tonic::IntoRequest<super::UpdateHelmReleaseRequest>,
410        ) -> std::result::Result<
411            tonic::Response<super::super::super::super::operation::Operation>,
412            tonic::Status,
413        > {
414            self.inner
415                .ready()
416                .await
417                .map_err(|e| {
418                    tonic::Status::new(
419                        tonic::Code::Unknown,
420                        format!("Service was not ready: {}", e.into()),
421                    )
422                })?;
423            let codec = tonic::codec::ProstCodec::default();
424            let path = http::uri::PathAndQuery::from_static(
425                "/yandex.cloud.k8s.marketplace.v1.HelmReleaseService/Update",
426            );
427            let mut req = request.into_request();
428            req.extensions_mut()
429                .insert(
430                    GrpcMethod::new(
431                        "yandex.cloud.k8s.marketplace.v1.HelmReleaseService",
432                        "Update",
433                    ),
434                );
435            self.inner.unary(req, path, codec).await
436        }
437        /// Uninstalls helm release.
438        pub async fn uninstall(
439            &mut self,
440            request: impl tonic::IntoRequest<super::UninstallHelmReleaseRequest>,
441        ) -> std::result::Result<
442            tonic::Response<super::super::super::super::operation::Operation>,
443            tonic::Status,
444        > {
445            self.inner
446                .ready()
447                .await
448                .map_err(|e| {
449                    tonic::Status::new(
450                        tonic::Code::Unknown,
451                        format!("Service was not ready: {}", e.into()),
452                    )
453                })?;
454            let codec = tonic::codec::ProstCodec::default();
455            let path = http::uri::PathAndQuery::from_static(
456                "/yandex.cloud.k8s.marketplace.v1.HelmReleaseService/Uninstall",
457            );
458            let mut req = request.into_request();
459            req.extensions_mut()
460                .insert(
461                    GrpcMethod::new(
462                        "yandex.cloud.k8s.marketplace.v1.HelmReleaseService",
463                        "Uninstall",
464                    ),
465                );
466            self.inner.unary(req, path, codec).await
467        }
468    }
469}