Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License").
   * You may not use this file except in compliance with the License.
   * A copy of the License is located at
   * 
   *  http://aws.amazon.com/apache2.0
   * 
  * or in the "license" file accompanying this file. This file is distributed
  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  * express or implied. See the License for the specific language governing
  * permissions and limitations under the License.
  */
 package com.amazonaws.services.lambda.model;
 
 
Container for the parameters to the Invoke operation.

Invokes a specified Lambda function.

This operation requires permission for the lambda:InvokeFunction action.

 
 public class InvokeRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
The Lambda function name.

You can specify an unqualified function name (for example, "Thumbnail") or you can specify Amazon Resource Name (ARN) of the function (for example, "arn:aws:lambda:us-west-2:account-id:function:ThumbNail"). AWS Lambda also allows you to specify only the account ID qualifier (for example, "account-id:Thumbnail"). Note that the length constraint applies only to the ARN. If you specify only the function name, it is limited to 64 character in length.

Constraints:
Length: 1 - 111
Pattern: (arn:aws:lambda:)?([a-z]{2}-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)

 
     private String functionName;

    
By default, the Invoke API assumes "RequestResponse" invocation type. You can optionally request asynchronous execution by specifying "Event" as the InvocationType. You can also use this parameter to request AWS Lambda to not execute the function but do some verification, such as if the caller is authorized to invoke the function and if the inputs are valid. You request this by specifying "DryRun" as the InvocationType. This is useful in a cross-account scenario when you want to verify access to a function without running it.

Constraints:
Allowed Values: Event, RequestResponse, DryRun

 
     private String invocationType;

    
You can set this optional parameter to "Tail" in the request only if you specify the InvocationType parameter with value "RequestResponse". In this case, AWS Lambda returns the base64-encoded last 4 KB of log data produced by your Lambda function in the x-amz-log-results header.

Constraints:
Allowed Values: None, Tail

 
     private String logType;

    
Using the ClientContext you can pass client-specific information to the Lambda function you are invoking. You can then process the client information in your Lambda function as you choose through the context variable. For an example of a ClientContext JSON, go to PutEvents in the Amazon Mobile Analytics API Reference and User Guide.

The ClientContext JSON must be base64-encoded.

 
     private String clientContext;

    
JSON that you want to provide to your Lambda function as input.
 
     private java.nio.ByteBuffer payload;

    
The Lambda function name.

You can specify an unqualified function name (for example, "Thumbnail") or you can specify Amazon Resource Name (ARN) of the function (for example, "arn:aws:lambda:us-west-2:account-id:function:ThumbNail"). AWS Lambda also allows you to specify only the account ID qualifier (for example, "account-id:Thumbnail"). Note that the length constraint applies only to the ARN. If you specify only the function name, it is limited to 64 character in length.

Constraints:
Length: 1 - 111
Pattern: (arn:aws:lambda:)?([a-z]{2}-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)

Returns:
The Lambda function name.

You can specify an unqualified function name (for example, "Thumbnail") or you can specify Amazon Resource Name (ARN) of the function (for example, "arn:aws:lambda:us-west-2:account-id:function:ThumbNail"). AWS Lambda also allows you to specify only the account ID qualifier (for example, "account-id:Thumbnail"). Note that the length constraint applies only to the ARN. If you specify only the function name, it is limited to 64 character in length.

    public String getFunctionName() {
        return ;
    }
    
    
The Lambda function name.

You can specify an unqualified function name (for example, "Thumbnail") or you can specify Amazon Resource Name (ARN) of the function (for example, "arn:aws:lambda:us-west-2:account-id:function:ThumbNail"). AWS Lambda also allows you to specify only the account ID qualifier (for example, "account-id:Thumbnail"). Note that the length constraint applies only to the ARN. If you specify only the function name, it is limited to 64 character in length.

Constraints:
Length: 1 - 111
Pattern: (arn:aws:lambda:)?([a-z]{2}-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)

Parameters:
functionName The Lambda function name.

You can specify an unqualified function name (for example, "Thumbnail") or you can specify Amazon Resource Name (ARN) of the function (for example, "arn:aws:lambda:us-west-2:account-id:function:ThumbNail"). AWS Lambda also allows you to specify only the account ID qualifier (for example, "account-id:Thumbnail"). Note that the length constraint applies only to the ARN. If you specify only the function name, it is limited to 64 character in length.

    public void setFunctionName(String functionName) {
        this. = functionName;
    }
    
    
The Lambda function name.

You can specify an unqualified function name (for example, "Thumbnail") or you can specify Amazon Resource Name (ARN) of the function (for example, "arn:aws:lambda:us-west-2:account-id:function:ThumbNail"). AWS Lambda also allows you to specify only the account ID qualifier (for example, "account-id:Thumbnail"). Note that the length constraint applies only to the ARN. If you specify only the function name, it is limited to 64 character in length.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 - 111
Pattern: (arn:aws:lambda:)?([a-z]{2}-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)

