/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::SSMContacts::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; CreateContactRequest::CreateContactRequest() : m_aliasHasBeenSet(false), m_displayNameHasBeenSet(false), m_type(ContactType::NOT_SET), m_typeHasBeenSet(false), m_planHasBeenSet(false), m_tagsHasBeenSet(false), m_idempotencyToken(Aws::Utils::UUID::PseudoRandomUUID()), m_idempotencyTokenHasBeenSet(true) { } Aws::String CreateContactRequest::SerializePayload() const { JsonValue payload; if(m_aliasHasBeenSet) { payload.WithString("Alias", m_alias); } if(m_displayNameHasBeenSet) { payload.WithString("DisplayName", m_displayName); } if(m_typeHasBeenSet) { payload.WithString("Type", ContactTypeMapper::GetNameForContactType(m_type)); } if(m_planHasBeenSet) { payload.WithObject("Plan", m_plan.Jsonize()); } 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_idempotencyTokenHasBeenSet) { payload.WithString("IdempotencyToken", m_idempotencyToken); } return payload.View().WriteReadable(); } Aws::Http::HeaderValueCollection CreateContactRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "SSMContacts.CreateContact")); return headers; }