proxmox_api/generated/nodes/node/
query_url_metadata.rs1pub struct QueryUrlMetadataClient<T> {
2 client: T,
3 path: String,
4}
5impl<T> QueryUrlMetadataClient<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, "/query-url-metadata"),
13 }
14 }
15}
16impl<T> QueryUrlMetadataClient<T>
17where
18 T: crate::client::Client,
19{
20 #[doc = "Query metadata of an URL: file size, file name and mime type."]
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}
26#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
27pub struct GetOutput {
28 #[serde(skip_serializing_if = "Option::is_none", default)]
29 pub filename: Option<String>,
30 #[serde(skip_serializing_if = "Option::is_none", default)]
31 pub mimetype: Option<String>,
32 #[serde(
33 serialize_with = "crate::types::serialize_int_optional",
34 deserialize_with = "crate::types::deserialize_int_optional"
35 )]
36 #[serde(skip_serializing_if = "Option::is_none", default)]
37 pub size: Option<u64>,
38 #[serde(
39 flatten,
40 default,
41 skip_serializing_if = "::std::collections::HashMap::is_empty"
42 )]
43 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
44}
45impl GetParams {
46 pub fn new(url: String) -> Self {
47 Self {
48 url,
49 verify_certificates: Default::default(),
50 additional_properties: Default::default(),
51 }
52 }
53}
54#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
55pub struct GetParams {
56 #[doc = "The URL to query the metadata from."]
57 pub url: String,
58 #[serde(rename = "verify-certificates")]
59 #[serde(
60 serialize_with = "crate::types::serialize_bool_optional",
61 deserialize_with = "crate::types::deserialize_bool_optional"
62 )]
63 #[serde(skip_serializing_if = "Option::is_none", default)]
64 #[doc = "If false, no SSL/TLS certificates will be verified."]
65 pub verify_certificates: Option<bool>,
66 #[serde(
67 flatten,
68 default,
69 skip_serializing_if = "::std::collections::HashMap::is_empty"
70 )]
71 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
72}