1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
// 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,
})
}
}