pub struct Builder { /* private fields */ }
Expand description

A builder for InvokeInput.

Implementations§

The name 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.

Examples found in repository?
src/client.rs (line 5142)
5141
5142
5143
5144
        pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
            self.inner = self.inner.function_name(input.into());
            self
        }

The name 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.

Examples found in repository?
src/client.rs (line 5157)
5153
5154
5155
5156
5157
5158
5159
        pub fn set_function_name(
            mut self,
            input: std::option::Option<std::string::String>,
        ) -> Self {
            self.inner = self.inner.set_function_name(input);
            self
        }

Choose from the following options.

  • RequestResponse (default) - Invoke the function synchronously. Keep the connection open until the function returns a response or times out. The API response includes the function response and additional data.

  • Event - Invoke the function asynchronously. Send events that fail multiple times to the function's dead-letter queue (if it's configured). The API response only includes a status code.

  • DryRun - Validate parameter values and verify that the user or role has permission to invoke the function.

Examples found in repository?
src/client.rs (line 5167)
5166
5167
5168
5169
        pub fn invocation_type(mut self, input: crate::model::InvocationType) -> Self {
            self.inner = self.inner.invocation_type(input);
            self
        }

Choose from the following options.

  • RequestResponse (default) - Invoke the function synchronously. Keep the connection open until the function returns a response or times out. The API response includes the function response and additional data.

  • Event - Invoke the function asynchronously. Send events that fail multiple times to the function's dead-letter queue (if it's configured). The API response only includes a status code.

  • DryRun - Validate parameter values and verify that the user or role has permission to invoke the function.

Examples found in repository?
src/client.rs (line 5180)
5176
5177
5178
5179
5180
5181
5182
        pub fn set_invocation_type(
            mut self,
            input: std::option::Option<crate::model::InvocationType>,
        ) -> Self {
            self.inner = self.inner.set_invocation_type(input);
            self
        }

Set to Tail to include the execution log in the response. Applies to synchronously invoked functions only.

Examples found in repository?
src/client.rs (line 5185)
5184
5185
5186
5187
        pub fn log_type(mut self, input: crate::model::LogType) -> Self {
            self.inner = self.inner.log_type(input);
            self
        }

Set to Tail to include the execution log in the response. Applies to synchronously invoked functions only.

Examples found in repository?
src/client.rs (line 5190)
5189
5190
5191
5192
        pub fn set_log_type(mut self, input: std::option::Option<crate::model::LogType>) -> Self {
            self.inner = self.inner.set_log_type(input);
            self
        }

Up to 3583 bytes of base64-encoded data about the invoking client to pass to the function in the context object.

Examples found in repository?
src/client.rs (line 5195)
5194
5195
5196
5197
        pub fn client_context(mut self, input: impl Into<std::string::String>) -> Self {
            self.inner = self.inner.client_context(input.into());
            self
        }

Up to 3583 bytes of base64-encoded data about the invoking client to pass to the function in the context object.

Examples found in repository?
src/client.rs (line 5203)
5199
5200
5201
5202
5203
5204
5205
        pub fn set_client_context(
            mut self,
            input: std::option::Option<std::string::String>,
        ) -> Self {
            self.inner = self.inner.set_client_context(input);
            self
        }

The JSON that you want to provide to your Lambda function as input.

You can enter the JSON directly. For example, --payload '{ "key": "value" }'. You can also specify a file path. For example, --payload file://payload.json.

Examples found in repository?
src/client.rs (line 5209)
5208
5209
5210
5211
        pub fn payload(mut self, input: aws_smithy_types::Blob) -> Self {
            self.inner = self.inner.payload(input);
            self
        }

The JSON that you want to provide to your Lambda function as input.

You can enter the JSON directly. For example, --payload '{ "key": "value" }'. You can also specify a file path. For example, --payload file://payload.json.

Examples found in repository?
src/client.rs (line 5215)
5214
5215
5216
5217
        pub fn set_payload(mut self, input: std::option::Option<aws_smithy_types::Blob>) -> Self {
            self.inner = self.inner.set_payload(input);
            self
        }

Specify a version or alias to invoke a published version of the function.

Examples found in repository?
src/client.rs (line 5220)
5219
5220
5221
5222
        pub fn qualifier(mut self, input: impl Into<std::string::String>) -> Self {
            self.inner = self.inner.qualifier(input.into());
            self
        }

Specify a version or alias to invoke a published version of the function.

Examples found in repository?
src/client.rs (line 5225)
5224
5225
5226
5227
        pub fn set_qualifier(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.inner = self.inner.set_qualifier(input);
            self
        }

Consumes the builder and constructs a InvokeInput.

Examples found in repository?
src/client.rs (line 5102)
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
        pub async fn customize(
            self,
        ) -> std::result::Result<
            crate::operation::customize::CustomizableOperation<
                crate::operation::Invoke,
                aws_http::retry::AwsResponseRetryClassifier,
            >,
            aws_smithy_http::result::SdkError<crate::error::InvokeError>,
        > {
            let handle = self.handle.clone();
            let operation = self
                .inner
                .build()
                .map_err(aws_smithy_http::result::SdkError::construction_failure)?
                .make_operation(&handle.conf)
                .await
                .map_err(aws_smithy_http::result::SdkError::construction_failure)?;
            Ok(crate::operation::customize::CustomizableOperation { handle, operation })
        }

        /// 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](aws_smithy_types::retry::RetryConfig), which can be
        /// set when configuring the client.
        pub async fn send(
            self,
        ) -> std::result::Result<
            crate::output::InvokeOutput,
            aws_smithy_http::result::SdkError<crate::error::InvokeError>,
        > {
            let op = self
                .inner
                .build()
                .map_err(aws_smithy_http::result::SdkError::construction_failure)?
                .make_operation(&self.handle.conf)
                .await
                .map_err(aws_smithy_http::result::SdkError::construction_failure)?;
            self.handle.client.call(op).await
        }

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more