Parameters:
functionName The Lambda function name.

You can specify an unqualified function name (for example, "Thumbnail") or you can specify Amazon Resource Name (ARN) of the function (for example, "arn:aws:lambda:us-west-2:account-id:function:ThumbNail"). AWS Lambda also allows you to specify only the account ID qualifier (for example, "account-id:Thumbnail"). Note that the length constraint applies only to the ARN. If you specify only the function name, it is limited to 64 character in length.

Returns:
A reference to this updated object so that method calls can be chained together.
    public InvokeRequest withFunctionName(String functionName) {
        this. = functionName;
        return this;
    }

    
By default, the Invoke API assumes "RequestResponse" invocation type. You can optionally request asynchronous execution by specifying "Event" as the InvocationType. You can also use this parameter to request AWS Lambda to not execute the function but do some verification, such as if the caller is authorized to invoke the function and if the inputs are valid. You request this by specifying "DryRun" as the InvocationType. This is useful in a cross-account scenario when you want to verify access to a function without running it.

Constraints:
Allowed Values: Event, RequestResponse, DryRun

Returns:
By default, the Invoke API assumes "RequestResponse" invocation type. You can optionally request asynchronous execution by specifying "Event" as the InvocationType. You can also use this parameter to request AWS Lambda to not execute the function but do some verification, such as if the caller is authorized to invoke the function and if the inputs are valid. You request this by specifying "DryRun" as the InvocationType. This is useful in a cross-account scenario when you want to verify access to a function without running it.
See also:
InvocationType
    public String getInvocationType() {
        return ;
    }
    
    
By default, the Invoke API assumes "RequestResponse" invocation type. You can optionally request asynchronous execution by specifying "Event" as the InvocationType. You can also use this parameter to request AWS Lambda to not execute the function but do some verification, such as if the caller is authorized to invoke the function and if the inputs are valid. You request this by specifying "DryRun" as the InvocationType. This is useful in a cross-account scenario when you want to verify access to a function without running it.

Constraints:
Allowed Values: Event, RequestResponse, DryRun

Parameters:
invocationType By default, the Invoke API assumes "RequestResponse" invocation type. You can optionally request asynchronous execution by specifying "Event" as the InvocationType. You can also use this parameter to request AWS Lambda to not execute the function but do some verification, such as if the caller is authorized to invoke the function and if the inputs are valid. You request this by specifying "DryRun" as the InvocationType. This is useful in a cross-account scenario when you want to verify access to a function without running it.
See also:
InvocationType
    public void setInvocationType(String invocationType) {
        this. = invocationType;
    }
    
    
By default, the Invoke API assumes "RequestResponse" invocation type. You can optionally request asynchronous execution by specifying "Event" as the InvocationType. You can also use this parameter to request AWS Lambda to not execute the function but do some verification, such as if the caller is authorized to invoke the function and if the inputs are valid. You request this by specifying "DryRun" as the InvocationType. This is useful in a cross-account scenario when you want to verify access to a function without running it.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: Event, RequestResponse, DryRun

Parameters:
invocationType By default, the Invoke API assumes "RequestResponse" invocation type. You can optionally request asynchronous execution by specifying "Event" as the InvocationType. You can also use this parameter to request AWS Lambda to not execute the function but do some verification, such as if the caller is authorized to invoke the function and if the inputs are valid. You request this by specifying "DryRun" as the InvocationType. This is useful in a cross-account scenario when you want to verify access to a function without running it.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
InvocationType
    public InvokeRequest withInvocationType(String invocationType) {
        this. = invocationType;
        return this;
    }

    
By default, the Invoke API assumes "RequestResponse" invocation type. You can optionally request asynchronous execution by specifying "Event" as the InvocationType. You can also use this parameter to request AWS Lambda to not execute the function but do some verification, such as if the caller is authorized to invoke the function and if the inputs are valid. You request this by specifying "DryRun" as the InvocationType. This is useful in a cross-account scenario when you want to verify access to a function without running it.

Constraints:
Allowed Values: Event, RequestResponse, DryRun

Parameters:
invocationType By default, the Invoke API assumes "RequestResponse" invocation type. You can optionally request asynchronous execution by specifying "Event" as the InvocationType. You can also use this parameter to request AWS Lambda to not execute the function but do some verification, such as if the caller is authorized to invoke the function and if the inputs are valid. You request this by specifying "DryRun" as the InvocationType. This is useful in a cross-account scenario when you want to verify access to a function without running it.
See also:
InvocationType
    public void setInvocationType(InvocationType invocationType) {
        this. = invocationType.toString();
    }
    
    
