proxmox_api/generated/nodes/node/qemu/vmid/agent/
file_read.rs1pub struct FileReadClient<T> {
2 client: T,
3 path: String,
4}
5impl<T> FileReadClient<T>
6where
7 T: crate::client::Client,
8{
9 pub fn new(client: T, parent_path: &str) -> Self {
10 Self {
11 client,
12 path: format!("{}{}", parent_path, "/file-read"),
13 }
14 }
15}
16impl<T> FileReadClient<T>
17where
18 T: crate::client::Client,
19{
20 #[doc = "Reads the given file via guest agent. Is limited to 16777216 bytes."]
21 pub fn get(&self, params: GetParams) -> Result<GetOutput, T::Error> {
22 let path = self.path.to_string();
23 self.client.get(&path, ¶ms)
24 }
25}
26impl GetOutput {
27 pub fn new(content: String) -> Self {
28 Self {
29 content,
30 truncated: Default::default(),
31 additional_properties: Default::default(),
32 }
33 }
34}
35#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
36pub struct GetOutput {
37 #[doc = "The content of the file, maximum 16777216"]
38 pub content: String,
39 #[serde(
40 serialize_with = "crate::types::serialize_bool_optional",
41 deserialize_with = "crate::types::deserialize_bool_optional"
42 )]
43 #[serde(skip_serializing_if = "Option::is_none", default)]
44 #[doc = "If set to 1, the output is truncated and not complete"]
45 pub truncated: Option<bool>,
46 #[serde(
47 flatten,
48 default,
49 skip_serializing_if = "::std::collections::HashMap::is_empty"
50 )]
51 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
52}
53impl GetParams {
54 pub fn new(file: String) -> Self {
55 Self {
56 file,
57 additional_properties: Default::default(),
58 }
59 }
60}
61#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
62pub struct GetParams {
63 #[doc = "The path to the file"]
64 pub file: String,
65 #[serde(
66 flatten,
67 default,
68 skip_serializing_if = "::std::collections::HashMap::is_empty"
69 )]
70 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
71}