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