1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>A savings plan that reserves a certain amount of outbound bandwidth usage at a discounted rate each month over a period of time.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Offering {
/// <p>The type of currency that is used for billing. The currencyCode used for all reservations is US dollars.</p>
pub currency_code: ::std::option::Option<::std::string::String>,
/// <p>The length of time that your reservation would be active.</p>
pub duration: ::std::option::Option<i32>,
/// <p>The unit of measurement for the duration of the offering.</p>
pub duration_units: ::std::option::Option<crate::types::DurationUnits>,
/// <p>The Amazon Resource Name (ARN) that MediaConnect assigns to the offering.</p>
pub offering_arn: ::std::option::Option<::std::string::String>,
/// <p>A description of the offering.</p>
pub offering_description: ::std::option::Option<::std::string::String>,
/// <p>The cost of a single unit. This value, in combination with priceUnits, makes up the rate.</p>
pub price_per_unit: ::std::option::Option<::std::string::String>,
/// <p>The unit of measurement that is used for billing. This value, in combination with pricePerUnit, makes up the rate.</p>
pub price_units: ::std::option::Option<crate::types::PriceUnits>,
/// <p>A definition of the amount of outbound bandwidth that you would be reserving if you purchase the offering.</p>
pub resource_specification: ::std::option::Option<crate::types::ResourceSpecification>,
}
impl Offering {
/// <p>The type of currency that is used for billing. The currencyCode used for all reservations is US dollars.</p>
pub fn currency_code(&self) -> ::std::option::Option<&str> {
self.currency_code.as_deref()
}
/// <p>The length of time that your reservation would be active.</p>
pub fn duration(&self) -> ::std::option::Option<i32> {
self.duration
}
/// <p>The unit of measurement for the duration of the offering.</p>
pub fn duration_units(&self) -> ::std::option::Option<&crate::types::DurationUnits> {
self.duration_units.as_ref()
}
/// <p>The Amazon Resource Name (ARN) that MediaConnect assigns to the offering.</p>
pub fn offering_arn(&self) -> ::std::option::Option<&str> {
self.offering_arn.as_deref()
}
/// <p>A description of the offering.</p>
pub fn offering_description(&self) -> ::std::option::Option<&str> {
self.offering_description.as_deref()
}
/// <p>The cost of a single unit. This value, in combination with priceUnits, makes up the rate.</p>
pub fn price_per_unit(&self) -> ::std::option::Option<&str> {
self.price_per_unit.as_deref()
}
/// <p>The unit of measurement that is used for billing. This value, in combination with pricePerUnit, makes up the rate.</p>
pub fn price_units(&self) -> ::std::option::Option<&crate::types::PriceUnits> {
self.price_units.as_ref()
}
/// <p>A definition of the amount of outbound bandwidth that you would be reserving if you purchase the offering.</p>
pub fn resource_specification(&self) -> ::std::option::Option<&crate::types::ResourceSpecification> {
self.resource_specification.as_ref()
}
}
impl Offering {
/// Creates a new builder-style object to manufacture [`Offering`](crate::types::Offering).
pub fn builder() -> crate::types::builders::OfferingBuilder {
crate::types::builders::OfferingBuilder::default()
}
}
/// A builder for [`Offering`](crate::types::Offering).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct OfferingBuilder {
pub(crate) currency_code: ::std::option::Option<::std::string::String>,
pub(crate) duration: ::std::option::Option<i32>,
pub(crate) duration_units: ::std::option::Option<crate::types::DurationUnits>,
pub(crate) offering_arn: ::std::option::Option<::std::string::String>,
pub(crate) offering_description: ::std::option::Option<::std::string::String>,
pub(crate) price_per_unit: ::std::option::Option<::std::string::String>,
pub(crate) price_units: ::std::option::Option<crate::types::PriceUnits>,
pub(crate) resource_specification: ::std::option::Option<crate::types::ResourceSpecification>,
}
impl OfferingBuilder {
/// <p>The type of currency that is used for billing. The currencyCode used for all reservations is US dollars.</p>
/// This field is required.
pub fn currency_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.currency_code = ::std::option::Option::Some(input.into());
self
}
/// <p>The type of currency that is used for billing. The currencyCode used for all reservations is US dollars.</p>
pub fn set_currency_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.currency_code = input;
self
}
/// <p>The type of currency that is used for billing. The currencyCode used for all reservations is US dollars.</p>
pub fn get_currency_code(&self) -> &::std::option::Option<::std::string::String> {
&self.currency_code
}
/// <p>The length of time that your reservation would be active.</p>
/// This field is required.
pub fn duration(mut self, input: i32) -> Self {
self.duration = ::std::option::Option::Some(input);
self
}
/// <p>The length of time that your reservation would be active.</p>
pub fn set_duration(mut self, input: ::std::option::Option<i32>) -> Self {
self.duration = input;
self
}
/// <p>The length of time that your reservation would be active.</p>
pub fn get_duration(&self) -> &::std::option::Option<i32> {
&self.duration
}
/// <p>The unit of measurement for the duration of the offering.</p>
/// This field is required.
pub fn duration_units(mut self, input: crate::types::DurationUnits) -> Self {
self.duration_units = ::std::option::Option::Some(input);
self
}
/// <p>The unit of measurement for the duration of the offering.</p>
pub fn set_duration_units(mut self, input: ::std::option::Option<crate::types::DurationUnits>) -> Self {
self.duration_units = input;
self
}
/// <p>The unit of measurement for the duration of the offering.</p>
pub fn get_duration_units(&self) -> &::std::option::Option<crate::types::DurationUnits> {
&self.duration_units
}
/// <p>The Amazon Resource Name (ARN) that MediaConnect assigns to the offering.</p>
/// This field is required.
pub fn offering_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.offering_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) that MediaConnect assigns to the offering.</p>
pub fn set_offering_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.offering_arn = input;
self
}
/// <p>The Amazon Resource Name (ARN) that MediaConnect assigns to the offering.</p>
pub fn get_offering_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.offering_arn
}
/// <p>A description of the offering.</p>
/// This field is required.
pub fn offering_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.offering_description = ::std::option::Option::Some(input.into());
self
}
/// <p>A description of the offering.</p>
pub fn set_offering_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.offering_description = input;
self
}
/// <p>A description of the offering.</p>
pub fn get_offering_description(&self) -> &::std::option::Option<::std::string::String> {
&self.offering_description
}
/// <p>The cost of a single unit. This value, in combination with priceUnits, makes up the rate.</p>
/// This field is required.
pub fn price_per_unit(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.price_per_unit = ::std::option::Option::Some(input.into());
self
}
/// <p>The cost of a single unit. This value, in combination with priceUnits, makes up the rate.</p>
pub fn set_price_per_unit(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.price_per_unit = input;
self
}
/// <p>The cost of a single unit. This value, in combination with priceUnits, makes up the rate.</p>
pub fn get_price_per_unit(&self) -> &::std::option::Option<::std::string::String> {
&self.price_per_unit
}
/// <p>The unit of measurement that is used for billing. This value, in combination with pricePerUnit, makes up the rate.</p>
/// This field is required.
pub fn price_units(mut self, input: crate::types::PriceUnits) -> Self {
self.price_units = ::std::option::Option::Some(input);
self
}
/// <p>The unit of measurement that is used for billing. This value, in combination with pricePerUnit, makes up the rate.</p>
pub fn set_price_units(mut self, input: ::std::option::Option<crate::types::PriceUnits>) -> Self {
self.price_units = input;
self
}
/// <p>The unit of measurement that is used for billing. This value, in combination with pricePerUnit, makes up the rate.</p>
pub fn get_price_units(&self) -> &::std::option::Option<crate::types::PriceUnits> {
&self.price_units
}
/// <p>A definition of the amount of outbound bandwidth that you would be reserving if you purchase the offering.</p>
/// This field is required.
pub fn resource_specification(mut self, input: crate::types::ResourceSpecification) -> Self {
self.resource_specification = ::std::option::Option::Some(input);
self
}
/// <p>A definition of the amount of outbound bandwidth that you would be reserving if you purchase the offering.</p>
pub fn set_resource_specification(mut self, input: ::std::option::Option<crate::types::ResourceSpecification>) -> Self {
self.resource_specification = input;
self
}
/// <p>A definition of the amount of outbound bandwidth that you would be reserving if you purchase the offering.</p>
pub fn get_resource_specification(&self) -> &::std::option::Option<crate::types::ResourceSpecification> {
&self.resource_specification
}
/// Consumes the builder and constructs a [`Offering`](crate::types::Offering).
pub fn build(self) -> crate::types::Offering {
crate::types::Offering {
currency_code: self.currency_code,
duration: self.duration,
duration_units: self.duration_units,
offering_arn: self.offering_arn,
offering_description: self.offering_description,
price_per_unit: self.price_per_unit,
price_units: self.price_units,
resource_specification: self.resource_specification,
}
}
}