github.com/treeverse/lakefs@v1.24.1-0.20240520134607-95648127bfb0/clients/rust/src/models/import_location.rs (about) 1 /* 2 * lakeFS API 3 * 4 * lakeFS HTTP API 5 * 6 * The version of the OpenAPI document: 1.0.0 7 * Contact: services@treeverse.io 8 * Generated by: https://openapi-generator.tech 9 */ 10 11 use crate::models; 12 13 #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 14 pub struct ImportLocation { 15 /// Path type, can either be 'common_prefix' or 'object' 16 #[serde(rename = "type")] 17 pub r#type: Type, 18 /// A source location to a 'common_prefix' or to a single object. Must match the lakeFS installation blockstore type. 19 #[serde(rename = "path")] 20 pub path: String, 21 /// Destination for the imported objects on the branch. Must be a relative path to the branch. If the type is an 'object', the destination is the exact object name under the branch. If the type is a 'common_prefix', the destination is the prefix under the branch. 22 #[serde(rename = "destination")] 23 pub destination: String, 24 } 25 26 impl ImportLocation { 27 pub fn new(r#type: Type, path: String, destination: String) -> ImportLocation { 28 ImportLocation { 29 r#type, 30 path, 31 destination, 32 } 33 } 34 } 35 /// Path type, can either be 'common_prefix' or 'object' 36 #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] 37 pub enum Type { 38 #[serde(rename = "common_prefix")] 39 CommonPrefix, 40 #[serde(rename = "object")] 41 Object, 42 } 43 44 impl Default for Type { 45 fn default() -> Type { 46 Self::CommonPrefix 47 } 48 } 49