aws_sdk_lambda/operation/add_permission/_add_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 AddPermissionInput {
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>A statement identifier that differentiates the statement from others in the same policy.</p>
19 pub statement_id: ::std::option::Option<::std::string::String>,
20 /// <p>The action that the principal can use on the function. For example, <code>lambda:InvokeFunction</code> or <code>lambda:GetFunction</code>.</p>
21 pub action: ::std::option::Option<::std::string::String>,
22 /// <p>The Amazon Web Services service, Amazon Web Services account, IAM user, or IAM role that invokes the function. If you specify a service, use <code>SourceArn</code> or <code>SourceAccount</code> to limit who can invoke the function through that service.</p>
23 pub principal: ::std::option::Option<::std::string::String>,
24 /// <p>For Amazon Web Services services, the ARN of the Amazon Web Services resource that invokes the function. For example, an Amazon S3 bucket or Amazon SNS topic.</p>
25 /// <p>Note that Lambda configures the comparison using the <code>StringLike</code> operator.</p>
26 pub source_arn: ::std::option::Option<::std::string::String>,
27 /// <p>For Amazon Web Services service, the ID of the Amazon Web Services account that owns the resource. Use this together with <code>SourceArn</code> to ensure that the specified account owns the resource. It is possible for an Amazon S3 bucket to be deleted by its owner and recreated by another account.</p>
28 pub source_account: ::std::option::Option<::std::string::String>,
29 /// <p>For Alexa Smart Home functions, a token that the invoker must supply.</p>
30 pub event_source_token: ::std::option::Option<::std::string::String>,
31 /// <p>Specify a version or alias to add permissions to a published version of the function.</p>
32 pub qualifier: ::std::option::Option<::std::string::String>,
33 /// <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>
34 pub revision_id: ::std::option::Option<::std::string::String>,
35 /// <p>The identifier for your organization in Organizations. Use this to grant permissions to all the Amazon Web Services accounts under this organization.</p>
36 pub principal_org_id: ::std::option::Option<::std::string::String>,
37 /// <p>The type of authentication that your function URL uses. Set to <code>AWS_IAM</code> if you want to restrict access to authenticated users only. Set to <code>NONE</code> if you want to bypass IAM authentication to create a public endpoint. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html">Security and auth model for Lambda function URLs</a>.</p>
38 pub function_url_auth_type: ::std::option::Option<crate::types::FunctionUrlAuthType>,
39}
40impl AddPermissionInput {
41 /// <p>The name or ARN of the Lambda function, version, or alias.</p>
42 /// <p class="title"><b>Name formats</b></p>
43 /// <ul>
44 /// <li>
45 /// <p><b>Function name</b> – <code>my-function</code> (name-only), <code>my-function:v1</code> (with alias).</p></li>
46 /// <li>
47 /// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>
48 /// <li>
49 /// <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li>
50 /// </ul>
51 /// <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>
52 pub fn function_name(&self) -> ::std::option::Option<&str> {
53 self.function_name.as_deref()
54 }
55 /// <p>A statement identifier that differentiates the statement from others in the same policy.</p>
56 pub fn statement_id(&self) -> ::std::option::Option<&str> {
57 self.statement_id.as_deref()
58 }
59 /// <p>The action that the principal can use on the function. For example, <code>lambda:InvokeFunction</code> or <code>lambda:GetFunction</code>.</p>
60 pub fn action(&self) -> ::std::option::Option<&str> {
61 self.action.as_deref()
62 }
63 /// <p>The Amazon Web Services service, Amazon Web Services account, IAM user, or IAM role that invokes the function. If you specify a service, use <code>SourceArn</code> or <code>SourceAccount</code> to limit who can invoke the function through that service.</p>
64 pub fn principal(&self) -> ::std::option::Option<&str> {
65 self.principal.as_deref()
66 }
67 /// <p>For Amazon Web Services services, the ARN of the Amazon Web Services resource that invokes the function. For example, an Amazon S3 bucket or Amazon SNS topic.</p>
68 /// <p>Note that Lambda configures the comparison using the <code>StringLike</code> operator.</p>
69 pub fn source_arn(&self) -> ::std::option::Option<&str> {
70 self.source_arn.as_deref()
71 }
72 /// <p>For Amazon Web Services service, the ID of the Amazon Web Services account that owns the resource. Use this together with <code>SourceArn</code> to ensure that the specified account owns the resource. It is possible for an Amazon S3 bucket to be deleted by its owner and recreated by another account.</p>
73 pub fn source_account(&self) -> ::std::option::Option<&str> {
74 self.source_account.as_deref()
75 }
76 /// <p>For Alexa Smart Home functions, a token that the invoker must supply.</p>
77 pub fn event_source_token(&self) -> ::std::option::Option<&str> {
78 self.event_source_token.as_deref()
79 }
80 /// <p>Specify a version or alias to add permissions to a published version of the function.</p>
81 pub fn qualifier(&self) -> ::std::option::Option<&str> {
82 self.qualifier.as_deref()
83 }
84 /// <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>
85 pub fn revision_id(&self) -> ::std::option::Option<&str> {
86 self.revision_id.as_deref()
87 }
88 /// <p>The identifier for your organization in Organizations. Use this to grant permissions to all the Amazon Web Services accounts under this organization.</p>
89 pub fn principal_org_id(&self) -> ::std::option::Option<&str> {
90 self.principal_org_id.as_deref()
91 }
92 /// <p>The type of authentication that your function URL uses. Set to <code>AWS_IAM</code> if you want to restrict access to authenticated users only. Set to <code>NONE</code> if you want to bypass IAM authentication to create a public endpoint. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html">Security and auth model for Lambda function URLs</a>.</p>
93 pub fn function_url_auth_type(&self) -> ::std::option::Option<&crate::types::FunctionUrlAuthType> {
94 self.function_url_auth_type.as_ref()
95 }
96}
97impl AddPermissionInput {
98 /// Creates a new builder-style object to manufacture [`AddPermissionInput`](crate::operation::add_permission::AddPermissionInput).
99 pub fn builder() -> crate::operation::add_permission::builders::AddPermissionInputBuilder {
100 crate::operation::add_permission::builders::AddPermissionInputBuilder::default()
101 }
102}
103
104/// A builder for [`AddPermissionInput`](crate::operation::add_permission::AddPermissionInput).
105#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
106#[non_exhaustive]
107pub struct AddPermissionInputBuilder {
108 pub(crate) function_name: ::std::option::Option<::std::string::String>,
109 pub(crate) statement_id: ::std::option::Option<::std::string::String>,
110 pub(crate) action: ::std::option::Option<::std::string::String>,
111 pub(crate) principal: ::std::option::Option<::std::string::String>,
112 pub(crate) source_arn: ::std::option::Option<::std::string::String>,
113 pub(crate) source_account: ::std::option::Option<::std::string::String>,
114 pub(crate) event_source_token: ::std::option::Option<::std::string::String>,
115 pub(crate) qualifier: ::std::option::Option<::std::string::String>,
116 pub(crate) revision_id: ::std::option::Option<::std::string::String>,
117 pub(crate) principal_org_id: ::std::option::Option<::std::string::String>,
118 pub(crate) function_url_auth_type: ::std::option::Option<crate::types::FunctionUrlAuthType>,
119}
120impl AddPermissionInputBuilder {
121 /// <p>The name or ARN of the Lambda function, version, or alias.</p>
122 /// <p class="title"><b>Name formats</b></p>
123 /// <ul>
124 /// <li>
125 /// <p><b>Function name</b> – <code>my-function</code> (name-only), <code>my-function:v1</code> (with alias).</p></li>
126 /// <li>
127 /// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>
128 /// <li>
129 /// <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li>
130 /// </ul>
131 /// <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>
132 /// This field is required.
133 pub fn function_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134 self.function_name = ::std::option::Option::Some(input.into());
135 self
136 }
137 /// <p>The name or ARN of the Lambda function, version, or alias.</p>
138 /// <p class="title"><b>Name formats</b></p>
139 /// <ul>
140 /// <li>
141 /// <p><b>Function name</b> – <code>my-function</code> (name-only), <code>my-function:v1</code> (with alias).</p></li>
142 /// <li>
143 /// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>
144 /// <li>
145 /// <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li>
146 /// </ul>
147 /// <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>
148 pub fn set_function_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149 self.function_name = input;
150 self
151 }
152 /// <p>The name or ARN of the Lambda function, version, or alias.</p>
153 /// <p class="title"><b>Name formats</b></p>
154 /// <ul>
155 /// <li>
156 /// <p><b>Function name</b> – <code>my-function</code> (name-only), <code>my-function:v1</code> (with alias).</p></li>
157 /// <li>
158 /// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>
159 /// <li>
160 /// <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li>
161 /// </ul>
162 /// <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>
163 pub fn get_function_name(&self) -> &::std::option::Option<::std::string::String> {
164 &self.function_name
165 }
166 /// <p>A statement identifier that differentiates the statement from others in the same policy.</p>
167 /// This field is required.
168 pub fn statement_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
169 self.statement_id = ::std::option::Option::Some(input.into());
170 self
171 }
172 /// <p>A statement identifier that differentiates the statement from others in the same policy.</p>
173 pub fn set_statement_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
174 self.statement_id = input;
175 self
176 }
177 /// <p>A statement identifier that differentiates the statement from others in the same policy.</p>
178 pub fn get_statement_id(&self) -> &::std::option::Option<::std::string::String> {
179 &self.statement_id
180 }
181 /// <p>The action that the principal can use on the function. For example, <code>lambda:InvokeFunction</code> or <code>lambda:GetFunction</code>.</p>
182 /// This field is required.
183 pub fn action(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
184 self.action = ::std::option::Option::Some(input.into());
185 self
186 }
187 /// <p>The action that the principal can use on the function. For example, <code>lambda:InvokeFunction</code> or <code>lambda:GetFunction</code>.</p>
188 pub fn set_action(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
189 self.action = input;
190 self
191 }
192 /// <p>The action that the principal can use on the function. For example, <code>lambda:InvokeFunction</code> or <code>lambda:GetFunction</code>.</p>
193 pub fn get_action(&self) -> &::std::option::Option<::std::string::String> {
194 &self.action
195 }
196 /// <p>The Amazon Web Services service, Amazon Web Services account, IAM user, or IAM role that invokes the function. If you specify a service, use <code>SourceArn</code> or <code>SourceAccount</code> to limit who can invoke the function through that service.</p>
197 /// This field is required.
198 pub fn principal(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
199 self.principal = ::std::option::Option::Some(input.into());
200 self
201 }
202 /// <p>The Amazon Web Services service, Amazon Web Services account, IAM user, or IAM role that invokes the function. If you specify a service, use <code>SourceArn</code> or <code>SourceAccount</code> to limit who can invoke the function through that service.</p>
203 pub fn set_principal(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
204 self.principal = input;
205 self
206 }
207 /// <p>The Amazon Web Services service, Amazon Web Services account, IAM user, or IAM role that invokes the function. If you specify a service, use <code>SourceArn</code> or <code>SourceAccount</code> to limit who can invoke the function through that service.</p>
208 pub fn get_principal(&self) -> &::std::option::Option<::std::string::String> {
209 &self.principal
210 }
211 /// <p>For Amazon Web Services services, the ARN of the Amazon Web Services resource that invokes the function. For example, an Amazon S3 bucket or Amazon SNS topic.</p>
212 /// <p>Note that Lambda configures the comparison using the <code>StringLike</code> operator.</p>
213 pub fn source_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
214 self.source_arn = ::std::option::Option::Some(input.into());
215 self
216 }
217 /// <p>For Amazon Web Services services, the ARN of the Amazon Web Services resource that invokes the function. For example, an Amazon S3 bucket or Amazon SNS topic.</p>
218 /// <p>Note that Lambda configures the comparison using the <code>StringLike</code> operator.</p>
219 pub fn set_source_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
220 self.source_arn = input;
221 self
222 }
223 /// <p>For Amazon Web Services services, the ARN of the Amazon Web Services resource that invokes the function. For example, an Amazon S3 bucket or Amazon SNS topic.</p>
224 /// <p>Note that Lambda configures the comparison using the <code>StringLike</code> operator.</p>
225 pub fn get_source_arn(&self) -> &::std::option::Option<::std::string::String> {
226 &self.source_arn
227 }
228 /// <p>For Amazon Web Services service, the ID of the Amazon Web Services account that owns the resource. Use this together with <code>SourceArn</code> to ensure that the specified account owns the resource. It is possible for an Amazon S3 bucket to be deleted by its owner and recreated by another account.</p>
229 pub fn source_account(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
230 self.source_account = ::std::option::Option::Some(input.into());
231 self
232 }
233 /// <p>For Amazon Web Services service, the ID of the Amazon Web Services account that owns the resource. Use this together with <code>SourceArn</code> to ensure that the specified account owns the resource. It is possible for an Amazon S3 bucket to be deleted by its owner and recreated by another account.</p>
234 pub fn set_source_account(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
235 self.source_account = input;
236 self
237 }
238 /// <p>For Amazon Web Services service, the ID of the Amazon Web Services account that owns the resource. Use this together with <code>SourceArn</code> to ensure that the specified account owns the resource. It is possible for an Amazon S3 bucket to be deleted by its owner and recreated by another account.</p>
239 pub fn get_source_account(&self) -> &::std::option::Option<::std::string::String> {
240 &self.source_account
241 }
242 /// <p>For Alexa Smart Home functions, a token that the invoker must supply.</p>
243 pub fn event_source_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
244 self.event_source_token = ::std::option::Option::Some(input.into());
245 self
246 }
247 /// <p>For Alexa Smart Home functions, a token that the invoker must supply.</p>
248 pub fn set_event_source_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
249 self.event_source_token = input;
250 self
251 }
252 /// <p>For Alexa Smart Home functions, a token that the invoker must supply.</p>
253 pub fn get_event_source_token(&self) -> &::std::option::Option<::std::string::String> {
254 &self.event_source_token
255 }
256 /// <p>Specify a version or alias to add permissions to a published version of the function.</p>
257 pub fn qualifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
258 self.qualifier = ::std::option::Option::Some(input.into());
259 self
260 }
261 /// <p>Specify a version or alias to add permissions to a published version of the function.</p>
262 pub fn set_qualifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
263 self.qualifier = input;
264 self
265 }
266 /// <p>Specify a version or alias to add permissions to a published version of the function.</p>
267 pub fn get_qualifier(&self) -> &::std::option::Option<::std::string::String> {
268 &self.qualifier
269 }
270 /// <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>
271 pub fn revision_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
272 self.revision_id = ::std::option::Option::Some(input.into());
273 self
274 }
275 /// <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>
276 pub fn set_revision_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
277 self.revision_id = input;
278 self
279 }
280 /// <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>
281 pub fn get_revision_id(&self) -> &::std::option::Option<::std::string::String> {
282 &self.revision_id
283 }
284 /// <p>The identifier for your organization in Organizations. Use this to grant permissions to all the Amazon Web Services accounts under this organization.</p>
285 pub fn principal_org_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
286 self.principal_org_id = ::std::option::Option::Some(input.into());
287 self
288 }
289 /// <p>The identifier for your organization in Organizations. Use this to grant permissions to all the Amazon Web Services accounts under this organization.</p>
290 pub fn set_principal_org_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
291 self.principal_org_id = input;
292 self
293 }
294 /// <p>The identifier for your organization in Organizations. Use this to grant permissions to all the Amazon Web Services accounts under this organization.</p>
295 pub fn get_principal_org_id(&self) -> &::std::option::Option<::std::string::String> {
296 &self.principal_org_id
297 }
298 /// <p>The type of authentication that your function URL uses. Set to <code>AWS_IAM</code> if you want to restrict access to authenticated users only. Set to <code>NONE</code> if you want to bypass IAM authentication to create a public endpoint. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html">Security and auth model for Lambda function URLs</a>.</p>
299 pub fn function_url_auth_type(mut self, input: crate::types::FunctionUrlAuthType) -> Self {
300 self.function_url_auth_type = ::std::option::Option::Some(input);
301 self
302 }
303 /// <p>The type of authentication that your function URL uses. Set to <code>AWS_IAM</code> if you want to restrict access to authenticated users only. Set to <code>NONE</code> if you want to bypass IAM authentication to create a public endpoint. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html">Security and auth model for Lambda function URLs</a>.</p>
304 pub fn set_function_url_auth_type(mut self, input: ::std::option::Option<crate::types::FunctionUrlAuthType>) -> Self {
305 self.function_url_auth_type = input;
306 self
307 }
308 /// <p>The type of authentication that your function URL uses. Set to <code>AWS_IAM</code> if you want to restrict access to authenticated users only. Set to <code>NONE</code> if you want to bypass IAM authentication to create a public endpoint. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html">Security and auth model for Lambda function URLs</a>.</p>
309 pub fn get_function_url_auth_type(&self) -> &::std::option::Option<crate::types::FunctionUrlAuthType> {
310 &self.function_url_auth_type
311 }
312 /// Consumes the builder and constructs a [`AddPermissionInput`](crate::operation::add_permission::AddPermissionInput).
313 pub fn build(
314 self,
315 ) -> ::std::result::Result<crate::operation::add_permission::AddPermissionInput, ::aws_smithy_types::error::operation::BuildError> {
316 ::std::result::Result::Ok(crate::operation::add_permission::AddPermissionInput {
317 function_name: self.function_name,
318 statement_id: self.statement_id,
319 action: self.action,
320 principal: self.principal,
321 source_arn: self.source_arn,
322 source_account: self.source_account,
323 event_source_token: self.event_source_token,
324 qualifier: self.qualifier,
325 revision_id: self.revision_id,
326 principal_org_id: self.principal_org_id,
327 function_url_auth_type: self.function_url_auth_type,
328 })
329 }
330}