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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// Input for GetMetricUsage.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetMetricUsageInput {
/// The ID of the app.
pub app_id: ::std::option::Option<::std::string::String>,
/// The end user whose usage is read. Do not include personally identifiable or otherwise sensitive data in this value.
pub user_id: ::std::option::Option<::std::string::String>,
/// Inclusive start of the reporting window (half-open \[startedAt, endedAt)).
pub started_at: ::std::option::Option<::aws_smithy_types::DateTime>,
/// Exclusive end of the reporting window. Must be after startedAt; the window may span at most 744 hours (31 days, the longest monthly billing period). Must not be in the future beyond a small clock-skew allowance.
pub ended_at: ::std::option::Option<::aws_smithy_types::DateTime>,
/// Required. The environment: live or sandbox. sandbox reads the app's isolated test environment. Usage is kept separately per environment.
pub scope: ::std::option::Option<crate::types::RequestScope>,
/// Maximum number of per-metric usage entries to return in this page (1-25, default 25).
pub max_results: ::std::option::Option<i32>,
/// Opaque continuation token from a prior response. The window (startedAt/endedAt) must be unchanged across a pagination sequence.
pub next_token: ::std::option::Option<::std::string::String>,
}
impl GetMetricUsageInput {
/// The ID of the app.
pub fn app_id(&self) -> ::std::option::Option<&str> {
self.app_id.as_deref()
}
/// The end user whose usage is read. Do not include personally identifiable or otherwise sensitive data in this value.
pub fn user_id(&self) -> ::std::option::Option<&str> {
self.user_id.as_deref()
}
/// Inclusive start of the reporting window (half-open \[startedAt, endedAt)).
pub fn started_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.started_at.as_ref()
}
/// Exclusive end of the reporting window. Must be after startedAt; the window may span at most 744 hours (31 days, the longest monthly billing period). Must not be in the future beyond a small clock-skew allowance.
pub fn ended_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.ended_at.as_ref()
}
/// Required. The environment: live or sandbox. sandbox reads the app's isolated test environment. Usage is kept separately per environment.
pub fn scope(&self) -> ::std::option::Option<&crate::types::RequestScope> {
self.scope.as_ref()
}
/// Maximum number of per-metric usage entries to return in this page (1-25, default 25).
pub fn max_results(&self) -> ::std::option::Option<i32> {
self.max_results
}
/// Opaque continuation token from a prior response. The window (startedAt/endedAt) must be unchanged across a pagination sequence.
pub fn next_token(&self) -> ::std::option::Option<&str> {
self.next_token.as_deref()
}
}
impl GetMetricUsageInput {
/// Creates a new builder-style object to manufacture [`GetMetricUsageInput`](crate::operation::get_metric_usage::GetMetricUsageInput).
pub fn builder() -> crate::operation::get_metric_usage::builders::GetMetricUsageInputBuilder {
crate::operation::get_metric_usage::builders::GetMetricUsageInputBuilder::default()
}
}
/// A builder for [`GetMetricUsageInput`](crate::operation::get_metric_usage::GetMetricUsageInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetMetricUsageInputBuilder {
pub(crate) app_id: ::std::option::Option<::std::string::String>,
pub(crate) user_id: ::std::option::Option<::std::string::String>,
pub(crate) started_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) ended_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) scope: ::std::option::Option<crate::types::RequestScope>,
pub(crate) max_results: ::std::option::Option<i32>,
pub(crate) next_token: ::std::option::Option<::std::string::String>,
}
impl GetMetricUsageInputBuilder {
/// The ID of the app.
/// This field is required.
pub fn app_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.app_id = ::std::option::Option::Some(input.into());
self
}
/// The ID of the app.
pub fn set_app_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.app_id = input;
self
}
/// The ID of the app.
pub fn get_app_id(&self) -> &::std::option::Option<::std::string::String> {
&self.app_id
}
/// The end user whose usage is read. Do not include personally identifiable or otherwise sensitive data in this value.
/// This field is required.
pub fn user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.user_id = ::std::option::Option::Some(input.into());
self
}
/// The end user whose usage is read. Do not include personally identifiable or otherwise sensitive data in this value.
pub fn set_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.user_id = input;
self
}
/// The end user whose usage is read. Do not include personally identifiable or otherwise sensitive data in this value.
pub fn get_user_id(&self) -> &::std::option::Option<::std::string::String> {
&self.user_id
}
/// Inclusive start of the reporting window (half-open \[startedAt, endedAt)).
/// This field is required.
pub fn started_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.started_at = ::std::option::Option::Some(input);
self
}
/// Inclusive start of the reporting window (half-open \[startedAt, endedAt)).
pub fn set_started_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.started_at = input;
self
}
/// Inclusive start of the reporting window (half-open \[startedAt, endedAt)).
pub fn get_started_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.started_at
}
/// Exclusive end of the reporting window. Must be after startedAt; the window may span at most 744 hours (31 days, the longest monthly billing period). Must not be in the future beyond a small clock-skew allowance.
/// This field is required.
pub fn ended_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.ended_at = ::std::option::Option::Some(input);
self
}
/// Exclusive end of the reporting window. Must be after startedAt; the window may span at most 744 hours (31 days, the longest monthly billing period). Must not be in the future beyond a small clock-skew allowance.
pub fn set_ended_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.ended_at = input;
self
}
/// Exclusive end of the reporting window. Must be after startedAt; the window may span at most 744 hours (31 days, the longest monthly billing period). Must not be in the future beyond a small clock-skew allowance.
pub fn get_ended_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.ended_at
}
/// Required. The environment: live or sandbox. sandbox reads the app's isolated test environment. Usage is kept separately per environment.
/// This field is required.
pub fn scope(mut self, input: crate::types::RequestScope) -> Self {
self.scope = ::std::option::Option::Some(input);
self
}
/// Required. The environment: live or sandbox. sandbox reads the app's isolated test environment. Usage is kept separately per environment.
pub fn set_scope(mut self, input: ::std::option::Option<crate::types::RequestScope>) -> Self {
self.scope = input;
self
}
/// Required. The environment: live or sandbox. sandbox reads the app's isolated test environment. Usage is kept separately per environment.
pub fn get_scope(&self) -> &::std::option::Option<crate::types::RequestScope> {
&self.scope
}
/// Maximum number of per-metric usage entries to return in this page (1-25, default 25).
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = ::std::option::Option::Some(input);
self
}
/// Maximum number of per-metric usage entries to return in this page (1-25, default 25).
pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
/// Maximum number of per-metric usage entries to return in this page (1-25, default 25).
pub fn get_max_results(&self) -> &::std::option::Option<i32> {
&self.max_results
}
/// Opaque continuation token from a prior response. The window (startedAt/endedAt) must be unchanged across a pagination sequence.
pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.next_token = ::std::option::Option::Some(input.into());
self
}
/// Opaque continuation token from a prior response. The window (startedAt/endedAt) must be unchanged across a pagination sequence.
pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.next_token = input;
self
}
/// Opaque continuation token from a prior response. The window (startedAt/endedAt) must be unchanged across a pagination sequence.
pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
&self.next_token
}
/// Consumes the builder and constructs a [`GetMetricUsageInput`](crate::operation::get_metric_usage::GetMetricUsageInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::get_metric_usage::GetMetricUsageInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::get_metric_usage::GetMetricUsageInput {
app_id: self.app_id,
user_id: self.user_id,
started_at: self.started_at,
ended_at: self.ended_at,
scope: self.scope,
max_results: self.max_results,
next_token: self.next_token,
})
}
}