/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::Utils::Json; using namespace Aws::Utils; namespace Aws { namespace IoTTwinMaker { namespace Model { PropertyGroupRequest::PropertyGroupRequest() : m_groupType(GroupType::NOT_SET), m_groupTypeHasBeenSet(false), m_propertyNamesHasBeenSet(false) { } PropertyGroupRequest::PropertyGroupRequest(JsonView jsonValue) : m_groupType(GroupType::NOT_SET), m_groupTypeHasBeenSet(false), m_propertyNamesHasBeenSet(false) { *this = jsonValue; } PropertyGroupRequest& PropertyGroupRequest::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("groupType")) { m_groupType = GroupTypeMapper::GetGroupTypeForName(jsonValue.GetString("groupType")); m_groupTypeHasBeenSet = true; } if(jsonValue.ValueExists("propertyNames")) { Aws::Utils::Array propertyNamesJsonList = jsonValue.GetArray("propertyNames"); for(unsigned propertyNamesIndex = 0; propertyNamesIndex < propertyNamesJsonList.GetLength(); ++propertyNamesIndex) { m_propertyNames.push_back(propertyNamesJsonList[propertyNamesIndex].AsString()); } m_propertyNamesHasBeenSet = true; } return *this; } JsonValue PropertyGroupRequest::Jsonize() const { JsonValue payload; if(m_groupTypeHasBeenSet) { payload.WithString("groupType", GroupTypeMapper::GetNameForGroupType(m_groupType)); } if(m_propertyNamesHasBeenSet) { Aws::Utils::Array propertyNamesJsonList(m_propertyNames.size()); for(unsigned propertyNamesIndex = 0; propertyNamesIndex < propertyNamesJsonList.GetLength(); ++propertyNamesIndex) { propertyNamesJsonList[propertyNamesIndex].AsString(m_propertyNames[propertyNamesIndex]); } payload.WithArray("propertyNames", std::move(propertyNamesJsonList)); } return payload; } } // namespace Model } // namespace IoTTwinMaker } // namespace Aws