aws_sdk_lambda/operation/remove_permission/
_remove_permission_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct RemovePermissionInput {
6    /// <p>The name or ARN of the Lambda function, version, or alias.</p>
7    /// <p class="title"><b>Name formats</b></p>
8    /// <ul>
9    /// <li>
10    /// <p><b>Function name</b> – <code>my-function</code> (name-only), <code>my-function:v1</code> (with alias).</p></li>
11    /// <li>
12    /// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>
13    /// <li>
14    /// <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li>
15    /// </ul>
16    /// <p>You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.</p>
17    pub function_name: ::std::option::Option<::std::string::String>,
18    /// <p>Statement ID of the permission to remove.</p>
19    pub statement_id: ::std::option::Option<::std::string::String>,
20    /// <p>Specify a version or alias to remove permissions from a published version of the function.</p>
21    pub qualifier: ::std::option::Option<::std::string::String>,
22    /// <p>Update the policy only if the revision ID matches the ID that's specified. Use this option to avoid modifying a policy that has changed since you last read it.</p>
23    pub revision_id: ::std::option::Option<::std::string::String>,
24}
25impl RemovePermissionInput {
26    /// <p>The name or ARN of the Lambda function, version, or alias.</p>
27    /// <p class="title"><b>Name formats</b></p>
28    /// <ul>
29    /// <li>
30    /// <p><b>Function name</b> – <code>my-function</code> (name-only), <code>my-function:v1</code> (with alias).</p></li>
31    /// <li>
32    /// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>
33    /// <li>
34    /// <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li>
35    /// </ul>
36    /// <p>You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.</p>
37    pub fn function_name(&self) -> ::std::option::Option<&str> {
38        self.function_name.as_deref()
39    }
40    /// <p>Statement ID of the permission to remove.</p>
41    pub fn statement_id(&self) -> ::std::option::Option<&str> {
42        self.statement_id.as_deref()
43    }
44    /// <p>Specify a version or alias to remove permissions from a published version of the function.</p>
45    pub fn qualifier(&self) -> ::std::option::Option<&str> {
46        self.qualifier.as_deref()
47    }
48    /// <p>Update the policy only if the revision ID matches the ID that's specified. Use this option to avoid modifying a policy that has changed since you last read it.</p>
49    pub fn revision_id(&self) -> ::std::option::Option<&str> {
50        self.revision_id.as_deref()
51    }
52}
53impl RemovePermissionInput {
54    /// Creates a new builder-style object to manufacture [`RemovePermissionInput`](crate::operation::remove_permission::RemovePermissionInput).
55    pub fn builder() -> crate::operation::remove_permission::builders::RemovePermissionInputBuilder {
56        crate::operation::remove_permission::builders::RemovePermissionInputBuilder::default()
57    }
58}
59
60/// A builder for [`RemovePermissionInput`](crate::operation::remove_permission::RemovePermissionInput).
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
62#[non_exhaustive]
63pub struct RemovePermissionInputBuilder {
64    pub(crate) function_name: ::std::option::Option<::std::string::String>,
65    pub(crate) statement_id: ::std::option::Option<::std::string::String>,
66    pub(crate) qualifier: ::std::option::Option<::std::string::String>,
67    pub(crate) revision_id: ::std::option::Option<::std::string::String>,
68}
69impl RemovePermissionInputBuilder {
70    /// <p>The name or ARN of the Lambda function, version, or alias.</p>
71    /// <p class="title"><b>Name formats</b></p>
72    /// <ul>
73    /// <li>
74    /// <p><b>Function name</b> – <code>my-function</code> (name-only), <code>my-function:v1</code> (with alias).</p></li>
75    /// <li>
76    /// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>
77    /// <li>
78    /// <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li>
79    /// </ul>
80    /// <p>You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.</p>
81    /// This field is required.
82    pub fn function_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
83        self.function_name = ::std::option::Option::Some(input.into());
84        self
85    }
86    /// <p>The name or ARN of the Lambda function, version, or alias.</p>
87    /// <p class="title"><b>Name formats</b></p>
88    /// <ul>
89    /// <li>
90    /// <p><b>Function name</b> – <code>my-function</code> (name-only), <code>my-function:v1</code> (with alias).</p></li>
91    /// <li>
92    /// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>
93    /// <li>
94    /// <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li>
95    /// </ul>
96    /// <p>You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.</p>
97    pub fn set_function_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
98        self.function_name = input;
99        self
100    }
101    /// <p>The name or ARN of the Lambda function, version, or alias.</p>
102    /// <p class="title"><b>Name formats</b></p>
103    /// <ul>
104    /// <li>
105    /// <p><b>Function name</b> – <code>my-function</code> (name-only), <code>my-function:v1</code> (with alias).</p></li>
106    /// <li>
107    /// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>
108    /// <li>
109    /// <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li>
110    /// </ul>
111    /// <p>You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.</p>
112    pub fn get_function_name(&self) -> &::std::option::Option<::std::string::String> {
113        &self.function_name
114    }
115    /// <p>Statement ID of the permission to remove.</p>
116    /// This field is required.
117    pub fn statement_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118        self.statement_id = ::std::option::Option::Some(input.into());
119        self
120    }
121    /// <p>Statement ID of the permission to remove.</p>
122    pub fn set_statement_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
123        self.statement_id = input;
124        self
125    }
126    /// <p>Statement ID of the permission to remove.</p>
127    pub fn get_statement_id(&self) -> &::std::option::Option<::std::string::String> {
128        &self.statement_id
129    }
130    /// <p>Specify a version or alias to remove permissions from a published version of the function.</p>
131    pub fn qualifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132        self.qualifier = ::std::option::Option::Some(input.into());
133        self
134    }
135    /// <p>Specify a version or alias to remove permissions from a published version of the function.</p>
136    pub fn set_qualifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137        self.qualifier = input;
138        self
139    }
140    /// <p>Specify a version or alias to remove permissions from a published version of the function.</p>
141    pub fn get_qualifier(&self) -> &::std::option::Option<::std::string::String> {
142        &self.qualifier
143    }
144    /// <p>Update the policy only if the revision ID matches the ID that's specified. Use this option to avoid modifying a policy that has changed since you last read it.</p>
145    pub fn revision_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146        self.revision_id = ::std::option::Option::Some(input.into());
147        self
148    }
149    /// <p>Update the policy only if the revision ID matches the ID that's specified. Use this option to avoid modifying a policy that has changed since you last read it.</p>
150    pub fn set_revision_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
151        self.revision_id = input;
152        self
153    }
154    /// <p>Update the policy only if the revision ID matches the ID that's specified. Use this option to avoid modifying a policy that has changed since you last read it.</p>
155    pub fn get_revision_id(&self) -> &::std::option::Option<::std::string::String> {
156        &self.revision_id
157    }
158    /// Consumes the builder and constructs a [`RemovePermissionInput`](crate::operation::remove_permission::RemovePermissionInput).
159    pub fn build(
160        self,
161    ) -> ::std::result::Result<crate::operation::remove_permission::RemovePermissionInput, ::aws_smithy_types::error::operation::BuildError> {
162        ::std::result::Result::Ok(crate::operation::remove_permission::RemovePermissionInput {
163            function_name: self.function_name,
164            statement_id: self.statement_id,
165            qualifier: self.qualifier,
166            revision_id: self.revision_id,
167        })
168    }
169}