1 /** 2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 * SPDX-License-Identifier: Apache-2.0. 4 */ 5 6 #include <aws/events/model/CreateEventBusRequest.h> 7 #include <aws/core/utils/json/JsonSerializer.h> 8 9 #include <utility> 10 11 using namespace Aws::CloudWatchEvents::Model; 12 using namespace Aws::Utils::Json; 13 using namespace Aws::Utils; 14 CreateEventBusRequest()15CreateEventBusRequest::CreateEventBusRequest() : 16 m_nameHasBeenSet(false), 17 m_eventSourceNameHasBeenSet(false), 18 m_tagsHasBeenSet(false) 19 { 20 } 21 SerializePayload() const22Aws::String CreateEventBusRequest::SerializePayload() const 23 { 24 JsonValue payload; 25 26 if(m_nameHasBeenSet) 27 { 28 payload.WithString("Name", m_name); 29 30 } 31 32 if(m_eventSourceNameHasBeenSet) 33 { 34 payload.WithString("EventSourceName", m_eventSourceName); 35 36 } 37 38 if(m_tagsHasBeenSet) 39 { 40 Array<JsonValue> tagsJsonList(m_tags.size()); 41 for(unsigned tagsIndex = 0; tagsIndex < tagsJsonList.GetLength(); ++tagsIndex) 42 { 43 tagsJsonList[tagsIndex].AsObject(m_tags[tagsIndex].Jsonize()); 44 } 45 payload.WithArray("Tags", std::move(tagsJsonList)); 46 47 } 48 49 return payload.View().WriteReadable(); 50 } 51 GetRequestSpecificHeaders() const52Aws::Http::HeaderValueCollection CreateEventBusRequest::GetRequestSpecificHeaders() const 53 { 54 Aws::Http::HeaderValueCollection headers; 55 headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSEvents.CreateEventBus")); 56 return headers; 57 58 } 59 60 61 62 63