aws-sdk-devopsagent 1.28.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 UpdateApprovalAction. Submits the terminal decision (APPROVED or REJECTED) against an approval request, optionally carrying the finalized pattern and time-to-live when the action is APPROVED, or a free-text rationale when the action is REJECTED. Cross-field invariants between `action` and the approve-only / reject-only members are enforced by service-side validation.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct UpdateApprovalActionInput {
    /// <p>The agent space identifier — multi-tenant workspace scope. Bound from the request URI.</p>
    pub agent_space_id: ::std::option::Option<::std::string::String>,
    /// <p>Identifier of the approval request being resolved. A UUID. Bound from the request URI.</p>
    pub approval_id: ::std::option::Option<::std::string::String>,
    /// <p>The action to take on the approval request — APPROVED or REJECTED.</p>
    pub action: ::std::option::Option<crate::types::ApprovalActionType>,
    /// <p>The finalized pattern (tool + argumentPins) that scopes the approval. Required when `action` is APPROVED; must be absent when `action` is REJECTED. The pattern narrows, and must not widen, the invocation originally requested by the agent. This cross-field invariant is enforced by service-side validation.</p>
    pub final_pattern: ::std::option::Option<crate::types::ApprovalPattern>,
    /// <p>Optional free-text rationale for the decision. Permitted when `action` is REJECTED; ignored when `action` is APPROVED.</p>
    pub reason: ::std::option::Option<::std::string::String>,
    /// <p>Approval lifetime in seconds, starting from when the decision is submitted. Required when `action` is APPROVED AND `singleUse` is false; must be absent when `action` is REJECTED or when `singleUse` is true (a single-use approval backs one executed action and the redemption window collapses). Cross-field invariants are enforced by service-side validation; the @range bound here is the operation-boundary check that always applies (a maximum of 4 hours).</p>
    pub ttl_seconds: ::std::option::Option<i32>,
    /// <p>Whether the approved action backs a single executed tool call (true) or is reusable within ttlSeconds (false). Required when `action` is APPROVED; must be absent when `action` is REJECTED. When true, ttlSeconds must be absent (the redemption window collapses to the single use). When false, ttlSeconds is required and bounds the reuse window. Cross-field invariants are enforced by service-side validation.</p>
    pub single_use: ::std::option::Option<bool>,
}
impl UpdateApprovalActionInput {
    /// <p>The agent space identifier — multi-tenant workspace scope. Bound from the request URI.</p>
    pub fn agent_space_id(&self) -> ::std::option::Option<&str> {
        self.agent_space_id.as_deref()
    }
    /// <p>Identifier of the approval request being resolved. A UUID. Bound from the request URI.</p>
    pub fn approval_id(&self) -> ::std::option::Option<&str> {
        self.approval_id.as_deref()
    }
    /// <p>The action to take on the approval request — APPROVED or REJECTED.</p>
    pub fn action(&self) -> ::std::option::Option<&crate::types::ApprovalActionType> {
        self.action.as_ref()
    }
    /// <p>The finalized pattern (tool + argumentPins) that scopes the approval. Required when `action` is APPROVED; must be absent when `action` is REJECTED. The pattern narrows, and must not widen, the invocation originally requested by the agent. This cross-field invariant is enforced by service-side validation.</p>
    pub fn final_pattern(&self) -> ::std::option::Option<&crate::types::ApprovalPattern> {
        self.final_pattern.as_ref()
    }
    /// <p>Optional free-text rationale for the decision. Permitted when `action` is REJECTED; ignored when `action` is APPROVED.</p>
    pub fn reason(&self) -> ::std::option::Option<&str> {
        self.reason.as_deref()
    }
    /// <p>Approval lifetime in seconds, starting from when the decision is submitted. Required when `action` is APPROVED AND `singleUse` is false; must be absent when `action` is REJECTED or when `singleUse` is true (a single-use approval backs one executed action and the redemption window collapses). Cross-field invariants are enforced by service-side validation; the @range bound here is the operation-boundary check that always applies (a maximum of 4 hours).</p>
    pub fn ttl_seconds(&self) -> ::std::option::Option<i32> {
        self.ttl_seconds
    }
    /// <p>Whether the approved action backs a single executed tool call (true) or is reusable within ttlSeconds (false). Required when `action` is APPROVED; must be absent when `action` is REJECTED. When true, ttlSeconds must be absent (the redemption window collapses to the single use). When false, ttlSeconds is required and bounds the reuse window. Cross-field invariants are enforced by service-side validation.</p>
    pub fn single_use(&self) -> ::std::option::Option<bool> {
        self.single_use
    }
}
impl UpdateApprovalActionInput {
    /// Creates a new builder-style object to manufacture [`UpdateApprovalActionInput`](crate::operation::update_approval_action::UpdateApprovalActionInput).
    pub fn builder() -> crate::operation::update_approval_action::builders::UpdateApprovalActionInputBuilder {
        crate::operation::update_approval_action::builders::UpdateApprovalActionInputBuilder::default()
    }
}

