Class InvokeResult
- java.lang.Object
-
- com.amazonaws.services.lambda.model.InvokeResult
-
- All Implemented Interfaces:
Serializable,Cloneable
public class InvokeResult extends Object implements Serializable, Cloneable
Upon success, returns an empty response. Otherwise, throws an exception.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description InvokeResult()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InvokeResultclone()booleanequals(Object obj)StringgetFunctionError()Indicates whether an error occurred while executing the Lambda function.StringgetLogResult()It is the base64-encoded logs for the Lambda function invocation.ByteBuffergetPayload()It is the JSON representation of the object returned by the Lambda function.IntegergetStatusCode()The HTTP status code will be in the 200 range for successful request.inthashCode()voidsetFunctionError(String functionError)Indicates whether an error occurred while executing the Lambda function.voidsetLogResult(String logResult)It is the base64-encoded logs for the Lambda function invocation.voidsetPayload(ByteBuffer payload)It is the JSON representation of the object returned by the Lambda function.voidsetStatusCode(Integer statusCode)The HTTP status code will be in the 200 range for successful request.StringtoString()Returns a string representation of this object; useful for testing and debugging.InvokeResultwithFunctionError(String functionError)Indicates whether an error occurred while executing the Lambda function.InvokeResultwithLogResult(String logResult)It is the base64-encoded logs for the Lambda function invocation.InvokeResultwithPayload(ByteBuffer payload)It is the JSON representation of the object returned by the Lambda function.InvokeResultwithStatusCode(Integer statusCode)The HTTP status code will be in the 200 range for successful request.
-
-
-
Method Detail
-
setStatusCode
public void setStatusCode(Integer statusCode)
The HTTP status code will be in the 200 range for successful request. For the
RequestResonseinvocation type this status code will be 200. For theEventinvocation type this status code will be 202. For theDryRuninvocation type the status code will be 204.- Parameters:
statusCode- The HTTP status code will be in the 200 range for successful request. For theRequestResonseinvocation type this status code will be 200. For theEventinvocation type this status code will be 202. For theDryRuninvocation type the status code will be 204.
-
getStatusCode
public Integer getStatusCode()
The HTTP status code will be in the 200 range for successful request. For the
RequestResonseinvocation type this status code will be 200. For theEventinvocation type this status code will be 202. For theDryRuninvocation type the status code will be 204.- Returns:
- The HTTP status code will be in the 200 range for successful
request. For the
RequestResonseinvocation type this status code will be 200. For theEventinvocation type this status code will be 202. For theDryRuninvocation type the status code will be 204.
-
withStatusCode
public InvokeResult withStatusCode(Integer statusCode)
The HTTP status code will be in the 200 range for successful request. For the
RequestResonseinvocation type this status code will be 200. For theEventinvocation type this status code will be 202. For theDryRuninvocation type the status code will be 204.- Parameters:
statusCode- The HTTP status code will be in the 200 range for successful request. For theRequestResonseinvocation type this status code will be 200. For theEventinvocation type this status code will be 202. For theDryRuninvocation type the status code will be 204.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setFunctionError
public void setFunctionError(String functionError)
Indicates whether an error occurred while executing the Lambda function. If an error occurred this field will have one of two values;
HandledorUnhandled.Handlederrors are errors that are reported by the function while theUnhandlederrors are those detected and reported by AWS Lambda. Unhandled errors include out of memory errors and function timeouts. For information about how to report anHandlederror, see Programming Model.- Parameters:
functionError- Indicates whether an error occurred while executing the Lambda function. If an error occurred this field will have one of two values;HandledorUnhandled.Handlederrors are errors that are reported by the function while theUnhandlederrors are those detected and reported by AWS Lambda. Unhandled errors include out of memory errors and function timeouts. For information about how to report anHandlederror, see Programming Model.
-
getFunctionError
public String getFunctionError()
Indicates whether an error occurred while executing the Lambda function. If an error occurred this field will have one of two values;
HandledorUnhandled.Handlederrors are errors that are reported by the function while theUnhandlederrors are those detected and reported by AWS Lambda. Unhandled errors include out of memory errors and function timeouts. For information about how to report anHandlederror, see Programming Model.- Returns:
- Indicates whether an error occurred while executing the Lambda
function. If an error occurred this field will have one of two
values;
HandledorUnhandled.Handlederrors are errors that are reported by the function while theUnhandlederrors are those detected and reported by AWS Lambda. Unhandled errors include out of memory errors and function timeouts. For information about how to report anHandlederror, see Programming Model.
-
withFunctionError
public InvokeResult withFunctionError(String functionError)
Indicates whether an error occurred while executing the Lambda function. If an error occurred this field will have one of two values;
HandledorUnhandled.Handlederrors are errors that are reported by the function while theUnhandlederrors are those detected and reported by AWS Lambda. Unhandled errors include out of memory errors and function timeouts. For information about how to report anHandlederror, see Programming Model.- Parameters:
functionError- Indicates whether an error occurred while executing the Lambda function. If an error occurred this field will have one of two values;HandledorUnhandled.Handlederrors are errors that are reported by the function while theUnhandlederrors are those detected and reported by AWS Lambda. Unhandled errors include out of memory errors and function timeouts. For information about how to report anHandlederror, see Programming Model.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setLogResult
public void setLogResult(String logResult)
It is the base64-encoded logs for the Lambda function invocation. This is present only if the invocation type is
RequestResponseand the logs were requested.- Parameters:
logResult- It is the base64-encoded logs for the Lambda function invocation. This is present only if the invocation type isRequestResponseand the logs were requested.
-
getLogResult
public String getLogResult()
It is the base64-encoded logs for the Lambda function invocation. This is present only if the invocation type is
RequestResponseand the logs were requested.- Returns:
- It is the base64-encoded logs for the Lambda function invocation.
This is present only if the invocation type is
RequestResponseand the logs were requested.
-
withLogResult
public InvokeResult withLogResult(String logResult)
It is the base64-encoded logs for the Lambda function invocation. This is present only if the invocation type is
RequestResponseand the logs were requested.- Parameters:
logResult- It is the base64-encoded logs for the Lambda function invocation. This is present only if the invocation type isRequestResponseand the logs were requested.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setPayload
public void setPayload(ByteBuffer payload)
It is the JSON representation of the object returned by the Lambda function. In This is present only if the invocation type is
RequestResponse.In the event of a function error this field contains a message describing the error. For the
Handlederrors the Lambda function will report this message. ForUnhandlederrors AWS Lambda reports the message.AWS SDK for Java performs a Base64 encoding on this field before sending this request to AWS service by default. Users of the SDK should not perform Base64 encoding on this field.
Warning: ByteBuffers returned by the SDK are mutable. Changes to the content or position of the byte buffer will be seen by all objects that have a reference to this object. It is recommended to call ByteBuffer.duplicate() or ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. This behavior will be changed in a future major version of the SDK.
- Parameters:
payload- It is the JSON representation of the object returned by the Lambda function. In This is present only if the invocation type isRequestResponse.In the event of a function error this field contains a message describing the error. For the
Handlederrors the Lambda function will report this message. ForUnhandlederrors AWS Lambda reports the message.
-
getPayload
public ByteBuffer getPayload()
It is the JSON representation of the object returned by the Lambda function. In This is present only if the invocation type is
RequestResponse.In the event of a function error this field contains a message describing the error. For the
Handlederrors the Lambda function will report this message. ForUnhandlederrors AWS Lambda reports the message.ByteBuffers are stateful. Calling theirgetmethods changes theirposition. We recommend usingByteBuffer.asReadOnlyBuffer()to create a read-only view of the buffer with an independentposition, and callinggetmethods on this rather than directly on the returnedByteBuffer. Doing so will ensure that anyone else using theByteBufferwill not be affected by changes to theposition.- Returns:
- It is the JSON representation of the object returned by the
Lambda function. In This is present only if the invocation type
is
RequestResponse.In the event of a function error this field contains a message describing the error. For the
Handlederrors the Lambda function will report this message. ForUnhandlederrors AWS Lambda reports the message.
-
withPayload
public InvokeResult withPayload(ByteBuffer payload)
It is the JSON representation of the object returned by the Lambda function. In This is present only if the invocation type is
RequestResponse.In the event of a function error this field contains a message describing the error. For the
Handlederrors the Lambda function will report this message. ForUnhandlederrors AWS Lambda reports the message.- Parameters:
payload- It is the JSON representation of the object returned by the Lambda function. In This is present only if the invocation type isRequestResponse.In the event of a function error this field contains a message describing the error. For the
Handlederrors the Lambda function will report this message. ForUnhandlederrors AWS Lambda reports the message.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
toString
public String toString()
Returns a string representation of this object; useful for testing and debugging.- Overrides:
toStringin classObject- Returns:
- A string representation of this object.
- See Also:
Object.toString()
-
clone
public InvokeResult clone()
-
-