Skip to main content

unitycatalog_common/models/_gen/
unitycatalog.shares.v1.rs

1// @generated
2// This file is @generated by prost-build.
3#[cfg_attr(feature = "python", ::pyo3::pyclass(get_all, set_all))]
4#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5pub struct DataObject {
6    /// A fully qualified name that uniquely identifies a data object.
7    ///
8    /// For example, a table's fully qualified name is in the format of <catalog>.<schema>.<table>,
9    #[prost(string, tag="1")]
10    pub name: ::prost::alloc::string::String,
11    /// Type of the data object.
12    #[prost(enumeration="DataObjectType", tag="2")]
13    pub data_object_type: i32,
14    /// The time when this data object is added to the share, in epoch milliseconds.
15    #[prost(int64, optional, tag="3")]
16    pub added_at: ::core::option::Option<i64>,
17    /// Username of the sharer.
18    #[prost(string, optional, tag="4")]
19    pub added_by: ::core::option::Option<::prost::alloc::string::String>,
20    /// A user-provided comment when adding the data object to the share.
21    #[prost(string, optional, tag="5")]
22    pub comment: ::core::option::Option<::prost::alloc::string::String>,
23    /// A user-provided new name for the data object within the share.
24    ///
25    /// If this new name is not provided, the object's original name will be used as the shared_as name.
26    /// The shared_as name must be unique within a share.
27    /// For tables, the new name must follow the format of <schema>.<table>.
28    #[prost(string, optional, tag="6")]
29    pub shared_as: ::core::option::Option<::prost::alloc::string::String>,
30    /// Array of partitions for the shared data.
31    #[prost(string, repeated, tag="7")]
32    pub partitions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
33    /// Whether to enable cdf or indicate if cdf is enabled on the shared object.
34    #[prost(bool, optional, tag="8")]
35    pub enable_cdf: ::core::option::Option<bool>,
36    /// Whether to enable or disable sharing of data history. If not specified, the default is DISABLED.
37    #[prost(enumeration="HistoryStatus", optional, tag="9")]
38    pub history_data_sharing_status: ::core::option::Option<i32>,
39    /// The start version associated with the object.
40    ///
41    /// This allows data providers to control the lowest object version that is accessible by clients.
42    /// If specified, clients can query snapshots or changes for versions >= start_version.
43    /// If not specified, clients can only query starting from the version of the object at the time it was added to the share.
44    ///
45    /// NOTE: The start_version should be <= the current version of the object.
46    #[prost(int64, optional, tag="10")]
47    pub start_version: ::core::option::Option<i64>,
48}
49#[cfg_attr(feature = "python", ::pyo3::pyclass(get_all, set_all))]
50#[derive(Clone, PartialEq, ::prost::Message)]
51pub struct Share {
52    /// Unique ID of the recipient.
53    #[prost(string, optional, tag="100")]
54    pub id: ::core::option::Option<::prost::alloc::string::String>,
55    /// Name of the share.
56    #[prost(string, tag="1")]
57    pub name: ::prost::alloc::string::String,
58    /// A list of shared data objects within the share.
59    #[prost(message, repeated, tag="6")]
60    pub objects: ::prost::alloc::vec::Vec<DataObject>,
61    /// Username of current owner of share.
62    #[prost(string, optional, tag="2")]
63    pub owner: ::core::option::Option<::prost::alloc::string::String>,
64    /// User-provided free-form text description.
65    #[prost(string, optional, tag="3")]
66    pub comment: ::core::option::Option<::prost::alloc::string::String>,
67    /// Storage Location URL (full path) for the share.
68    #[prost(string, optional, tag="4")]
69    pub storage_location: ::core::option::Option<::prost::alloc::string::String>,
70    /// Storage root URL for the share.
71    #[prost(string, optional, tag="5")]
72    pub storage_root: ::core::option::Option<::prost::alloc::string::String>,
73    /// Time at which this share was created, in epoch milliseconds.
74    #[prost(int64, optional, tag="7")]
75    pub created_at: ::core::option::Option<i64>,
76    /// Username of the creator of the share.
77    #[prost(string, optional, tag="8")]
78    pub created_by: ::core::option::Option<::prost::alloc::string::String>,
79    /// Time at which this share was updated, in epoch milliseconds.
80    #[prost(int64, optional, tag="9")]
81    pub updated_at: ::core::option::Option<i64>,
82    /// Username of share updater.
83    #[prost(string, optional, tag="10")]
84    pub updated_by: ::core::option::Option<::prost::alloc::string::String>,
85}
86#[cfg_attr(feature = "python", ::pyo3::pyclass(get_all, set_all))]
87#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
88pub struct PrivilegeAssignment {
89    /// The principal (user email address or group name).
90    ///
91    /// For deleted principals, principal is empty while principal_id is populated.
92    #[prost(string, tag="1")]
93    pub principal: ::prost::alloc::string::String,
94    /// The privileges assigned to the principal.
95    #[prost(string, repeated, tag="2")]
96    pub privileges: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
97}
98#[cfg_attr(feature = "python", ::pyo3::pyclass(get_all, set_all))]
99#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
100pub struct PermissionsChange {
101    /// The principal (user email address or group name).
102    #[prost(string, tag="1")]
103    pub principal: ::prost::alloc::string::String,
104    /// The set of privileges to add.
105    #[prost(string, repeated, tag="2")]
106    pub add: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
107    /// The set of privileges to remove.
108    #[prost(string, repeated, tag="3")]
109    pub remove: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
110}
111#[cfg_attr(feature = "python", ::pyo3::pyclass)]
112#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
113#[repr(i32)]
114pub enum DataObjectType {
115    /// Unknown data object type.
116    Unspecified = 0,
117    Table = 1,
118    Schema = 2,
119    // VIEW = 3;
120
121    // MATERIALIZED_VIEW = 4;
122
123    // STREAMING_TABLE = 5;
124
125    // MODEL = 6;
126
127    // NOTEBOOK_FILE = 7;
128
129    // FUNCTION = 8;
130
131    // FEATURE_SPEC = 9;
132
133    /// A Unity Catalog volume shared as a storage-backed asset (Open Sharing).
134    Volume = 10,
135    /// An agent skill (a directory of SKILL.md + scripts/assets) shared as a
136    /// storage-backed asset on top of a volume (Open Sharing).
137    AgentSkill = 11,
138}
139impl DataObjectType {
140    /// String value of the enum field names used in the ProtoBuf definition.
141    ///
142    /// The values are not transformed in any way and thus are considered stable
143    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
144    pub fn as_str_name(&self) -> &'static str {
145        match self {
146            Self::Unspecified => "DATA_OBJECT_TYPE_UNSPECIFIED",
147            Self::Table => "TABLE",
148            Self::Schema => "SCHEMA",
149            Self::Volume => "VOLUME",
150            Self::AgentSkill => "AGENT_SKILL",
151        }
152    }
153    /// Creates an enum from field names used in the ProtoBuf definition.
154    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
155        match value {
156            "DATA_OBJECT_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
157            "TABLE" => Some(Self::Table),
158            "SCHEMA" => Some(Self::Schema),
159            "VOLUME" => Some(Self::Volume),
160            "AGENT_SKILL" => Some(Self::AgentSkill),
161            _ => None,
162        }
163    }
164}
165#[cfg_attr(feature = "python", ::pyo3::pyclass)]
166#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
167#[repr(i32)]
168pub enum HistoryStatus {
169    /// Data history sharing is disabled.
170    Disabled = 0,
171    /// Data history sharing is enabled.
172    Enabled = 1,
173}
174impl HistoryStatus {
175    /// String value of the enum field names used in the ProtoBuf definition.
176    ///
177    /// The values are not transformed in any way and thus are considered stable
178    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
179    pub fn as_str_name(&self) -> &'static str {
180        match self {
181            Self::Disabled => "DISABLED",
182            Self::Enabled => "ENABLED",
183        }
184    }
185    /// Creates an enum from field names used in the ProtoBuf definition.
186    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
187        match value {
188            "DISABLED" => Some(Self::Disabled),
189            "ENABLED" => Some(Self::Enabled),
190            _ => None,
191        }
192    }
193}
194/// Request to list shares.
195#[cfg_attr(feature = "python", ::pyo3::pyclass(get_all, set_all))]
196#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
197pub struct ListSharesRequest {
198    /// The maximum number of results per page that should be returned.
199    #[prost(int32, optional, tag="1")]
200    pub max_results: ::core::option::Option<i32>,
201    /// Opaque pagination token to go to next page based on previous query.
202    #[prost(string, optional, tag="2")]
203    pub page_token: ::core::option::Option<::prost::alloc::string::String>,
204}
205/// Response to list shares.
206#[cfg_attr(feature = "python", ::pyo3::pyclass(get_all, set_all))]
207#[derive(Clone, PartialEq, ::prost::Message)]
208pub struct ListSharesResponse {
209    /// List of shares.
210    #[prost(message, repeated, tag="1")]
211    pub shares: ::prost::alloc::vec::Vec<Share>,
212    /// Opaque pagination token to go to next page based on previous query.
213    #[prost(string, optional, tag="2")]
214    pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
215}
216/// Creates a new share for data objects.
217///
218/// Data objects can be added after creation with update.
219/// The caller must be a metastore admin or have the CREATE_SHARE privilege on the metastore.
220#[cfg_attr(feature = "python", ::pyo3::pyclass(get_all, set_all))]
221#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
222pub struct CreateShareRequest {
223    /// Name of the share.
224    #[prost(string, tag="1")]
225    pub name: ::prost::alloc::string::String,
226    /// User-provided free-form text description.
227    #[prost(string, optional, tag="2")]
228    pub comment: ::core::option::Option<::prost::alloc::string::String>,
229}
230/// Get a share by name.
231#[cfg_attr(feature = "python", ::pyo3::pyclass(get_all, set_all))]
232#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
233pub struct GetShareRequest {
234    /// Name of the share.
235    #[prost(string, tag="1")]
236    pub name: ::prost::alloc::string::String,
237    /// Query for data to include in the share.
238    #[prost(bool, optional, tag="2")]
239    pub include_shared_data: ::core::option::Option<bool>,
240}
241/// Data object update.
242#[cfg_attr(feature = "python", ::pyo3::pyclass(get_all, set_all))]
243#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
244pub struct DataObjectUpdate {
245    /// Name of the share.
246    #[prost(enumeration="Action", tag="1")]
247    pub action: i32,
248    /// User-provided free-form text description.
249    #[prost(message, optional, tag="2")]
250    pub data_object: ::core::option::Option<DataObject>,
251}
252/// Update a share.
253///
254/// The caller must be a metastore admin or have the UPDATE_SHARE privilege on the metastore.
255#[cfg_attr(feature = "python", ::pyo3::pyclass(get_all, set_all))]
256#[derive(Clone, PartialEq, ::prost::Message)]
257pub struct UpdateShareRequest {
258    /// Name of the share.
259    #[prost(string, tag="1")]
260    pub name: ::prost::alloc::string::String,
261    /// Array of shared data object updates.
262    #[prost(message, repeated, tag="2")]
263    pub updates: ::prost::alloc::vec::Vec<DataObjectUpdate>,
264    /// A new name for the share.
265    #[prost(string, optional, tag="3")]
266    pub new_name: ::core::option::Option<::prost::alloc::string::String>,
267    /// Owner of the share.
268    #[prost(string, optional, tag="4")]
269    pub owner: ::core::option::Option<::prost::alloc::string::String>,
270    /// User-provided free-form text description.
271    #[prost(string, optional, tag="5")]
272    pub comment: ::core::option::Option<::prost::alloc::string::String>,
273}
274/// Delete a share.
275///
276/// The caller must be a metastore admin or have the DELETE_SHARE privilege on the metastore.
277#[cfg_attr(feature = "python", ::pyo3::pyclass(get_all, set_all))]
278#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
279pub struct DeleteShareRequest {
280    /// Name of the share.
281    #[prost(string, tag="1")]
282    pub name: ::prost::alloc::string::String,
283}
284/// Get permissions for a data share.
285#[cfg_attr(feature = "python", ::pyo3::pyclass(get_all, set_all))]
286#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
287pub struct GetPermissionsRequest {
288    /// Name of the share.
289    #[prost(string, tag="1")]
290    pub name: ::prost::alloc::string::String,
291    /// The maximum number of results per page that should be returned.
292    #[prost(int32, optional, tag="2")]
293    pub max_results: ::core::option::Option<i32>,
294    /// Opaque pagination token to go to next page based on previous query.
295    #[prost(string, optional, tag="3")]
296    pub page_token: ::core::option::Option<::prost::alloc::string::String>,
297}
298/// Response to list shares.
299#[cfg_attr(feature = "python", ::pyo3::pyclass(get_all, set_all))]
300#[derive(Clone, PartialEq, ::prost::Message)]
301pub struct GetPermissionsResponse {
302    /// The privileges assigned to each principal
303    #[prost(message, repeated, tag="1")]
304    pub privilege_assignments: ::prost::alloc::vec::Vec<PrivilegeAssignment>,
305    /// Opaque pagination token to go to next page based on previous query.
306    #[prost(string, optional, tag="2")]
307    pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
308}
309#[cfg_attr(feature = "python", ::pyo3::pyclass(get_all, set_all))]
310#[derive(Clone, PartialEq, ::prost::Message)]
311pub struct UpdatePermissionsRequest {
312    /// Name of the share.
313    #[prost(string, tag="1")]
314    pub name: ::prost::alloc::string::String,
315    /// Array of permissions change objects.
316    #[prost(message, repeated, tag="2")]
317    pub changes: ::prost::alloc::vec::Vec<PermissionsChange>,
318    /// Whether to return the latest permissions list of the share in the response.
319    #[prost(bool, optional, tag="3")]
320    pub omit_permissions_list: ::core::option::Option<bool>,
321}
322#[cfg_attr(feature = "python", ::pyo3::pyclass(get_all, set_all))]
323#[derive(Clone, PartialEq, ::prost::Message)]
324pub struct UpdatePermissionsResponse {
325    /// The privileges assigned to each principal
326    #[prost(message, repeated, tag="1")]
327    pub privilege_assignments: ::prost::alloc::vec::Vec<PrivilegeAssignment>,
328}
329#[cfg_attr(feature = "python", ::pyo3::pyclass)]
330#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
331#[repr(i32)]
332pub enum Action {
333    /// Unspecified action.
334    Unspecified = 0,
335    Add = 1,
336    Remove = 2,
337    Update = 3,
338}
339impl Action {
340    /// String value of the enum field names used in the ProtoBuf definition.
341    ///
342    /// The values are not transformed in any way and thus are considered stable
343    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
344    pub fn as_str_name(&self) -> &'static str {
345        match self {
346            Self::Unspecified => "ACTION_UNSPECIFIED",
347            Self::Add => "ADD",
348            Self::Remove => "REMOVE",
349            Self::Update => "UPDATE",
350        }
351    }
352    /// Creates an enum from field names used in the ProtoBuf definition.
353    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
354        match value {
355            "ACTION_UNSPECIFIED" => Some(Self::Unspecified),
356            "ADD" => Some(Self::Add),
357            "REMOVE" => Some(Self::Remove),
358            "UPDATE" => Some(Self::Update),
359            _ => None,
360        }
361    }
362}
363include!("unitycatalog.shares.v1.serde.rs");
364// @@protoc_insertion_point(module)