/** * 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 imagebuilder { namespace Model { Ami::Ami() : m_regionHasBeenSet(false), m_imageHasBeenSet(false), m_nameHasBeenSet(false), m_descriptionHasBeenSet(false), m_stateHasBeenSet(false), m_accountIdHasBeenSet(false) { } Ami::Ami(JsonView jsonValue) : m_regionHasBeenSet(false), m_imageHasBeenSet(false), m_nameHasBeenSet(false), m_descriptionHasBeenSet(false), m_stateHasBeenSet(false), m_accountIdHasBeenSet(false) { *this = jsonValue; } Ami& Ami::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("region")) { m_region = jsonValue.GetString("region"); m_regionHasBeenSet = true; } if(jsonValue.ValueExists("image")) { m_image = jsonValue.GetString("image"); m_imageHasBeenSet = true; } if(jsonValue.ValueExists("name")) { m_name = jsonValue.GetString("name"); m_nameHasBeenSet = true; } if(jsonValue.ValueExists("description")) { m_description = jsonValue.GetString("description"); m_descriptionHasBeenSet = true; } if(jsonValue.ValueExists("state")) { m_state = jsonValue.GetObject("state"); m_stateHasBeenSet = true; } if(jsonValue.ValueExists("accountId")) { m_accountId = jsonValue.GetString("accountId"); m_accountIdHasBeenSet = true; } return *this; } JsonValue Ami::Jsonize() const { JsonValue payload; if(m_regionHasBeenSet) { payload.WithString("region", m_region); } if(m_imageHasBeenSet) { payload.WithString("image", m_image); } if(m_nameHasBeenSet) { payload.WithString("name", m_name); } if(m_descriptionHasBeenSet) { payload.WithString("description", m_description); } if(m_stateHasBeenSet) { payload.WithObject("state", m_state.Jsonize()); } if(m_accountIdHasBeenSet) { payload.WithString("accountId", m_accountId); } return payload; } } // namespace Model } // namespace imagebuilder } // namespace Aws