By default, the Invoke API assumes "RequestResponse" invocation type. You can optionally request asynchronous execution by specifying "Event" as the InvocationType. You can also use this parameter to request AWS Lambda to not execute the function but do some verification, such as if the caller is authorized to invoke the function and if the inputs are valid. You request this by specifying "DryRun" as the InvocationType. This is useful in a cross-account scenario when you want to verify access to a function without running it.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: Event, RequestResponse, DryRun

Parameters:
invocationType By default, the Invoke API assumes "RequestResponse" invocation type. You can optionally request asynchronous execution by specifying "Event" as the InvocationType. You can also use this parameter to request AWS Lambda to not execute the function but do some verification, such as if the caller is authorized to invoke the function and if the inputs are valid. You request this by specifying "DryRun" as the InvocationType. This is useful in a cross-account scenario when you want to verify access to a function without running it.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
InvocationType
    public InvokeRequest withInvocationType(InvocationType invocationType) {
        this. = invocationType.toString();
        return this;
    }

    
You can set this optional parameter to "Tail" in the request only if you specify the InvocationType parameter with value "RequestResponse". In this case, AWS Lambda returns the base64-encoded last 4 KB of log data produced by your Lambda function in the x-amz-log-results header.

Constraints:
Allowed Values: None, Tail

Returns:
You can set this optional parameter to "Tail" in the request only if you specify the InvocationType parameter with value "RequestResponse". In this case, AWS Lambda returns the base64-encoded last 4 KB of log data produced by your Lambda function in the x-amz-log-results header.
See also:
LogType
    public String getLogType() {
        return ;
    }
    
    
You can set this optional parameter to "Tail" in the request only if you specify the InvocationType parameter with value "RequestResponse". In this case, AWS Lambda returns the base64-encoded last 4 KB of log data produced by your Lambda function in the x-amz-log-results header.

Constraints:
Allowed Values: None, Tail

Parameters:
logType You can set this optional parameter to "Tail" in the request only if you specify the InvocationType parameter with value "RequestResponse". In this case, AWS Lambda returns the base64-encoded last 4 KB of log data produced by your Lambda function in the x-amz-log-results header.
See also:
LogType
    public void setLogType(String logType) {
        this. = logType;
    }
    
    
You can set this optional parameter to "Tail" in the request only if you specify the InvocationType parameter with value "RequestResponse". In this case, AWS Lambda returns the base64-encoded last 4 KB of log data produced by your Lambda function in the x-amz-log-results header.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: None, Tail

Parameters:
logType You can set this optional parameter to "Tail" in the request only if you specify the InvocationType parameter with value "RequestResponse". In this case, AWS Lambda returns the base64-encoded last 4 KB of log data produced by your Lambda function in the x-amz-log-results header.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
LogType
    public InvokeRequest withLogType(String logType) {
        this. = logType;
        return this;
    }

    
You can set this optional parameter to "Tail" in the request only if you specify the InvocationType parameter with value "RequestResponse". In this case, AWS Lambda returns the base64-encoded last 4 KB of log data produced by your Lambda function in the x-amz-log-results header.

Constraints:
Allowed Values: None, Tail

Parameters:
logType You can set this optional parameter to "Tail" in the request only if you specify the InvocationType parameter with value "RequestResponse". In this case, AWS Lambda returns the base64-encoded last 4 KB of log data produced by your Lambda function in the x-amz-log-results header.
See also:
LogType
    public void setLogType(LogType logType) {
        this. = logType.toString();
    }
    
    
You can set this optional parameter to "Tail" in the request only if you specify the InvocationType parameter with value "RequestResponse". In this case, AWS Lambda returns the base64-encoded last 4 KB of log data produced by your Lambda function in the x-amz-log-results header.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: None, Tail

Parameters:
logType You can set this optional parameter to "Tail" in the request only if you specify the InvocationType parameter with value "RequestResponse". In this case, AWS Lambda returns the base64-encoded last 4 KB of log data produced by your Lambda function in the x-amz-log-results header.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
LogType
    public InvokeRequest withLogType(LogType logType) {
        this. = logType.toString();
        return this;
    }

    
Using the ClientContext you can pass client-specific information to the Lambda function you are invoking. You can then process the client information in your Lambda function as you choose through the context variable. For an example of a ClientContext JSON, go to PutEvents in the Amazon Mobile Analytics API Reference and User Guide.

The ClientContext JSON must be base64-encoded.

Returns:
Using the ClientContext you can pass client-specific information to the Lambda function you are invoking. You can then process the client information in your Lambda function as you choose through the context variable. For an example of a ClientContext JSON, go to PutEvents in the Amazon Mobile Analytics API Reference and User Guide.

The ClientContext JSON must be base64-encoded.

    public String getClientContext() {
        return ;
    }
    
    
Using the ClientContext you can pass client-specific information to the Lambda function you are invoking. You can then process the client information in your Lambda function as you choose through the context variable. For an example of a ClientContext JSON, go to PutEvents in the Amazon Mobile Analytics API Reference and User Guide.

