yandex-cloud 2025.4.14

Generated gRPC clients for the Yandex Cloud API
Documentation
/// A federated credential.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FederatedCredential {
    /// Id of the federated credential.
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    /// Id of the service account that the federated credential belongs to.
    #[prost(string, tag = "2")]
    pub service_account_id: ::prost::alloc::string::String,
    /// ID of the workload identity federation which is used for authentication.
    #[prost(string, tag = "3")]
    pub federation_id: ::prost::alloc::string::String,
    /// Id of the external subject.
    #[prost(string, tag = "4")]
    pub external_subject_id: ::prost::alloc::string::String,
    /// Creation timestamp.
    #[prost(message, optional, tag = "5")]
    pub created_at: ::core::option::Option<::prost_types::Timestamp>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetFederatedCredentialRequest {
    /// ID of the federated credential to return.
    /// To get the federated credential ID, make a \[FederatedCredentialService.List\] request.
    #[prost(string, tag = "1")]
    pub federated_credential_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListFederatedCredentialsRequest {
    /// ID of the service account to list federated credentials for.
    /// To get the the service account ID make a \[yandex.cloud.iam.v1.ServiceAccountService.List\] request.
    #[prost(string, tag = "1")]
    pub service_account_id: ::prost::alloc::string::String,
    /// The maximum number of results per page to return. If the number of available
    /// results is larger than \[page_size\],
    /// the service returns a \[ListFederatedCredentialsResponse.next_page_token\]
    /// that can be used to get the next page of results in subsequent list requests.
    /// Default value: 100.
    #[prost(int64, tag = "2")]
    pub page_size: i64,
    /// Page token. To get the next page of results, set \[page_token\]
    /// to the \[ListFederatedCredentialsResponse.next_page_token\]
    /// returned by a previous list request.
    #[prost(string, tag = "3")]
    pub page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListFederatedCredentialsResponse {
    /// List of federated credentials.
    #[prost(message, repeated, tag = "1")]
    pub federated_credentials: ::prost::alloc::vec::Vec<FederatedCredential>,
    /// This token allows you to get the next page of results for list requests. If the number of results
    /// is larger than \[ListFederatedCredentialsRequest.page_size\], use
    /// the \[next_page_token\] as the value
    /// for the \[ListFederatedCredentialsRequest.page_token\] query parameter
    /// in the next list request. Each subsequent list request will have its own
    /// \[next_page_token\] to continue paging through the results.
    #[prost(string, tag = "2")]
    pub next_page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateFederatedCredentialRequest {
    /// ID of the service account to create a federated credential for.
    /// To get the service account ID, use a \[yandex.cloud.iam.v1.ServiceAccountService.List\] request.
    #[prost(string, tag = "1")]
    pub service_account_id: ::prost::alloc::string::String,
    /// ID of the workload identity federation that is used for authentication.
    #[prost(string, tag = "2")]
    pub federation_id: ::prost::alloc::string::String,
    /// Id of the external subject.
    #[prost(string, tag = "3")]
    pub external_subject_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateFederatedCredentialMetadata {
    /// ID of the federated credential that is being created.
    #[prost(string, tag = "1")]
    pub federated_credential_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteFederatedCredentialRequest {
    /// ID of the federated credential key to delete.
    /// To get the federated credential ID, use a \[FederatedCredentialService.List\] request.
    #[prost(string, tag = "1")]
    pub federated_credential_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteFederatedCredentialMetadata {
    /// ID of the federated credential that is being deleted.
    #[prost(string, tag = "1")]
    pub federated_credential_id: ::prost::alloc::string::String,
}
/// Generated client implementations.
pub mod federated_credential_service_client {
    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// A set of methods for managing federated credentials.
    #[derive(Debug, Clone)]
    pub struct FederatedCredentialServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl FederatedCredentialServiceClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> FederatedCredentialServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::BoxBody>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> FederatedCredentialServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
            >>::Error: Into<StdError> + Send + Sync,
        {
            FederatedCredentialServiceClient::new(
                InterceptedService::new(inner, interceptor),
            )
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// Returns the specified federated credential.
        ///
        /// To get the list of available federated credentials, make a [List] request.
        pub async fn get(
            &mut self,
            request: impl tonic::IntoRequest<super::GetFederatedCredentialRequest>,
        ) -> std::result::Result<
            tonic::Response<super::FederatedCredential>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/yandex.cloud.iam.v1.workload.FederatedCredentialService/Get",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "yandex.cloud.iam.v1.workload.FederatedCredentialService",
                        "Get",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Retrieves the list of federated credentials for the specified service account.
        pub async fn list(
            &mut self,
            request: impl tonic::IntoRequest<super::ListFederatedCredentialsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListFederatedCredentialsResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/yandex.cloud.iam.v1.workload.FederatedCredentialService/List",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "yandex.cloud.iam.v1.workload.FederatedCredentialService",
                        "List",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Creates a federated credential for the specified service account.
        pub async fn create(
            &mut self,
            request: impl tonic::IntoRequest<super::CreateFederatedCredentialRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::operation::Operation>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/yandex.cloud.iam.v1.workload.FederatedCredentialService/Create",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "yandex.cloud.iam.v1.workload.FederatedCredentialService",
                        "Create",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Deletes the specified federated credential.
        pub async fn delete(
            &mut self,
            request: impl tonic::IntoRequest<super::DeleteFederatedCredentialRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::operation::Operation>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/yandex.cloud.iam.v1.workload.FederatedCredentialService/Delete",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "yandex.cloud.iam.v1.workload.FederatedCredentialService",
                        "Delete",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}