olai-uc-common 0.0.2

Shared types, generated Unity Catalog models, and storage/REST abstractions for the Unity Catalog server and client crates.
Documentation
// @generated
// This file is @generated by prost-build.
/// A catalog is a root-level namespace that contains schemas.
#[cfg_attr(feature = "python", ::pyo3::pyclass(get_all, set_all))]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Catalog {
    /// Name of catalog.
    #[prost(string, tag="1")]
    pub name: ::prost::alloc::string::String,
    /// Unique identifier for the catalog.
    #[prost(string, optional, tag="2")]
    pub id: ::core::option::Option<::prost::alloc::string::String>,
    /// Username of current owner of catalog.
    #[prost(string, optional, tag="3")]
    pub owner: ::core::option::Option<::prost::alloc::string::String>,
    /// User-provided free-form text description.
    #[prost(string, optional, tag="4")]
    pub comment: ::core::option::Option<::prost::alloc::string::String>,
    /// A map of key-value properties attached to the securable.
    #[prost(map="string, string", tag="5")]
    pub properties: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
    /// Storage root URL for managed tables within catalog.
    #[prost(string, optional, tag="6")]
    pub storage_root: ::core::option::Option<::prost::alloc::string::String>,
    /// The name of delta sharing provider.
    ///
    /// A Delta Sharing catalog is a catalog that is based on a Delta share on a remote sharing server.
    #[prost(string, optional, tag="7")]
    pub provider_name: ::core::option::Option<::prost::alloc::string::String>,
    /// The name of the share under the share provider.
    #[prost(string, optional, tag="8")]
    pub share_name: ::core::option::Option<::prost::alloc::string::String>,
    /// The type of the catalog.
    #[prost(enumeration="CatalogType", optional, tag="9")]
    pub catalog_type: ::core::option::Option<i32>,
    /// Storage location URL (full path) for managed storage of the catalog.
    ///
    /// A unique path under `storage_root`, used as the managed-storage parent for
    /// managed tables/volumes whose schema has no storage location of its own.
    /// Absent when the catalog has no `storage_root`.
    /// Example: `s3://bucket/ucroot/__unitystorage/catalogs/{catalog_id}`.
    #[prost(string, optional, tag="10")]
    pub storage_location: ::core::option::Option<::prost::alloc::string::String>,
    /// Time at which this catalog was created, in epoch milliseconds.
    #[prost(int64, optional, tag="1000")]
    pub created_at: ::core::option::Option<i64>,
    /// Username of catalog creator.
    #[prost(string, optional, tag="1001")]
    pub created_by: ::core::option::Option<::prost::alloc::string::String>,
    /// Time at which this catalog was last updated, in epoch milliseconds.
    #[prost(int64, optional, tag="1002")]
    pub updated_at: ::core::option::Option<i64>,
    /// Username of user who last modified catalog.
    #[prost(string, optional, tag="1003")]
    pub updated_by: ::core::option::Option<::prost::alloc::string::String>,
    /// Indicates whether the principal is limited to retrieving metadata
    /// for the associated object through the BROWSE privilege when include_browse
    /// is enabled in the request.
    #[prost(bool, optional, tag="1004")]
    pub browse_only: ::core::option::Option<bool>,
}
/// The type of the catalog.
#[cfg_attr(feature = "python", ::pyo3::pyclass)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum CatalogType {
    /// Unknown catalog type.
    Unspecified = 0,
    ManagedCatalog = 1,
    DeltasharingCatalog = 2,
    SystemCatalog = 3,
}
impl CatalogType {
    /// 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 => "CATALOG_TYPE_UNSPECIFIED",
            Self::ManagedCatalog => "MANAGED_CATALOG",
            Self::DeltasharingCatalog => "DELTASHARING_CATALOG",
            Self::SystemCatalog => "SYSTEM_CATALOG",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "CATALOG_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "MANAGED_CATALOG" => Some(Self::ManagedCatalog),
            "DELTASHARING_CATALOG" => Some(Self::DeltasharingCatalog),
            "SYSTEM_CATALOG" => Some(Self::SystemCatalog),
            _ => None,
        }
    }
}
/// List catalogs
#[cfg_attr(feature = "python", ::pyo3::pyclass(get_all, set_all))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListCatalogsRequest {
    /// The maximum number of results per page that should be returned.
    #[prost(int32, optional, tag="2")]
    pub max_results: ::core::option::Option<i32>,
    /// Opaque pagination token to go to next page based on previous query.
    #[prost(string, optional, tag="3")]
    pub page_token: ::core::option::Option<::prost::alloc::string::String>,
}
/// List catalogs response.
#[cfg_attr(feature = "python", ::pyo3::pyclass(get_all, set_all))]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListCatalogsResponse {
    /// The catalogs returned.
    #[prost(message, repeated, tag="1")]
    pub catalogs: ::prost::alloc::vec::Vec<Catalog>,
    /// The next_page_token value to include in the next List request.
    #[prost(string, optional, tag="2")]
    pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
}
/// Create a new catalog
#[cfg_attr(feature = "python", ::pyo3::pyclass(get_all, set_all))]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateCatalogRequest {
    /// Name of catalog.
    #[prost(string, tag="1")]
    pub name: ::prost::alloc::string::String,
    /// User-provided free-form text description.
    #[prost(string, optional, tag="2")]
    pub comment: ::core::option::Option<::prost::alloc::string::String>,
    /// A map of key-value properties attached to the securable.
    #[prost(map="string, string", tag="3")]
    pub properties: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
    /// Storage root URL for managed tables within catalog.
    #[prost(string, optional, tag="4")]
    pub storage_root: ::core::option::Option<::prost::alloc::string::String>,
    /// The name of delta sharing provider.
    ///
    /// A Delta Sharing catalog is a catalog that is based on a Delta share on a remote sharing server.
    #[prost(string, optional, tag="5")]
    pub provider_name: ::core::option::Option<::prost::alloc::string::String>,
    /// The name of the share under the share provider.
    #[prost(string, optional, tag="6")]
    pub share_name: ::core::option::Option<::prost::alloc::string::String>,
}
/// Get a catalog
#[cfg_attr(feature = "python", ::pyo3::pyclass(get_all, set_all))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetCatalogRequest {
    /// Name of catalog.
    #[prost(string, tag="1")]
    pub name: ::prost::alloc::string::String,
    /// Whether to include catalogs in the response for which the principal can only access selective metadata for
    #[prost(bool, optional, tag="2")]
    pub include_browse: ::core::option::Option<bool>,
}
/// Update a catalog
#[cfg_attr(feature = "python", ::pyo3::pyclass(get_all, set_all))]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateCatalogRequest {
    /// Name of catalog.
    #[prost(string, tag="1")]
    pub name: ::prost::alloc::string::String,
    /// Username of new owner of catalog.
    #[prost(string, optional, tag="2")]
    pub owner: ::core::option::Option<::prost::alloc::string::String>,
    /// User-provided free-form text description.
    #[prost(string, optional, tag="3")]
    pub comment: ::core::option::Option<::prost::alloc::string::String>,
    /// A map of key-value properties attached to the securable.
    ///
    /// When provided in update request, the specified properties will override the existing properties.
    /// To add and remove properties, one would need to perform a read-modify-write.
    #[prost(map="string, string", tag="4")]
    pub properties: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
    /// Name of catalog.
    #[prost(string, optional, tag="5")]
    pub new_name: ::core::option::Option<::prost::alloc::string::String>,
}
/// Delete a catalog
#[cfg_attr(feature = "python", ::pyo3::pyclass(get_all, set_all))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteCatalogRequest {
    /// Name of catalog.
    #[prost(string, tag="1")]
    pub name: ::prost::alloc::string::String,
    /// Force deletion even if the catalog is not empty.
    #[prost(bool, optional, tag="2")]
    pub force: ::core::option::Option<bool>,
}
include!("unitycatalog.catalogs.v1.serde.rs");
// @@protoc_insertion_point(module)