1 /**
2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 * SPDX-License-Identifier: Apache-2.0.
4 */
5
6 #include <aws/apigatewayv2/model/CreateRouteResponseRequest.h>
7 #include <aws/core/utils/json/JsonSerializer.h>
8
9 #include <utility>
10
11 using namespace Aws::ApiGatewayV2::Model;
12 using namespace Aws::Utils::Json;
13 using namespace Aws::Utils;
14
CreateRouteResponseRequest()15 CreateRouteResponseRequest::CreateRouteResponseRequest() :
16 m_apiIdHasBeenSet(false),
17 m_modelSelectionExpressionHasBeenSet(false),
18 m_responseModelsHasBeenSet(false),
19 m_responseParametersHasBeenSet(false),
20 m_routeIdHasBeenSet(false),
21 m_routeResponseKeyHasBeenSet(false)
22 {
23 }
24
SerializePayload() const25 Aws::String CreateRouteResponseRequest::SerializePayload() const
26 {
27 JsonValue payload;
28
29 if(m_modelSelectionExpressionHasBeenSet)
30 {
31 payload.WithString("modelSelectionExpression", m_modelSelectionExpression);
32
33 }
34
35 if(m_responseModelsHasBeenSet)
36 {
37 JsonValue responseModelsJsonMap;
38 for(auto& responseModelsItem : m_responseModels)
39 {
40 responseModelsJsonMap.WithString(responseModelsItem.first, responseModelsItem.second);
41 }
42 payload.WithObject("responseModels", std::move(responseModelsJsonMap));
43
44 }
45
46 if(m_responseParametersHasBeenSet)
47 {
48 JsonValue responseParametersJsonMap;
49 for(auto& responseParametersItem : m_responseParameters)
50 {
51 responseParametersJsonMap.WithObject(responseParametersItem.first, responseParametersItem.second.Jsonize());
52 }
53 payload.WithObject("responseParameters", std::move(responseParametersJsonMap));
54
55 }
56
57 if(m_routeResponseKeyHasBeenSet)
58 {
59 payload.WithString("routeResponseKey", m_routeResponseKey);
60
61 }
62
63 return payload.View().WriteReadable();
64 }
65
66
67
68
69