217 lines
4.3 KiB
C++
217 lines
4.3 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/mediaconnect/model/SetSourceRequest.h>
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|
|
|
#include <utility>
|
|
|
|
using namespace Aws::Utils::Json;
|
|
using namespace Aws::Utils;
|
|
|
|
namespace Aws
|
|
{
|
|
namespace MediaConnect
|
|
{
|
|
namespace Model
|
|
{
|
|
|
|
SetSourceRequest::SetSourceRequest() :
|
|
m_decryptionHasBeenSet(false),
|
|
m_descriptionHasBeenSet(false),
|
|
m_entitlementArnHasBeenSet(false),
|
|
m_ingestPort(0),
|
|
m_ingestPortHasBeenSet(false),
|
|
m_maxBitrate(0),
|
|
m_maxBitrateHasBeenSet(false),
|
|
m_maxLatency(0),
|
|
m_maxLatencyHasBeenSet(false),
|
|
m_nameHasBeenSet(false),
|
|
m_protocol(Protocol::NOT_SET),
|
|
m_protocolHasBeenSet(false),
|
|
m_streamIdHasBeenSet(false),
|
|
m_vpcInterfaceNameHasBeenSet(false),
|
|
m_whitelistCidrHasBeenSet(false)
|
|
{
|
|
}
|
|
|
|
SetSourceRequest::SetSourceRequest(JsonView jsonValue) :
|
|
m_decryptionHasBeenSet(false),
|
|
m_descriptionHasBeenSet(false),
|
|
m_entitlementArnHasBeenSet(false),
|
|
m_ingestPort(0),
|
|
m_ingestPortHasBeenSet(false),
|
|
m_maxBitrate(0),
|
|
m_maxBitrateHasBeenSet(false),
|
|
m_maxLatency(0),
|
|
m_maxLatencyHasBeenSet(false),
|
|
m_nameHasBeenSet(false),
|
|
m_protocol(Protocol::NOT_SET),
|
|
m_protocolHasBeenSet(false),
|
|
m_streamIdHasBeenSet(false),
|
|
m_vpcInterfaceNameHasBeenSet(false),
|
|
m_whitelistCidrHasBeenSet(false)
|
|
{
|
|
*this = jsonValue;
|
|
}
|
|
|
|
SetSourceRequest& SetSourceRequest::operator =(JsonView jsonValue)
|
|
{
|
|
if(jsonValue.ValueExists("decryption"))
|
|
{
|
|
m_decryption = jsonValue.GetObject("decryption");
|
|
|
|
m_decryptionHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("description"))
|
|
{
|
|
m_description = jsonValue.GetString("description");
|
|
|
|
m_descriptionHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("entitlementArn"))
|
|
{
|
|
m_entitlementArn = jsonValue.GetString("entitlementArn");
|
|
|
|
m_entitlementArnHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("ingestPort"))
|
|
{
|
|
m_ingestPort = jsonValue.GetInteger("ingestPort");
|
|
|
|
m_ingestPortHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("maxBitrate"))
|
|
{
|
|
m_maxBitrate = jsonValue.GetInteger("maxBitrate");
|
|
|
|
m_maxBitrateHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("maxLatency"))
|
|
{
|
|
m_maxLatency = jsonValue.GetInteger("maxLatency");
|
|
|
|
m_maxLatencyHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("name"))
|
|
{
|
|
m_name = jsonValue.GetString("name");
|
|
|
|
m_nameHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("protocol"))
|
|
{
|
|
m_protocol = ProtocolMapper::GetProtocolForName(jsonValue.GetString("protocol"));
|
|
|
|
m_protocolHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("streamId"))
|
|
{
|
|
m_streamId = jsonValue.GetString("streamId");
|
|
|
|
m_streamIdHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("vpcInterfaceName"))
|
|
{
|
|
m_vpcInterfaceName = jsonValue.GetString("vpcInterfaceName");
|
|
|
|
m_vpcInterfaceNameHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("whitelistCidr"))
|
|
{
|
|
m_whitelistCidr = jsonValue.GetString("whitelistCidr");
|
|
|
|
m_whitelistCidrHasBeenSet = true;
|
|
}
|
|
|
|
return *this;
|
|
}
|
|
|
|
JsonValue SetSourceRequest::Jsonize() const
|
|
{
|
|
JsonValue payload;
|
|
|
|
if(m_decryptionHasBeenSet)
|
|
{
|
|
payload.WithObject("decryption", m_decryption.Jsonize());
|
|
|
|
}
|
|
|
|
if(m_descriptionHasBeenSet)
|
|
{
|
|
payload.WithString("description", m_description);
|
|
|
|
}
|
|
|
|
if(m_entitlementArnHasBeenSet)
|
|
{
|
|
payload.WithString("entitlementArn", m_entitlementArn);
|
|
|
|
}
|
|
|
|
if(m_ingestPortHasBeenSet)
|
|
{
|
|
payload.WithInteger("ingestPort", m_ingestPort);
|
|
|
|
}
|
|
|
|
if(m_maxBitrateHasBeenSet)
|
|
{
|
|
payload.WithInteger("maxBitrate", m_maxBitrate);
|
|
|
|
}
|
|
|
|
if(m_maxLatencyHasBeenSet)
|
|
{
|
|
payload.WithInteger("maxLatency", m_maxLatency);
|
|
|
|
}
|
|
|
|
if(m_nameHasBeenSet)
|
|
{
|
|
payload.WithString("name", m_name);
|
|
|
|
}
|
|
|
|
if(m_protocolHasBeenSet)
|
|
{
|
|
payload.WithString("protocol", ProtocolMapper::GetNameForProtocol(m_protocol));
|
|
}
|
|
|
|
if(m_streamIdHasBeenSet)
|
|
{
|
|
payload.WithString("streamId", m_streamId);
|
|
|
|
}
|
|
|
|
if(m_vpcInterfaceNameHasBeenSet)
|
|
{
|
|
payload.WithString("vpcInterfaceName", m_vpcInterfaceName);
|
|
|
|
}
|
|
|
|
if(m_whitelistCidrHasBeenSet)
|
|
{
|
|
payload.WithString("whitelistCidr", m_whitelistCidr);
|
|
|
|
}
|
|
|
|
return payload;
|
|
}
|
|
|
|
} // namespace Model
|
|
} // namespace MediaConnect
|
|
} // namespace Aws
|