1 /** 2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 * SPDX-License-Identifier: Apache-2.0. 4 */ 5 6 #include <aws/servicediscovery/model/NamespaceAlreadyExists.h> 7 #include <aws/core/utils/json/JsonSerializer.h> 8 9 #include <utility> 10 11 using namespace Aws::Utils::Json; 12 using namespace Aws::Utils; 13 14 namespace Aws 15 { 16 namespace ServiceDiscovery 17 { 18 namespace Model 19 { 20 NamespaceAlreadyExists()21NamespaceAlreadyExists::NamespaceAlreadyExists() : 22 m_messageHasBeenSet(false), 23 m_creatorRequestIdHasBeenSet(false), 24 m_namespaceIdHasBeenSet(false) 25 { 26 } 27 NamespaceAlreadyExists(JsonView jsonValue)28NamespaceAlreadyExists::NamespaceAlreadyExists(JsonView jsonValue) : 29 m_messageHasBeenSet(false), 30 m_creatorRequestIdHasBeenSet(false), 31 m_namespaceIdHasBeenSet(false) 32 { 33 *this = jsonValue; 34 } 35 operator =(JsonView jsonValue)36NamespaceAlreadyExists& NamespaceAlreadyExists::operator =(JsonView jsonValue) 37 { 38 if(jsonValue.ValueExists("Message")) 39 { 40 m_message = jsonValue.GetString("Message"); 41 42 m_messageHasBeenSet = true; 43 } 44 45 if(jsonValue.ValueExists("CreatorRequestId")) 46 { 47 m_creatorRequestId = jsonValue.GetString("CreatorRequestId"); 48 49 m_creatorRequestIdHasBeenSet = true; 50 } 51 52 if(jsonValue.ValueExists("NamespaceId")) 53 { 54 m_namespaceId = jsonValue.GetString("NamespaceId"); 55 56 m_namespaceIdHasBeenSet = true; 57 } 58 59 return *this; 60 } 61 Jsonize() const62JsonValue NamespaceAlreadyExists::Jsonize() const 63 { 64 JsonValue payload; 65 66 if(m_messageHasBeenSet) 67 { 68 payload.WithString("Message", m_message); 69 70 } 71 72 if(m_creatorRequestIdHasBeenSet) 73 { 74 payload.WithString("CreatorRequestId", m_creatorRequestId); 75 76 } 77 78 if(m_namespaceIdHasBeenSet) 79 { 80 payload.WithString("NamespaceId", m_namespaceId); 81 82 } 83 84 return payload; 85 } 86 87 } // namespace Model 88 } // namespace ServiceDiscovery 89 } // namespace Aws 90