AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

This is the response object from the Invoke operation.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceResponse
    Amazon.Lambda.Model.InvokeResponse

Namespace: Amazon.Lambda.Model
Assembly: AWSSDK.Lambda.dll
Version: 3.x.y.z

Syntax

C#
public class InvokeResponse : AmazonWebServiceResponse

The InvokeResponse type exposes the following members

Constructors

NameDescription
Public Method InvokeResponse()

Properties

NameTypeDescription
Public Property ContentLength System.Int64 Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property ExecutedVersion System.String

Gets and sets the property ExecutedVersion.

The version of the function that executed. When you invoke a function with an alias, this indicates which version the alias resolved to.

Public Property FunctionError System.String

Gets and sets the property FunctionError.

If present, indicates that an error occurred during function execution. Details about the error are included in the response payload.

Public Property HttpStatusCode System.Net.HttpStatusCode Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property LogResult System.String

Gets and sets the property LogResult.

The last 4 KB of the execution log, which is base64-encoded.

Public Property Payload System.IO.MemoryStream

Gets and sets the property Payload.

The response from the function, or an error object.

Public Property ResponseMetadata Amazon.Runtime.ResponseMetadata Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property StatusCode System.Int32

Gets and sets the property StatusCode.

The HTTP status code is in the 200 range for a successful request. For the RequestResponse invocation type, this status code is 200. For the Event invocation type, this status code is 202. For the DryRun invocation type, the status code is 204.

Examples

The following example invokes version 1 of a function named my-function with an empty event payload.

To invoke a Lambda function


var response = client.Invoke(new InvokeRequest 
{
    FunctionName = "my-function",
    Qualifier = "1"
});

MemoryStream payload = response.Payload;
int statusCode = response.StatusCode;

            

The following example invokes version 1 of a function named my-function asynchronously.

To invoke a Lambda function asynchronously


var response = client.Invoke(new InvokeRequest 
{
    FunctionName = "my-function",
    InvocationType = "Event",
    Qualifier = "1"
});

MemoryStream payload = response.Payload;
int statusCode = response.StatusCode;

            

Version Information

.NET Core App:
Supported in: 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5, 4.0, 3.5