aws-sdk-codepipeline 1.108.0

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

/// <p>Represents the input of a <code>PutApprovalResult</code> action.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct PutApprovalResultInput {
    /// <p>The name of the pipeline that contains the action.</p>
    pub pipeline_name: ::std::option::Option<::std::string::String>,
    /// <p>The name of the stage that contains the action.</p>
    pub stage_name: ::std::option::Option<::std::string::String>,
    /// <p>The name of the action for which approval is requested.</p>
    pub action_name: ::std::option::Option<::std::string::String>,
    /// <p>Represents information about the result of the approval request.</p>
    pub result: ::std::option::Option<crate::types::ApprovalResult>,
    /// <p>The system-generated token used to identify a unique approval request. The token for each open approval request can be obtained using the <code>GetPipelineState</code> action. It is used to validate that the approval request corresponding to this token is still valid.</p><important>
    /// <p>For a pipeline where the execution mode is set to PARALLEL, the token required to approve/reject an approval request as detailed above is not available. Instead, use the <code>externalExecutionId</code> in the response output from the <code>ListActionExecutions</code> action as the token in the approval request.</p>
    /// </important>
    pub token: ::std::option::Option<::std::string::String>,
}
impl PutApprovalResultInput {
    /// <p>The name of the pipeline that contains the action.</p>
    pub fn pipeline_name(&self) -> ::std::option::Option<&str> {
        self.pipeline_name.as_deref()
    }
    /// <p>The name of the stage that contains the action.</p>
    pub fn stage_name(&self) -> ::std::option::Option<&str> {
        self.stage_name.as_deref()
    }
    /// <p>The name of the action for which approval is requested.</p>
    pub fn action_name(&self) -> ::std::option::Option<&str> {
        self.action_name.as_deref()
    }
    /// <p>Represents information about the result of the approval request.</p>
    pub fn result(&self) -> ::std::option::Option<&crate::types::ApprovalResult> {
        self.result.as_ref()
    }
    /// <p>The system-generated token used to identify a unique approval request. The token for each open approval request can be obtained using the <code>GetPipelineState</code> action. It is used to validate that the approval request corresponding to this token is still valid.</p><important>
    /// <p>For a pipeline where the execution mode is set to PARALLEL, the token required to approve/reject an approval request as detailed above is not available. Instead, use the <code>externalExecutionId</code> in the response output from the <code>ListActionExecutions</code> action as the token in the approval request.</p>
    /// </important>
    pub fn token(&self) -> ::std::option::Option<&str> {
        self.token.as_deref()
    }
}
impl PutApprovalResultInput {
    /// Creates a new builder-style object to manufacture [`PutApprovalResultInput`](crate::operation::put_approval_result::PutApprovalResultInput).
    pub fn builder() -> crate::operation::put_approval_result::builders::PutApprovalResultInputBuilder {
        crate::operation::put_approval_result::builders::PutApprovalResultInputBuilder::default()
    }
}

/// A builder for [`PutApprovalResultInput`](crate::operation::put_approval_result::PutApprovalResultInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PutApprovalResultInputBuilder {
    pub(crate) pipeline_name: ::std::option::Option<::std::string::String>,
    pub(crate) stage_name: ::std::option::Option<::std::string::String>,
    pub(crate) action_name: ::std::option::Option<::std::string::String>,
    pub(crate) result: ::std::option::Option<crate::types::ApprovalResult>,
    pub(crate) token: ::std::option::Option<::std::string::String>,
}
impl PutApprovalResultInputBuilder {
    /// <p>The name of the pipeline that contains the action.</p>
    /// This field is required.
    pub fn pipeline_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.pipeline_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the pipeline that contains the action.</p>
    pub fn set_pipeline_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.pipeline_name = input;
        self
    }
    /// <p>The name of the pipeline that contains the action.</p>
    pub fn get_pipeline_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.pipeline_name
    }
    /// <p>The name of the stage that contains the action.</p>
    /// This field is required.
    pub fn stage_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.stage_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the stage that contains the action.</p>
    pub fn set_stage_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.stage_name = input;
        self
    }
    /// <p>The name of the stage that contains the action.</p>
    pub fn get_stage_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.stage_name
    }
    /// <p>The name of the action for which approval is requested.</p>
    /// This field is required.
    pub fn action_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.action_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the action for which approval is requested.</p>
    pub fn set_action_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.action_name = input;
        self
    }
    /// <p>The name of the action for which approval is requested.</p>
    pub fn get_action_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.action_name
    }
    /// <p>Represents information about the result of the approval request.</p>
    /// This field is required.
    pub fn result(mut self, input: crate::types::ApprovalResult) -> Self {
        self.result = ::std::option::Option::Some(input);
        self
    }
    /// <p>Represents information about the result of the approval request.</p>
    pub fn set_result(mut self, input: ::std::option::Option<crate::types::ApprovalResult>) -> Self {
        self.result = input;
        self
    }
    /// <p>Represents information about the result of the approval request.</p>
    pub fn get_result(&self) -> &::std::option::Option<crate::types::ApprovalResult> {
        &self.result
    }
    /// <p>The system-generated token used to identify a unique approval request. The token for each open approval request can be obtained using the <code>GetPipelineState</code> action. It is used to validate that the approval request corresponding to this token is still valid.</p><important>
    /// <p>For a pipeline where the execution mode is set to PARALLEL, the token required to approve/reject an approval request as detailed above is not available. Instead, use the <code>externalExecutionId</code> in the response output from the <code>ListActionExecutions</code> action as the token in the approval request.</p>
    /// </important>
    /// This field is required.
    pub fn token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The system-generated token used to identify a unique approval request. The token for each open approval request can be obtained using the <code>GetPipelineState</code> action. It is used to validate that the approval request corresponding to this token is still valid.</p><important>
    /// <p>For a pipeline where the execution mode is set to PARALLEL, the token required to approve/reject an approval request as detailed above is not available. Instead, use the <code>externalExecutionId</code> in the response output from the <code>ListActionExecutions</code> action as the token in the approval request.</p>
    /// </important>
    pub fn set_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.token = input;
        self
    }
    /// <p>The system-generated token used to identify a unique approval request. The token for each open approval request can be obtained using the <code>GetPipelineState</code> action. It is used to validate that the approval request corresponding to this token is still valid.</p><important>
    /// <p>For a pipeline where the execution mode is set to PARALLEL, the token required to approve/reject an approval request as detailed above is not available. Instead, use the <code>externalExecutionId</code> in the response output from the <code>ListActionExecutions</code> action as the token in the approval request.</p>
    /// </important>
    pub fn get_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.token
    }
    /// Consumes the builder and constructs a [`PutApprovalResultInput`](crate::operation::put_approval_result::PutApprovalResultInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::put_approval_result::PutApprovalResultInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::put_approval_result::PutApprovalResultInput {
            pipeline_name: self.pipeline_name,
            stage_name: self.stage_name,
            action_name: self.action_name,
            result: self.result,
            token: self.token,
        })
    }
}