Skip to main content

aws_sdk_devopsagent/operation/create_trigger/
_create_trigger_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Request structure for creating a new Trigger</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateTriggerInput {
7    /// <p>The unique identifier for the agent space where the Trigger will be created</p>
8    pub agent_space_id: ::std::option::Option<::std::string::String>,
9    /// <p>How the new Trigger fires</p>
10    pub r#type: ::std::option::Option<::std::string::String>,
11    /// <p>The condition that fires the new Trigger</p>
12    pub condition: ::std::option::Option<crate::types::TriggerCondition>,
13    /// <p>The action the new Trigger performs when it fires</p>
14    pub action: ::std::option::Option<::aws_smithy_types::Document>,
15    /// <p>The initial status of the Trigger</p>
16    pub status: ::std::option::Option<::std::string::String>,
17    /// <p>A unique, case-sensitive identifier used for idempotent Trigger creation</p>
18    pub client_token: ::std::option::Option<::std::string::String>,
19}
20impl CreateTriggerInput {
21    /// <p>The unique identifier for the agent space where the Trigger will be created</p>
22    pub fn agent_space_id(&self) -> ::std::option::Option<&str> {
23        self.agent_space_id.as_deref()
24    }
25    /// <p>How the new Trigger fires</p>
26    pub fn r#type(&self) -> ::std::option::Option<&str> {
27        self.r#type.as_deref()
28    }
29    /// <p>The condition that fires the new Trigger</p>
30    pub fn condition(&self) -> ::std::option::Option<&crate::types::TriggerCondition> {
31        self.condition.as_ref()
32    }
33    /// <p>The action the new Trigger performs when it fires</p>
34    pub fn action(&self) -> ::std::option::Option<&::aws_smithy_types::Document> {
35        self.action.as_ref()
36    }
37    /// <p>The initial status of the Trigger</p>
38    pub fn status(&self) -> ::std::option::Option<&str> {
39        self.status.as_deref()
40    }
41    /// <p>A unique, case-sensitive identifier used for idempotent Trigger creation</p>
42    pub fn client_token(&self) -> ::std::option::Option<&str> {
43        self.client_token.as_deref()
44    }
45}
46impl CreateTriggerInput {
47    /// Creates a new builder-style object to manufacture [`CreateTriggerInput`](crate::operation::create_trigger::CreateTriggerInput).
48    pub fn builder() -> crate::operation::create_trigger::builders::CreateTriggerInputBuilder {
49        crate::operation::create_trigger::builders::CreateTriggerInputBuilder::default()
50    }
51}
52
53/// A builder for [`CreateTriggerInput`](crate::operation::create_trigger::CreateTriggerInput).
54#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
55#[non_exhaustive]
56pub struct CreateTriggerInputBuilder {
57    pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
58    pub(crate) r#type: ::std::option::Option<::std::string::String>,
59    pub(crate) condition: ::std::option::Option<crate::types::TriggerCondition>,
60    pub(crate) action: ::std::option::Option<::aws_smithy_types::Document>,
61    pub(crate) status: ::std::option::Option<::std::string::String>,
62    pub(crate) client_token: ::std::option::Option<::std::string::String>,
63}
64impl CreateTriggerInputBuilder {
65    /// <p>The unique identifier for the agent space where the Trigger will be created</p>
66    /// This field is required.
67    pub fn agent_space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
68        self.agent_space_id = ::std::option::Option::Some(input.into());
69        self
70    }
71    /// <p>The unique identifier for the agent space where the Trigger will be created</p>
72    pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73        self.agent_space_id = input;
74        self
75    }
76    /// <p>The unique identifier for the agent space where the Trigger will be created</p>
77    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
78        &self.agent_space_id
79    }
80    /// <p>How the new Trigger fires</p>
81    /// This field is required.
82    pub fn r#type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
83        self.r#type = ::std::option::Option::Some(input.into());
84        self
85    }
86    /// <p>How the new Trigger fires</p>
87    pub fn set_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88        self.r#type = input;
89        self
90    }
91    /// <p>How the new Trigger fires</p>
92    pub fn get_type(&self) -> &::std::option::Option<::std::string::String> {
93        &self.r#type
94    }
95    /// <p>The condition that fires the new Trigger</p>
96    /// This field is required.
97    pub fn condition(mut self, input: crate::types::TriggerCondition) -> Self {
98        self.condition = ::std::option::Option::Some(input);
99        self
100    }
101    /// <p>The condition that fires the new Trigger</p>
102    pub fn set_condition(mut self, input: ::std::option::Option<crate::types::TriggerCondition>) -> Self {
103        self.condition = input;
104        self
105    }
106    /// <p>The condition that fires the new Trigger</p>
107    pub fn get_condition(&self) -> &::std::option::Option<crate::types::TriggerCondition> {
108        &self.condition
109    }
110    /// <p>The action the new Trigger performs when it fires</p>
111    /// This field is required.
112    pub fn action(mut self, input: ::aws_smithy_types::Document) -> Self {
113        self.action = ::std::option::Option::Some(input);
114        self
115    }
116    /// <p>The action the new Trigger performs when it fires</p>
117    pub fn set_action(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
118        self.action = input;
119        self
120    }
121    /// <p>The action the new Trigger performs when it fires</p>
122    pub fn get_action(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
123        &self.action
124    }
125    /// <p>The initial status of the Trigger</p>
126    pub fn status(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.status = ::std::option::Option::Some(input.into());
128        self
129    }
130    /// <p>The initial status of the Trigger</p>
131    pub fn set_status(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.status = input;
133        self
134    }
135    /// <p>The initial status of the Trigger</p>
136    pub fn get_status(&self) -> &::std::option::Option<::std::string::String> {
137        &self.status
138    }
139    /// <p>A unique, case-sensitive identifier used for idempotent Trigger creation</p>
140    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.client_token = ::std::option::Option::Some(input.into());
142        self
143    }
144    /// <p>A unique, case-sensitive identifier used for idempotent Trigger creation</p>
145    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.client_token = input;
147        self
148    }
149    /// <p>A unique, case-sensitive identifier used for idempotent Trigger creation</p>
150    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
151        &self.client_token
152    }
153    /// Consumes the builder and constructs a [`CreateTriggerInput`](crate::operation::create_trigger::CreateTriggerInput).
154    pub fn build(
155        self,
156    ) -> ::std::result::Result<crate::operation::create_trigger::CreateTriggerInput, ::aws_smithy_types::error::operation::BuildError> {
157        ::std::result::Result::Ok(crate::operation::create_trigger::CreateTriggerInput {
158            agent_space_id: self.agent_space_id,
159            r#type: self.r#type,
160            condition: self.condition,
161            action: self.action,
162            status: self.status,
163            client_token: self.client_token,
164        })
165    }
166}