aws-sdk-devopsagent 1.30.0

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

/// <p>Response structure for UpdateApprovalAction. Reports the post-submission lifecycle status of the approval request and, when applicable, the absolute expiry timestamp. The status is a lifecycle state distinct from the action verb — an APPROVED submission transitions the request to APPROVED status (live, redeemable); a REJECTED submission transitions it to REJECTED status (terminal).</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct UpdateApprovalActionOutput {
    /// <p>Identifier of the approval request that was resolved. Echoed back so the client can correlate the response with the request.</p>
    pub approval_id: ::std::string::String,
    /// <p>Lifecycle status of the approval request immediately after submission. Expected post-submission states are APPROVED (when the action is APPROVED) or REJECTED (when the action is REJECTED); PENDING is not returned from this operation, and REVOKED and REDEEMED are reachable only via subsequent reads.</p>
    pub status: crate::types::ApprovalStatus,
    /// <p>Absolute timestamp at which the approval expires. Set when status is APPROVED (computed as the submission time plus ttlSeconds); absent when status is REJECTED.</p>
    pub expires_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl UpdateApprovalActionOutput {
    /// <p>Identifier of the approval request that was resolved. Echoed back so the client can correlate the response with the request.</p>
    pub fn approval_id(&self) -> &str {
        use std::ops::Deref;
        self.approval_id.deref()
    }
    /// <p>Lifecycle status of the approval request immediately after submission. Expected post-submission states are APPROVED (when the action is APPROVED) or REJECTED (when the action is REJECTED); PENDING is not returned from this operation, and REVOKED and REDEEMED are reachable only via subsequent reads.</p>
    pub fn status(&self) -> &crate::types::ApprovalStatus {
        &self.status
    }
    /// <p>Absolute timestamp at which the approval expires. Set when status is APPROVED (computed as the submission time plus ttlSeconds); absent when status is REJECTED.</p>
    pub fn expires_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.expires_at.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for UpdateApprovalActionOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl UpdateApprovalActionOutput {
    /// Creates a new builder-style object to manufacture [`UpdateApprovalActionOutput`](crate::operation::update_approval_action::UpdateApprovalActionOutput).
    pub fn builder() -> crate::operation::update_approval_action::builders::UpdateApprovalActionOutputBuilder {
        crate::operation::update_approval_action::builders::UpdateApprovalActionOutputBuilder::default()
    }
}

/// A builder for [`UpdateApprovalActionOutput`](crate::operation::update_approval_action::UpdateApprovalActionOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateApprovalActionOutputBuilder {
    pub(crate) approval_id: ::std::option::Option<::std::string::String>,
    pub(crate) status: ::std::option::Option<crate::types::ApprovalStatus>,
    pub(crate) expires_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl UpdateApprovalActionOutputBuilder {
    /// <p>Identifier of the approval request that was resolved. Echoed back so the client can correlate the response with the request.</p>
    /// This field is required.
    pub fn approval_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.approval_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Identifier of the approval request that was resolved. Echoed back so the client can correlate the response with the request.</p>
    pub fn set_approval_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.approval_id = input;
        self
    }
    /// <p>Identifier of the approval request that was resolved. Echoed back so the client can correlate the response with the request.</p>
    pub fn get_approval_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.approval_id
    }
    /// <p>Lifecycle status of the approval request immediately after submission. Expected post-submission states are APPROVED (when the action is APPROVED) or REJECTED (when the action is REJECTED); PENDING is not returned from this operation, and REVOKED and REDEEMED are reachable only via subsequent reads.</p>
    /// This field is required.
    pub fn status(mut self, input: crate::types::ApprovalStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>Lifecycle status of the approval request immediately after submission. Expected post-submission states are APPROVED (when the action is APPROVED) or REJECTED (when the action is REJECTED); PENDING is not returned from this operation, and REVOKED and REDEEMED are reachable only via subsequent reads.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::ApprovalStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>Lifecycle status of the approval request immediately after submission. Expected post-submission states are APPROVED (when the action is APPROVED) or REJECTED (when the action is REJECTED); PENDING is not returned from this operation, and REVOKED and REDEEMED are reachable only via subsequent reads.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::ApprovalStatus> {
        &self.status
    }
    /// <p>Absolute timestamp at which the approval expires. Set when status is APPROVED (computed as the submission time plus ttlSeconds); absent when status is REJECTED.</p>
    pub fn expires_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.expires_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>Absolute timestamp at which the approval expires. Set when status is APPROVED (computed as the submission time plus ttlSeconds); absent when status is REJECTED.</p>
    pub fn set_expires_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.expires_at = input;
        self
    }
    /// <p>Absolute timestamp at which the approval expires. Set when status is APPROVED (computed as the submission time plus ttlSeconds); absent when status is REJECTED.</p>
    pub fn get_expires_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.expires_at
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`UpdateApprovalActionOutput`](crate::operation::update_approval_action::UpdateApprovalActionOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`approval_id`](crate::operation::update_approval_action::builders::UpdateApprovalActionOutputBuilder::approval_id)
    /// - [`status`](crate::operation::update_approval_action::builders::UpdateApprovalActionOutputBuilder::status)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_approval_action::UpdateApprovalActionOutput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::update_approval_action::UpdateApprovalActionOutput {
            approval_id: self.approval_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "approval_id",
                    "approval_id was not specified but it is required when building UpdateApprovalActionOutput",
                )
            })?,
            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 UpdateApprovalActionOutput",
                )
            })?,
            expires_at: self.expires_at,
            _request_id: self._request_id,
        })
    }
}