/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include namespace Aws { template class AmazonWebServiceResult; namespace Lambda { namespace Model { class InvokeResult { public: AWS_LAMBDA_API InvokeResult(); //We have to define these because Microsoft doesn't auto generate them AWS_LAMBDA_API InvokeResult(InvokeResult&&); AWS_LAMBDA_API InvokeResult& operator=(InvokeResult&&); //we delete these because Microsoft doesn't handle move generation correctly //and we therefore don't trust them to get it right here either. InvokeResult(const InvokeResult&) = delete; InvokeResult& operator=(const InvokeResult&) = delete; AWS_LAMBDA_API InvokeResult(Aws::AmazonWebServiceResult&& result); AWS_LAMBDA_API InvokeResult& operator=(Aws::AmazonWebServiceResult&& result); /** *

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.

*/ inline int GetStatusCode() const{ return m_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.

*/ inline void SetStatusCode(int value) { m_statusCode = value; } /** *

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.

*/ inline InvokeResult& WithStatusCode(int value) { SetStatusCode(value); return *this;} /** *

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

*/ inline const Aws::String& GetFunctionError() const{ return m_functionError; } /** *

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

*/ inline void SetFunctionError(const Aws::String& value) { m_functionError = value; } /** *

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

*/ inline void SetFunctionError(Aws::String&& value) { m_functionError = std::move(value); } /** *

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

*/ inline void SetFunctionError(const char* value) { m_functionError.assign(value); } /** *

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

*/ inline InvokeResult& WithFunctionError(const Aws::String& value) { SetFunctionError(value); return *this;} /** *

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

*/ inline InvokeResult& WithFunctionError(Aws::String&& value) { SetFunctionError(std::move(value)); return *this;} /** *

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

*/ inline InvokeResult& WithFunctionError(const char* value) { SetFunctionError(value); return *this;} /** *

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

*/ inline const Aws::String& GetLogResult() const{ return m_logResult; } /** *

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

*/ inline void SetLogResult(const Aws::String& value) { m_logResult = value; } /** *

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

*/ inline void SetLogResult(Aws::String&& value) { m_logResult = std::move(value); } /** *

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

*/ inline void SetLogResult(const char* value) { m_logResult.assign(value); } /** *

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

*/ inline InvokeResult& WithLogResult(const Aws::String& value) { SetLogResult(value); return *this;} /** *

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

*/ inline InvokeResult& WithLogResult(Aws::String&& value) { SetLogResult(std::move(value)); return *this;} /** *

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

*/ inline InvokeResult& WithLogResult(const char* value) { SetLogResult(value); return *this;} /** *

The response from the function, or an error object.

*/ inline Aws::IOStream& GetPayload() const { return m_payload.GetUnderlyingStream(); } /** *

The response from the function, or an error object.

*/ inline void ReplaceBody(Aws::IOStream* body) { m_payload = Aws::Utils::Stream::ResponseStream(body); } /** *

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

*/ inline const Aws::String& GetExecutedVersion() const{ return m_executedVersion; } /** *

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

*/ inline void SetExecutedVersion(const Aws::String& value) { m_executedVersion = value; } /** *

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

*/ inline void SetExecutedVersion(Aws::String&& value) { m_executedVersion = std::move(value); } /** *

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

*/ inline void SetExecutedVersion(const char* value) { m_executedVersion.assign(value); } /** *

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

*/ inline InvokeResult& WithExecutedVersion(const Aws::String& value) { SetExecutedVersion(value); return *this;} /** *

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

*/ inline InvokeResult& WithExecutedVersion(Aws::String&& value) { SetExecutedVersion(std::move(value)); return *this;} /** *

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

*/ inline InvokeResult& WithExecutedVersion(const char* value) { SetExecutedVersion(value); return *this;} inline const Aws::String& GetRequestId() const{ return m_requestId; } inline void SetRequestId(const Aws::String& value) { m_requestId = value; } inline void SetRequestId(Aws::String&& value) { m_requestId = std::move(value); } inline void SetRequestId(const char* value) { m_requestId.assign(value); } inline InvokeResult& WithRequestId(const Aws::String& value) { SetRequestId(value); return *this;} inline InvokeResult& WithRequestId(Aws::String&& value) { SetRequestId(std::move(value)); return *this;} inline InvokeResult& WithRequestId(const char* value) { SetRequestId(value); return *this;} private: int m_statusCode; Aws::String m_functionError; Aws::String m_logResult; Aws::Utils::Stream::ResponseStream m_payload; Aws::String m_executedVersion; Aws::String m_requestId; }; } // namespace Model } // namespace Lambda } // namespace Aws