nominal-api-proto 0.1504.0

Protobuf/gRPC API bindings for the Nominal platform
Documentation
// This file is @generated by prost-build.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IngestAutomation {
    #[prost(string, tag = "1")]
    pub rid: ::prost::alloc::string::String,
    #[prost(enumeration = "IngestAutomationStatus", tag = "2")]
    pub status: i32,
    #[prost(string, tag = "3")]
    pub workspace_rid: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub created_by_rid: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "5")]
    pub created_at: ::core::option::Option<
        super::super::super::google::protobuf::Timestamp,
    >,
    #[prost(message, optional, tag = "6")]
    pub updated_at: ::core::option::Option<
        super::super::super::google::protobuf::Timestamp,
    >,
    #[prost(string, optional, tag = "7")]
    pub asset_rid: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "8")]
    pub dataset_rid: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "9")]
    pub run_rid: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "10")]
    pub ingest_job_rid: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(enumeration = "IngestAutomationStep", optional, tag = "11")]
    pub failed_step: ::core::option::Option<i32>,
    #[prost(string, optional, tag = "12")]
    pub error_message: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IngestAutomationSpec {
    #[prost(string, tag = "1")]
    pub workspace_rid: ::prost::alloc::string::String,
    #[prost(message, repeated, tag = "2")]
    pub sources: ::prost::alloc::vec::Vec<super::super::ingest::v2::S3IngestSource>,
    #[prost(message, optional, tag = "3")]
    pub timestamp_metadata: ::core::option::Option<
        super::super::ingest::v2::TimestampMetadata,
    >,
    #[prost(enumeration = "IngestAutomationFileType", optional, tag = "4")]
    pub file_type: ::core::option::Option<i32>,
    #[prost(string, tag = "5")]
    pub asset_title: ::prost::alloc::string::String,
    #[prost(string, tag = "6")]
    pub dataset_title: ::prost::alloc::string::String,
    #[prost(string, tag = "7")]
    pub run_title: ::prost::alloc::string::String,
    #[prost(string, tag = "8")]
    pub data_scope_name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateIngestAutomationRequest {
    #[prost(message, optional, tag = "1")]
    pub spec: ::core::option::Option<IngestAutomationSpec>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateIngestAutomationResponse {
    #[prost(message, optional, tag = "1")]
    pub ingest_automation: ::core::option::Option<IngestAutomation>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetIngestAutomationRequest {
    #[prost(string, tag = "1")]
    pub ingest_automation_rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetIngestAutomationResponse {
    #[prost(message, optional, tag = "1")]
    pub ingest_automation: ::core::option::Option<IngestAutomation>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum IngestAutomationStatus {
    Unspecified = 0,
    CreatingResources = 1,
    Ingesting = 2,
    AwaitingChannels = 3,
    Completed = 4,
    Failed = 5,
}
impl IngestAutomationStatus {
    /// 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 => "INGEST_AUTOMATION_STATUS_UNSPECIFIED",
            Self::CreatingResources => "INGEST_AUTOMATION_STATUS_CREATING_RESOURCES",
            Self::Ingesting => "INGEST_AUTOMATION_STATUS_INGESTING",
            Self::AwaitingChannels => "INGEST_AUTOMATION_STATUS_AWAITING_CHANNELS",
            Self::Completed => "INGEST_AUTOMATION_STATUS_COMPLETED",
            Self::Failed => "INGEST_AUTOMATION_STATUS_FAILED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "INGEST_AUTOMATION_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
            "INGEST_AUTOMATION_STATUS_CREATING_RESOURCES" => {
                Some(Self::CreatingResources)
            }
            "INGEST_AUTOMATION_STATUS_INGESTING" => Some(Self::Ingesting),
            "INGEST_AUTOMATION_STATUS_AWAITING_CHANNELS" => Some(Self::AwaitingChannels),
            "INGEST_AUTOMATION_STATUS_COMPLETED" => Some(Self::Completed),
            "INGEST_AUTOMATION_STATUS_FAILED" => Some(Self::Failed),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum IngestAutomationStep {
    Unspecified = 0,
    CreateResources = 1,
    SubmitIngest = 2,
    AwaitIngest = 3,
    AwaitChannels = 4,
}
impl IngestAutomationStep {
    /// 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 => "INGEST_AUTOMATION_STEP_UNSPECIFIED",
            Self::CreateResources => "INGEST_AUTOMATION_STEP_CREATE_RESOURCES",
            Self::SubmitIngest => "INGEST_AUTOMATION_STEP_SUBMIT_INGEST",
            Self::AwaitIngest => "INGEST_AUTOMATION_STEP_AWAIT_INGEST",
            Self::AwaitChannels => "INGEST_AUTOMATION_STEP_AWAIT_CHANNELS",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "INGEST_AUTOMATION_STEP_UNSPECIFIED" => Some(Self::Unspecified),
            "INGEST_AUTOMATION_STEP_CREATE_RESOURCES" => Some(Self::CreateResources),
            "INGEST_AUTOMATION_STEP_SUBMIT_INGEST" => Some(Self::SubmitIngest),
            "INGEST_AUTOMATION_STEP_AWAIT_INGEST" => Some(Self::AwaitIngest),
            "INGEST_AUTOMATION_STEP_AWAIT_CHANNELS" => Some(Self::AwaitChannels),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum IngestAutomationFileType {
    Unspecified = 0,
    Csv = 1,
    Parquet = 2,
}
impl IngestAutomationFileType {
    /// 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 => "INGEST_AUTOMATION_FILE_TYPE_UNSPECIFIED",
            Self::Csv => "INGEST_AUTOMATION_FILE_TYPE_CSV",
            Self::Parquet => "INGEST_AUTOMATION_FILE_TYPE_PARQUET",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "INGEST_AUTOMATION_FILE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "INGEST_AUTOMATION_FILE_TYPE_CSV" => Some(Self::Csv),
            "INGEST_AUTOMATION_FILE_TYPE_PARQUET" => Some(Self::Parquet),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum IngestAutomationError {
    Unspecified = 0,
    InvalidRequest = 1,
}
impl IngestAutomationError {
    /// 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 => "INGEST_AUTOMATION_ERROR_UNSPECIFIED",
            Self::InvalidRequest => "INGEST_AUTOMATION_ERROR_INVALID_REQUEST",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "INGEST_AUTOMATION_ERROR_UNSPECIFIED" => Some(Self::Unspecified),
            "INGEST_AUTOMATION_ERROR_INVALID_REQUEST" => Some(Self::InvalidRequest),
            _ => None,
        }
    }
}
/// Generated client implementations.
pub mod ingest_automation_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 IngestAutomationServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl IngestAutomationServiceClient<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> IngestAutomationServiceClient<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,
        ) -> IngestAutomationServiceClient<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,
        {
            IngestAutomationServiceClient::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 create_ingest_automation(
            &mut self,
            request: impl tonic::IntoRequest<super::CreateIngestAutomationRequest>,
        ) -> std::result::Result<
            tonic::Response<super::CreateIngestAutomationResponse>,
            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.ingestautomations.v1.IngestAutomationService/CreateIngestAutomation",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.ingestautomations.v1.IngestAutomationService",
                        "CreateIngestAutomation",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        pub async fn get_ingest_automation(
            &mut self,
            request: impl tonic::IntoRequest<super::GetIngestAutomationRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GetIngestAutomationResponse>,
            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.ingestautomations.v1.IngestAutomationService/GetIngestAutomation",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.ingestautomations.v1.IngestAutomationService",
                        "GetIngestAutomation",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}