Skip to main content

aws_sdk_ec2/types/
_host_offering.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Details about the Dedicated Host Reservation offering.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct HostOffering {
7    /// <p>The currency of the offering.</p>
8    pub currency_code: ::std::option::Option<crate::types::CurrencyCodeValues>,
9    /// <p>The duration of the offering (in seconds).</p>
10    pub duration: ::std::option::Option<i32>,
11    /// <p>The hourly price of the offering.</p>
12    pub hourly_price: ::std::option::Option<::std::string::String>,
13    /// <p>The instance family of the offering.</p>
14    pub instance_family: ::std::option::Option<::std::string::String>,
15    /// <p>The ID of the offering.</p>
16    pub offering_id: ::std::option::Option<::std::string::String>,
17    /// <p>The available payment option.</p>
18    pub payment_option: ::std::option::Option<crate::types::PaymentOption>,
19    /// <p>The upfront price of the offering. Does not apply to No Upfront offerings.</p>
20    pub upfront_price: ::std::option::Option<::std::string::String>,
21}
22impl HostOffering {
23    /// <p>The currency of the offering.</p>
24    pub fn currency_code(&self) -> ::std::option::Option<&crate::types::CurrencyCodeValues> {
25        self.currency_code.as_ref()
26    }
27    /// <p>The duration of the offering (in seconds).</p>
28    pub fn duration(&self) -> ::std::option::Option<i32> {
29        self.duration
30    }
31    /// <p>The hourly price of the offering.</p>
32    pub fn hourly_price(&self) -> ::std::option::Option<&str> {
33        self.hourly_price.as_deref()
34    }
35    /// <p>The instance family of the offering.</p>
36    pub fn instance_family(&self) -> ::std::option::Option<&str> {
37        self.instance_family.as_deref()
38    }
39    /// <p>The ID of the offering.</p>
40    pub fn offering_id(&self) -> ::std::option::Option<&str> {
41        self.offering_id.as_deref()
42    }
43    /// <p>The available payment option.</p>
44    pub fn payment_option(&self) -> ::std::option::Option<&crate::types::PaymentOption> {
45        self.payment_option.as_ref()
46    }
47    /// <p>The upfront price of the offering. Does not apply to No Upfront offerings.</p>
48    pub fn upfront_price(&self) -> ::std::option::Option<&str> {
49        self.upfront_price.as_deref()
50    }
51}
52impl HostOffering {
53    /// Creates a new builder-style object to manufacture [`HostOffering`](crate::types::HostOffering).
54    pub fn builder() -> crate::types::builders::HostOfferingBuilder {
55        crate::types::builders::HostOfferingBuilder::default()
56    }
57}
58
59/// A builder for [`HostOffering`](crate::types::HostOffering).
60#[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    /// <p>The currency of the offering.</p>
73    pub fn currency_code(mut self, input: crate::types::CurrencyCodeValues) -> Self {
74        self.currency_code = ::std::option::Option::Some(input);
75        self
76    }
77    /// <p>The currency of the offering.</p>
78    pub fn set_currency_code(mut self, input: ::std::option::Option<crate::types::CurrencyCodeValues>) -> Self {
79        self.currency_code = input;
80        self
81    }
82    /// <p>The currency of the offering.</p>
83    pub fn get_currency_code(&self) -> &::std::option::Option<crate::types::CurrencyCodeValues> {
84        &self.currency_code
85    }
86    /// <p>The duration of the offering (in seconds).</p>
87    pub fn duration(mut self, input: i32) -> Self {
88        self.duration = ::std::option::Option::Some(input);
89        self
90    }
91    /// <p>The duration of the offering (in seconds).</p>
92    pub fn set_duration(mut self, input: ::std::option::Option<i32>) -> Self {
93        self.duration = input;
94        self
95    }
96    /// <p>The duration of the offering (in seconds).</p>
97    pub fn get_duration(&self) -> &::std::option::Option<i32> {
98        &self.duration
99    }
100    /// <p>The hourly price of the offering.</p>
101    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    /// <p>The hourly price of the offering.</p>
106    pub fn set_hourly_price(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
107        self.hourly_price = input;
108        self
109    }
110    /// <p>The hourly price of the offering.</p>
111    pub fn get_hourly_price(&self) -> &::std::option::Option<::std::string::String> {
112        &self.hourly_price
113    }
114    /// <p>The instance family of the offering.</p>
115    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    /// <p>The instance family of the offering.</p>
120    pub fn set_instance_family(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121        self.instance_family = input;
122        self
123    }
124    /// <p>The instance family of the offering.</p>
125    pub fn get_instance_family(&self) -> &::std::option::Option<::std::string::String> {
126        &self.instance_family
127    }
128    /// <p>The ID of the offering.</p>
129    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    /// <p>The ID of the offering.</p>
134    pub fn set_offering_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135        self.offering_id = input;
136        self
137    }
138    /// <p>The ID of the offering.</p>
139    pub fn get_offering_id(&self) -> &::std::option::Option<::std::string::String> {
140        &self.offering_id
141    }
142    /// <p>The available payment option.</p>
143    pub fn payment_option(mut self, input: crate::types::PaymentOption) -> Self {
144        self.payment_option = ::std::option::Option::Some(input);
145        self
146    }
147    /// <p>The available payment option.</p>
148    pub fn set_payment_option(mut self, input: ::std::option::Option<crate::types::PaymentOption>) -> Self {
149        self.payment_option = input;
150        self
151    }
152    /// <p>The available payment option.</p>
153    pub fn get_payment_option(&self) -> &::std::option::Option<crate::types::PaymentOption> {
154        &self.payment_option
155    }
156    /// <p>The upfront price of the offering. Does not apply to No Upfront offerings.</p>
157    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    /// <p>The upfront price of the offering. Does not apply to No Upfront offerings.</p>
162    pub fn set_upfront_price(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
163        self.upfront_price = input;
164        self
165    }
166    /// <p>The upfront price of the offering. Does not apply to No Upfront offerings.</p>
167    pub fn get_upfront_price(&self) -> &::std::option::Option<::std::string::String> {
168        &self.upfront_price
169    }
170    /// Consumes the builder and constructs a [`HostOffering`](crate::types::HostOffering).
171    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}