cdp_protocol/
file_system.rs1#![allow(dead_code)]
3use super::network;
4use super::storage;
5#[allow(unused_imports)]
6use super::types::*;
7#[allow(unused_imports)]
8use derive_builder::Builder;
9#[allow(unused_imports)]
10use serde::{Deserialize, Serialize};
11#[allow(unused_imports)]
12use serde_json::Value as Json;
13#[allow(deprecated)]
14#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
15#[builder(setter(into, strip_option))]
16#[serde(rename_all = "camelCase")]
17pub struct File {
18 #[serde(default)]
19 pub name: String,
20 #[doc = "Timestamp"]
21 pub last_modified: network::TimeSinceEpoch,
22 #[serde(default)]
23 #[doc = "Size in bytes"]
24 pub size: JsFloat,
25 #[serde(default)]
26 pub r#type: String,
27}
28#[allow(deprecated)]
29#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
30#[builder(setter(into, strip_option))]
31#[serde(rename_all = "camelCase")]
32pub struct Directory {
33 #[serde(default)]
34 pub name: String,
35 #[serde(default)]
36 pub nested_directories: Vec<String>,
37 #[doc = "Files that are directly nested under this directory."]
38 pub nested_files: Vec<File>,
39}
40#[allow(deprecated)]
41#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
42#[builder(setter(into, strip_option))]
43#[serde(rename_all = "camelCase")]
44pub struct BucketFileSystemLocator {
45 #[doc = "Storage key"]
46 pub storage_key: storage::SerializedStorageKey,
47 #[builder(default)]
48 #[serde(skip_serializing_if = "Option::is_none")]
49 #[serde(default)]
50 #[doc = "Bucket name. Not passing a `bucketName` will retrieve the default Bucket. (<https://developer.mozilla.org/en-US/docs/Web/API/Storage_API#storage_buckets>)"]
51 pub bucket_name: Option<String>,
52 #[serde(default)]
53 #[doc = "Path to the directory using each path component as an array item."]
54 pub path_components: Vec<String>,
55}
56#[allow(deprecated)]
57#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
58#[builder(setter(into, strip_option))]
59#[serde(rename_all = "camelCase")]
60pub struct GetDirectory {
61 pub bucket_file_system_locator: BucketFileSystemLocator,
62}
63#[allow(deprecated)]
64#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
65#[serde(rename_all = "camelCase")]
66pub struct GetDirectoryReturnObject {
67 #[doc = "Returns the directory object at the path."]
68 pub directory: Directory,
69}
70#[allow(deprecated)]
71impl Method for GetDirectory {
72 const NAME: &'static str = "FileSystem.getDirectory";
73 type ReturnObject = GetDirectoryReturnObject;
74}
75#[allow(dead_code)]
76pub mod events {
77 #[allow(unused_imports)]
78 use super::super::types::*;
79 #[allow(unused_imports)]
80 use derive_builder::Builder;
81 #[allow(unused_imports)]
82 use serde::{Deserialize, Serialize};
83 #[allow(unused_imports)]
84 use serde_json::Value as Json;
85}