tembo_api_client/models/
restore_instance.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct RestoreInstance {
16 #[serde(
17 rename = "app_services",
18 default,
19 with = "::serde_with::rust::double_option",
20 skip_serializing_if = "Option::is_none"
21 )]
22 pub app_services: Option<Option<Vec<models::AppType>>>,
23 #[serde(
24 rename = "autoscaling",
25 default,
26 with = "::serde_with::rust::double_option",
27 skip_serializing_if = "Option::is_none"
28 )]
29 pub autoscaling: Option<Option<Box<models::PatchAutoscaling>>>,
30 #[serde(
31 rename = "connection_pooler",
32 default,
33 with = "::serde_with::rust::double_option",
34 skip_serializing_if = "Option::is_none"
35 )]
36 pub connection_pooler: Option<Option<Box<models::ConnectionPooler>>>,
37 #[serde(
38 rename = "cpu",
39 default,
40 with = "::serde_with::rust::double_option",
41 skip_serializing_if = "Option::is_none"
42 )]
43 pub cpu: Option<Option<models::Cpu>>,
44 #[serde(
45 rename = "environment",
46 default,
47 with = "::serde_with::rust::double_option",
48 skip_serializing_if = "Option::is_none"
49 )]
50 pub environment: Option<Option<models::Environment>>,
51 #[serde(
52 rename = "extra_domains_rw",
53 default,
54 with = "::serde_with::rust::double_option",
55 skip_serializing_if = "Option::is_none"
56 )]
57 pub extra_domains_rw: Option<Option<Vec<String>>>,
58 #[serde(rename = "instance_name")]
59 pub instance_name: String,
60 #[serde(
61 rename = "memory",
62 default,
63 with = "::serde_with::rust::double_option",
64 skip_serializing_if = "Option::is_none"
65 )]
66 pub memory: Option<Option<models::Memory>>,
67 #[serde(rename = "restore")]
68 pub restore: Box<models::Restore>,
69 #[serde(
70 rename = "storage",
71 default,
72 with = "::serde_with::rust::double_option",
73 skip_serializing_if = "Option::is_none"
74 )]
75 pub storage: Option<Option<models::Storage>>,
76}
77
78impl RestoreInstance {
79 pub fn new(instance_name: String, restore: models::Restore) -> RestoreInstance {
80 RestoreInstance {
81 app_services: None,
82 autoscaling: None,
83 connection_pooler: None,
84 cpu: None,
85 environment: None,
86 extra_domains_rw: None,
87 instance_name,
88 memory: None,
89 restore: Box::new(restore),
90 storage: None,
91 }
92 }
93}