/** * 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 { Status::Status() : m_state(State::NOT_SET), m_stateHasBeenSet(false), m_errorHasBeenSet(false) { } Status::Status(JsonView jsonValue) : m_state(State::NOT_SET), m_stateHasBeenSet(false), m_errorHasBeenSet(false) { *this = jsonValue; } Status& Status::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("state")) { m_state = StateMapper::GetStateForName(jsonValue.GetString("state")); m_stateHasBeenSet = true; } if(jsonValue.ValueExists("error")) { m_error = jsonValue.GetObject("error"); m_errorHasBeenSet = true; } return *this; } JsonValue Status::Jsonize() const { JsonValue payload; if(m_stateHasBeenSet) { payload.WithString("state", StateMapper::GetNameForState(m_state)); } if(m_errorHasBeenSet) { payload.WithObject("error", m_error.Jsonize()); } return payload; } } // namespace Model } // namespace IoTTwinMaker } // namespace Aws