nominal-api-proto 0.1364.0

Protobuf/gRPC API bindings for the Nominal platform
Documentation
// This file is @generated by prost-build.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchResolveWorkbookResourcesRequest {
    #[prost(string, repeated, tag = "1")]
    pub workbook_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchResolveWorkbookResourcesResponse {
    #[prost(message, repeated, tag = "1")]
    pub results: ::prost::alloc::vec::Vec<WorkbookResources>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkbookResources {
    #[prost(string, tag = "1")]
    pub workbook_rid: ::prost::alloc::string::String,
    #[prost(oneof = "workbook_resources::Result", tags = "2, 3")]
    pub result: ::core::option::Option<workbook_resources::Result>,
}
/// Nested message and enum types in `WorkbookResources`.
pub mod workbook_resources {
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct ResolvedResources {
        #[prost(string, repeated, tag = "1")]
        pub run_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
        #[prost(string, repeated, tag = "2")]
        pub asset_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
        #[prost(string, repeated, tag = "3")]
        pub datasource_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    }
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum UnresolvableReason {
        Unspecified = 0,
        NotFound = 1,
        Unsupported = 2,
    }
    impl UnresolvableReason {
        /// 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 => "UNRESOLVABLE_REASON_UNSPECIFIED",
                Self::NotFound => "UNRESOLVABLE_REASON_NOT_FOUND",
                Self::Unsupported => "UNRESOLVABLE_REASON_UNSUPPORTED",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "UNRESOLVABLE_REASON_UNSPECIFIED" => Some(Self::Unspecified),
                "UNRESOLVABLE_REASON_NOT_FOUND" => Some(Self::NotFound),
                "UNRESOLVABLE_REASON_UNSUPPORTED" => Some(Self::Unsupported),
                _ => None,
            }
        }
    }
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Result {
        #[prost(message, tag = "2")]
        Resolved(ResolvedResources),
        #[prost(enumeration = "UnresolvableReason", tag = "3")]
        Unresolvable(i32),
    }
}
/// Generated client implementations.
pub mod internal_resource_relationships_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 InternalResourceRelationshipsServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl InternalResourceRelationshipsServiceClient<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> InternalResourceRelationshipsServiceClient<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,
        ) -> InternalResourceRelationshipsServiceClient<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,
        {
            InternalResourceRelationshipsServiceClient::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 batch_resolve_workbook_resources(
            &mut self,
            request: impl tonic::IntoRequest<super::BatchResolveWorkbookResourcesRequest>,
        ) -> std::result::Result<
            tonic::Response<super::BatchResolveWorkbookResourcesResponse>,
            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.internalresourcerelationships.v1.InternalResourceRelationshipsService/BatchResolveWorkbookResources",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.internalresourcerelationships.v1.InternalResourceRelationshipsService",
                        "BatchResolveWorkbookResources",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}