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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>The output from the GetRetainedMessage operation.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetRetainedMessageOutput {
/// <p>The topic name to which the retained message was published.</p>
pub topic: ::std::option::Option<::std::string::String>,
/// <p>The Base64-encoded message payload of the retained message body.</p>
pub payload: ::std::option::Option<::aws_smithy_types::Blob>,
/// <p>The quality of service (QoS) level used to publish the retained message.</p>
pub qos: i32,
/// <p>The Epoch date and time, in milliseconds, when the retained message was stored by IoT.</p>
pub last_modified_time: i64,
/// <p>A base64-encoded JSON string that includes an array of JSON objects, or null if the retained message doesn't include any user properties.</p>
/// <p>The following example <code>userProperties</code> parameter is a JSON string that represents two user properties. Note that it will be base64-encoded:</p>
/// <p><code>\[{"deviceName": "alpha"}, {"deviceCnt": "45"}\]</code></p>
pub user_properties: ::std::option::Option<::aws_smithy_types::Blob>,
_request_id: Option<String>,
}
impl GetRetainedMessageOutput {
/// <p>The topic name to which the retained message was published.</p>
pub fn topic(&self) -> ::std::option::Option<&str> {
self.topic.as_deref()
}
/// <p>The Base64-encoded message payload of the retained message body.</p>
pub fn payload(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
self.payload.as_ref()
}
/// <p>The quality of service (QoS) level used to publish the retained message.</p>
pub fn qos(&self) -> i32 {
self.qos
}
/// <p>The Epoch date and time, in milliseconds, when the retained message was stored by IoT.</p>
pub fn last_modified_time(&self) -> i64 {
self.last_modified_time
}
/// <p>A base64-encoded JSON string that includes an array of JSON objects, or null if the retained message doesn't include any user properties.</p>
/// <p>The following example <code>userProperties</code> parameter is a JSON string that represents two user properties. Note that it will be base64-encoded:</p>
/// <p><code>\[{"deviceName": "alpha"}, {"deviceCnt": "45"}\]</code></p>
pub fn user_properties(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
self.user_properties.as_ref()
}
}
impl ::aws_types::request_id::RequestId for GetRetainedMessageOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl GetRetainedMessageOutput {
/// Creates a new builder-style object to manufacture [`GetRetainedMessageOutput`](crate::operation::get_retained_message::GetRetainedMessageOutput).
pub fn builder() -> crate::operation::get_retained_message::builders::GetRetainedMessageOutputBuilder {
crate::operation::get_retained_message::builders::GetRetainedMessageOutputBuilder::default()
}
}
/// A builder for [`GetRetainedMessageOutput`](crate::operation::get_retained_message::GetRetainedMessageOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetRetainedMessageOutputBuilder {
pub(crate) topic: ::std::option::Option<::std::string::String>,
pub(crate) payload: ::std::option::Option<::aws_smithy_types::Blob>,
pub(crate) qos: ::std::option::Option<i32>,
pub(crate) last_modified_time: ::std::option::Option<i64>,
pub(crate) user_properties: ::std::option::Option<::aws_smithy_types::Blob>,
_request_id: Option<String>,
}
impl GetRetainedMessageOutputBuilder {
/// <p>The topic name to which the retained message was published.</p>
pub fn topic(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.topic = ::std::option::Option::Some(input.into());
self
}
/// <p>The topic name to which the retained message was published.</p>
pub fn set_topic(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.topic = input;
self
}
/// <p>The topic name to which the retained message was published.</p>
pub fn get_topic(&self) -> &::std::option::Option<::std::string::String> {
&self.topic
}
/// <p>The Base64-encoded message payload of the retained message body.</p>
pub fn payload(mut self, input: ::aws_smithy_types::Blob) -> Self {
self.payload = ::std::option::Option::Some(input);
self
}
/// <p>The Base64-encoded message payload of the retained message body.</p>
pub fn set_payload(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
self.payload = input;
self
}
/// <p>The Base64-encoded message payload of the retained message body.</p>
pub fn get_payload(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
&self.payload
}
/// <p>The quality of service (QoS) level used to publish the retained message.</p>
pub fn qos(mut self, input: i32) -> Self {
self.qos = ::std::option::Option::Some(input);
self
}
/// <p>The quality of service (QoS) level used to publish the retained message.</p>
pub fn set_qos(mut self, input: ::std::option::Option<i32>) -> Self {
self.qos = input;
self
}
/// <p>The quality of service (QoS) level used to publish the retained message.</p>
pub fn get_qos(&self) -> &::std::option::Option<i32> {
&self.qos
}
/// <p>The Epoch date and time, in milliseconds, when the retained message was stored by IoT.</p>
pub fn last_modified_time(mut self, input: i64) -> Self {
self.last_modified_time = ::std::option::Option::Some(input);
self
}
/// <p>The Epoch date and time, in milliseconds, when the retained message was stored by IoT.</p>
pub fn set_last_modified_time(mut self, input: ::std::option::Option<i64>) -> Self {
self.last_modified_time = input;
self
}
/// <p>The Epoch date and time, in milliseconds, when the retained message was stored by IoT.</p>
pub fn get_last_modified_time(&self) -> &::std::option::Option<i64> {
&self.last_modified_time
}
/// <p>A base64-encoded JSON string that includes an array of JSON objects, or null if the retained message doesn't include any user properties.</p>
/// <p>The following example <code>userProperties</code> parameter is a JSON string that represents two user properties. Note that it will be base64-encoded:</p>
/// <p><code>\[{"deviceName": "alpha"}, {"deviceCnt": "45"}\]</code></p>
pub fn user_properties(mut self, input: ::aws_smithy_types::Blob) -> Self {
self.user_properties = ::std::option::Option::Some(input);
self
}
/// <p>A base64-encoded JSON string that includes an array of JSON objects, or null if the retained message doesn't include any user properties.</p>
/// <p>The following example <code>userProperties</code> parameter is a JSON string that represents two user properties. Note that it will be base64-encoded:</p>
/// <p><code>\[{"deviceName": "alpha"}, {"deviceCnt": "45"}\]</code></p>
pub fn set_user_properties(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
self.user_properties = input;
self
}
/// <p>A base64-encoded JSON string that includes an array of JSON objects, or null if the retained message doesn't include any user properties.</p>
/// <p>The following example <code>userProperties</code> parameter is a JSON string that represents two user properties. Note that it will be base64-encoded:</p>
/// <p><code>\[{"deviceName": "alpha"}, {"deviceCnt": "45"}\]</code></p>
pub fn get_user_properties(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
&self.user_properties
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
/// Consumes the builder and constructs a [`GetRetainedMessageOutput`](crate::operation::get_retained_message::GetRetainedMessageOutput).
pub fn build(self) -> crate::operation::get_retained_message::GetRetainedMessageOutput {
crate::operation::get_retained_message::GetRetainedMessageOutput {
topic: self.topic,
payload: self.payload,
qos: self.qos.unwrap_or_default(),
last_modified_time: self.last_modified_time.unwrap_or_default(),
user_properties: self.user_properties,
_request_id: self._request_id,
}
}
}