The ClientContext JSON must be base64-encoded.

Parameters:
clientContext Using the ClientContext you can pass client-specific information to the Lambda function you are invoking. You can then process the client information in your Lambda function as you choose through the context variable. For an example of a ClientContext JSON, go to PutEvents in the Amazon Mobile Analytics API Reference and User Guide.

The ClientContext JSON must be base64-encoded.

    public void setClientContext(String clientContext) {
        this. = clientContext;
    }
    
    
Using the ClientContext you can pass client-specific information to the Lambda function you are invoking. You can then process the client information in your Lambda function as you choose through the context variable. For an example of a ClientContext JSON, go to PutEvents in the Amazon Mobile Analytics API Reference and User Guide.

The ClientContext JSON must be base64-encoded.

Returns a reference to this object so that method calls can be chained together.

Parameters:
clientContext Using the ClientContext you can pass client-specific information to the Lambda function you are invoking. You can then process the client information in your Lambda function as you choose through the context variable. For an example of a ClientContext JSON, go to PutEvents in the Amazon Mobile Analytics API Reference and User Guide.

The ClientContext JSON must be base64-encoded.

Returns:
A reference to this updated object so that method calls can be chained together.
    public InvokeRequest withClientContext(String clientContext) {
        this. = clientContext;
        return this;
    }

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

Returns:
JSON that you want to provide to your Lambda function as input.
    public java.nio.ByteBuffer getPayload() {
        return ;
    }
    
    
JSON that you want to provide to your Lambda function as input.

Parameters:
payload JSON that you want to provide to your Lambda function as input.
    public void setPayload(java.nio.ByteBuffer payload) {
        this. = payload;
    }
    
    
JSON that you want to provide to your Lambda function as input.

Returns a reference to this object so that method calls can be chained together.

Parameters:
payload JSON that you want to provide to your Lambda function as input.
Returns:
A reference to this updated object so that method calls can be chained together.
    public InvokeRequest withPayload(java.nio.ByteBuffer payload) {
        this. = payload;
        return this;
    }

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

Parameters:
payload JSON that you want to provide to your Lambda function as input.
    public void setPayload(String payload) {
        if (payload == null) {
            this. = null;
        } else {
            this. = java.nio.ByteBuffer.wrap(payload.getBytes(....));
        }
    }
    
    
JSON that you want to provide to your Lambda function as input.

Returns a reference to this object so that method calls can be chained together.

Parameters:
payload JSON that you want to provide to your Lambda function as input.
Returns:
A reference to this updated object so that method calls can be chained together.
    public InvokeRequest withPayload(String payload) {
        setPayload(payload);
        return this;
    }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getFunctionName() != nullsb.append("FunctionName: " + getFunctionName() + ",");
        if (getInvocationType() != nullsb.append("InvocationType: " + getInvocationType() + ",");
        if (getLogType() != nullsb.append("LogType: " + getLogType() + ",");
        if (getClientContext() != nullsb.append("ClientContext: " + getClientContext() + ",");
        if (getPayload() != nullsb.append("Payload: " + getPayload() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getFunctionName() == null) ? 0 : getFunctionName().hashCode()); 
        hashCode = prime * hashCode + ((getInvocationType() == null) ? 0 : getInvocationType().hashCode()); 
        hashCode = prime * hashCode + ((getLogType() == null) ? 0 : getLogType().hashCode()); 
        hashCode = prime * hashCode + ((getClientContext() == null) ? 0 : getClientContext().hashCode()); 
        hashCode = prime * hashCode + ((getPayload() == null) ? 0 : getPayload().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof InvokeRequest == falsereturn false;
        InvokeRequest other = (InvokeRequest)obj;
        
        if (other.getFunctionName() == null ^ this.getFunctionName() == nullreturn false;
        if (other.getFunctionName() != null && other.getFunctionName().equals(this.getFunctionName()) == falsereturn false
        if (other.getInvocationType() == null ^ this.getInvocationType() == nullreturn false;
        if (other.getInvocationType() != null && other.getInvocationType().equals(this.getInvocationType()) == falsereturn false
        if (other.getLogType() == null ^ this.getLogType() == nullreturn false;
        if (other.getLogType() != null && other.getLogType().equals(this.getLogType()) == falsereturn false
        if (other.getClientContext() == null ^ this.getClientContext() == nullreturn false;
        if (other.getClientContext() != null && other.getClientContext().equals(this.getClientContext()) == falsereturn false
        if (other.getPayload() == null ^ this.getPayload() == nullreturn false;
        if (other.getPayload() != null && other.getPayload().equals(this.getPayload()) == falsereturn false
        return true;
    }
    
    @Override
    public InvokeRequest clone() {
        
            return (InvokeRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X