AWS SDK for C++  0.12.9
AWS SDK for C++
InvokeResult.h
Go to the documentation of this file.
1 /*
2 * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License").
5 * You may not use this file except in compliance with the License.
6 * A copy of the License is located at
7 *
8 * http://aws.amazon.com/apache2.0
9 *
10 * or in the "license" file accompanying this file. This file is distributed
11 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 * express or implied. See the License for the specific language governing
13 * permissions and limitations under the License.
14 */
15 #pragma once
19 #include <aws/core/utils/Array.h>
20 
21 namespace Aws
22 {
23 template<typename RESULT_TYPE>
24 class AmazonWebServiceResult;
25 
26 namespace Lambda
27 {
28 namespace Model
29 {
34  {
35  public:
36  InvokeResult();
37  //We have to define these because Microsoft doesn't auto generate them
39  InvokeResult& operator=(InvokeResult&&);
40  //we delete these because Microsoft doesn't handle move generation correctly
41  //and we therefore don't trust them to get it right here either.
42  InvokeResult(const InvokeResult&) = delete;
43  InvokeResult& operator=(const InvokeResult&) = delete;
44 
45 
48 
49 
56  inline long GetStatusCode() const{ return m_statusCode; }
57 
64  inline void SetStatusCode(long value) { m_statusCode = value; }
65 
72  inline InvokeResult& WithStatusCode(long value) { SetStatusCode(value); return *this;}
73 
85  inline const Aws::String& GetFunctionError() const{ return m_functionError; }
86 
98  inline void SetFunctionError(const Aws::String& value) { m_functionError = value; }
99 
111  inline void SetFunctionError(Aws::String&& value) { m_functionError = value; }
112 
124  inline void SetFunctionError(const char* value) { m_functionError.assign(value); }
125 
137  inline InvokeResult& WithFunctionError(const Aws::String& value) { SetFunctionError(value); return *this;}
138 
150  inline InvokeResult& WithFunctionError(Aws::String&& value) { SetFunctionError(value); return *this;}
151 
163  inline InvokeResult& WithFunctionError(const char* value) { SetFunctionError(value); return *this;}
164 
170  inline const Aws::String& GetLogResult() const{ return m_logResult; }
171 
177  inline void SetLogResult(const Aws::String& value) { m_logResult = value; }
178 
184  inline void SetLogResult(Aws::String&& value) { m_logResult = value; }
185 
191  inline void SetLogResult(const char* value) { m_logResult.assign(value); }
192 
198  inline InvokeResult& WithLogResult(const Aws::String& value) { SetLogResult(value); return *this;}
199 
205  inline InvokeResult& WithLogResult(Aws::String&& value) { SetLogResult(value); return *this;}
206 
212  inline InvokeResult& WithLogResult(const char* value) { SetLogResult(value); return *this;}
213 
222  inline Aws::IOStream& GetPayload() { return m_payload.GetUnderlyingStream(); }
223 
224  private:
225  long m_statusCode;
226  Aws::String m_functionError;
227  Aws::String m_logResult;
229  };
230 
231 } // namespace Model
232 } // namespace Lambda
233 } // namespace Aws
InvokeResult & WithLogResult(Aws::String &&value)
Definition: InvokeResult.h:205
void SetFunctionError(const char *value)
Definition: InvokeResult.h:124
InvokeResult & WithFunctionError(const Aws::String &value)
Definition: InvokeResult.h:137
const Aws::String & GetFunctionError() const
Definition: InvokeResult.h:85
void SetFunctionError(Aws::String &&value)
Definition: InvokeResult.h:111
void SetFunctionError(const Aws::String &value)
Definition: InvokeResult.h:98
#define AWS_LAMBDA_API
const Aws::String & GetLogResult() const
Definition: InvokeResult.h:170
std::basic_iostream< char, std::char_traits< char > > IOStream
Definition: AWSStreamFwd.h:32
void SetLogResult(const Aws::String &value)
Definition: InvokeResult.h:177
InvokeResult & WithLogResult(const char *value)
Definition: InvokeResult.h:212
InvokeResult & WithFunctionError(Aws::String &&value)
Definition: InvokeResult.h:150
InvokeResult & WithFunctionError(const char *value)
Definition: InvokeResult.h:163
void SetLogResult(const char *value)
Definition: InvokeResult.h:191
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
Definition: AWSString.h:97
void SetLogResult(Aws::String &&value)
Definition: InvokeResult.h:184
JSON (JavaScript Object Notation).
InvokeResult & WithStatusCode(long value)
Definition: InvokeResult.h:72
InvokeResult & WithLogResult(const Aws::String &value)
Definition: InvokeResult.h:198