pub struct AddPermissionFluentBuilder { /* private fields */ }
Expand description
Fluent builder constructing a request to AddPermission
.
Grants a principal permission to use a function. You can apply the policy at the function level, or specify a qualifier to restrict access to a single version or alias. If you use a qualifier, the invoker must use the full Amazon Resource Name (ARN) of that version or alias to invoke the function. Note: Lambda does not support adding policies to version $LATEST.
To grant permission to another account, specify the account ID as the Principal
. To grant permission to an organization defined in Organizations, specify the organization ID as the PrincipalOrgID
. For Amazon Web Services services, the principal is a domain-style identifier that the service defines, such as s3.amazonaws.com
or sns.amazonaws.com
. For Amazon Web Services services, you can also specify the ARN of the associated resource as the SourceArn
. If you grant permission to a service principal without specifying the source, other accounts could potentially configure resources in their account to invoke your Lambda function.
This operation adds a statement to a resource-based permissions policy for the function. For more information about function policies, see Using resource-based policies for Lambda.
Implementations§
Source§impl AddPermissionFluentBuilder
impl AddPermissionFluentBuilder
Sourcepub fn as_input(&self) -> &AddPermissionInputBuilder
pub fn as_input(&self) -> &AddPermissionInputBuilder
Access the AddPermission as a reference.
Sourcepub async fn send(
self,
) -> Result<AddPermissionOutput, SdkError<AddPermissionError, HttpResponse>>
pub async fn send( self, ) -> Result<AddPermissionOutput, SdkError<AddPermissionError, HttpResponse>>
Sends the request and returns the response.
If an error occurs, an SdkError
will be returned with additional details that
can be matched against.
By default, any retryable failures will be retried twice. Retry behavior is configurable with the RetryConfig, which can be set when configuring the client.
Sourcepub fn customize(
self,
) -> CustomizableOperation<AddPermissionOutput, AddPermissionError, Self>
pub fn customize( self, ) -> CustomizableOperation<AddPermissionOutput, AddPermissionError, Self>
Consumes this builder, creating a customizable operation that can be modified before being sent.
Sourcepub fn function_name(self, input: impl Into<String>) -> Self
pub fn function_name(self, input: impl Into<String>) -> Self
The name or ARN of the Lambda function, version, or alias.
Name formats
-
Function name –
my-function
(name-only),my-function:v1
(with alias). -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN –
123456789012:function:my-function
.
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.
Sourcepub fn set_function_name(self, input: Option<String>) -> Self
pub fn set_function_name(self, input: Option<String>) -> Self
The name or ARN of the Lambda function, version, or alias.
Name formats
-
Function name –
my-function
(name-only),my-function:v1
(with alias). -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN –
123456789012:function:my-function
.
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.
Sourcepub fn get_function_name(&self) -> &Option<String>
pub fn get_function_name(&self) -> &Option<String>
The name or ARN of the Lambda function, version, or alias.
Name formats
-
Function name –
my-function
(name-only),my-function:v1
(with alias). -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN –
123456789012:function:my-function
.
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.
Sourcepub fn statement_id(self, input: impl Into<String>) -> Self
pub fn statement_id(self, input: impl Into<String>) -> Self
A statement identifier that differentiates the statement from others in the same policy.
Sourcepub fn set_statement_id(self, input: Option<String>) -> Self
pub fn set_statement_id(self, input: Option<String>) -> Self
A statement identifier that differentiates the statement from others in the same policy.
Sourcepub fn get_statement_id(&self) -> &Option<String>
pub fn get_statement_id(&self) -> &Option<String>
A statement identifier that differentiates the statement from others in the same policy.
Sourcepub fn action(self, input: impl Into<String>) -> Self
pub fn action(self, input: impl Into<String>) -> Self
The action that the principal can use on the function. For example, lambda:InvokeFunction
or lambda:GetFunction
.
Sourcepub fn set_action(self, input: Option<String>) -> Self
pub fn set_action(self, input: Option<String>) -> Self
The action that the principal can use on the function. For example, lambda:InvokeFunction
or lambda:GetFunction
.
Sourcepub fn get_action(&self) -> &Option<String>
pub fn get_action(&self) -> &Option<String>
The action that the principal can use on the function. For example, lambda:InvokeFunction
or lambda:GetFunction
.
Sourcepub fn principal(self, input: impl Into<String>) -> Self
pub fn principal(self, input: impl Into<String>) -> Self
The Amazon Web Services service, Amazon Web Services account, IAM user, or IAM role that invokes the function. If you specify a service, use SourceArn
or SourceAccount
to limit who can invoke the function through that service.
Sourcepub fn set_principal(self, input: Option<String>) -> Self
pub fn set_principal(self, input: Option<String>) -> Self
The Amazon Web Services service, Amazon Web Services account, IAM user, or IAM role that invokes the function. If you specify a service, use SourceArn
or SourceAccount
to limit who can invoke the function through that service.
Sourcepub fn get_principal(&self) -> &Option<String>
pub fn get_principal(&self) -> &Option<String>
The Amazon Web Services service, Amazon Web Services account, IAM user, or IAM role that invokes the function. If you specify a service, use SourceArn
or SourceAccount
to limit who can invoke the function through that service.
Sourcepub fn source_arn(self, input: impl Into<String>) -> Self
pub fn source_arn(self, input: impl Into<String>) -> Self
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.
Note that Lambda configures the comparison using the StringLike
operator.
Sourcepub fn set_source_arn(self, input: Option<String>) -> Self
pub fn set_source_arn(self, input: Option<String>) -> Self
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.
Note that Lambda configures the comparison using the StringLike
operator.
Sourcepub fn get_source_arn(&self) -> &Option<String>
pub fn get_source_arn(&self) -> &Option<String>
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.
Note that Lambda configures the comparison using the StringLike
operator.
Sourcepub fn source_account(self, input: impl Into<String>) -> Self
pub fn source_account(self, input: impl Into<String>) -> Self
For Amazon Web Services service, the ID of the Amazon Web Services account that owns the resource. Use this together with SourceArn
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.
Sourcepub fn set_source_account(self, input: Option<String>) -> Self
pub fn set_source_account(self, input: Option<String>) -> Self
For Amazon Web Services service, the ID of the Amazon Web Services account that owns the resource. Use this together with SourceArn
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.
Sourcepub fn get_source_account(&self) -> &Option<String>
pub fn get_source_account(&self) -> &Option<String>
For Amazon Web Services service, the ID of the Amazon Web Services account that owns the resource. Use this together with SourceArn
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.
Sourcepub fn event_source_token(self, input: impl Into<String>) -> Self
pub fn event_source_token(self, input: impl Into<String>) -> Self
For Alexa Smart Home functions, a token that the invoker must supply.
Sourcepub fn set_event_source_token(self, input: Option<String>) -> Self
pub fn set_event_source_token(self, input: Option<String>) -> Self
For Alexa Smart Home functions, a token that the invoker must supply.
Sourcepub fn get_event_source_token(&self) -> &Option<String>
pub fn get_event_source_token(&self) -> &Option<String>
For Alexa Smart Home functions, a token that the invoker must supply.
Sourcepub fn qualifier(self, input: impl Into<String>) -> Self
pub fn qualifier(self, input: impl Into<String>) -> Self
Specify a version or alias to add permissions to a published version of the function.
Sourcepub fn set_qualifier(self, input: Option<String>) -> Self
pub fn set_qualifier(self, input: Option<String>) -> Self
Specify a version or alias to add permissions to a published version of the function.
Sourcepub fn get_qualifier(&self) -> &Option<String>
pub fn get_qualifier(&self) -> &Option<String>
Specify a version or alias to add permissions to a published version of the function.
Sourcepub fn revision_id(self, input: impl Into<String>) -> Self
pub fn revision_id(self, input: impl Into<String>) -> Self
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.
Sourcepub fn set_revision_id(self, input: Option<String>) -> Self
pub fn set_revision_id(self, input: Option<String>) -> Self
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.
Sourcepub fn get_revision_id(&self) -> &Option<String>
pub fn get_revision_id(&self) -> &Option<String>
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.
Sourcepub fn principal_org_id(self, input: impl Into<String>) -> Self
pub fn principal_org_id(self, input: impl Into<String>) -> Self
The identifier for your organization in Organizations. Use this to grant permissions to all the Amazon Web Services accounts under this organization.
Sourcepub fn set_principal_org_id(self, input: Option<String>) -> Self
pub fn set_principal_org_id(self, input: Option<String>) -> Self
The identifier for your organization in Organizations. Use this to grant permissions to all the Amazon Web Services accounts under this organization.
Sourcepub fn get_principal_org_id(&self) -> &Option<String>
pub fn get_principal_org_id(&self) -> &Option<String>
The identifier for your organization in Organizations. Use this to grant permissions to all the Amazon Web Services accounts under this organization.
Sourcepub fn function_url_auth_type(self, input: FunctionUrlAuthType) -> Self
pub fn function_url_auth_type(self, input: FunctionUrlAuthType) -> Self
The type of authentication that your function URL uses. Set to AWS_IAM
if you want to restrict access to authenticated users only. Set to NONE
if you want to bypass IAM authentication to create a public endpoint. For more information, see Security and auth model for Lambda function URLs.
Sourcepub fn set_function_url_auth_type(
self,
input: Option<FunctionUrlAuthType>,
) -> Self
pub fn set_function_url_auth_type( self, input: Option<FunctionUrlAuthType>, ) -> Self
The type of authentication that your function URL uses. Set to AWS_IAM
if you want to restrict access to authenticated users only. Set to NONE
if you want to bypass IAM authentication to create a public endpoint. For more information, see Security and auth model for Lambda function URLs.
Sourcepub fn get_function_url_auth_type(&self) -> &Option<FunctionUrlAuthType>
pub fn get_function_url_auth_type(&self) -> &Option<FunctionUrlAuthType>
The type of authentication that your function URL uses. Set to AWS_IAM
if you want to restrict access to authenticated users only. Set to NONE
if you want to bypass IAM authentication to create a public endpoint. For more information, see Security and auth model for Lambda function URLs.
Trait Implementations§
Source§impl Clone for AddPermissionFluentBuilder
impl Clone for AddPermissionFluentBuilder
Source§fn clone(&self) -> AddPermissionFluentBuilder
fn clone(&self) -> AddPermissionFluentBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for AddPermissionFluentBuilder
impl !RefUnwindSafe for AddPermissionFluentBuilder
impl Send for AddPermissionFluentBuilder
impl Sync for AddPermissionFluentBuilder
impl Unpin for AddPermissionFluentBuilder
impl !UnwindSafe for AddPermissionFluentBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute
value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
Quirk
value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition
value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);