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