75 lines
1.3 KiB
C++
75 lines
1.3 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/storagegateway/model/ServiceUnavailableError.h>
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|
|
|
#include <utility>
|
|
|
|
using namespace Aws::Utils::Json;
|
|
using namespace Aws::Utils;
|
|
|
|
namespace Aws
|
|
{
|
|
namespace StorageGateway
|
|
{
|
|
namespace Model
|
|
{
|
|
|
|
ServiceUnavailableError::ServiceUnavailableError() :
|
|
m_messageHasBeenSet(false),
|
|
m_errorHasBeenSet(false)
|
|
{
|
|
}
|
|
|
|
ServiceUnavailableError::ServiceUnavailableError(JsonView jsonValue) :
|
|
m_messageHasBeenSet(false),
|
|
m_errorHasBeenSet(false)
|
|
{
|
|
*this = jsonValue;
|
|
}
|
|
|
|
ServiceUnavailableError& ServiceUnavailableError::operator =(JsonView jsonValue)
|
|
{
|
|
if(jsonValue.ValueExists("message"))
|
|
{
|
|
m_message = jsonValue.GetString("message");
|
|
|
|
m_messageHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("error"))
|
|
{
|
|
m_error = jsonValue.GetObject("error");
|
|
|
|
m_errorHasBeenSet = true;
|
|
}
|
|
|
|
return *this;
|
|
}
|
|
|
|
JsonValue ServiceUnavailableError::Jsonize() const
|
|
{
|
|
JsonValue payload;
|
|
|
|
if(m_messageHasBeenSet)
|
|
{
|
|
payload.WithString("message", m_message);
|
|
|
|
}
|
|
|
|
if(m_errorHasBeenSet)
|
|
{
|
|
payload.WithObject("error", m_error.Jsonize());
|
|
|
|
}
|
|
|
|
return payload;
|
|
}
|
|
|
|
} // namespace Model
|
|
} // namespace StorageGateway
|
|
} // namespace Aws
|