1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #include <aws/awstransfer/model/UpdateServerRequest.h>
7 #include <aws/core/utils/json/JsonSerializer.h>
8 
9 #include <utility>
10 
11 using namespace Aws::Transfer::Model;
12 using namespace Aws::Utils::Json;
13 using namespace Aws::Utils;
14 
UpdateServerRequest()15 UpdateServerRequest::UpdateServerRequest() :
16     m_certificateHasBeenSet(false),
17     m_protocolDetailsHasBeenSet(false),
18     m_endpointDetailsHasBeenSet(false),
19     m_endpointType(EndpointType::NOT_SET),
20     m_endpointTypeHasBeenSet(false),
21     m_hostKeyHasBeenSet(false),
22     m_identityProviderDetailsHasBeenSet(false),
23     m_loggingRoleHasBeenSet(false),
24     m_protocolsHasBeenSet(false),
25     m_securityPolicyNameHasBeenSet(false),
26     m_serverIdHasBeenSet(false),
27     m_workflowDetailsHasBeenSet(false)
28 {
29 }
30 
SerializePayload() const31 Aws::String UpdateServerRequest::SerializePayload() const
32 {
33   JsonValue payload;
34 
35   if(m_certificateHasBeenSet)
36   {
37    payload.WithString("Certificate", m_certificate);
38 
39   }
40 
41   if(m_protocolDetailsHasBeenSet)
42   {
43    payload.WithObject("ProtocolDetails", m_protocolDetails.Jsonize());
44 
45   }
46 
47   if(m_endpointDetailsHasBeenSet)
48   {
49    payload.WithObject("EndpointDetails", m_endpointDetails.Jsonize());
50 
51   }
52 
53   if(m_endpointTypeHasBeenSet)
54   {
55    payload.WithString("EndpointType", EndpointTypeMapper::GetNameForEndpointType(m_endpointType));
56   }
57 
58   if(m_hostKeyHasBeenSet)
59   {
60    payload.WithString("HostKey", m_hostKey);
61 
62   }
63 
64   if(m_identityProviderDetailsHasBeenSet)
65   {
66    payload.WithObject("IdentityProviderDetails", m_identityProviderDetails.Jsonize());
67 
68   }
69 
70   if(m_loggingRoleHasBeenSet)
71   {
72    payload.WithString("LoggingRole", m_loggingRole);
73 
74   }
75 
76   if(m_protocolsHasBeenSet)
77   {
78    Array<JsonValue> protocolsJsonList(m_protocols.size());
79    for(unsigned protocolsIndex = 0; protocolsIndex < protocolsJsonList.GetLength(); ++protocolsIndex)
80    {
81      protocolsJsonList[protocolsIndex].AsString(ProtocolMapper::GetNameForProtocol(m_protocols[protocolsIndex]));
82    }
83    payload.WithArray("Protocols", std::move(protocolsJsonList));
84 
85   }
86 
87   if(m_securityPolicyNameHasBeenSet)
88   {
89    payload.WithString("SecurityPolicyName", m_securityPolicyName);
90 
91   }
92 
93   if(m_serverIdHasBeenSet)
94   {
95    payload.WithString("ServerId", m_serverId);
96 
97   }
98 
99   if(m_workflowDetailsHasBeenSet)
100   {
101    payload.WithObject("WorkflowDetails", m_workflowDetails.Jsonize());
102 
103   }
104 
105   return payload.View().WriteReadable();
106 }
107 
GetRequestSpecificHeaders() const108 Aws::Http::HeaderValueCollection UpdateServerRequest::GetRequestSpecificHeaders() const
109 {
110   Aws::Http::HeaderValueCollection headers;
111   headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "TransferService.UpdateServer"));
112   return headers;
113 
114 }
115 
116 
117 
118 
119