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>Request structure for creating a new Trigger</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateTriggerInput {
    /// <p>The unique identifier for the agent space where the Trigger will be created</p>
    pub agent_space_id: ::std::option::Option<::std::string::String>,
    /// <p>How the new Trigger fires</p>
    pub r#type: ::std::option::Option<::std::string::String>,
    /// <p>The condition that fires the new Trigger</p>
    pub condition: ::std::option::Option<crate::types::TriggerCondition>,
    /// <p>The action the new Trigger performs when it fires</p>
    pub action: ::std::option::Option<::aws_smithy_types::Document>,
    /// <p>The initial status of the Trigger</p>
    pub status: ::std::option::Option<::std::string::String>,
    /// <p>A unique, case-sensitive identifier used for idempotent Trigger creation</p>
    pub client_token: ::std::option::Option<::std::string::String>,
}
impl CreateTriggerInput {
    /// <p>The unique identifier for the agent space where the Trigger will be created</p>
    pub fn agent_space_id(&self) -> ::std::option::Option<&str> {
        self.agent_space_id.as_deref()
    }
    /// <p>How the new Trigger fires</p>
    pub fn r#type(&self) -> ::std::option::Option<&str> {
        self.r#type.as_deref()
    }
    /// <p>The condition that fires the new Trigger</p>
    pub fn condition(&self) -> ::std::option::Option<&crate::types::TriggerCondition> {
        self.condition.as_ref()
    }
    /// <p>The action the new Trigger performs when it fires</p>
    pub fn action(&self) -> ::std::option::Option<&::aws_smithy_types::Document> {
        self.action.as_ref()
    }
    /// <p>The initial status of the Trigger</p>
    pub fn status(&self) -> ::std::option::Option<&str> {
        self.status.as_deref()
    }
    /// <p>A unique, case-sensitive identifier used for idempotent Trigger creation</p>
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
}
impl CreateTriggerInput {
    /// Creates a new builder-style object to manufacture [`CreateTriggerInput`](crate::operation::create_trigger::CreateTriggerInput).
    pub fn builder() -> crate::operation::create_trigger::builders::CreateTriggerInputBuilder {
        crate::operation::create_trigger::builders::CreateTriggerInputBuilder::default()
    }
}

/// A builder for [`CreateTriggerInput`](crate::operation::create_trigger::CreateTriggerInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateTriggerInputBuilder {
    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) client_token: ::std::option::Option<::std::string::String>,
}
impl CreateTriggerInputBuilder {
    /// <p>The unique identifier for the agent space where the Trigger will be created</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 unique identifier for the agent space where the Trigger will be created</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 unique identifier for the agent space where the Trigger will be created</p>
    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.agent_space_id
    }
    /// <p>How the new 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 the new Trigger fires</p>
    pub fn set_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.r#type = input;
        self
    }
    /// <p>How the new Trigger fires</p>
    pub fn get_type(&self) -> &::std::option::Option<::std::string::String> {
        &self.r#type
    }
    /// <p>The condition that fires the new 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 the new 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 the new Trigger</p>
    pub fn get_condition(&self) -> &::std::option::Option<crate::types::TriggerCondition> {
        &self.condition
    }
    /// <p>The action the new 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 the new 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 the new Trigger performs when it fires</p>
    pub fn get_action(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
        &self.action
    }
    /// <p>The initial status of the Trigger</p>
    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 initial status of the Trigger</p>
    pub fn set_status(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.status = input;
        self
    }
    /// <p>The initial status of the Trigger</p>
    pub fn get_status(&self) -> &::std::option::Option<::std::string::String> {
        &self.status
    }
    /// <p>A unique, case-sensitive identifier used for idempotent Trigger creation</p>
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A unique, case-sensitive identifier used for idempotent Trigger creation</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// <p>A unique, case-sensitive identifier used for idempotent Trigger creation</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// Consumes the builder and constructs a [`CreateTriggerInput`](crate::operation::create_trigger::CreateTriggerInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_trigger::CreateTriggerInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_trigger::CreateTriggerInput {
            agent_space_id: self.agent_space_id,
            r#type: self.r#type,
            condition: self.condition,
            action: self.action,
            status: self.status,
            client_token: self.client_token,
        })
    }
}