/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::KMS::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; CreateKeyRequest::CreateKeyRequest() : m_policyHasBeenSet(false), m_descriptionHasBeenSet(false), m_keyUsage(KeyUsageType::NOT_SET), m_keyUsageHasBeenSet(false), m_keySpec(KeySpec::NOT_SET), m_keySpecHasBeenSet(false), m_origin(OriginType::NOT_SET), m_originHasBeenSet(false), m_customKeyStoreIdHasBeenSet(false), m_bypassPolicyLockoutSafetyCheck(false), m_bypassPolicyLockoutSafetyCheckHasBeenSet(false), m_tagsHasBeenSet(false), m_multiRegion(false), m_multiRegionHasBeenSet(false), m_xksKeyIdHasBeenSet(false) { } Aws::String CreateKeyRequest::SerializePayload() const { JsonValue payload; if(m_policyHasBeenSet) { payload.WithString("Policy", m_policy); } if(m_descriptionHasBeenSet) { payload.WithString("Description", m_description); } if(m_keyUsageHasBeenSet) { payload.WithString("KeyUsage", KeyUsageTypeMapper::GetNameForKeyUsageType(m_keyUsage)); } if(m_keySpecHasBeenSet) { payload.WithString("KeySpec", KeySpecMapper::GetNameForKeySpec(m_keySpec)); } if(m_originHasBeenSet) { payload.WithString("Origin", OriginTypeMapper::GetNameForOriginType(m_origin)); } if(m_customKeyStoreIdHasBeenSet) { payload.WithString("CustomKeyStoreId", m_customKeyStoreId); } if(m_bypassPolicyLockoutSafetyCheckHasBeenSet) { payload.WithBool("BypassPolicyLockoutSafetyCheck", m_bypassPolicyLockoutSafetyCheck); } if(m_tagsHasBeenSet) { Aws::Utils::Array tagsJsonList(m_tags.size()); for(unsigned tagsIndex = 0; tagsIndex < tagsJsonList.GetLength(); ++tagsIndex) { tagsJsonList[tagsIndex].AsObject(m_tags[tagsIndex].Jsonize()); } payload.WithArray("Tags", std::move(tagsJsonList)); } if(m_multiRegionHasBeenSet) { payload.WithBool("MultiRegion", m_multiRegion); } if(m_xksKeyIdHasBeenSet) { payload.WithString("XksKeyId", m_xksKeyId); } return payload.View().WriteReadable(); } Aws::Http::HeaderValueCollection CreateKeyRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "TrentService.CreateKey")); return headers; }