nominal-api 0.1220.0

API bindings for the Nominal platform
Documentation
// This file is @generated by prost-build.
/// A containerized extractor that processes input files using a self-hosted container image.
///
/// Schema fields (inputs, parameters, output format, timestamp metadata) live on the underlying
/// ContainerImage rows; clients should read them off `active_container_image`. The extractor
/// itself carries only identity, workspace ownership, and lifecycle state.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ContainerizedExtractor {
    /// Unique resource identifier for this extractor.
    #[prost(string, tag = "1")]
    pub rid: ::prost::alloc::string::String,
    /// Workspace that owns this extractor.
    #[prost(string, tag = "2")]
    pub workspace_rid: ::prost::alloc::string::String,
    /// User-supplied name. Need not be unique within a workspace.
    #[prost(string, tag = "3")]
    pub name: ::prost::alloc::string::String,
    /// Free-form description shown in the UI.
    #[prost(string, optional, tag = "4")]
    pub description: ::core::option::Option<::prost::alloc::string::String>,
    /// Timestamp at which this extractor was first registered.
    #[prost(message, optional, tag = "5")]
    pub created_at: ::core::option::Option<
        super::super::super::google::protobuf::Timestamp,
    >,
    /// True once the extractor has been archived. Archived extractors are hidden from default search
    /// results and reject new ingests; flip back to false on UpdateContainerizedExtractor to restore.
    #[prost(bool, tag = "6")]
    pub is_archived: bool,
    /// The container image currently selected to run this extractor. Unset until the first image
    /// for this extractor reaches READY status; ingest requests that arrive before then will fail.
    /// The schema fields (inputs, parameters, output_file_format, default_timestamp_metadata) live
    /// on this nested image.
    #[prost(message, optional, tag = "7")]
    pub active_container_image: ::core::option::Option<
        super::super::registry::v1::ContainerImage,
    >,
}
/// Request to create a new self-hosted containerized extractor in a workspace. Schema fields
/// (inputs / parameters / output format / timestamp metadata) are supplied with each container
/// image via RegistryService.CreateImage and not on the extractor itself.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateContainerizedExtractorRequest {
    #[prost(string, tag = "1")]
    pub workspace_rid: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub name: ::prost::alloc::string::String,
    #[prost(string, optional, tag = "3")]
    pub description: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateContainerizedExtractorResponse {
    #[prost(message, optional, tag = "1")]
    pub extractor: ::core::option::Option<ContainerizedExtractor>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetContainerizedExtractorRequest {
    #[prost(string, tag = "1")]
    pub rid: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub workspace_rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetContainerizedExtractorResponse {
    #[prost(message, optional, tag = "1")]
    pub extractor: ::core::option::Option<ContainerizedExtractor>,
}
/// Partial update. Only fields explicitly set on the request are modified; unset fields are left
/// unchanged on the existing extractor. Archive / unarchive are expressed through this request by
/// setting `is_archived`. The active container image is selected by setting
/// `active_container_image_rid`.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateContainerizedExtractorRequest {
    #[prost(string, tag = "1")]
    pub rid: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub workspace_rid: ::prost::alloc::string::String,
    #[prost(string, optional, tag = "3")]
    pub name: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "4")]
    pub description: ::core::option::Option<::prost::alloc::string::String>,
    /// Set to true to archive, false to unarchive. Leave unset to leave archive state unchanged.
    #[prost(bool, optional, tag = "5")]
    pub is_archived: ::core::option::Option<bool>,
    /// RID of the container image to set as the active one for this extractor. Must reference a
    /// ContainerImage that is owned by the same workspace, was built for this extractor, and has
    /// reached READY status. Leave unset to leave the active image unchanged.
    #[prost(string, optional, tag = "6")]
    pub active_container_image_rid: ::core::option::Option<
        ::prost::alloc::string::String,
    >,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateContainerizedExtractorResponse {
    #[prost(message, optional, tag = "1")]
    pub extractor: ::core::option::Option<ContainerizedExtractor>,
}
/// Search extractors within a workspace, with cursor-based pagination. Filter fields are intended
/// to be added here over time; calling with only the workspace_rid set returns the default listing.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchContainerizedExtractorsRequest {
    #[prost(string, tag = "1")]
    pub workspace_rid: ::prost::alloc::string::String,
    /// When true, archived extractors are also returned.
    #[prost(bool, tag = "2")]
    pub include_archived: bool,
    #[prost(int32, tag = "3")]
    pub page_size: i32,
    #[prost(string, optional, tag = "4")]
    pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchContainerizedExtractorsResponse {
    #[prost(message, repeated, tag = "1")]
    pub extractors: ::prost::alloc::vec::Vec<ContainerizedExtractor>,
    #[prost(string, optional, tag = "2")]
    pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
}
/// Generated client implementations.
pub mod containerized_extractor_service_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// Manages containerized extractors backed by self-hosted images in the internal registry.
    #[derive(Debug, Clone)]
    pub struct ContainerizedExtractorServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl ContainerizedExtractorServiceClient<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> ContainerizedExtractorServiceClient<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,
        ) -> ContainerizedExtractorServiceClient<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,
        {
            ContainerizedExtractorServiceClient::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
        }
        /// Create a new extractor in a workspace. Container images are attached separately via
        /// RegistryService.CreateImage.
        pub async fn create_containerized_extractor(
            &mut self,
            request: impl tonic::IntoRequest<super::CreateContainerizedExtractorRequest>,
        ) -> std::result::Result<
            tonic::Response<super::CreateContainerizedExtractorResponse>,
            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.ingest.v2.ContainerizedExtractorService/CreateContainerizedExtractor",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.ingest.v2.ContainerizedExtractorService",
                        "CreateContainerizedExtractor",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Fetch a single extractor by RID.
        pub async fn get_containerized_extractor(
            &mut self,
            request: impl tonic::IntoRequest<super::GetContainerizedExtractorRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GetContainerizedExtractorResponse>,
            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.ingest.v2.ContainerizedExtractorService/GetContainerizedExtractor",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.ingest.v2.ContainerizedExtractorService",
                        "GetContainerizedExtractor",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Partial update of an existing extractor. Use the `is_archived` field to archive / unarchive.
        pub async fn update_containerized_extractor(
            &mut self,
            request: impl tonic::IntoRequest<super::UpdateContainerizedExtractorRequest>,
        ) -> std::result::Result<
            tonic::Response<super::UpdateContainerizedExtractorResponse>,
            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.ingest.v2.ContainerizedExtractorService/UpdateContainerizedExtractor",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.ingest.v2.ContainerizedExtractorService",
                        "UpdateContainerizedExtractor",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Search extractors within a workspace, with cursor-based pagination.
        pub async fn search_containerized_extractors(
            &mut self,
            request: impl tonic::IntoRequest<super::SearchContainerizedExtractorsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::SearchContainerizedExtractorsResponse>,
            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.ingest.v2.ContainerizedExtractorService/SearchContainerizedExtractors",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.ingest.v2.ContainerizedExtractorService",
                        "SearchContainerizedExtractors",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}