aws_sdk_iotsitewise/operation/execute_action/
_execute_action_input.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 ExecuteActionInput {
6    /// <p>The resource the action will be taken on.</p>
7    pub target_resource: ::std::option::Option<crate::types::TargetResource>,
8    /// <p>The ID of the action definition.</p>
9    pub action_definition_id: ::std::option::Option<::std::string::String>,
10    /// <p>The JSON payload of the action.</p>
11    pub action_payload: ::std::option::Option<crate::types::ActionPayload>,
12    /// <p>A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.</p>
13    pub client_token: ::std::option::Option<::std::string::String>,
14    /// <p>The detailed resource this action resolves to.</p>
15    pub resolve_to: ::std::option::Option<crate::types::ResolveTo>,
16}
17impl ExecuteActionInput {
18    /// <p>The resource the action will be taken on.</p>
19    pub fn target_resource(&self) -> ::std::option::Option<&crate::types::TargetResource> {
20        self.target_resource.as_ref()
21    }
22    /// <p>The ID of the action definition.</p>
23    pub fn action_definition_id(&self) -> ::std::option::Option<&str> {
24        self.action_definition_id.as_deref()
25    }
26    /// <p>The JSON payload of the action.</p>
27    pub fn action_payload(&self) -> ::std::option::Option<&crate::types::ActionPayload> {
28        self.action_payload.as_ref()
29    }
30    /// <p>A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.</p>
31    pub fn client_token(&self) -> ::std::option::Option<&str> {
32        self.client_token.as_deref()
33    }
34    /// <p>The detailed resource this action resolves to.</p>
35    pub fn resolve_to(&self) -> ::std::option::Option<&crate::types::ResolveTo> {
36        self.resolve_to.as_ref()
37    }
38}
39impl ExecuteActionInput {
40    /// Creates a new builder-style object to manufacture [`ExecuteActionInput`](crate::operation::execute_action::ExecuteActionInput).
41    pub fn builder() -> crate::operation::execute_action::builders::ExecuteActionInputBuilder {
42        crate::operation::execute_action::builders::ExecuteActionInputBuilder::default()
43    }
44}
45
46/// A builder for [`ExecuteActionInput`](crate::operation::execute_action::ExecuteActionInput).
47#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
48#[non_exhaustive]
49pub struct ExecuteActionInputBuilder {
50    pub(crate) target_resource: ::std::option::Option<crate::types::TargetResource>,
51    pub(crate) action_definition_id: ::std::option::Option<::std::string::String>,
52    pub(crate) action_payload: ::std::option::Option<crate::types::ActionPayload>,
53    pub(crate) client_token: ::std::option::Option<::std::string::String>,
54    pub(crate) resolve_to: ::std::option::Option<crate::types::ResolveTo>,
55}
56impl ExecuteActionInputBuilder {
57    /// <p>The resource the action will be taken on.</p>
58    /// This field is required.
59    pub fn target_resource(mut self, input: crate::types::TargetResource) -> Self {
60        self.target_resource = ::std::option::Option::Some(input);
61        self
62    }
63    /// <p>The resource the action will be taken on.</p>
64    pub fn set_target_resource(mut self, input: ::std::option::Option<crate::types::TargetResource>) -> Self {
65        self.target_resource = input;
66        self
67    }
68    /// <p>The resource the action will be taken on.</p>
69    pub fn get_target_resource(&self) -> &::std::option::Option<crate::types::TargetResource> {
70        &self.target_resource
71    }
72    /// <p>The ID of the action definition.</p>
73    /// This field is required.
74    pub fn action_definition_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75        self.action_definition_id = ::std::option::Option::Some(input.into());
76        self
77    }
78    /// <p>The ID of the action definition.</p>
79    pub fn set_action_definition_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
80        self.action_definition_id = input;
81        self
82    }
83    /// <p>The ID of the action definition.</p>
84    pub fn get_action_definition_id(&self) -> &::std::option::Option<::std::string::String> {
85        &self.action_definition_id
86    }
87    /// <p>The JSON payload of the action.</p>
88    /// This field is required.
89    pub fn action_payload(mut self, input: crate::types::ActionPayload) -> Self {
90        self.action_payload = ::std::option::Option::Some(input);
91        self
92    }
93    /// <p>The JSON payload of the action.</p>
94    pub fn set_action_payload(mut self, input: ::std::option::Option<crate::types::ActionPayload>) -> Self {
95        self.action_payload = input;
96        self
97    }
98    /// <p>The JSON payload of the action.</p>
99    pub fn get_action_payload(&self) -> &::std::option::Option<crate::types::ActionPayload> {
100        &self.action_payload
101    }
102    /// <p>A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.</p>
103    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104        self.client_token = ::std::option::Option::Some(input.into());
105        self
106    }
107    /// <p>A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.</p>
108    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109        self.client_token = input;
110        self
111    }
112    /// <p>A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.</p>
113    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
114        &self.client_token
115    }
116    /// <p>The detailed resource this action resolves to.</p>
117    pub fn resolve_to(mut self, input: crate::types::ResolveTo) -> Self {
118        self.resolve_to = ::std::option::Option::Some(input);
119        self
120    }
121    /// <p>The detailed resource this action resolves to.</p>
122    pub fn set_resolve_to(mut self, input: ::std::option::Option<crate::types::ResolveTo>) -> Self {
123        self.resolve_to = input;
124        self
125    }
126    /// <p>The detailed resource this action resolves to.</p>
127    pub fn get_resolve_to(&self) -> &::std::option::Option<crate::types::ResolveTo> {
128        &self.resolve_to
129    }
130    /// Consumes the builder and constructs a [`ExecuteActionInput`](crate::operation::execute_action::ExecuteActionInput).
131    pub fn build(
132        self,
133    ) -> ::std::result::Result<crate::operation::execute_action::ExecuteActionInput, ::aws_smithy_types::error::operation::BuildError> {
134        ::std::result::Result::Ok(crate::operation::execute_action::ExecuteActionInput {
135            target_resource: self.target_resource,
136            action_definition_id: self.action_definition_id,
137            action_payload: self.action_payload,
138            client_token: self.client_token,
139            resolve_to: self.resolve_to,
140        })
141    }
142}