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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// A comparable app, read from its public pricing page. Give `quality` or `features`: one of them is required.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct Comparable {
/// Short name of the comparable app. Absent: the host of `url`, lowercased, without a leading `www.`; when two comparables get the same name, the later ones get ` (2)`, ` (3)`.
pub name: ::std::option::Option<::std::string::String>,
/// The public pricing page the price was read from.
pub url: ::std::string::String,
/// How the comparable charges.
pub mechanism: crate::types::ComparableMechanism,
/// Its price: per month for PAID_SUB, per use for PER_REQUEST, 0 for FREE_CAPPED and FREEMIUM, the one-time price for ONE_TIME. USD only: another currencyCode is rejected.
pub price: ::std::option::Option<crate::types::Price>,
/// Monthly usage cap of the free tier, for FREE_CAPPED and FREEMIUM. A free tier without a cap is not used.
pub cap: ::std::option::Option<f64>,
/// For PAID_SUB: units of this app's billable action the plan includes per month. With `overageRate`, a customer pays the plan price plus overage at their own usage; without it, the plan stops at this allowance. Absent: the plan price covers any usage.
pub included_units: ::std::option::Option<f64>,
/// For PAID_SUB with `includedUnits`: price per unit past the allowance, in USD. Absent: the plan stops at `includedUnits` (no overage).
pub overage_rate: ::std::option::Option<f64>,
/// How good it is compared with this app, where this app is 1.
pub quality: ::std::option::Option<f64>,
/// Its scores on the characteristics in `features`, instead of `quality`. Required when `quality` is absent.
pub features: ::std::option::Option<::std::collections::HashMap<::std::string::String, f64>>,
}
impl Comparable {
/// Short name of the comparable app. Absent: the host of `url`, lowercased, without a leading `www.`; when two comparables get the same name, the later ones get ` (2)`, ` (3)`.
pub fn name(&self) -> ::std::option::Option<&str> {
self.name.as_deref()
}
/// The public pricing page the price was read from.
pub fn url(&self) -> &str {
use std::ops::Deref;
self.url.deref()
}
/// How the comparable charges.
pub fn mechanism(&self) -> &crate::types::ComparableMechanism {
&self.mechanism
}
/// Its price: per month for PAID_SUB, per use for PER_REQUEST, 0 for FREE_CAPPED and FREEMIUM, the one-time price for ONE_TIME. USD only: another currencyCode is rejected.
pub fn price(&self) -> ::std::option::Option<&crate::types::Price> {
self.price.as_ref()
}
/// Monthly usage cap of the free tier, for FREE_CAPPED and FREEMIUM. A free tier without a cap is not used.
pub fn cap(&self) -> ::std::option::Option<f64> {
self.cap
}
/// For PAID_SUB: units of this app's billable action the plan includes per month. With `overageRate`, a customer pays the plan price plus overage at their own usage; without it, the plan stops at this allowance. Absent: the plan price covers any usage.
pub fn included_units(&self) -> ::std::option::Option<f64> {
self.included_units
}
/// For PAID_SUB with `includedUnits`: price per unit past the allowance, in USD. Absent: the plan stops at `includedUnits` (no overage).
pub fn overage_rate(&self) -> ::std::option::Option<f64> {
self.overage_rate
}
/// How good it is compared with this app, where this app is 1.
pub fn quality(&self) -> ::std::option::Option<f64> {
self.quality
}
/// Its scores on the characteristics in `features`, instead of `quality`. Required when `quality` is absent.
pub fn features(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, f64>> {
self.features.as_ref()
}
}
impl ::std::fmt::Debug for Comparable {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("Comparable");
formatter.field("name", &"*** Sensitive Data Redacted ***");
formatter.field("url", &"*** Sensitive Data Redacted ***");
formatter.field("mechanism", &"*** Sensitive Data Redacted ***");
formatter.field("price", &"*** Sensitive Data Redacted ***");
formatter.field("cap", &"*** Sensitive Data Redacted ***");
formatter.field("included_units", &"*** Sensitive Data Redacted ***");
formatter.field("overage_rate", &"*** Sensitive Data Redacted ***");
formatter.field("quality", &"*** Sensitive Data Redacted ***");
formatter.field("features", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}
impl Comparable {
/// Creates a new builder-style object to manufacture [`Comparable`](crate::types::Comparable).
pub fn builder() -> crate::types::builders::ComparableBuilder {
crate::types::builders::ComparableBuilder::default()
}
}
/// A builder for [`Comparable`](crate::types::Comparable).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct ComparableBuilder {
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) url: ::std::option::Option<::std::string::String>,
pub(crate) mechanism: ::std::option::Option<crate::types::ComparableMechanism>,
pub(crate) price: ::std::option::Option<crate::types::Price>,
pub(crate) cap: ::std::option::Option<f64>,
pub(crate) included_units: ::std::option::Option<f64>,
pub(crate) overage_rate: ::std::option::Option<f64>,
pub(crate) quality: ::std::option::Option<f64>,
pub(crate) features: ::std::option::Option<::std::collections::HashMap<::std::string::String, f64>>,
}
impl ComparableBuilder {
/// Short name of the comparable app. Absent: the host of `url`, lowercased, without a leading `www.`; when two comparables get the same name, the later ones get ` (2)`, ` (3)`.
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
/// Short name of the comparable app. Absent: the host of `url`, lowercased, without a leading `www.`; when two comparables get the same name, the later ones get ` (2)`, ` (3)`.
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// Short name of the comparable app. Absent: the host of `url`, lowercased, without a leading `www.`; when two comparables get the same name, the later ones get ` (2)`, ` (3)`.
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// The public pricing page the price was read from.
/// This field is required.
pub fn url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.url = ::std::option::Option::Some(input.into());
self
}
/// The public pricing page the price was read from.
pub fn set_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.url = input;
self
}
/// The public pricing page the price was read from.
pub fn get_url(&self) -> &::std::option::Option<::std::string::String> {
&self.url
}
/// How the comparable charges.
/// This field is required.
pub fn mechanism(mut self, input: crate::types::ComparableMechanism) -> Self {
self.mechanism = ::std::option::Option::Some(input);
self
}
/// How the comparable charges.
pub fn set_mechanism(mut self, input: ::std::option::Option<crate::types::ComparableMechanism>) -> Self {
self.mechanism = input;
self
}
/// How the comparable charges.
pub fn get_mechanism(&self) -> &::std::option::Option<crate::types::ComparableMechanism> {
&self.mechanism
}
/// Its price: per month for PAID_SUB, per use for PER_REQUEST, 0 for FREE_CAPPED and FREEMIUM, the one-time price for ONE_TIME. USD only: another currencyCode is rejected.
/// This field is required.
pub fn price(mut self, input: crate::types::Price) -> Self {
self.price = ::std::option::Option::Some(input);
self
}
/// Its price: per month for PAID_SUB, per use for PER_REQUEST, 0 for FREE_CAPPED and FREEMIUM, the one-time price for ONE_TIME. USD only: another currencyCode is rejected.
pub fn set_price(mut self, input: ::std::option::Option<crate::types::Price>) -> Self {
self.price = input;
self
}
/// Its price: per month for PAID_SUB, per use for PER_REQUEST, 0 for FREE_CAPPED and FREEMIUM, the one-time price for ONE_TIME. USD only: another currencyCode is rejected.
pub fn get_price(&self) -> &::std::option::Option<crate::types::Price> {
&self.price
}
/// Monthly usage cap of the free tier, for FREE_CAPPED and FREEMIUM. A free tier without a cap is not used.
pub fn cap(mut self, input: f64) -> Self {
self.cap = ::std::option::Option::Some(input);
self
}
/// Monthly usage cap of the free tier, for FREE_CAPPED and FREEMIUM. A free tier without a cap is not used.
pub fn set_cap(mut self, input: ::std::option::Option<f64>) -> Self {
self.cap = input;
self
}
/// Monthly usage cap of the free tier, for FREE_CAPPED and FREEMIUM. A free tier without a cap is not used.
pub fn get_cap(&self) -> &::std::option::Option<f64> {
&self.cap
}
/// For PAID_SUB: units of this app's billable action the plan includes per month. With `overageRate`, a customer pays the plan price plus overage at their own usage; without it, the plan stops at this allowance. Absent: the plan price covers any usage.
pub fn included_units(mut self, input: f64) -> Self {
self.included_units = ::std::option::Option::Some(input);
self
}
/// For PAID_SUB: units of this app's billable action the plan includes per month. With `overageRate`, a customer pays the plan price plus overage at their own usage; without it, the plan stops at this allowance. Absent: the plan price covers any usage.
pub fn set_included_units(mut self, input: ::std::option::Option<f64>) -> Self {
self.included_units = input;
self
}
/// For PAID_SUB: units of this app's billable action the plan includes per month. With `overageRate`, a customer pays the plan price plus overage at their own usage; without it, the plan stops at this allowance. Absent: the plan price covers any usage.
pub fn get_included_units(&self) -> &::std::option::Option<f64> {
&self.included_units
}
/// For PAID_SUB with `includedUnits`: price per unit past the allowance, in USD. Absent: the plan stops at `includedUnits` (no overage).
pub fn overage_rate(mut self, input: f64) -> Self {
self.overage_rate = ::std::option::Option::Some(input);
self
}
/// For PAID_SUB with `includedUnits`: price per unit past the allowance, in USD. Absent: the plan stops at `includedUnits` (no overage).
pub fn set_overage_rate(mut self, input: ::std::option::Option<f64>) -> Self {
self.overage_rate = input;
self
}
/// For PAID_SUB with `includedUnits`: price per unit past the allowance, in USD. Absent: the plan stops at `includedUnits` (no overage).
pub fn get_overage_rate(&self) -> &::std::option::Option<f64> {
&self.overage_rate
}
/// How good it is compared with this app, where this app is 1.
pub fn quality(mut self, input: f64) -> Self {
self.quality = ::std::option::Option::Some(input);
self
}
/// How good it is compared with this app, where this app is 1.
pub fn set_quality(mut self, input: ::std::option::Option<f64>) -> Self {
self.quality = input;
self
}
/// How good it is compared with this app, where this app is 1.
pub fn get_quality(&self) -> &::std::option::Option<f64> {
&self.quality
}
/// Adds a key-value pair to `features`.
///
/// To override the contents of this collection use [`set_features`](Self::set_features).
///
/// Its scores on the characteristics in `features`, instead of `quality`. Required when `quality` is absent.
pub fn features(mut self, k: impl ::std::convert::Into<::std::string::String>, v: f64) -> Self {
let mut hash_map = self.features.unwrap_or_default();
hash_map.insert(k.into(), v);
self.features = ::std::option::Option::Some(hash_map);
self
}
/// Its scores on the characteristics in `features`, instead of `quality`. Required when `quality` is absent.
pub fn set_features(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, f64>>) -> Self {
self.features = input;
self
}
/// Its scores on the characteristics in `features`, instead of `quality`. Required when `quality` is absent.
pub fn get_features(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, f64>> {
&self.features
}
/// Consumes the builder and constructs a [`Comparable`](crate::types::Comparable).
/// This method will fail if any of the following fields are not set:
/// - [`url`](crate::types::builders::ComparableBuilder::url)
/// - [`mechanism`](crate::types::builders::ComparableBuilder::mechanism)
pub fn build(self) -> ::std::result::Result<crate::types::Comparable, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Comparable {
name: self.name,
url: self.url.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"url",
"url was not specified but it is required when building Comparable",
)
})?,
mechanism: self.mechanism.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"mechanism",
"mechanism was not specified but it is required when building Comparable",
)
})?,
price: self.price,
cap: self.cap,
included_units: self.included_units,
overage_rate: self.overage_rate,
quality: self.quality,
features: self.features,
})
}
}
impl ::std::fmt::Debug for ComparableBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("ComparableBuilder");
formatter.field("name", &"*** Sensitive Data Redacted ***");
formatter.field("url", &"*** Sensitive Data Redacted ***");
formatter.field("mechanism", &"*** Sensitive Data Redacted ***");
formatter.field("price", &"*** Sensitive Data Redacted ***");
formatter.field("cap", &"*** Sensitive Data Redacted ***");
formatter.field("included_units", &"*** Sensitive Data Redacted ***");
formatter.field("overage_rate", &"*** Sensitive Data Redacted ***");
formatter.field("quality", &"*** Sensitive Data Redacted ***");
formatter.field("features", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}