1 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - |
|
3 - | /// <p>A summary of an asynchronous invocation.</p>
|
4 - | #[non_exhaustive]
|
5 - | #[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
|
6 - | pub struct AsyncInvokeSummary {
|
7 - | /// <p>The invocation's ARN.</p>
|
8 - | pub invocation_arn: ::std::string::String,
|
9 - | /// <p>The invoked model's ARN.</p>
|
10 - | pub model_arn: ::std::string::String,
|
11 - | /// <p>The invocation's idempotency token.</p>
|
12 - | pub client_request_token: ::std::option::Option<::std::string::String>,
|
13 - | /// <p>The invocation's status.</p>
|
14 - | pub status: ::std::option::Option<crate::types::AsyncInvokeStatus>,
|
15 - | /// <p>An error message.</p>
|
16 - | pub failure_message: ::std::option::Option<::std::string::String>,
|
17 - | /// <p>When the invocation was submitted.</p>
|
18 - | pub submit_time: ::aws_smithy_types::DateTime,
|
19 - | /// <p>When the invocation was last modified.</p>
|
20 - | pub last_modified_time: ::std::option::Option<::aws_smithy_types::DateTime>,
|
21 - | /// <p>When the invocation ended.</p>
|
22 - | pub end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
|
23 - | /// <p>The invocation's output data settings.</p>
|
24 - | pub output_data_config: ::std::option::Option<crate::types::AsyncInvokeOutputDataConfig>,
|
25 - | }
|
26 - | impl AsyncInvokeSummary {
|
27 - | /// <p>The invocation's ARN.</p>
|
28 - | pub fn invocation_arn(&self) -> &str {
|
29 - | use std::ops::Deref;
|
30 - | self.invocation_arn.deref()
|
31 - | }
|
32 - | /// <p>The invoked model's ARN.</p>
|
33 - | pub fn model_arn(&self) -> &str {
|
34 - | use std::ops::Deref;
|
35 - | self.model_arn.deref()
|
36 - | }
|
37 - | /// <p>The invocation's idempotency token.</p>
|
38 - | pub fn client_request_token(&self) -> ::std::option::Option<&str> {
|
39 - | self.client_request_token.as_deref()
|
40 - | }
|
41 - | /// <p>The invocation's status.</p>
|
42 - | pub fn status(&self) -> ::std::option::Option<&crate::types::AsyncInvokeStatus> {
|
43 - | self.status.as_ref()
|
44 - | }
|
45 - | /// <p>An error message.</p>
|
46 - | pub fn failure_message(&self) -> ::std::option::Option<&str> {
|
47 - | self.failure_message.as_deref()
|
48 - | }
|
49 - | /// <p>When the invocation was submitted.</p>
|
50 - | pub fn submit_time(&self) -> &::aws_smithy_types::DateTime {
|
51 - | &self.submit_time
|
52 - | }
|
53 - | /// <p>When the invocation was last modified.</p>
|
54 - | pub fn last_modified_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
|
55 - | self.last_modified_time.as_ref()
|
56 - | }
|
57 - | /// <p>When the invocation ended.</p>
|
58 - | pub fn end_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
|
59 - | self.end_time.as_ref()
|
60 - | }
|
61 - | /// <p>The invocation's output data settings.</p>
|
62 - | pub fn output_data_config(&self) -> ::std::option::Option<&crate::types::AsyncInvokeOutputDataConfig> {
|
63 - | self.output_data_config.as_ref()
|
64 - | }
|
65 - | }
|
66 - | impl ::std::fmt::Debug for AsyncInvokeSummary {
|
67 - | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
68 - | let mut formatter = f.debug_struct("AsyncInvokeSummary");
|
69 - | formatter.field("invocation_arn", &self.invocation_arn);
|
70 - | formatter.field("model_arn", &self.model_arn);
|
71 - | formatter.field("client_request_token", &self.client_request_token);
|
72 - | formatter.field("status", &self.status);
|
73 - | formatter.field("failure_message", &"*** Sensitive Data Redacted ***");
|
74 - | formatter.field("submit_time", &self.submit_time);
|
75 - | formatter.field("last_modified_time", &self.last_modified_time);
|
76 - | formatter.field("end_time", &self.end_time);
|
77 - | formatter.field("output_data_config", &self.output_data_config);
|
78 - | formatter.finish()
|
79 - | }
|
80 - | }
|
81 - | impl AsyncInvokeSummary {
|
82 - | /// Creates a new builder-style object to manufacture [`AsyncInvokeSummary`](crate::types::AsyncInvokeSummary).
|
83 - | pub fn builder() -> crate::types::builders::AsyncInvokeSummaryBuilder {
|
84 - | crate::types::builders::AsyncInvokeSummaryBuilder::default()
|
85 - | }
|
86 - | }
|
87 - |
|
88 - | /// A builder for [`AsyncInvokeSummary`](crate::types::AsyncInvokeSummary).
|
89 - | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
|
90 - | #[non_exhaustive]
|
91 - | pub struct AsyncInvokeSummaryBuilder {
|
92 - | pub(crate) invocation_arn: ::std::option::Option<::std::string::String>,
|
93 - | pub(crate) model_arn: ::std::option::Option<::std::string::String>,
|
94 - | pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
|
95 - | pub(crate) status: ::std::option::Option<crate::types::AsyncInvokeStatus>,
|
96 - | pub(crate) failure_message: ::std::option::Option<::std::string::String>,
|
97 - | pub(crate) submit_time: ::std::option::Option<::aws_smithy_types::DateTime>,
|
98 - | pub(crate) last_modified_time: ::std::option::Option<::aws_smithy_types::DateTime>,
|
99 - | pub(crate) end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
|
100 - | pub(crate) output_data_config: ::std::option::Option<crate::types::AsyncInvokeOutputDataConfig>,
|
101 - | }
|
102 - | impl AsyncInvokeSummaryBuilder {
|
103 - | /// <p>The invocation's ARN.</p>
|
104 - | /// This field is required.
|
105 - | pub fn invocation_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
106 - | self.invocation_arn = ::std::option::Option::Some(input.into());
|
107 - | self
|
108 - | }
|
109 - | /// <p>The invocation's ARN.</p>
|
110 - | pub fn set_invocation_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
111 - | self.invocation_arn = input;
|
112 - | self
|
113 - | }
|
114 - | /// <p>The invocation's ARN.</p>
|
115 - | pub fn get_invocation_arn(&self) -> &::std::option::Option<::std::string::String> {
|
116 - | &self.invocation_arn
|
117 - | }
|
118 - | /// <p>The invoked model's ARN.</p>
|
119 - | /// This field is required.
|
120 - | pub fn model_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
121 - | self.model_arn = ::std::option::Option::Some(input.into());
|
122 - | self
|
123 - | }
|
124 - | /// <p>The invoked model's ARN.</p>
|
125 - | pub fn set_model_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
126 - | self.model_arn = input;
|
127 - | self
|
128 - | }
|
129 - | /// <p>The invoked model's ARN.</p>
|
130 - | pub fn get_model_arn(&self) -> &::std::option::Option<::std::string::String> {
|
131 - | &self.model_arn
|
132 - | }
|
133 - | /// <p>The invocation's idempotency token.</p>
|
134 - | pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
135 - | self.client_request_token = ::std::option::Option::Some(input.into());
|
136 - | self
|
137 - | }
|
138 - | /// <p>The invocation's idempotency token.</p>
|
139 - | pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
140 - | self.client_request_token = input;
|
141 - | self
|
142 - | }
|
143 - | /// <p>The invocation's idempotency token.</p>
|
144 - | pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
|
145 - | &self.client_request_token
|
146 - | }
|
147 - | /// <p>The invocation's status.</p>
|
148 - | pub fn status(mut self, input: crate::types::AsyncInvokeStatus) -> Self {
|
149 - | self.status = ::std::option::Option::Some(input);
|
150 - | self
|
151 - | }
|
152 - | /// <p>The invocation's status.</p>
|
153 - | pub fn set_status(mut self, input: ::std::option::Option<crate::types::AsyncInvokeStatus>) -> Self {
|
154 - | self.status = input;
|
155 - | self
|
156 - | }
|
157 - | /// <p>The invocation's status.</p>
|
158 - | pub fn get_status(&self) -> &::std::option::Option<crate::types::AsyncInvokeStatus> {
|
159 - | &self.status
|
160 - | }
|
161 - | /// <p>An error message.</p>
|
162 - | pub fn failure_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
163 - | self.failure_message = ::std::option::Option::Some(input.into());
|
164 - | self
|
165 - | }
|
166 - | /// <p>An error message.</p>
|
167 - | pub fn set_failure_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
168 - | self.failure_message = input;
|
169 - | self
|
170 - | }
|
171 - | /// <p>An error message.</p>
|
172 - | pub fn get_failure_message(&self) -> &::std::option::Option<::std::string::String> {
|
173 - | &self.failure_message
|
174 - | }
|
175 - | /// <p>When the invocation was submitted.</p>
|
176 - | /// This field is required.
|
177 - | pub fn submit_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
|
178 - | self.submit_time = ::std::option::Option::Some(input);
|
179 - | self
|
180 - | }
|
181 - | /// <p>When the invocation was submitted.</p>
|
182 - | pub fn set_submit_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
|
183 - | self.submit_time = input;
|
184 - | self
|
185 - | }
|
186 - | /// <p>When the invocation was submitted.</p>
|
187 - | pub fn get_submit_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
|
188 - | &self.submit_time
|
189 - | }
|
190 - | /// <p>When the invocation was last modified.</p>
|
191 - | pub fn last_modified_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
|
192 - | self.last_modified_time = ::std::option::Option::Some(input);
|
193 - | self
|
194 - | }
|
195 - | /// <p>When the invocation was last modified.</p>
|
196 - | pub fn set_last_modified_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
|
197 - | self.last_modified_time = input;
|
198 - | self
|
199 - | }
|
200 - | /// <p>When the invocation was last modified.</p>
|
201 - | pub fn get_last_modified_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
|
202 - | &self.last_modified_time
|
203 - | }
|
204 - | /// <p>When the invocation ended.</p>
|
205 - | pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
|
206 - | self.end_time = ::std::option::Option::Some(input);
|
207 - | self
|
208 - | }
|
209 - | /// <p>When the invocation ended.</p>
|
210 - | pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
|
211 - | self.end_time = input;
|
212 - | self
|
213 - | }
|
214 - | /// <p>When the invocation ended.</p>
|
215 - | pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
|
216 - | &self.end_time
|
217 - | }
|
218 - | /// <p>The invocation's output data settings.</p>
|
219 - | /// This field is required.
|
220 - | pub fn output_data_config(mut self, input: crate::types::AsyncInvokeOutputDataConfig) -> Self {
|
221 - | self.output_data_config = ::std::option::Option::Some(input);
|
222 - | self
|
223 - | }
|
224 - | /// <p>The invocation's output data settings.</p>
|
225 - | pub fn set_output_data_config(mut self, input: ::std::option::Option<crate::types::AsyncInvokeOutputDataConfig>) -> Self {
|
226 - | self.output_data_config = input;
|
227 - | self
|
228 - | }
|
229 - | /// <p>The invocation's output data settings.</p>
|
230 - | pub fn get_output_data_config(&self) -> &::std::option::Option<crate::types::AsyncInvokeOutputDataConfig> {
|
231 - | &self.output_data_config
|
232 - | }
|
233 - | /// Consumes the builder and constructs a [`AsyncInvokeSummary`](crate::types::AsyncInvokeSummary).
|
234 - | /// This method will fail if any of the following fields are not set:
|
235 - | /// - [`invocation_arn`](crate::types::builders::AsyncInvokeSummaryBuilder::invocation_arn)
|
236 - | /// - [`model_arn`](crate::types::builders::AsyncInvokeSummaryBuilder::model_arn)
|
237 - | /// - [`submit_time`](crate::types::builders::AsyncInvokeSummaryBuilder::submit_time)
|
238 - | pub fn build(self) -> ::std::result::Result<crate::types::AsyncInvokeSummary, ::aws_smithy_types::error::operation::BuildError> {
|
239 - | ::std::result::Result::Ok(crate::types::AsyncInvokeSummary {
|
240 - | invocation_arn: self.invocation_arn.ok_or_else(|| {
|
241 - | ::aws_smithy_types::error::operation::BuildError::missing_field(
|
242 - | "invocation_arn",
|
243 - | "invocation_arn was not specified but it is required when building AsyncInvokeSummary",
|
244 - | )
|
245 - | })?,
|
246 - | model_arn: self.model_arn.ok_or_else(|| {
|
247 - | ::aws_smithy_types::error::operation::BuildError::missing_field(
|
248 - | "model_arn",
|
249 - | "model_arn was not specified but it is required when building AsyncInvokeSummary",
|
250 - | )
|
251 - | })?,
|
252 - | client_request_token: self.client_request_token,
|
253 - | status: self.status,
|
254 - | failure_message: self.failure_message,
|
255 - | submit_time: self.submit_time.ok_or_else(|| {
|
256 - | ::aws_smithy_types::error::operation::BuildError::missing_field(
|
257 - | "submit_time",
|
258 - | "submit_time was not specified but it is required when building AsyncInvokeSummary",
|
259 - | )
|
260 - | })?,
|
261 - | last_modified_time: self.last_modified_time,
|
262 - | end_time: self.end_time,
|
263 - | output_data_config: self.output_data_config,
|
264 - | })
|
265 - | }
|
266 - | }
|
267 - | impl ::std::fmt::Debug for AsyncInvokeSummaryBuilder {
|
268 - | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
269 - | let mut formatter = f.debug_struct("AsyncInvokeSummaryBuilder");
|
270 - | formatter.field("invocation_arn", &self.invocation_arn);
|
271 - | formatter.field("model_arn", &self.model_arn);
|
272 - | formatter.field("client_request_token", &self.client_request_token);
|
273 - | formatter.field("status", &self.status);
|
274 - | formatter.field("failure_message", &"*** Sensitive Data Redacted ***");
|
275 - | formatter.field("submit_time", &self.submit_time);
|
276 - | formatter.field("last_modified_time", &self.last_modified_time);
|
277 - | formatter.field("end_time", &self.end_time);
|
278 - | formatter.field("output_data_config", &self.output_data_config);
|
279 - | formatter.finish()
|
280 - | }
|
281 - | }
|