zitadel 3.4.0

An implementation of ZITADEL API access and authentication in Rust.
Documentation
// @generated
/// Generated client implementations.
pub mod settings_service_client {
    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    #[derive(Debug, Clone)]
    pub struct SettingsServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl SettingsServiceClient<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: std::convert::TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> SettingsServiceClient<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,
        ) -> SettingsServiceClient<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,
        {
            SettingsServiceClient::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
        }
        pub async fn get_general_settings(
            &mut self,
            request: impl tonic::IntoRequest<super::GetGeneralSettingsRequest>,
        ) -> Result<tonic::Response<super::GetGeneralSettingsResponse>, 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(
                "/zitadel.settings.v2alpha.SettingsService/GetGeneralSettings",
            );
            self.inner.unary(request.into_request(), path, codec).await
        }
        pub async fn get_login_settings(
            &mut self,
            request: impl tonic::IntoRequest<super::GetLoginSettingsRequest>,
        ) -> Result<tonic::Response<super::GetLoginSettingsResponse>, 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(
                "/zitadel.settings.v2alpha.SettingsService/GetLoginSettings",
            );
            self.inner.unary(request.into_request(), path, codec).await
        }
        pub async fn get_active_identity_providers(
            &mut self,
            request: impl tonic::IntoRequest<super::GetActiveIdentityProvidersRequest>,
        ) -> Result<
            tonic::Response<super::GetActiveIdentityProvidersResponse>,
            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(
                "/zitadel.settings.v2alpha.SettingsService/GetActiveIdentityProviders",
            );
            self.inner.unary(request.into_request(), path, codec).await
        }
        pub async fn get_password_complexity_settings(
            &mut self,
            request: impl tonic::IntoRequest<super::GetPasswordComplexitySettingsRequest>,
        ) -> Result<
            tonic::Response<super::GetPasswordComplexitySettingsResponse>,
            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(
                "/zitadel.settings.v2alpha.SettingsService/GetPasswordComplexitySettings",
            );
            self.inner.unary(request.into_request(), path, codec).await
        }
        pub async fn get_branding_settings(
            &mut self,
            request: impl tonic::IntoRequest<super::GetBrandingSettingsRequest>,
        ) -> Result<tonic::Response<super::GetBrandingSettingsResponse>, 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(
                "/zitadel.settings.v2alpha.SettingsService/GetBrandingSettings",
            );
            self.inner.unary(request.into_request(), path, codec).await
        }
        pub async fn get_domain_settings(
            &mut self,
            request: impl tonic::IntoRequest<super::GetDomainSettingsRequest>,
        ) -> Result<tonic::Response<super::GetDomainSettingsResponse>, 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(
                "/zitadel.settings.v2alpha.SettingsService/GetDomainSettings",
            );
            self.inner.unary(request.into_request(), path, codec).await
        }
        pub async fn get_legal_and_support_settings(
            &mut self,
            request: impl tonic::IntoRequest<super::GetLegalAndSupportSettingsRequest>,
        ) -> Result<
            tonic::Response<super::GetLegalAndSupportSettingsResponse>,
            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(
                "/zitadel.settings.v2alpha.SettingsService/GetLegalAndSupportSettings",
            );
            self.inner.unary(request.into_request(), path, codec).await
        }
        pub async fn get_lockout_settings(
            &mut self,
            request: impl tonic::IntoRequest<super::GetLockoutSettingsRequest>,
        ) -> Result<tonic::Response<super::GetLockoutSettingsResponse>, 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(
                "/zitadel.settings.v2alpha.SettingsService/GetLockoutSettings",
            );
            self.inner.unary(request.into_request(), path, codec).await
        }
    }
}