aws_sdk_iotsitewise/operation/describe_action/
_describe_action_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct DescribeActionOutput {
6    /// <p>The ID of the action.</p>
7    pub action_id: ::std::string::String,
8    /// <p>The resource the action will be taken on.</p>
9    pub target_resource: ::std::option::Option<crate::types::TargetResource>,
10    /// <p>The ID of the action definition.</p>
11    pub action_definition_id: ::std::string::String,
12    /// <p>The JSON payload of the action.</p>
13    pub action_payload: ::std::option::Option<crate::types::ActionPayload>,
14    /// <p>The time the action was executed.</p>
15    pub execution_time: ::aws_smithy_types::DateTime,
16    /// <p>The detailed resource this action resolves to.</p>
17    pub resolve_to: ::std::option::Option<crate::types::ResolveTo>,
18    _request_id: Option<String>,
19}
20impl DescribeActionOutput {
21    /// <p>The ID of the action.</p>
22    pub fn action_id(&self) -> &str {
23        use std::ops::Deref;
24        self.action_id.deref()
25    }
26    /// <p>The resource the action will be taken on.</p>
27    pub fn target_resource(&self) -> ::std::option::Option<&crate::types::TargetResource> {
28        self.target_resource.as_ref()
29    }
30    /// <p>The ID of the action definition.</p>
31    pub fn action_definition_id(&self) -> &str {
32        use std::ops::Deref;
33        self.action_definition_id.deref()
34    }
35    /// <p>The JSON payload of the action.</p>
36    pub fn action_payload(&self) -> ::std::option::Option<&crate::types::ActionPayload> {
37        self.action_payload.as_ref()
38    }
39    /// <p>The time the action was executed.</p>
40    pub fn execution_time(&self) -> &::aws_smithy_types::DateTime {
41        &self.execution_time
42    }
43    /// <p>The detailed resource this action resolves to.</p>
44    pub fn resolve_to(&self) -> ::std::option::Option<&crate::types::ResolveTo> {
45        self.resolve_to.as_ref()
46    }
47}
48impl ::aws_types::request_id::RequestId for DescribeActionOutput {
49    fn request_id(&self) -> Option<&str> {
50        self._request_id.as_deref()
51    }
52}
53impl DescribeActionOutput {
54    /// Creates a new builder-style object to manufacture [`DescribeActionOutput`](crate::operation::describe_action::DescribeActionOutput).
55    pub fn builder() -> crate::operation::describe_action::builders::DescribeActionOutputBuilder {
56        crate::operation::describe_action::builders::DescribeActionOutputBuilder::default()
57    }
58}
59
60/// A builder for [`DescribeActionOutput`](crate::operation::describe_action::DescribeActionOutput).
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
62#[non_exhaustive]
63pub struct DescribeActionOutputBuilder {
64    pub(crate) action_id: ::std::option::Option<::std::string::String>,
65    pub(crate) target_resource: ::std::option::Option<crate::types::TargetResource>,
66    pub(crate) action_definition_id: ::std::option::Option<::std::string::String>,
67    pub(crate) action_payload: ::std::option::Option<crate::types::ActionPayload>,
68    pub(crate) execution_time: ::std::option::Option<::aws_smithy_types::DateTime>,
69    pub(crate) resolve_to: ::std::option::Option<crate::types::ResolveTo>,
70    _request_id: Option<String>,
71}
72impl DescribeActionOutputBuilder {
73    /// <p>The ID of the action.</p>
74    /// This field is required.
75    pub fn action_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76        self.action_id = ::std::option::Option::Some(input.into());
77        self
78    }
79    /// <p>The ID of the action.</p>
80    pub fn set_action_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81        self.action_id = input;
82        self
83    }
84    /// <p>The ID of the action.</p>
85    pub fn get_action_id(&self) -> &::std::option::Option<::std::string::String> {
86        &self.action_id
87    }
88    /// <p>The resource the action will be taken on.</p>
89    /// This field is required.
90    pub fn target_resource(mut self, input: crate::types::TargetResource) -> Self {
91        self.target_resource = ::std::option::Option::Some(input);
92        self
93    }
94    /// <p>The resource the action will be taken on.</p>
95    pub fn set_target_resource(mut self, input: ::std::option::Option<crate::types::TargetResource>) -> Self {
96        self.target_resource = input;
97        self
98    }
99    /// <p>The resource the action will be taken on.</p>
100    pub fn get_target_resource(&self) -> &::std::option::Option<crate::types::TargetResource> {
101        &self.target_resource
102    }
103    /// <p>The ID of the action definition.</p>
104    /// This field is required.
105    pub fn action_definition_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
106        self.action_definition_id = ::std::option::Option::Some(input.into());
107        self
108    }
109    /// <p>The ID of the action definition.</p>
110    pub fn set_action_definition_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
111        self.action_definition_id = input;
112        self
113    }
114    /// <p>The ID of the action definition.</p>
115    pub fn get_action_definition_id(&self) -> &::std::option::Option<::std::string::String> {
116        &self.action_definition_id
117    }
118    /// <p>The JSON payload of the action.</p>
119    /// This field is required.
120    pub fn action_payload(mut self, input: crate::types::ActionPayload) -> Self {
121        self.action_payload = ::std::option::Option::Some(input);
122        self
123    }
124    /// <p>The JSON payload of the action.</p>
125    pub fn set_action_payload(mut self, input: ::std::option::Option<crate::types::ActionPayload>) -> Self {
126        self.action_payload = input;
127        self
128    }
129    /// <p>The JSON payload of the action.</p>
130    pub fn get_action_payload(&self) -> &::std::option::Option<crate::types::ActionPayload> {
131        &self.action_payload
132    }
133    /// <p>The time the action was executed.</p>
134    /// This field is required.
135    pub fn execution_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
136        self.execution_time = ::std::option::Option::Some(input);
137        self
138    }
139    /// <p>The time the action was executed.</p>
140    pub fn set_execution_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
141        self.execution_time = input;
142        self
143    }
144    /// <p>The time the action was executed.</p>
145    pub fn get_execution_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
146        &self.execution_time
147    }
148    /// <p>The detailed resource this action resolves to.</p>
149    pub fn resolve_to(mut self, input: crate::types::ResolveTo) -> Self {
150        self.resolve_to = ::std::option::Option::Some(input);
151        self
152    }
153    /// <p>The detailed resource this action resolves to.</p>
154    pub fn set_resolve_to(mut self, input: ::std::option::Option<crate::types::ResolveTo>) -> Self {
155        self.resolve_to = input;
156        self
157    }
158    /// <p>The detailed resource this action resolves to.</p>
159    pub fn get_resolve_to(&self) -> &::std::option::Option<crate::types::ResolveTo> {
160        &self.resolve_to
161    }
162    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
163        self._request_id = Some(request_id.into());
164        self
165    }
166
167    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
168        self._request_id = request_id;
169        self
170    }
171    /// Consumes the builder and constructs a [`DescribeActionOutput`](crate::operation::describe_action::DescribeActionOutput).
172    /// This method will fail if any of the following fields are not set:
173    /// - [`action_id`](crate::operation::describe_action::builders::DescribeActionOutputBuilder::action_id)
174    /// - [`action_definition_id`](crate::operation::describe_action::builders::DescribeActionOutputBuilder::action_definition_id)
175    /// - [`execution_time`](crate::operation::describe_action::builders::DescribeActionOutputBuilder::execution_time)
176    pub fn build(
177        self,
178    ) -> ::std::result::Result<crate::operation::describe_action::DescribeActionOutput, ::aws_smithy_types::error::operation::BuildError> {
179        ::std::result::Result::Ok(crate::operation::describe_action::DescribeActionOutput {
180            action_id: self.action_id.ok_or_else(|| {
181                ::aws_smithy_types::error::operation::BuildError::missing_field(
182                    "action_id",
183                    "action_id was not specified but it is required when building DescribeActionOutput",
184                )
185            })?,
186            target_resource: self.target_resource,
187            action_definition_id: self.action_definition_id.ok_or_else(|| {
188                ::aws_smithy_types::error::operation::BuildError::missing_field(
189                    "action_definition_id",
190                    "action_definition_id was not specified but it is required when building DescribeActionOutput",
191                )
192            })?,
193            action_payload: self.action_payload,
194            execution_time: self.execution_time.ok_or_else(|| {
195                ::aws_smithy_types::error::operation::BuildError::missing_field(
196                    "execution_time",
197                    "execution_time was not specified but it is required when building DescribeActionOutput",
198                )
199            })?,
200            resolve_to: self.resolve_to,
201            _request_id: self._request_id,
202        })
203    }
204}