aws-sdk-devopsagent 1.10.0

AWS SDK for AWS DevOps Agent Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>A Trigger fires on a schedule and invokes an agent</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Trigger {
    /// <p>The unique identifier for this Trigger</p>
    pub trigger_id: ::std::string::String,
    /// <p>The agent space this Trigger belongs to</p>
    pub agent_space_id: ::std::string::String,
    /// <p>How this Trigger fires</p>
    pub r#type: ::std::string::String,
    /// <p>The condition that fires this Trigger</p>
    pub condition: ::std::option::Option<crate::types::TriggerCondition>,
    /// <p>The action this Trigger performs when it fires</p>
    pub action: ::aws_smithy_types::Document,
    /// <p>The status of this Trigger</p>
    pub status: ::std::string::String,
    /// <p>Timestamp when this Trigger was created</p>
    pub created_at: ::aws_smithy_types::DateTime,
    /// <p>Timestamp when this Trigger was last updated</p>
    pub updated_at: ::aws_smithy_types::DateTime,
}
impl Trigger {
    /// <p>The unique identifier for this Trigger</p>
    pub fn trigger_id(&self) -> &str {
        use std::ops::Deref;
        self.trigger_id.deref()
    }
    /// <p>The agent space this Trigger belongs to</p>
    pub fn agent_space_id(&self) -> &str {
        use std::ops::Deref;
        self.agent_space_id.deref()
    }
    /// <p>How this Trigger fires</p>
    pub fn r#type(&self) -> &str {
        use std::ops::Deref;
        self.r#type.deref()
    }
    /// <p>The condition that fires this Trigger</p>
    pub fn condition(&self) -> ::std::option::Option<&crate::types::TriggerCondition> {
        self.condition.as_ref()
    }
    /// <p>The action this Trigger performs when it fires</p>
    pub fn action(&self) -> &::aws_smithy_types::Document {
        &self.action
    }
    /// <p>The status of this Trigger</p>
    pub fn status(&self) -> &str {
        use std::ops::Deref;
        self.status.deref()
    }
    /// <p>Timestamp when this Trigger was created</p>
    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
        &self.created_at
    }
    /// <p>Timestamp when this Trigger was last updated</p>
    pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
        &self.updated_at
    }
}
impl Trigger {
    /// Creates a new builder-style object to manufacture [`Trigger`](crate::types::Trigger).
    pub fn builder() -> crate::types::builders::TriggerBuilder {
        crate::types::builders::TriggerBuilder::default()
    }
}

/// A builder for [`Trigger`](crate::types::Trigger).
#[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 {
    /// <p>The unique identifier for this Trigger</p>
    /// This field is required.
    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
    }
    /// <p>The unique identifier for this Trigger</p>
    pub fn set_trigger_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.trigger_id = input;
        self
    }
    /// <p>The unique identifier for this Trigger</p>
    pub fn get_trigger_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.trigger_id
    }
    /// <p>The agent space this Trigger belongs to</p>
    /// This field is required.
    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
    }
    /// <p>The agent space this Trigger belongs to</p>
    pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.agent_space_id = input;
        self
    }
    /// <p>The agent space this Trigger belongs to</p>
    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.agent_space_id
    }
    /// <p>How this Trigger fires</p>
    /// This field is required.
    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
    }
    /// <p>How this Trigger fires</p>
    pub fn set_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.r#type = input;
        self
    }
    /// <p>How this Trigger fires</p>
    pub fn get_type(&self) -> &::std::option::Option<::std::string::String> {
        &self.r#type
    }
    /// <p>The condition that fires this Trigger</p>
    /// This field is required.
    pub fn condition(mut self, input: crate::types::TriggerCondition) -> Self {
        self.condition = ::std::option::Option::Some(input);
        self
    }
    /// <p>The condition that fires this Trigger</p>
    pub fn set_condition(mut self, input: ::std::option::Option<crate::types::TriggerCondition>) -> Self {
        self.condition = input;
        self
    }
    /// <p>The condition that fires this Trigger</p>
    pub fn get_condition(&self) -> &::std::option::Option<crate::types::TriggerCondition> {
        &self.condition
    }
    /// <p>The action this Trigger performs when it fires</p>
    /// This field is required.
    pub fn action(mut self, input: ::aws_smithy_types::Document) -> Self {
        self.action = ::std::option::Option::Some(input);
        self
    }
    /// <p>The action this Trigger performs when it fires</p>
    pub fn set_action(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
        self.action = input;
        self
    }
    /// <p>The action this Trigger performs when it fires</p>
    pub fn get_action(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
        &self.action
    }
    /// <p>The status of this Trigger</p>
    /// This field is required.
    pub fn status(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.status = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The status of this Trigger</p>
    pub fn set_status(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.status = input;
        self
    }
    /// <p>The status of this Trigger</p>
    pub fn get_status(&self) -> &::std::option::Option<::std::string::String> {
        &self.status
    }
    /// <p>Timestamp when this Trigger was created</p>
    /// This field is required.
    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>Timestamp when this Trigger was created</p>
    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_at = input;
        self
    }
    /// <p>Timestamp when this Trigger was created</p>
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    /// <p>Timestamp when this Trigger was last updated</p>
    /// This field is required.
    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.updated_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>Timestamp when this Trigger was last updated</p>
    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.updated_at = input;
        self
    }
    /// <p>Timestamp when this Trigger was last updated</p>
    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.updated_at
    }
    /// Consumes the builder and constructs a [`Trigger`](crate::types::Trigger).
    /// This method will fail if any of the following fields are not set:
    /// - [`trigger_id`](crate::types::builders::TriggerBuilder::trigger_id)
    /// - [`agent_space_id`](crate::types::builders::TriggerBuilder::agent_space_id)
    /// - [`r#type`](crate::types::builders::TriggerBuilder::type)
    /// - [`action`](crate::types::builders::TriggerBuilder::action)
    /// - [`status`](crate::types::builders::TriggerBuilder::status)
    /// - [`created_at`](crate::types::builders::TriggerBuilder::created_at)
    /// - [`updated_at`](crate::types::builders::TriggerBuilder::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",
                )
            })?,
        })
    }
}