Skip to main content

aws_sdk_cloudcontrol/types/
_progress_event.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents the current status of a resource operation request. For more information, see <a href="https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-manage-requests.html">Managing resource operation requests</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
6pub struct ProgressEvent {
7    /// <p>The name of the resource type used in the operation.</p>
8    pub type_name: ::std::option::Option<::std::string::String>,
9    /// <p>The primary identifier for the resource.</p><note>
10    /// <p>In some cases, the resource identifier may be available before the resource operation has reached a status of <code>SUCCESS</code>.</p>
11    /// </note>
12    pub identifier: ::std::option::Option<::std::string::String>,
13    /// <p>The unique token representing this resource operation request.</p>
14    /// <p>Use the <code>RequestToken</code> with <a href="https://docs.aws.amazon.com/cloudcontrolapi/latest/APIReference/API_GetResourceRequestStatus.html">GetResourceRequestStatus</a> to return the current status of a resource operation request.</p>
15    pub request_token: ::std::option::Option<::std::string::String>,
16    /// <p>The unique token representing the Hooks operation for the request.</p>
17    pub hooks_request_token: ::std::option::Option<::std::string::String>,
18    /// <p>The resource operation type.</p>
19    pub operation: ::std::option::Option<crate::types::Operation>,
20    /// <p>The current status of the resource operation request.</p>
21    /// <ul>
22    /// <li>
23    /// <p><code>PENDING</code>: The resource operation hasn't yet started.</p></li>
24    /// <li>
25    /// <p><code>IN_PROGRESS</code>: The resource operation is currently in progress.</p></li>
26    /// <li>
27    /// <p><code>SUCCESS</code>: The resource operation has successfully completed.</p></li>
28    /// <li>
29    /// <p><code>FAILED</code>: The resource operation has failed. Refer to the error code and status message for more information.</p></li>
30    /// <li>
31    /// <p><code>CANCEL_IN_PROGRESS</code>: The resource operation is in the process of being canceled.</p></li>
32    /// <li>
33    /// <p><code>CANCEL_COMPLETE</code>: The resource operation has been canceled.</p></li>
34    /// </ul>
35    pub operation_status: ::std::option::Option<crate::types::OperationStatus>,
36    /// <p>When the resource operation request was initiated.</p>
37    pub event_time: ::std::option::Option<::aws_smithy_types::DateTime>,
38    /// <p>A JSON string containing the resource model, consisting of each resource property and its current value.</p>
39    pub resource_model: ::std::option::Option<::std::string::String>,
40    /// <p>Any message explaining the current status.</p>
41    pub status_message: ::std::option::Option<::std::string::String>,
42    /// <p>For requests with a status of <code>FAILED</code>, the associated error code.</p>
43    /// <p>For error code definitions, see <a href="https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-test-contract-errors.html">Handler error codes</a> in the <i>CloudFormation Command Line Interface User Guide for Extension Development</i>.</p>
44    pub error_code: ::std::option::Option<crate::types::HandlerErrorCode>,
45    /// <p>When to next request the status of this resource operation request.</p>
46    pub retry_after: ::std::option::Option<::aws_smithy_types::DateTime>,
47}
48impl ProgressEvent {
49    /// <p>The name of the resource type used in the operation.</p>
50    pub fn type_name(&self) -> ::std::option::Option<&str> {
51        self.type_name.as_deref()
52    }
53    /// <p>The primary identifier for the resource.</p><note>
54    /// <p>In some cases, the resource identifier may be available before the resource operation has reached a status of <code>SUCCESS</code>.</p>
55    /// </note>
56    pub fn identifier(&self) -> ::std::option::Option<&str> {
57        self.identifier.as_deref()
58    }
59    /// <p>The unique token representing this resource operation request.</p>
60    /// <p>Use the <code>RequestToken</code> with <a href="https://docs.aws.amazon.com/cloudcontrolapi/latest/APIReference/API_GetResourceRequestStatus.html">GetResourceRequestStatus</a> to return the current status of a resource operation request.</p>
61    pub fn request_token(&self) -> ::std::option::Option<&str> {
62        self.request_token.as_deref()
63    }
64    /// <p>The unique token representing the Hooks operation for the request.</p>
65    pub fn hooks_request_token(&self) -> ::std::option::Option<&str> {
66        self.hooks_request_token.as_deref()
67    }
68    /// <p>The resource operation type.</p>
69    pub fn operation(&self) -> ::std::option::Option<&crate::types::Operation> {
70        self.operation.as_ref()
71    }
72    /// <p>The current status of the resource operation request.</p>
73    /// <ul>
74    /// <li>
75    /// <p><code>PENDING</code>: The resource operation hasn't yet started.</p></li>
76    /// <li>
77    /// <p><code>IN_PROGRESS</code>: The resource operation is currently in progress.</p></li>
78    /// <li>
79    /// <p><code>SUCCESS</code>: The resource operation has successfully completed.</p></li>
80    /// <li>
81    /// <p><code>FAILED</code>: The resource operation has failed. Refer to the error code and status message for more information.</p></li>
82    /// <li>
83    /// <p><code>CANCEL_IN_PROGRESS</code>: The resource operation is in the process of being canceled.</p></li>
84    /// <li>
85    /// <p><code>CANCEL_COMPLETE</code>: The resource operation has been canceled.</p></li>
86    /// </ul>
87    pub fn operation_status(&self) -> ::std::option::Option<&crate::types::OperationStatus> {
88        self.operation_status.as_ref()
89    }
90    /// <p>When the resource operation request was initiated.</p>
91    pub fn event_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
92        self.event_time.as_ref()
93    }
94    /// <p>A JSON string containing the resource model, consisting of each resource property and its current value.</p>
95    pub fn resource_model(&self) -> ::std::option::Option<&str> {
96        self.resource_model.as_deref()
97    }
98    /// <p>Any message explaining the current status.</p>
99    pub fn status_message(&self) -> ::std::option::Option<&str> {
100        self.status_message.as_deref()
101    }
102    /// <p>For requests with a status of <code>FAILED</code>, the associated error code.</p>
103    /// <p>For error code definitions, see <a href="https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-test-contract-errors.html">Handler error codes</a> in the <i>CloudFormation Command Line Interface User Guide for Extension Development</i>.</p>
104    pub fn error_code(&self) -> ::std::option::Option<&crate::types::HandlerErrorCode> {
105        self.error_code.as_ref()
106    }
107    /// <p>When to next request the status of this resource operation request.</p>
108    pub fn retry_after(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
109        self.retry_after.as_ref()
110    }
111}
112impl ::std::fmt::Debug for ProgressEvent {
113    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
114        let mut formatter = f.debug_struct("ProgressEvent");
115        formatter.field("type_name", &self.type_name);
116        formatter.field("identifier", &self.identifier);
117        formatter.field("request_token", &self.request_token);
118        formatter.field("hooks_request_token", &self.hooks_request_token);
119        formatter.field("operation", &self.operation);
120        formatter.field("operation_status", &self.operation_status);
121        formatter.field("event_time", &self.event_time);
122        formatter.field("resource_model", &"*** Sensitive Data Redacted ***");
123        formatter.field("status_message", &self.status_message);
124        formatter.field("error_code", &self.error_code);
125        formatter.field("retry_after", &self.retry_after);
126        formatter.finish()
127    }
128}
129impl ProgressEvent {
130    /// Creates a new builder-style object to manufacture [`ProgressEvent`](crate::types::ProgressEvent).
131    pub fn builder() -> crate::types::builders::ProgressEventBuilder {
132        crate::types::builders::ProgressEventBuilder::default()
133    }
134}
135
136/// A builder for [`ProgressEvent`](crate::types::ProgressEvent).
137#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
138#[non_exhaustive]
139pub struct ProgressEventBuilder {
140    pub(crate) type_name: ::std::option::Option<::std::string::String>,
141    pub(crate) identifier: ::std::option::Option<::std::string::String>,
142    pub(crate) request_token: ::std::option::Option<::std::string::String>,
143    pub(crate) hooks_request_token: ::std::option::Option<::std::string::String>,
144    pub(crate) operation: ::std::option::Option<crate::types::Operation>,
145    pub(crate) operation_status: ::std::option::Option<crate::types::OperationStatus>,
146    pub(crate) event_time: ::std::option::Option<::aws_smithy_types::DateTime>,
147    pub(crate) resource_model: ::std::option::Option<::std::string::String>,
148    pub(crate) status_message: ::std::option::Option<::std::string::String>,
149    pub(crate) error_code: ::std::option::Option<crate::types::HandlerErrorCode>,
150    pub(crate) retry_after: ::std::option::Option<::aws_smithy_types::DateTime>,
151}
152impl ProgressEventBuilder {
153    /// <p>The name of the resource type used in the operation.</p>
154    pub fn type_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.type_name = ::std::option::Option::Some(input.into());
156        self
157    }
158    /// <p>The name of the resource type used in the operation.</p>
159    pub fn set_type_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.type_name = input;
161        self
162    }
163    /// <p>The name of the resource type used in the operation.</p>
164    pub fn get_type_name(&self) -> &::std::option::Option<::std::string::String> {
165        &self.type_name
166    }
167    /// <p>The primary identifier for the resource.</p><note>
168    /// <p>In some cases, the resource identifier may be available before the resource operation has reached a status of <code>SUCCESS</code>.</p>
169    /// </note>
170    pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
171        self.identifier = ::std::option::Option::Some(input.into());
172        self
173    }
174    /// <p>The primary identifier for the resource.</p><note>
175    /// <p>In some cases, the resource identifier may be available before the resource operation has reached a status of <code>SUCCESS</code>.</p>
176    /// </note>
177    pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
178        self.identifier = input;
179        self
180    }
181    /// <p>The primary identifier for the resource.</p><note>
182    /// <p>In some cases, the resource identifier may be available before the resource operation has reached a status of <code>SUCCESS</code>.</p>
183    /// </note>
184    pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
185        &self.identifier
186    }
187    /// <p>The unique token representing this resource operation request.</p>
188    /// <p>Use the <code>RequestToken</code> with <a href="https://docs.aws.amazon.com/cloudcontrolapi/latest/APIReference/API_GetResourceRequestStatus.html">GetResourceRequestStatus</a> to return the current status of a resource operation request.</p>
189    pub fn request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
190        self.request_token = ::std::option::Option::Some(input.into());
191        self
192    }
193    /// <p>The unique token representing this resource operation request.</p>
194    /// <p>Use the <code>RequestToken</code> with <a href="https://docs.aws.amazon.com/cloudcontrolapi/latest/APIReference/API_GetResourceRequestStatus.html">GetResourceRequestStatus</a> to return the current status of a resource operation request.</p>
195    pub fn set_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
196        self.request_token = input;
197        self
198    }
199    /// <p>The unique token representing this resource operation request.</p>
200    /// <p>Use the <code>RequestToken</code> with <a href="https://docs.aws.amazon.com/cloudcontrolapi/latest/APIReference/API_GetResourceRequestStatus.html">GetResourceRequestStatus</a> to return the current status of a resource operation request.</p>
201    pub fn get_request_token(&self) -> &::std::option::Option<::std::string::String> {
202        &self.request_token
203    }
204    /// <p>The unique token representing the Hooks operation for the request.</p>
205    pub fn hooks_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
206        self.hooks_request_token = ::std::option::Option::Some(input.into());
207        self
208    }
209    /// <p>The unique token representing the Hooks operation for the request.</p>
210    pub fn set_hooks_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
211        self.hooks_request_token = input;
212        self
213    }
214    /// <p>The unique token representing the Hooks operation for the request.</p>
215    pub fn get_hooks_request_token(&self) -> &::std::option::Option<::std::string::String> {
216        &self.hooks_request_token
217    }
218    /// <p>The resource operation type.</p>
219    pub fn operation(mut self, input: crate::types::Operation) -> Self {
220        self.operation = ::std::option::Option::Some(input);
221        self
222    }
223    /// <p>The resource operation type.</p>
224    pub fn set_operation(mut self, input: ::std::option::Option<crate::types::Operation>) -> Self {
225        self.operation = input;
226        self
227    }
228    /// <p>The resource operation type.</p>
229    pub fn get_operation(&self) -> &::std::option::Option<crate::types::Operation> {
230        &self.operation
231    }
232    /// <p>The current status of the resource operation request.</p>
233    /// <ul>
234    /// <li>
235    /// <p><code>PENDING</code>: The resource operation hasn't yet started.</p></li>
236    /// <li>
237    /// <p><code>IN_PROGRESS</code>: The resource operation is currently in progress.</p></li>
238    /// <li>
239    /// <p><code>SUCCESS</code>: The resource operation has successfully completed.</p></li>
240    /// <li>
241    /// <p><code>FAILED</code>: The resource operation has failed. Refer to the error code and status message for more information.</p></li>
242    /// <li>
243    /// <p><code>CANCEL_IN_PROGRESS</code>: The resource operation is in the process of being canceled.</p></li>
244    /// <li>
245    /// <p><code>CANCEL_COMPLETE</code>: The resource operation has been canceled.</p></li>
246    /// </ul>
247    pub fn operation_status(mut self, input: crate::types::OperationStatus) -> Self {
248        self.operation_status = ::std::option::Option::Some(input);
249        self
250    }
251    /// <p>The current status of the resource operation request.</p>
252    /// <ul>
253    /// <li>
254    /// <p><code>PENDING</code>: The resource operation hasn't yet started.</p></li>
255    /// <li>
256    /// <p><code>IN_PROGRESS</code>: The resource operation is currently in progress.</p></li>
257    /// <li>
258    /// <p><code>SUCCESS</code>: The resource operation has successfully completed.</p></li>
259    /// <li>
260    /// <p><code>FAILED</code>: The resource operation has failed. Refer to the error code and status message for more information.</p></li>
261    /// <li>
262    /// <p><code>CANCEL_IN_PROGRESS</code>: The resource operation is in the process of being canceled.</p></li>
263    /// <li>
264    /// <p><code>CANCEL_COMPLETE</code>: The resource operation has been canceled.</p></li>
265    /// </ul>
266    pub fn set_operation_status(mut self, input: ::std::option::Option<crate::types::OperationStatus>) -> Self {
267        self.operation_status = input;
268        self
269    }
270    /// <p>The current status of the resource operation request.</p>
271    /// <ul>
272    /// <li>
273    /// <p><code>PENDING</code>: The resource operation hasn't yet started.</p></li>
274    /// <li>
275    /// <p><code>IN_PROGRESS</code>: The resource operation is currently in progress.</p></li>
276    /// <li>
277    /// <p><code>SUCCESS</code>: The resource operation has successfully completed.</p></li>
278    /// <li>
279    /// <p><code>FAILED</code>: The resource operation has failed. Refer to the error code and status message for more information.</p></li>
280    /// <li>
281    /// <p><code>CANCEL_IN_PROGRESS</code>: The resource operation is in the process of being canceled.</p></li>
282    /// <li>
283    /// <p><code>CANCEL_COMPLETE</code>: The resource operation has been canceled.</p></li>
284    /// </ul>
285    pub fn get_operation_status(&self) -> &::std::option::Option<crate::types::OperationStatus> {
286        &self.operation_status
287    }
288    /// <p>When the resource operation request was initiated.</p>
289    pub fn event_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
290        self.event_time = ::std::option::Option::Some(input);
291        self
292    }
293    /// <p>When the resource operation request was initiated.</p>
294    pub fn set_event_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
295        self.event_time = input;
296        self
297    }
298    /// <p>When the resource operation request was initiated.</p>
299    pub fn get_event_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
300        &self.event_time
301    }
302    /// <p>A JSON string containing the resource model, consisting of each resource property and its current value.</p>
303    pub fn resource_model(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
304        self.resource_model = ::std::option::Option::Some(input.into());
305        self
306    }
307    /// <p>A JSON string containing the resource model, consisting of each resource property and its current value.</p>
308    pub fn set_resource_model(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
309        self.resource_model = input;
310        self
311    }
312    /// <p>A JSON string containing the resource model, consisting of each resource property and its current value.</p>
313    pub fn get_resource_model(&self) -> &::std::option::Option<::std::string::String> {
314        &self.resource_model
315    }
316    /// <p>Any message explaining the current status.</p>
317    pub fn status_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
318        self.status_message = ::std::option::Option::Some(input.into());
319        self
320    }
321    /// <p>Any message explaining the current status.</p>
322    pub fn set_status_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
323        self.status_message = input;
324        self
325    }
326    /// <p>Any message explaining the current status.</p>
327    pub fn get_status_message(&self) -> &::std::option::Option<::std::string::String> {
328        &self.status_message
329    }
330    /// <p>For requests with a status of <code>FAILED</code>, the associated error code.</p>
331    /// <p>For error code definitions, see <a href="https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-test-contract-errors.html">Handler error codes</a> in the <i>CloudFormation Command Line Interface User Guide for Extension Development</i>.</p>
332    pub fn error_code(mut self, input: crate::types::HandlerErrorCode) -> Self {
333        self.error_code = ::std::option::Option::Some(input);
334        self
335    }
336    /// <p>For requests with a status of <code>FAILED</code>, the associated error code.</p>
337    /// <p>For error code definitions, see <a href="https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-test-contract-errors.html">Handler error codes</a> in the <i>CloudFormation Command Line Interface User Guide for Extension Development</i>.</p>
338    pub fn set_error_code(mut self, input: ::std::option::Option<crate::types::HandlerErrorCode>) -> Self {
339        self.error_code = input;
340        self
341    }
342    /// <p>For requests with a status of <code>FAILED</code>, the associated error code.</p>
343    /// <p>For error code definitions, see <a href="https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-test-contract-errors.html">Handler error codes</a> in the <i>CloudFormation Command Line Interface User Guide for Extension Development</i>.</p>
344    pub fn get_error_code(&self) -> &::std::option::Option<crate::types::HandlerErrorCode> {
345        &self.error_code
346    }
347    /// <p>When to next request the status of this resource operation request.</p>
348    pub fn retry_after(mut self, input: ::aws_smithy_types::DateTime) -> Self {
349        self.retry_after = ::std::option::Option::Some(input);
350        self
351    }
352    /// <p>When to next request the status of this resource operation request.</p>
353    pub fn set_retry_after(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
354        self.retry_after = input;
355        self
356    }
357    /// <p>When to next request the status of this resource operation request.</p>
358    pub fn get_retry_after(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
359        &self.retry_after
360    }
361    /// Consumes the builder and constructs a [`ProgressEvent`](crate::types::ProgressEvent).
362    pub fn build(self) -> crate::types::ProgressEvent {
363        crate::types::ProgressEvent {
364            type_name: self.type_name,
365            identifier: self.identifier,
366            request_token: self.request_token,
367            hooks_request_token: self.hooks_request_token,
368            operation: self.operation,
369            operation_status: self.operation_status,
370            event_time: self.event_time,
371            resource_model: self.resource_model,
372            status_message: self.status_message,
373            error_code: self.error_code,
374            retry_after: self.retry_after,
375        }
376    }
377}
378impl ::std::fmt::Debug for ProgressEventBuilder {
379    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
380        let mut formatter = f.debug_struct("ProgressEventBuilder");
381        formatter.field("type_name", &self.type_name);
382        formatter.field("identifier", &self.identifier);
383        formatter.field("request_token", &self.request_token);
384        formatter.field("hooks_request_token", &self.hooks_request_token);
385        formatter.field("operation", &self.operation);
386        formatter.field("operation_status", &self.operation_status);
387        formatter.field("event_time", &self.event_time);
388        formatter.field("resource_model", &"*** Sensitive Data Redacted ***");
389        formatter.field("status_message", &self.status_message);
390        formatter.field("error_code", &self.error_code);
391        formatter.field("retry_after", &self.retry_after);
392        formatter.finish()
393    }
394}