1 /**
2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 * SPDX-License-Identifier: Apache-2.0.
4 */
5
6 #include <aws/servicediscovery/model/CreateServiceRequest.h>
7 #include <aws/core/utils/json/JsonSerializer.h>
8
9 #include <utility>
10
11 using namespace Aws::ServiceDiscovery::Model;
12 using namespace Aws::Utils::Json;
13 using namespace Aws::Utils;
14
CreateServiceRequest()15 CreateServiceRequest::CreateServiceRequest() :
16 m_nameHasBeenSet(false),
17 m_namespaceIdHasBeenSet(false),
18 m_creatorRequestId(Aws::Utils::UUID::RandomUUID()),
19 m_creatorRequestIdHasBeenSet(true),
20 m_descriptionHasBeenSet(false),
21 m_dnsConfigHasBeenSet(false),
22 m_healthCheckConfigHasBeenSet(false),
23 m_healthCheckCustomConfigHasBeenSet(false),
24 m_tagsHasBeenSet(false),
25 m_type(ServiceTypeOption::NOT_SET),
26 m_typeHasBeenSet(false)
27 {
28 }
29
SerializePayload() const30 Aws::String CreateServiceRequest::SerializePayload() const
31 {
32 JsonValue payload;
33
34 if(m_nameHasBeenSet)
35 {
36 payload.WithString("Name", m_name);
37
38 }
39
40 if(m_namespaceIdHasBeenSet)
41 {
42 payload.WithString("NamespaceId", m_namespaceId);
43
44 }
45
46 if(m_creatorRequestIdHasBeenSet)
47 {
48 payload.WithString("CreatorRequestId", m_creatorRequestId);
49
50 }
51
52 if(m_descriptionHasBeenSet)
53 {
54 payload.WithString("Description", m_description);
55
56 }
57
58 if(m_dnsConfigHasBeenSet)
59 {
60 payload.WithObject("DnsConfig", m_dnsConfig.Jsonize());
61
62 }
63
64 if(m_healthCheckConfigHasBeenSet)
65 {
66 payload.WithObject("HealthCheckConfig", m_healthCheckConfig.Jsonize());
67
68 }
69
70 if(m_healthCheckCustomConfigHasBeenSet)
71 {
72 payload.WithObject("HealthCheckCustomConfig", m_healthCheckCustomConfig.Jsonize());
73
74 }
75
76 if(m_tagsHasBeenSet)
77 {
78 Array<JsonValue> tagsJsonList(m_tags.size());
79 for(unsigned tagsIndex = 0; tagsIndex < tagsJsonList.GetLength(); ++tagsIndex)
80 {
81 tagsJsonList[tagsIndex].AsObject(m_tags[tagsIndex].Jsonize());
82 }
83 payload.WithArray("Tags", std::move(tagsJsonList));
84
85 }
86
87 if(m_typeHasBeenSet)
88 {
89 payload.WithString("Type", ServiceTypeOptionMapper::GetNameForServiceTypeOption(m_type));
90 }
91
92 return payload.View().WriteReadable();
93 }
94
GetRequestSpecificHeaders() const95 Aws::Http::HeaderValueCollection CreateServiceRequest::GetRequestSpecificHeaders() const
96 {
97 Aws::Http::HeaderValueCollection headers;
98 headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "Route53AutoNaming_v20170314.CreateService"));
99 return headers;
100
101 }
102
103
104
105
106