aws_sdk_ec2/types/
_host_offering.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct HostOffering {
7 pub currency_code: ::std::option::Option<crate::types::CurrencyCodeValues>,
9 pub duration: ::std::option::Option<i32>,
11 pub hourly_price: ::std::option::Option<::std::string::String>,
13 pub instance_family: ::std::option::Option<::std::string::String>,
15 pub offering_id: ::std::option::Option<::std::string::String>,
17 pub payment_option: ::std::option::Option<crate::types::PaymentOption>,
19 pub upfront_price: ::std::option::Option<::std::string::String>,
21}
22impl HostOffering {
23 pub fn currency_code(&self) -> ::std::option::Option<&crate::types::CurrencyCodeValues> {
25 self.currency_code.as_ref()
26 }
27 pub fn duration(&self) -> ::std::option::Option<i32> {
29 self.duration
30 }
31 pub fn hourly_price(&self) -> ::std::option::Option<&str> {
33 self.hourly_price.as_deref()
34 }
35 pub fn instance_family(&self) -> ::std::option::Option<&str> {
37 self.instance_family.as_deref()
38 }
39 pub fn offering_id(&self) -> ::std::option::Option<&str> {
41 self.offering_id.as_deref()
42 }
43 pub fn payment_option(&self) -> ::std::option::Option<&crate::types::PaymentOption> {
45 self.payment_option.as_ref()
46 }
47 pub fn upfront_price(&self) -> ::std::option::Option<&str> {
49 self.upfront_price.as_deref()
50 }
51}
52impl HostOffering {
53 pub fn builder() -> crate::types::builders::HostOfferingBuilder {
55 crate::types::builders::HostOfferingBuilder::default()
56 }
57}
58
59#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
61#[non_exhaustive]
62pub struct HostOfferingBuilder {
63 pub(crate) currency_code: ::std::option::Option<crate::types::CurrencyCodeValues>,
64 pub(crate) duration: ::std::option::Option<i32>,
65 pub(crate) hourly_price: ::std::option::Option<::std::string::String>,
66 pub(crate) instance_family: ::std::option::Option<::std::string::String>,
67 pub(crate) offering_id: ::std::option::Option<::std::string::String>,
68 pub(crate) payment_option: ::std::option::Option<crate::types::PaymentOption>,
69 pub(crate) upfront_price: ::std::option::Option<::std::string::String>,
70}
71impl HostOfferingBuilder {
72 pub fn currency_code(mut self, input: crate::types::CurrencyCodeValues) -> Self {
74 self.currency_code = ::std::option::Option::Some(input);
75 self
76 }
77 pub fn set_currency_code(mut self, input: ::std::option::Option<crate::types::CurrencyCodeValues>) -> Self {
79 self.currency_code = input;
80 self
81 }
82 pub fn get_currency_code(&self) -> &::std::option::Option<crate::types::CurrencyCodeValues> {
84 &self.currency_code
85 }
86 pub fn duration(mut self, input: i32) -> Self {
88 self.duration = ::std::option::Option::Some(input);
89 self
90 }
91 pub fn set_duration(mut self, input: ::std::option::Option<i32>) -> Self {
93 self.duration = input;
94 self
95 }
96 pub fn get_duration(&self) -> &::std::option::Option<i32> {
98 &self.duration
99 }
100 pub fn hourly_price(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
102 self.hourly_price = ::std::option::Option::Some(input.into());
103 self
104 }
105 pub fn set_hourly_price(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
107 self.hourly_price = input;
108 self
109 }
110 pub fn get_hourly_price(&self) -> &::std::option::Option<::std::string::String> {
112 &self.hourly_price
113 }
114 pub fn instance_family(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116 self.instance_family = ::std::option::Option::Some(input.into());
117 self
118 }
119 pub fn set_instance_family(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121 self.instance_family = input;
122 self
123 }
124 pub fn get_instance_family(&self) -> &::std::option::Option<::std::string::String> {
126 &self.instance_family
127 }
128 pub fn offering_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130 self.offering_id = ::std::option::Option::Some(input.into());
131 self
132 }
133 pub fn set_offering_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135 self.offering_id = input;
136 self
137 }
138 pub fn get_offering_id(&self) -> &::std::option::Option<::std::string::String> {
140 &self.offering_id
141 }
142 pub fn payment_option(mut self, input: crate::types::PaymentOption) -> Self {
144 self.payment_option = ::std::option::Option::Some(input);
145 self
146 }
147 pub fn set_payment_option(mut self, input: ::std::option::Option<crate::types::PaymentOption>) -> Self {
149 self.payment_option = input;
150 self
151 }
152 pub fn get_payment_option(&self) -> &::std::option::Option<crate::types::PaymentOption> {
154 &self.payment_option
155 }
156 pub fn upfront_price(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
158 self.upfront_price = ::std::option::Option::Some(input.into());
159 self
160 }
161 pub fn set_upfront_price(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
163 self.upfront_price = input;
164 self
165 }
166 pub fn get_upfront_price(&self) -> &::std::option::Option<::std::string::String> {
168 &self.upfront_price
169 }
170 pub fn build(self) -> crate::types::HostOffering {
172 crate::types::HostOffering {
173 currency_code: self.currency_code,
174 duration: self.duration,
175 hourly_price: self.hourly_price,
176 instance_family: self.instance_family,
177 offering_id: self.offering_id,
178 payment_option: self.payment_option,
179 upfront_price: self.upfront_price,
180 }
181 }
182}