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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
// @generated
// This file is @generated by prost-build.
/// Information about a single function parameter.
#[cfg_attr(feature = "python", ::pyo3::pyclass(get_all, set_all))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FunctionParameterInfo {
    /// Name of parameter.
    #[prost(string, tag="1")]
    pub name: ::prost::alloc::string::String,
    /// Full data type specification as SQL/catalogString text.
    #[prost(string, tag="2")]
    pub type_text: ::prost::alloc::string::String,
    /// Full data type specification, JSON-serialized.
    #[prost(string, optional, tag="3")]
    pub type_json: ::core::option::Option<::prost::alloc::string::String>,
    /// Data type name.
    #[prost(enumeration="super::super::tables::v1::ColumnTypeName", tag="4")]
    pub type_name: i32,
    /// Digits of precision; required for DecimalTypes.
    #[prost(int32, optional, tag="5")]
    pub type_precision: ::core::option::Option<i32>,
    /// Digits to right of decimal; required for DecimalTypes.
    #[prost(int32, optional, tag="6")]
    pub type_scale: ::core::option::Option<i32>,
    /// Format of IntervalType.
    #[prost(string, optional, tag="7")]
    pub type_interval_type: ::core::option::Option<::prost::alloc::string::String>,
    /// Ordinal position of column (starting at position 0).
    #[prost(int32, optional, tag="8")]
    pub position: ::core::option::Option<i32>,
    /// The mode of the function parameter.
    #[prost(enumeration="ParameterMode", tag="9")]
    pub parameter_mode: i32,
    /// The type of function parameter.
    #[prost(enumeration="FunctionParameterType", tag="10")]
    pub parameter_type: i32,
    /// Default value of the parameter.
    #[prost(string, optional, tag="11")]
    pub parameter_default: ::core::option::Option<::prost::alloc::string::String>,
    /// User-provided free-form text description.
    #[prost(string, optional, tag="12")]
    pub comment: ::core::option::Option<::prost::alloc::string::String>,
}
/// A collection of function parameters.
#[cfg_attr(feature = "python", ::pyo3::pyclass(get_all, set_all))]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FunctionParameterInfos {
    /// The parameters of the function.
    #[prost(message, repeated, tag="1")]
    pub parameters: ::prost::alloc::vec::Vec<FunctionParameterInfo>,
}
/// A User-Defined Function (UDF) registered under a catalog + schema hierarchy.
#[cfg_attr(feature = "python", ::pyo3::pyclass(get_all, set_all))]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Function {
    /// Name of function, relative to parent schema.
    #[prost(string, tag="1")]
    pub name: ::prost::alloc::string::String,
    /// Name of parent catalog.
    #[prost(string, tag="2")]
    pub catalog_name: ::prost::alloc::string::String,
    /// Name of parent schema.
    #[prost(string, tag="3")]
    pub schema_name: ::prost::alloc::string::String,
    /// The three-level (fully qualified) name of the function.
    ///
    /// Format: catalog_name.schema_name.function_name
    #[prost(string, tag="4")]
    pub full_name: ::prost::alloc::string::String,
    /// Full data type specification of the return type of the function.
    #[prost(string, tag="5")]
    pub data_type: ::prost::alloc::string::String,
    /// Full data type specification as SQL/catalogString text.
    #[prost(string, tag="6")]
    pub full_data_type: ::prost::alloc::string::String,
    /// The array of function parameter infos.
    #[prost(message, optional, tag="7")]
    pub input_params: ::core::option::Option<FunctionParameterInfos>,
    /// The return type of the function in JSON format.
    #[prost(string, optional, tag="8")]
    pub return_params: ::core::option::Option<::prost::alloc::string::String>,
    /// The language of the function routine body.
    #[prost(string, optional, tag="9")]
    pub routine_body_language: ::core::option::Option<::prost::alloc::string::String>,
    /// Function body.
    #[prost(string, optional, tag="10")]
    pub routine_definition: ::core::option::Option<::prost::alloc::string::String>,
    /// Function dependencies (in JSON form).
    #[prost(string, optional, tag="11")]
    pub routine_dependencies: ::core::option::Option<::prost::alloc::string::String>,
    /// The parameter-passing style.
    #[prost(enumeration="ParameterStyle", tag="12")]
    pub parameter_style: i32,
    /// Indicates whether the function is deterministic.
    #[prost(bool, tag="13")]
    pub is_deterministic: bool,
    /// SQL data access information.
    #[prost(enumeration="SqlDataAccess", tag="14")]
    pub sql_data_access: i32,
    /// Indicates whether the function is null-calling.
    #[prost(bool, tag="15")]
    pub is_null_call: bool,
    /// The security type of the function.
    #[prost(enumeration="SecurityType", tag="16")]
    pub security_type: i32,
    /// The type of the function (SCALAR or TABLE).
    #[prost(string, optional, tag="17")]
    pub specific_name: ::core::option::Option<::prost::alloc::string::String>,
    /// The routine body.
    #[prost(enumeration="RoutineBody", tag="18")]
    pub routine_body: i32,
    /// User-provided free-form text description.
    #[prost(string, optional, tag="19")]
    pub comment: ::core::option::Option<::prost::alloc::string::String>,
    /// A map of key-value properties attached to the securable.
    #[prost(map="string, string", tag="20")]
    pub properties: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
    /// Username of current owner of the function.
    #[prost(string, optional, tag="21")]
    pub owner: ::core::option::Option<::prost::alloc::string::String>,
    /// Unique identifier for the function.
    #[prost(string, optional, tag="22")]
    pub function_id: ::core::option::Option<::prost::alloc::string::String>,
    /// Time at which this function was created, in epoch milliseconds.
    #[prost(int64, optional, tag="1000")]
    pub created_at: ::core::option::Option<i64>,
    /// Username of function creator.
    #[prost(string, optional, tag="1001")]
    pub created_by: ::core::option::Option<::prost::alloc::string::String>,
    /// Time at which this function was last updated, in epoch milliseconds.
    #[prost(int64, optional, tag="1002")]
    pub updated_at: ::core::option::Option<i64>,
    /// Username of user who last modified the function.
    #[prost(string, optional, tag="1003")]
    pub updated_by: ::core::option::Option<::prost::alloc::string::String>,
}
/// Determines whether the function body is interpreted as SQL or as an external function.
#[cfg_attr(feature = "python", ::pyo3::pyclass)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum RoutineBody {
    Unspecified = 0,
    /// The function is defined in SQL.
    Sql = 1,
    /// The function is defined externally.
    External = 2,
}
impl RoutineBody {
    /// 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 => "ROUTINE_BODY_UNSPECIFIED",
            Self::Sql => "SQL",
            Self::External => "EXTERNAL",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "ROUTINE_BODY_UNSPECIFIED" => Some(Self::Unspecified),
            "SQL" => Some(Self::Sql),
            "EXTERNAL" => Some(Self::External),
            _ => None,
        }
    }
}
/// The parameter-passing style.
#[cfg_attr(feature = "python", ::pyo3::pyclass)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ParameterStyle {
    Unspecified = 0,
    /// The parameters are passed positionally (S = SQL).
    S = 1,
}
impl ParameterStyle {
    /// 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 => "PARAMETER_STYLE_UNSPECIFIED",
            Self::S => "S",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "PARAMETER_STYLE_UNSPECIFIED" => Some(Self::Unspecified),
            "S" => Some(Self::S),
            _ => None,
        }
    }
}
/// The security type of the function.
#[cfg_attr(feature = "python", ::pyo3::pyclass)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SecurityType {
    Unspecified = 0,
    /// The function runs as the invoking user (DEFINER = standard SQL semantics).
    Definer = 1,
}
impl SecurityType {
    /// 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 => "SECURITY_TYPE_UNSPECIFIED",
            Self::Definer => "DEFINER",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "SECURITY_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "DEFINER" => Some(Self::Definer),
            _ => None,
        }
    }
}
/// Information about the SQL data access capability of the function.
#[cfg_attr(feature = "python", ::pyo3::pyclass)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SqlDataAccess {
    Unspecified = 0,
    /// Function contains no SQL.
    ContainsSql = 1,
    /// Function reads from SQL tables or views.
    ReadsSqlData = 2,
    /// Function does not use SQL and does not access data.
    NoSql = 3,
}
impl SqlDataAccess {
    /// 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 => "SQL_DATA_ACCESS_UNSPECIFIED",
            Self::ContainsSql => "CONTAINS_SQL",
            Self::ReadsSqlData => "READS_SQL_DATA",
            Self::NoSql => "NO_SQL",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "SQL_DATA_ACCESS_UNSPECIFIED" => Some(Self::Unspecified),
            "CONTAINS_SQL" => Some(Self::ContainsSql),
            "READS_SQL_DATA" => Some(Self::ReadsSqlData),
            "NO_SQL" => Some(Self::NoSql),
            _ => None,
        }
    }
}
/// The mode of the function parameter.
#[cfg_attr(feature = "python", ::pyo3::pyclass)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ParameterMode {
    Unspecified = 0,
    /// Input parameter.
    In = 1,
}
impl ParameterMode {
    /// 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 => "PARAMETER_MODE_UNSPECIFIED",
            Self::In => "IN",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "PARAMETER_MODE_UNSPECIFIED" => Some(Self::Unspecified),
            "IN" => Some(Self::In),
            _ => None,
        }
    }
}
/// The type of the function parameter.
#[cfg_attr(feature = "python", ::pyo3::pyclass)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum FunctionParameterType {
    Unspecified = 0,
    /// A named column parameter.
    Column = 1,
    /// A named parameter (default).
    Param = 2,
}
impl FunctionParameterType {
    /// 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 => "FUNCTION_PARAMETER_TYPE_UNSPECIFIED",
            Self::Column => "COLUMN",
            Self::Param => "PARAM",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "FUNCTION_PARAMETER_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "COLUMN" => Some(Self::Column),
            "PARAM" => Some(Self::Param),
            _ => None,
        }
    }
}
/// List functions in a schema
#[cfg_attr(feature = "python", ::pyo3::pyclass(get_all, set_all))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListFunctionsRequest {
    /// Name of parent catalog for functions of interest.
    #[prost(string, tag="1")]
    pub catalog_name: ::prost::alloc::string::String,
    /// Parent schema of functions.
    #[prost(string, tag="2")]
    pub schema_name: ::prost::alloc::string::String,
    /// The maximum number of results per page that should be returned.
    #[prost(int32, optional, tag="3")]
    pub max_results: ::core::option::Option<i32>,
    /// Opaque pagination token to go to next page based on previous query.
    #[prost(string, optional, tag="4")]
    pub page_token: ::core::option::Option<::prost::alloc::string::String>,
    /// Whether to include functions in the response for which the principal can only access selective metadata for.
    #[prost(bool, optional, tag="5")]
    pub include_browse: ::core::option::Option<bool>,
}
/// List functions response.
#[cfg_attr(feature = "python", ::pyo3::pyclass(get_all, set_all))]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListFunctionsResponse {
    /// The functions returned.
    #[prost(message, repeated, tag="1")]
    pub functions: ::prost::alloc::vec::Vec<Function>,
    /// 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 function
