104 lines
2.2 KiB
C++
104 lines
2.2 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/eventbridge/model/PartnerEventSourceAccount.h>
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|
|
|
#include <utility>
|
|
|
|
using namespace Aws::Utils::Json;
|
|
using namespace Aws::Utils;
|
|
|
|
namespace Aws
|
|
{
|
|
namespace EventBridge
|
|
{
|
|
namespace Model
|
|
{
|
|
|
|
PartnerEventSourceAccount::PartnerEventSourceAccount() :
|
|
m_accountHasBeenSet(false),
|
|
m_creationTimeHasBeenSet(false),
|
|
m_expirationTimeHasBeenSet(false),
|
|
m_state(EventSourceState::NOT_SET),
|
|
m_stateHasBeenSet(false)
|
|
{
|
|
}
|
|
|
|
PartnerEventSourceAccount::PartnerEventSourceAccount(JsonView jsonValue) :
|
|
m_accountHasBeenSet(false),
|
|
m_creationTimeHasBeenSet(false),
|
|
m_expirationTimeHasBeenSet(false),
|
|
m_state(EventSourceState::NOT_SET),
|
|
m_stateHasBeenSet(false)
|
|
{
|
|
*this = jsonValue;
|
|
}
|
|
|
|
PartnerEventSourceAccount& PartnerEventSourceAccount::operator =(JsonView jsonValue)
|
|
{
|
|
if(jsonValue.ValueExists("Account"))
|
|
{
|
|
m_account = jsonValue.GetString("Account");
|
|
|
|
m_accountHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("CreationTime"))
|
|
{
|
|
m_creationTime = jsonValue.GetDouble("CreationTime");
|
|
|
|
m_creationTimeHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("ExpirationTime"))
|
|
{
|
|
m_expirationTime = jsonValue.GetDouble("ExpirationTime");
|
|
|
|
m_expirationTimeHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("State"))
|
|
{
|
|
m_state = EventSourceStateMapper::GetEventSourceStateForName(jsonValue.GetString("State"));
|
|
|
|
m_stateHasBeenSet = true;
|
|
}
|
|
|
|
return *this;
|
|
}
|
|
|
|
JsonValue PartnerEventSourceAccount::Jsonize() const
|
|
{
|
|
JsonValue payload;
|
|
|
|
if(m_accountHasBeenSet)
|
|
{
|
|
payload.WithString("Account", m_account);
|
|
|
|
}
|
|
|
|
if(m_creationTimeHasBeenSet)
|
|
{
|
|
payload.WithDouble("CreationTime", m_creationTime.SecondsWithMSPrecision());
|
|
}
|
|
|
|
if(m_expirationTimeHasBeenSet)
|
|
{
|
|
payload.WithDouble("ExpirationTime", m_expirationTime.SecondsWithMSPrecision());
|
|
}
|
|
|
|
if(m_stateHasBeenSet)
|
|
{
|
|
payload.WithString("State", EventSourceStateMapper::GetNameForEventSourceState(m_state));
|
|
}
|
|
|
|
return payload;
|
|
}
|
|
|
|
} // namespace Model
|
|
} // namespace EventBridge
|
|
} // namespace Aws
|