/// A builder for [`UpdateApprovalActionInput`](crate::operation::update_approval_action::UpdateApprovalActionInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateApprovalActionInputBuilder {
    pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
    pub(crate) approval_id: ::std::option::Option<::std::string::String>,
    pub(crate) action: ::std::option::Option<crate::types::ApprovalActionType>,
    pub(crate) final_pattern: ::std::option::Option<crate::types::ApprovalPattern>,
    pub(crate) reason: ::std::option::Option<::std::string::String>,
    pub(crate) ttl_seconds: ::std::option::Option<i32>,
    pub(crate) single_use: ::std::option::Option<bool>,
}
impl UpdateApprovalActionInputBuilder {
    /// <p>The agent space identifier — multi-tenant workspace scope. Bound from the request URI.</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 identifier — multi-tenant workspace scope. Bound from the request URI.</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 identifier — multi-tenant workspace scope. Bound from the request URI.</p>
    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.agent_space_id
    }
    /// <p>Identifier of the approval request being resolved. A UUID. Bound from the request URI.</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 being resolved. A UUID. Bound from the request URI.</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 being resolved. A UUID. Bound from the request URI.</p>
    pub fn get_approval_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.approval_id
    }
    /// <p>The action to take on the approval request — APPROVED or REJECTED.</p>
    /// This field is required.
    pub fn action(mut self, input: crate::types::ApprovalActionType) -> Self {
        self.action = ::std::option::Option::Some(input);
        self
    }
    /// <p>The action to take on the approval request — APPROVED or REJECTED.</p>
    pub fn set_action(mut self, input: ::std::option::Option<crate::types::ApprovalActionType>) -> Self {
        self.action = input;
        self
    }
    /// <p>The action to take on the approval request — APPROVED or REJECTED.</p>
    pub fn get_action(&self) -> &::std::option::Option<crate::types::ApprovalActionType> {
        &self.action
    }
    /// <p>The finalized pattern (tool + argumentPins) that scopes the approval. Required when `action` is APPROVED; must be absent when `action` is REJECTED. The pattern narrows, and must not widen, the invocation originally requested by the agent. This cross-field invariant is enforced by service-side validation.</p>
    pub fn final_pattern(mut self, input: crate::types::ApprovalPattern) -> Self {
        self.final_pattern = ::std::option::Option::Some(input);
        self
    }
    /// <p>The finalized pattern (tool + argumentPins) that scopes the approval. Required when `action` is APPROVED; must be absent when `action` is REJECTED. The pattern narrows, and must not widen, the invocation originally requested by the agent. This cross-field invariant is enforced by service-side validation.</p>
    pub fn set_final_pattern(mut self, input: ::std::option::Option<crate::types::ApprovalPattern>) -> Self {
        self.final_pattern = input;
        self
    }
    /// <p>The finalized pattern (tool + argumentPins) that scopes the approval. Required when `action` is APPROVED; must be absent when `action` is REJECTED. The pattern narrows, and must not widen, the invocation originally requested by the agent. This cross-field invariant is enforced by service-side validation.</p>
    pub fn get_final_pattern(&self) -> &::std::option::Option<crate::types::ApprovalPattern> {
        &self.final_pattern
    }
    /// <p>Optional free-text rationale for the decision. Permitted when `action` is REJECTED; ignored when `action` is APPROVED.</p>
    pub fn reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.reason = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Optional free-text rationale for the decision. Permitted when `action` is REJECTED; ignored when `action` is APPROVED.</p>
    pub fn set_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.reason = input;
        self
    }
    /// <p>Optional free-text rationale for the decision. Permitted when `action` is REJECTED; ignored when `action` is APPROVED.</p>
    pub fn get_reason(&self) -> &::std::option::Option<::std::string::String> {
        &self.reason
    }
    /// <p>Approval lifetime in seconds, starting from when the decision is submitted. Required when `action` is APPROVED AND `singleUse` is false; must be absent when `action` is REJECTED or when `singleUse` is true (a single-use approval backs one executed action and the redemption window collapses). Cross-field invariants are enforced by service-side validation; the @range bound here is the operation-boundary check that always applies (a maximum of 4 hours).</p>
    pub fn ttl_seconds(mut self, input: i32) -> Self {
        self.ttl_seconds = ::std::option::Option::Some(input);
        self
    }
    /// <p>Approval lifetime in seconds, starting from when the decision is submitted. Required when `action` is APPROVED AND `singleUse` is false; must be absent when `action` is REJECTED or when `singleUse` is true (a single-use approval backs one executed action and the redemption window collapses). Cross-field invariants are enforced by service-side validation; the @range bound here is the operation-boundary check that always applies (a maximum of 4 hours).</p>
    pub fn set_ttl_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
        self.ttl_seconds = input;
        self
    }
    /// <p>Approval lifetime in seconds, starting from when the decision is submitted. Required when `action` is APPROVED AND `singleUse` is false; must be absent when `action` is REJECTED or when `singleUse` is true (a single-use approval backs one executed action and the redemption window collapses). Cross-field invariants are enforced by service-side validation; the @range bound here is the operation-boundary check that always applies (a maximum of 4 hours).</p>
    pub fn get_ttl_seconds(&self) -> &::std::option::Option<i32> {
        &self.ttl_seconds
    }
    /// <p>Whether the approved action backs a single executed tool call (true) or is reusable within ttlSeconds (false). Required when `action` is APPROVED; must be absent when `action` is REJECTED. When true, ttlSeconds must be absent (the redemption window collapses to the single use). When false, ttlSeconds is required and bounds the reuse window. Cross-field invariants are enforced by service-side validation.</p>
    pub fn single_use(mut self, input: bool) -> Self {
        self.single_use = ::std::option::Option::Some(input);
        self
    }
    /// <p>Whether the approved action backs a single executed tool call (true) or is reusable within ttlSeconds (false). Required when `action` is APPROVED; must be absent when `action` is REJECTED. When true, ttlSeconds must be absent (the redemption window collapses to the single use). When false, ttlSeconds is required and bounds the reuse window. Cross-field invariants are enforced by service-side validation.</p>
    pub fn set_single_use(mut self, input: ::std::option::Option<bool>) -> Self {
        self.single_use = input;
        self
    }
    /// <p>Whether the approved action backs a single executed tool call (true) or is reusable within ttlSeconds (false). Required when `action` is APPROVED; must be absent when `action` is REJECTED. When true, ttlSeconds must be absent (the redemption window collapses to the single use). When false, ttlSeconds is required and bounds the reuse window. Cross-field invariants are enforced by service-side validation.</p>
    pub fn get_single_use(&self) -> &::std::option::Option<bool> {
        &self.single_use
    }
    /// Consumes the builder and constructs a [`UpdateApprovalActionInput`](crate::operation::update_approval_action::UpdateApprovalActionInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_approval_action::UpdateApprovalActionInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::update_approval_action::UpdateApprovalActionInput {
            agent_space_id: self.agent_space_id,
            approval_id: self.approval_id,
            action: self.action,
            final_pattern: self.final_pattern,
            reason: self.reason,
            ttl_seconds: self.ttl_seconds,
            single_use: self.single_use,
        })
    }
}