#[cfg_attr(feature = "python", ::pyo3::pyclass(get_all, set_all))]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateFunctionRequest {
    /// Name of function, relative to parent schema.
    #[prost(string, tag="1")]
    pub name: ::prost::alloc::string::String,
    /// Name of parent catalog.
    #[prost(string, tag="2")]
    pub catalog_name: ::prost::alloc::string::String,
    /// Name of parent schema.
    #[prost(string, tag="3")]
    pub schema_name: ::prost::alloc::string::String,
    /// Full data type specification of the return type of the function.
    #[prost(string, tag="4")]
    pub data_type: ::prost::alloc::string::String,
    /// Full data type specification as SQL/catalogString text.
    #[prost(string, tag="5")]
    pub full_data_type: ::prost::alloc::string::String,
    /// The array of function parameter infos.
    #[prost(message, optional, tag="6")]
    pub input_params: ::core::option::Option<FunctionParameterInfos>,
    /// The parameter-passing style.
    #[prost(enumeration="ParameterStyle", tag="7")]
    pub parameter_style: i32,
    /// Indicates whether the function is deterministic.
    #[prost(bool, tag="8")]
    pub is_deterministic: bool,
    /// SQL data access information.
    #[prost(enumeration="SqlDataAccess", tag="9")]
    pub sql_data_access: i32,
    /// Indicates whether the function is null-calling.
    #[prost(bool, tag="10")]
    pub is_null_call: bool,
    /// The security type of the function.
    #[prost(enumeration="SecurityType", tag="11")]
    pub security_type: i32,
    /// The routine body.
    #[prost(enumeration="RoutineBody", tag="12")]
    pub routine_body: i32,
    /// Function body.
    #[prost(string, optional, tag="13")]
    pub routine_definition: ::core::option::Option<::prost::alloc::string::String>,
    /// The language of the function routine body.
    #[prost(string, optional, tag="14")]
    pub routine_body_language: ::core::option::Option<::prost::alloc::string::String>,
    /// User-provided free-form text description.
    #[prost(string, optional, tag="15")]
    pub comment: ::core::option::Option<::prost::alloc::string::String>,
    /// A map of key-value properties attached to the securable.
    #[prost(map="string, string", tag="16")]
    pub properties: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
}
/// Get a function
#[cfg_attr(feature = "python", ::pyo3::pyclass(get_all, set_all))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetFunctionRequest {
    /// The fully-qualified name of the function (three-level name: catalog.schema.function).
    #[prost(string, tag="1")]
    pub name: ::prost::alloc::string::String,
}
/// Update a function
#[cfg_attr(feature = "python", ::pyo3::pyclass(get_all, set_all))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UpdateFunctionRequest {
    /// The fully-qualified name of the function (three-level name: catalog.schema.function).
    #[prost(string, tag="1")]
    pub name: ::prost::alloc::string::String,
    /// Username of new owner of the function.
    #[prost(string, optional, tag="2")]
    pub owner: ::core::option::Option<::prost::alloc::string::String>,
}
/// Delete a function
#[cfg_attr(feature = "python", ::pyo3::pyclass(get_all, set_all))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteFunctionRequest {
    /// The fully-qualified name of the function (three-level name: catalog.schema.function).
    #[prost(string, tag="1")]
    pub name: ::prost::alloc::string::String,
    /// Force deletion even if the function is not empty.
    #[prost(bool, optional, tag="2")]
    pub force: ::core::option::Option<bool>,
}
include!("unitycatalog.functions.v1.serde.rs");
// @@protoc_insertion_point(module)