nominal-api 0.1249.0

API bindings for the Nominal platform
Documentation
// This file is @generated by prost-build.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ContainerImage {
    #[prost(string, tag = "1")]
    pub rid: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub tag: ::prost::alloc::string::String,
    #[prost(int64, optional, tag = "3")]
    pub size_bytes: ::core::option::Option<i64>,
    #[prost(enumeration = "super::v1::ContainerImageStatus", tag = "4")]
    pub status: i32,
    #[prost(message, optional, tag = "5")]
    pub created_at: ::core::option::Option<
        super::super::super::google::protobuf::Timestamp,
    >,
    #[prost(string, tag = "6")]
    pub extractor_rid: ::prost::alloc::string::String,
    #[prost(message, repeated, tag = "7")]
    pub inputs: ::prost::alloc::vec::Vec<super::v1::FileExtractionInput>,
    #[prost(message, repeated, tag = "8")]
    pub parameters: ::prost::alloc::vec::Vec<super::v1::FileExtractionParameter>,
    #[prost(enumeration = "super::v1::FileOutputFormat", tag = "9")]
    pub file_output_format: i32,
    #[prost(message, optional, tag = "10")]
    pub default_timestamp_metadata: ::core::option::Option<super::v1::TimestampMetadata>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateImageRequest {
    #[prost(string, tag = "1")]
    pub workspace_rid: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub tag: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub object_path: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub extractor_rid: ::prost::alloc::string::String,
    #[prost(message, repeated, tag = "5")]
    pub inputs: ::prost::alloc::vec::Vec<super::v1::FileExtractionInput>,
    #[prost(message, repeated, tag = "6")]
    pub parameters: ::prost::alloc::vec::Vec<super::v1::FileExtractionParameter>,
    #[prost(enumeration = "super::v1::FileOutputFormat", tag = "7")]
    pub file_output_format: i32,
    #[prost(message, optional, tag = "8")]
    pub default_timestamp_metadata: ::core::option::Option<super::v1::TimestampMetadata>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateImageResponse {
    #[prost(message, optional, tag = "1")]
    pub image: ::core::option::Option<ContainerImage>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetImageRequest {
    #[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 GetImageResponse {
    #[prost(message, optional, tag = "1")]
    pub image: ::core::option::Option<ContainerImage>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteImageRequest {
    #[prost(string, tag = "1")]
    pub rid: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub workspace_rid: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DeleteImageResponse {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TagFilter {
    #[prost(string, tag = "1")]
    pub tag: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct StatusFilter {
    #[prost(enumeration = "super::v1::ContainerImageStatus", tag = "1")]
    pub status: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AndFilter {
    #[prost(message, repeated, tag = "1")]
    pub clauses: ::prost::alloc::vec::Vec<SearchFilter>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchFilter {
    #[prost(oneof = "search_filter::Filter", tags = "1, 2, 3")]
    pub filter: ::core::option::Option<search_filter::Filter>,
}
/// Nested message and enum types in `SearchFilter`.
pub mod search_filter {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Filter {
        #[prost(message, tag = "1")]
        Tag(super::TagFilter),
        #[prost(message, tag = "2")]
        Status(super::StatusFilter),
        #[prost(message, tag = "3")]
        And(super::AndFilter),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchImagesRequest {
    #[prost(string, tag = "1")]
    pub workspace_rid: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "2")]
    pub filter: ::core::option::Option<SearchFilter>,
    #[prost(int32, optional, tag = "3")]
    pub page_size: ::core::option::Option<i32>,
    #[prost(string, optional, tag = "4")]
    pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchImagesResponse {
    #[prost(message, repeated, tag = "1")]
    pub images: ::prost::alloc::vec::Vec<ContainerImage>,
    #[prost(string, optional, tag = "2")]
    pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
}
/// Generated client implementations.
pub mod registry_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 RegistryServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl RegistryServiceClient<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> RegistryServiceClient<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,
        ) -> RegistryServiceClient<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,
        {
            RegistryServiceClient::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_image(
            &mut self,
            request: impl tonic::IntoRequest<super::CreateImageRequest>,
        ) -> std::result::Result<
            tonic::Response<super::CreateImageResponse>,
            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.registry.v2.RegistryService/CreateImage",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("nominal.registry.v2.RegistryService", "CreateImage"),
                );
            self.inner.unary(req, path, codec).await
        }
        pub async fn get_image(
            &mut self,
            request: impl tonic::IntoRequest<super::GetImageRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GetImageResponse>,
            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.registry.v2.RegistryService/GetImage",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("nominal.registry.v2.RegistryService", "GetImage"),
                );
            self.inner.unary(req, path, codec).await
        }
        pub async fn delete_image(
            &mut self,
            request: impl tonic::IntoRequest<super::DeleteImageRequest>,
        ) -> std::result::Result<
            tonic::Response<super::DeleteImageResponse>,
            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.registry.v2.RegistryService/DeleteImage",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("nominal.registry.v2.RegistryService", "DeleteImage"),
                );
            self.inner.unary(req, path, codec).await
        }
        pub async fn search_images(
            &mut self,
            request: impl tonic::IntoRequest<super::SearchImagesRequest>,
        ) -> std::result::Result<
            tonic::Response<super::SearchImagesResponse>,
            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.registry.v2.RegistryService/SearchImages",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.registry.v2.RegistryService",
                        "SearchImages",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}