nominal-api-proto 0.1499.0

Protobuf/gRPC API bindings for the Nominal platform
Documentation
// This file is @generated by prost-build.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchCancelRequestsRequest {
    #[prost(string, repeated, tag = "1")]
    pub request_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct BatchCancelRequestsResponse {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchGetRequestProgressRequest {
    #[prost(string, repeated, tag = "1")]
    pub request_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct RequestInProgress {
    #[prost(int64, tag = "1")]
    pub read_rows: i64,
    #[prost(int64, tag = "2")]
    pub total_rows_approx: i64,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct RequestInactive {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RequestProgress {
    #[prost(string, tag = "1")]
    pub request_id: ::prost::alloc::string::String,
    #[prost(oneof = "request_progress::State", tags = "2, 3")]
    pub state: ::core::option::Option<request_progress::State>,
}
/// Nested message and enum types in `RequestProgress`.
pub mod request_progress {
    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
    pub enum State {
        #[prost(message, tag = "2")]
        InProgress(super::RequestInProgress),
        #[prost(message, tag = "3")]
        Inactive(super::RequestInactive),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchGetRequestProgressResponse {
    #[prost(message, repeated, tag = "1")]
    pub progress: ::prost::alloc::vec::Vec<RequestProgress>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct QuotaWindow {
    #[prost(message, optional, tag = "1")]
    pub start_time: ::core::option::Option<
        super::super::super::google::protobuf::Timestamp,
    >,
    #[prost(message, optional, tag = "2")]
    pub end_time: ::core::option::Option<
        super::super::super::google::protobuf::Timestamp,
    >,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct QuotaResourceUsage {
    #[prost(enumeration = "QuotaResourceType", tag = "1")]
    pub resource: i32,
    #[prost(double, tag = "2")]
    pub used: f64,
    #[prost(double, tag = "3")]
    pub limit: f64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QuotaIntervalUsage {
    #[prost(int64, tag = "1")]
    pub duration_seconds: i64,
    #[prost(message, optional, tag = "2")]
    pub current_window: ::core::option::Option<QuotaWindow>,
    #[prost(message, repeated, tag = "3")]
    pub resources: ::prost::alloc::vec::Vec<QuotaResourceUsage>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QuotaUsage {
    #[prost(message, repeated, tag = "1")]
    pub intervals: ::prost::alloc::vec::Vec<QuotaIntervalUsage>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListQuotaUsageIntervalsRequest {
    #[prost(int32, optional, tag = "1")]
    pub page_size: ::core::option::Option<i32>,
    #[prost(string, tag = "2")]
    pub page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListQuotaUsageIntervalsResponse {
    #[prost(message, repeated, tag = "1")]
    pub intervals: ::prost::alloc::vec::Vec<QuotaIntervalUsage>,
    #[prost(string, tag = "2")]
    pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ComputeRequestControlError {
    Unspecified = 0,
    InvalidRequestId = 1,
    InvalidPageToken = 2,
    InvalidPageSize = 3,
}
impl ComputeRequestControlError {
    /// 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 => "COMPUTE_REQUEST_CONTROL_ERROR_UNSPECIFIED",
            Self::InvalidRequestId => "COMPUTE_REQUEST_CONTROL_ERROR_INVALID_REQUEST_ID",
            Self::InvalidPageToken => "COMPUTE_REQUEST_CONTROL_ERROR_INVALID_PAGE_TOKEN",
            Self::InvalidPageSize => "COMPUTE_REQUEST_CONTROL_ERROR_INVALID_PAGE_SIZE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "COMPUTE_REQUEST_CONTROL_ERROR_UNSPECIFIED" => Some(Self::Unspecified),
            "COMPUTE_REQUEST_CONTROL_ERROR_INVALID_REQUEST_ID" => {
                Some(Self::InvalidRequestId)
            }
            "COMPUTE_REQUEST_CONTROL_ERROR_INVALID_PAGE_TOKEN" => {
                Some(Self::InvalidPageToken)
            }
            "COMPUTE_REQUEST_CONTROL_ERROR_INVALID_PAGE_SIZE" => {
                Some(Self::InvalidPageSize)
            }
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum QuotaResourceType {
    Unspecified = 0,
    ReadRows = 1,
    ReadBytes = 2,
    Queries = 3,
    Errors = 4,
    ExecutionTime = 5,
}
impl QuotaResourceType {
    /// 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 => "QUOTA_RESOURCE_TYPE_UNSPECIFIED",
            Self::ReadRows => "QUOTA_RESOURCE_TYPE_READ_ROWS",
            Self::ReadBytes => "QUOTA_RESOURCE_TYPE_READ_BYTES",
            Self::Queries => "QUOTA_RESOURCE_TYPE_QUERIES",
            Self::Errors => "QUOTA_RESOURCE_TYPE_ERRORS",
            Self::ExecutionTime => "QUOTA_RESOURCE_TYPE_EXECUTION_TIME",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "QUOTA_RESOURCE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "QUOTA_RESOURCE_TYPE_READ_ROWS" => Some(Self::ReadRows),
            "QUOTA_RESOURCE_TYPE_READ_BYTES" => Some(Self::ReadBytes),
            "QUOTA_RESOURCE_TYPE_QUERIES" => Some(Self::Queries),
            "QUOTA_RESOURCE_TYPE_ERRORS" => Some(Self::Errors),
            "QUOTA_RESOURCE_TYPE_EXECUTION_TIME" => Some(Self::ExecutionTime),
            _ => None,
        }
    }
}
/// Generated client implementations.
pub mod compute_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 ComputeServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl ComputeServiceClient<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> ComputeServiceClient<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,
        ) -> ComputeServiceClient<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,
        {
            ComputeServiceClient::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_cancel_requests(
            &mut self,
            request: impl tonic::IntoRequest<super::BatchCancelRequestsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::BatchCancelRequestsResponse>,
            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.compute.v1.ComputeService/BatchCancelRequests",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.compute.v1.ComputeService",
                        "BatchCancelRequests",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        pub async fn batch_get_request_progress(
            &mut self,
            request: impl tonic::IntoRequest<super::BatchGetRequestProgressRequest>,
        ) -> std::result::Result<
            tonic::Response<super::BatchGetRequestProgressResponse>,
            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.compute.v1.ComputeService/BatchGetRequestProgress",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.compute.v1.ComputeService",
                        "BatchGetRequestProgress",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        pub async fn list_quota_usage_intervals(
            &mut self,
            request: impl tonic::IntoRequest<super::ListQuotaUsageIntervalsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListQuotaUsageIntervalsResponse>,
            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.compute.v1.ComputeService/ListQuotaUsageIntervals",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.compute.v1.ComputeService",
                        "ListQuotaUsageIntervals",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}