lance_namespace_reqwest_client/models/drop_namespace_request.rs
1/*
2 * Lance Namespace Specification
3 *
4 * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lancedb.github.io/lance-namespace/spec/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lancedb.github.io/lance-namespace/spec/impls/rest for more details.
5 *
6 * The version of the OpenAPI document: 1.0.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct DropNamespaceRequest {
16 #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
17 pub id: Option<Vec<String>>,
18 /// The mode for dropping a namespace, deciding the server behavior when the namespace to drop is not found. - FAIL (default): the server must return 400 indicating the namespace to drop does not exist. - SKIP: the server must return 204 indicating the drop operation has succeeded.
19 #[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
20 pub mode: Option<Mode>,
21 /// The behavior for dropping a namespace. - RESTRICT (default): the namespace should not contain any table or child namespace when drop is initiated. If tables are found, the server should return error and not drop the namespace. - CASCADE: all tables and child namespaces in the namespace are dropped before the namespace is dropped.
22 #[serde(rename = "behavior", skip_serializing_if = "Option::is_none")]
23 pub behavior: Option<Behavior>,
24}
25
26impl DropNamespaceRequest {
27 pub fn new() -> DropNamespaceRequest {
28 DropNamespaceRequest {
29 id: None,
30 mode: None,
31 behavior: None,
32 }
33 }
34}
35/// The mode for dropping a namespace, deciding the server behavior when the namespace to drop is not found. - FAIL (default): the server must return 400 indicating the namespace to drop does not exist. - SKIP: the server must return 204 indicating the drop operation has succeeded.
36#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
37pub enum Mode {
38 #[serde(rename = "SKIP")]
39 Skip,
40 #[serde(rename = "FAIL")]
41 Fail,
42}
43
44impl Default for Mode {
45 fn default() -> Mode {
46 Self::Skip
47 }
48}
49/// The behavior for dropping a namespace. - RESTRICT (default): the namespace should not contain any table or child namespace when drop is initiated. If tables are found, the server should return error and not drop the namespace. - CASCADE: all tables and child namespaces in the namespace are dropped before the namespace is dropped.
50#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
51pub enum Behavior {
52 #[serde(rename = "RESTRICT")]
53 Restrict,
54 #[serde(rename = "CASCADE")]
55 Cascade,
56}
57
58impl Default for Behavior {
59 fn default() -> Behavior {
60 Self::Restrict
61 }
62}
63