/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::WorkMail::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; CreateImpersonationRoleRequest::CreateImpersonationRoleRequest() : m_clientToken(Aws::Utils::UUID::PseudoRandomUUID()), m_clientTokenHasBeenSet(true), m_organizationIdHasBeenSet(false), m_nameHasBeenSet(false), m_type(ImpersonationRoleType::NOT_SET), m_typeHasBeenSet(false), m_descriptionHasBeenSet(false), m_rulesHasBeenSet(false) { } Aws::String CreateImpersonationRoleRequest::SerializePayload() const { JsonValue payload; if(m_clientTokenHasBeenSet) { payload.WithString("ClientToken", m_clientToken); } if(m_organizationIdHasBeenSet) { payload.WithString("OrganizationId", m_organizationId); } if(m_nameHasBeenSet) { payload.WithString("Name", m_name); } if(m_typeHasBeenSet) { payload.WithString("Type", ImpersonationRoleTypeMapper::GetNameForImpersonationRoleType(m_type)); } if(m_descriptionHasBeenSet) { payload.WithString("Description", m_description); } if(m_rulesHasBeenSet) { Aws::Utils::Array rulesJsonList(m_rules.size()); for(unsigned rulesIndex = 0; rulesIndex < rulesJsonList.GetLength(); ++rulesIndex) { rulesJsonList[rulesIndex].AsObject(m_rules[rulesIndex].Jsonize()); } payload.WithArray("Rules", std::move(rulesJsonList)); } return payload.View().WriteReadable(); } Aws::Http::HeaderValueCollection CreateImpersonationRoleRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "WorkMailService.CreateImpersonationRole")); return headers; }