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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// Input for PutEvent.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct PutEventInput {
/// The ID of the app the event belongs to.
pub app_id: ::std::option::Option<::std::string::String>,
/// A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request but does not return an error.
pub client_token: ::std::option::Option<::std::string::String>,
/// The ID of the end user the event is attributed to. Do not include personally identifiable or otherwise sensitive data in this value.
pub user_id: ::std::option::Option<::std::string::String>,
/// The event type. Correlates with the event type of the metrics that aggregate it.
pub event_type: ::std::option::Option<::std::string::String>,
/// The amount of usage the event represents, as a non-negative decimal string (for example, "1" or "12.5").
pub quantity: ::std::option::Option<::std::string::String>,
/// The time the event occurred.
pub timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
/// The key/value properties carried on the event, usable in metric filters and grouping. When a metric sums or takes the max of a property, that property's value must be a plain non-negative decimal (up to 15 digits before the point and 6 after; no sign, exponent, spaces, or commas, for example "1200" or "12.5"), and events that break this are rejected.
pub properties: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
/// The environment of the app that this operation applies to: the live app or the app's isolated sandbox test environment.
pub scope: ::std::option::Option<crate::types::RequestScope>,
}
impl PutEventInput {
/// The ID of the app the event belongs to.
pub fn app_id(&self) -> ::std::option::Option<&str> {
self.app_id.as_deref()
}
/// A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request but does not return an error.
pub fn client_token(&self) -> ::std::option::Option<&str> {
self.client_token.as_deref()
}
/// The ID of the end user the event is attributed to. 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()
}
/// The event type. Correlates with the event type of the metrics that aggregate it.
pub fn event_type(&self) -> ::std::option::Option<&str> {
self.event_type.as_deref()
}
/// The amount of usage the event represents, as a non-negative decimal string (for example, "1" or "12.5").
pub fn quantity(&self) -> ::std::option::Option<&str> {
self.quantity.as_deref()
}
/// The time the event occurred.
pub fn timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.timestamp.as_ref()
}
/// The key/value properties carried on the event, usable in metric filters and grouping. When a metric sums or takes the max of a property, that property's value must be a plain non-negative decimal (up to 15 digits before the point and 6 after; no sign, exponent, spaces, or commas, for example "1200" or "12.5"), and events that break this are rejected.
pub fn properties(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.properties.as_ref()
}
/// The environment of the app that this operation applies to: the live app or the app's isolated sandbox test environment.
pub fn scope(&self) -> ::std::option::Option<&crate::types::RequestScope> {
self.scope.as_ref()
}
}
impl PutEventInput {
/// Creates a new builder-style object to manufacture [`PutEventInput`](crate::operation::put_event::PutEventInput).
pub fn builder() -> crate::operation::put_event::builders::PutEventInputBuilder {
crate::operation::put_event::builders::PutEventInputBuilder::default()
}
}
/// A builder for [`PutEventInput`](crate::operation::put_event::PutEventInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PutEventInputBuilder {
pub(crate) app_id: ::std::option::Option<::std::string::String>,
pub(crate) client_token: ::std::option::Option<::std::string::String>,
pub(crate) user_id: ::std::option::Option<::std::string::String>,
pub(crate) event_type: ::std::option::Option<::std::string::String>,
pub(crate) quantity: ::std::option::Option<::std::string::String>,
pub(crate) timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) properties: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
pub(crate) scope: ::std::option::Option<crate::types::RequestScope>,
}
impl PutEventInputBuilder {
/// The ID of the app the event belongs to.
/// 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 the event belongs to.
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 the event belongs to.
pub fn get_app_id(&self) -> &::std::option::Option<::std::string::String> {
&self.app_id
}
/// A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request but does not return an error.
pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.client_token = ::std::option::Option::Some(input.into());
self
}
/// A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request but does not return an error.
pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.client_token = input;
self
}
/// A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request but does not return an error.
pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
&self.client_token
}
/// The ID of the end user the event is attributed to. 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 ID of the end user the event is attributed to. 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 ID of the end user the event is attributed to. 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
}
/// The event type. Correlates with the event type of the metrics that aggregate it.
/// This field is required.
pub fn event_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.event_type = ::std::option::Option::Some(input.into());
self
}
/// The event type. Correlates with the event type of the metrics that aggregate it.
pub fn set_event_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.event_type = input;
self
}
/// The event type. Correlates with the event type of the metrics that aggregate it.
pub fn get_event_type(&self) -> &::std::option::Option<::std::string::String> {
&self.event_type
}
/// The amount of usage the event represents, as a non-negative decimal string (for example, "1" or "12.5").
/// This field is required.
pub fn quantity(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.quantity = ::std::option::Option::Some(input.into());
self
}
/// The amount of usage the event represents, as a non-negative decimal string (for example, "1" or "12.5").
pub fn set_quantity(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.quantity = input;
self
}
/// The amount of usage the event represents, as a non-negative decimal string (for example, "1" or "12.5").
pub fn get_quantity(&self) -> &::std::option::Option<::std::string::String> {
&self.quantity
}
/// The time the event occurred.
/// This field is required.
pub fn timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.timestamp = ::std::option::Option::Some(input);
self
}
/// The time the event occurred.
pub fn set_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.timestamp = input;
self
}
/// The time the event occurred.
pub fn get_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.timestamp
}
/// Adds a key-value pair to `properties`.
///
/// To override the contents of this collection use [`set_properties`](Self::set_properties).
///
/// The key/value properties carried on the event, usable in metric filters and grouping. When a metric sums or takes the max of a property, that property's value must be a plain non-negative decimal (up to 15 digits before the point and 6 after; no sign, exponent, spaces, or commas, for example "1200" or "12.5"), and events that break this are rejected.
pub fn properties(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut hash_map = self.properties.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.properties = ::std::option::Option::Some(hash_map);
self
}
/// The key/value properties carried on the event, usable in metric filters and grouping. When a metric sums or takes the max of a property, that property's value must be a plain non-negative decimal (up to 15 digits before the point and 6 after; no sign, exponent, spaces, or commas, for example "1200" or "12.5"), and events that break this are rejected.
pub fn set_properties(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
self.properties = input;
self
}
/// The key/value properties carried on the event, usable in metric filters and grouping. When a metric sums or takes the max of a property, that property's value must be a plain non-negative decimal (up to 15 digits before the point and 6 after; no sign, exponent, spaces, or commas, for example "1200" or "12.5"), and events that break this are rejected.
pub fn get_properties(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.properties
}
/// The environment of the app that this operation applies to: the live app or the app's isolated sandbox test environment.
/// This field is required.
pub fn scope(mut self, input: crate::types::RequestScope) -> Self {
self.scope = ::std::option::Option::Some(input);
self
}
/// The environment of the app that this operation applies to: the live app or the app's isolated sandbox test environment.
pub fn set_scope(mut self, input: ::std::option::Option<crate::types::RequestScope>) -> Self {
self.scope = input;
self
}
/// The environment of the app that this operation applies to: the live app or the app's isolated sandbox test environment.
pub fn get_scope(&self) -> &::std::option::Option<crate::types::RequestScope> {
&self.scope
}
/// Consumes the builder and constructs a [`PutEventInput`](crate::operation::put_event::PutEventInput).
pub fn build(self) -> ::std::result::Result<crate::operation::put_event::PutEventInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::put_event::PutEventInput {
app_id: self.app_id,
client_token: self.client_token,
user_id: self.user_id,
event_type: self.event_type,
quantity: self.quantity,
timestamp: self.timestamp,
properties: self.properties,
scope: self.scope,
})
}
}