nominal-api-proto 0.1502.0

Protobuf/gRPC API bindings for the Nominal platform
Documentation
// This file is @generated by prost-build.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetEntitlementsRequest {
    #[prost(string, tag = "1")]
    pub workspace_rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetEntitlementsResponse {
    #[prost(message, optional, tag = "1")]
    pub entitlements: ::core::option::Option<Entitlements>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Entitlements {
    #[prost(string, tag = "1")]
    pub workspace_rid: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "2")]
    pub edition: ::core::option::Option<Edition>,
    #[prost(enumeration = "Capability", repeated, tag = "3")]
    pub capabilities: ::prost::alloc::vec::Vec<i32>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Edition {
    #[prost(enumeration = "EditionType", tag = "1")]
    pub name: i32,
    #[prost(string, tag = "2")]
    pub version: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum EditionType {
    Unspecified = 0,
    Essential = 1,
    Standard = 2,
}
impl EditionType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "EDITION_TYPE_UNSPECIFIED",
            Self::Essential => "EDITION_TYPE_ESSENTIAL",
            Self::Standard => "EDITION_TYPE_STANDARD",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "EDITION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "EDITION_TYPE_ESSENTIAL" => Some(Self::Essential),
            "EDITION_TYPE_STANDARD" => Some(Self::Standard),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Capability {
    Unspecified = 0,
    PlatformData = 1,
    PlatformIngestion = 2,
    PlatformCompute = 3,
    PlatformDrive = 4,
    PlatformNova = 5,
    PlatformWorkbooks = 6,
    PlatformChecklists = 7,
    PlatformProcedures = 8,
    PlatformPlans = 9,
    Analyst = 10,
    AppsData = 11,
    AppsDrive = 12,
    AppsNova = 13,
    AppsIngestion = 14,
    AppsWorkbooks = 15,
    AppsChecklists = 16,
    AppsProcedures = 17,
    AppsPlans = 18,
    AppsAnalyst = 19,
    AppsReports = 20,
}
impl Capability {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "CAPABILITY_UNSPECIFIED",
            Self::PlatformData => "CAPABILITY_PLATFORM_DATA",
            Self::PlatformIngestion => "CAPABILITY_PLATFORM_INGESTION",
            Self::PlatformCompute => "CAPABILITY_PLATFORM_COMPUTE",
            Self::PlatformDrive => "CAPABILITY_PLATFORM_DRIVE",
            Self::PlatformNova => "CAPABILITY_PLATFORM_NOVA",
            Self::PlatformWorkbooks => "CAPABILITY_PLATFORM_WORKBOOKS",
            Self::PlatformChecklists => "CAPABILITY_PLATFORM_CHECKLISTS",
            Self::PlatformProcedures => "CAPABILITY_PLATFORM_PROCEDURES",
            Self::PlatformPlans => "CAPABILITY_PLATFORM_PLANS",
            Self::Analyst => "CAPABILITY_ANALYST",
            Self::AppsData => "CAPABILITY_APPS_DATA",
            Self::AppsDrive => "CAPABILITY_APPS_DRIVE",
            Self::AppsNova => "CAPABILITY_APPS_NOVA",
            Self::AppsIngestion => "CAPABILITY_APPS_INGESTION",
            Self::AppsWorkbooks => "CAPABILITY_APPS_WORKBOOKS",
            Self::AppsChecklists => "CAPABILITY_APPS_CHECKLISTS",
            Self::AppsProcedures => "CAPABILITY_APPS_PROCEDURES",
            Self::AppsPlans => "CAPABILITY_APPS_PLANS",
            Self::AppsAnalyst => "CAPABILITY_APPS_ANALYST",
            Self::AppsReports => "CAPABILITY_APPS_REPORTS",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "CAPABILITY_UNSPECIFIED" => Some(Self::Unspecified),
            "CAPABILITY_PLATFORM_DATA" => Some(Self::PlatformData),
            "CAPABILITY_PLATFORM_INGESTION" => Some(Self::PlatformIngestion),
            "CAPABILITY_PLATFORM_COMPUTE" => Some(Self::PlatformCompute),
            "CAPABILITY_PLATFORM_DRIVE" => Some(Self::PlatformDrive),
            "CAPABILITY_PLATFORM_NOVA" => Some(Self::PlatformNova),
            "CAPABILITY_PLATFORM_WORKBOOKS" => Some(Self::PlatformWorkbooks),
            "CAPABILITY_PLATFORM_CHECKLISTS" => Some(Self::PlatformChecklists),
            "CAPABILITY_PLATFORM_PROCEDURES" => Some(Self::PlatformProcedures),
            "CAPABILITY_PLATFORM_PLANS" => Some(Self::PlatformPlans),
            "CAPABILITY_ANALYST" => Some(Self::Analyst),
            "CAPABILITY_APPS_DATA" => Some(Self::AppsData),
            "CAPABILITY_APPS_DRIVE" => Some(Self::AppsDrive),
            "CAPABILITY_APPS_NOVA" => Some(Self::AppsNova),
            "CAPABILITY_APPS_INGESTION" => Some(Self::AppsIngestion),
            "CAPABILITY_APPS_WORKBOOKS" => Some(Self::AppsWorkbooks),
            "CAPABILITY_APPS_CHECKLISTS" => Some(Self::AppsChecklists),
            "CAPABILITY_APPS_PROCEDURES" => Some(Self::AppsProcedures),
            "CAPABILITY_APPS_PLANS" => Some(Self::AppsPlans),
            "CAPABILITY_APPS_ANALYST" => Some(Self::AppsAnalyst),
            "CAPABILITY_APPS_REPORTS" => Some(Self::AppsReports),
            _ => None,
        }
    }
}
/// Generated client implementations.
pub mod entitlements_service_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    #[derive(Debug, Clone)]
    pub struct EntitlementsServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl EntitlementsServiceClient<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> EntitlementsServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::Body>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::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,
        ) -> EntitlementsServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::Body>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::Body>,
            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            EntitlementsServiceClient::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
        }
        pub async fn get_entitlements(
            &mut self,
            request: impl tonic::IntoRequest<super::GetEntitlementsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GetEntitlementsResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/nominal.entitlements.v1.EntitlementsService/GetEntitlements",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.entitlements.v1.EntitlementsService",
                        "GetEntitlements",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}