#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Trigger {
pub trigger_id: ::std::string::String,
pub agent_space_id: ::std::string::String,
pub r#type: ::std::string::String,
pub condition: ::std::option::Option<crate::types::TriggerCondition>,
pub action: ::aws_smithy_types::Document,
pub status: ::std::string::String,
pub created_at: ::aws_smithy_types::DateTime,
pub updated_at: ::aws_smithy_types::DateTime,
}
impl Trigger {
pub fn trigger_id(&self) -> &str {
use std::ops::Deref;
self.trigger_id.deref()
}
pub fn agent_space_id(&self) -> &str {
use std::ops::Deref;
self.agent_space_id.deref()
}
pub fn r#type(&self) -> &str {
use std::ops::Deref;
self.r#type.deref()
}
pub fn condition(&self) -> ::std::option::Option<&crate::types::TriggerCondition> {
self.condition.as_ref()
}
pub fn action(&self) -> &::aws_smithy_types::Document {
&self.action
}
pub fn status(&self) -> &str {
use std::ops::Deref;
self.status.deref()
}
pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
&self.created_at
}
pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
&self.updated_at
}
}
impl Trigger {
pub fn builder() -> crate::types::builders::TriggerBuilder {
crate::types::builders::TriggerBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct TriggerBuilder {
pub(crate) trigger_id: ::std::option::Option<::std::string::String>,
pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
pub(crate) r#type: ::std::option::Option<::std::string::String>,
pub(crate) condition: ::std::option::Option<crate::types::TriggerCondition>,
pub(crate) action: ::std::option::Option<::aws_smithy_types::Document>,
pub(crate) status: ::std::option::Option<::std::string::String>,
pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl TriggerBuilder {
pub fn trigger_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.trigger_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_trigger_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.trigger_id = input;
self
}
pub fn get_trigger_id(&self) -> &::std::option::Option<::std::string::String> {
&self.trigger_id
}
pub fn agent_space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.agent_space_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.agent_space_id = input;
self
}
pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
&self.agent_space_id
}
pub fn r#type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.r#type = ::std::option::Option::Some(input.into());
self
}
pub fn set_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.r#type = input;
self
}
pub fn get_type(&self) -> &::std::option::Option<::std::string::String> {
&self.r#type
}
pub fn condition(mut self, input: crate::types::TriggerCondition) -> Self {
self.condition = ::std::option::Option::Some(input);
self
}
pub fn set_condition(mut self, input: ::std::option::Option<crate::types::TriggerCondition>) -> Self {
self.condition = input;
self
}
pub fn get_condition(&self) -> &::std::option::Option<crate::types::TriggerCondition> {
&self.condition
}
pub fn action(mut self, input: ::aws_smithy_types::Document) -> Self {
self.action = ::std::option::Option::Some(input);
self
}
pub fn set_action(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
self.action = input;
self
}
pub fn get_action(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
&self.action
}
pub fn status(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.status = ::std::option::Option::Some(input.into());
self
}
pub fn set_status(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.status = input;
self
}
pub fn get_status(&self) -> &::std::option::Option<::std::string::String> {
&self.status
}
pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.created_at = ::std::option::Option::Some(input);
self
}
pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.created_at = input;
self
}
pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.created_at
}
pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.updated_at = ::std::option::Option::Some(input);
self
}
pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.updated_at = input;
self
}
pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.updated_at
}
pub fn build(self) -> ::std::result::Result<crate::types::Trigger, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Trigger {
trigger_id: self.trigger_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"trigger_id",
"trigger_id was not specified but it is required when building Trigger",
)
})?,
agent_space_id: self.agent_space_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"agent_space_id",
"agent_space_id was not specified but it is required when building Trigger",
)
})?,
r#type: self.r#type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"r#type",
"r#type was not specified but it is required when building Trigger",
)
})?,
condition: self.condition,
action: self.action.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"action",
"action was not specified but it is required when building Trigger",
)
})?,
status: self.status.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"status",
"status was not specified but it is required when building Trigger",
)
})?,
created_at: self.created_at.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"created_at",
"created_at was not specified but it is required when building Trigger",
)
})?,
updated_at: self.updated_at.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"updated_at",
"updated_at was not specified but it is required when building Trigger",
)
})?,
})
}
}