/** * 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 mediapackagev2 { namespace Model { OriginEndpointListConfiguration::OriginEndpointListConfiguration() : m_arnHasBeenSet(false), m_channelGroupNameHasBeenSet(false), m_channelNameHasBeenSet(false), m_originEndpointNameHasBeenSet(false), m_containerType(ContainerType::NOT_SET), m_containerTypeHasBeenSet(false), m_descriptionHasBeenSet(false), m_createdAtHasBeenSet(false), m_modifiedAtHasBeenSet(false), m_hlsManifestsHasBeenSet(false), m_lowLatencyHlsManifestsHasBeenSet(false) { } OriginEndpointListConfiguration::OriginEndpointListConfiguration(JsonView jsonValue) : m_arnHasBeenSet(false), m_channelGroupNameHasBeenSet(false), m_channelNameHasBeenSet(false), m_originEndpointNameHasBeenSet(false), m_containerType(ContainerType::NOT_SET), m_containerTypeHasBeenSet(false), m_descriptionHasBeenSet(false), m_createdAtHasBeenSet(false), m_modifiedAtHasBeenSet(false), m_hlsManifestsHasBeenSet(false), m_lowLatencyHlsManifestsHasBeenSet(false) { *this = jsonValue; } OriginEndpointListConfiguration& OriginEndpointListConfiguration::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("Arn")) { m_arn = jsonValue.GetString("Arn"); m_arnHasBeenSet = true; } if(jsonValue.ValueExists("ChannelGroupName")) { m_channelGroupName = jsonValue.GetString("ChannelGroupName"); m_channelGroupNameHasBeenSet = true; } if(jsonValue.ValueExists("ChannelName")) { m_channelName = jsonValue.GetString("ChannelName"); m_channelNameHasBeenSet = true; } if(jsonValue.ValueExists("OriginEndpointName")) { m_originEndpointName = jsonValue.GetString("OriginEndpointName"); m_originEndpointNameHasBeenSet = true; } if(jsonValue.ValueExists("ContainerType")) { m_containerType = ContainerTypeMapper::GetContainerTypeForName(jsonValue.GetString("ContainerType")); m_containerTypeHasBeenSet = true; } if(jsonValue.ValueExists("Description")) { m_description = jsonValue.GetString("Description"); m_descriptionHasBeenSet = true; } if(jsonValue.ValueExists("CreatedAt")) { m_createdAt = jsonValue.GetDouble("CreatedAt"); m_createdAtHasBeenSet = true; } if(jsonValue.ValueExists("ModifiedAt")) { m_modifiedAt = jsonValue.GetDouble("ModifiedAt"); m_modifiedAtHasBeenSet = true; } if(jsonValue.ValueExists("HlsManifests")) { Aws::Utils::Array hlsManifestsJsonList = jsonValue.GetArray("HlsManifests"); for(unsigned hlsManifestsIndex = 0; hlsManifestsIndex < hlsManifestsJsonList.GetLength(); ++hlsManifestsIndex) { m_hlsManifests.push_back(hlsManifestsJsonList[hlsManifestsIndex].AsObject()); } m_hlsManifestsHasBeenSet = true; } if(jsonValue.ValueExists("LowLatencyHlsManifests")) { Aws::Utils::Array lowLatencyHlsManifestsJsonList = jsonValue.GetArray("LowLatencyHlsManifests"); for(unsigned lowLatencyHlsManifestsIndex = 0; lowLatencyHlsManifestsIndex < lowLatencyHlsManifestsJsonList.GetLength(); ++lowLatencyHlsManifestsIndex) { m_lowLatencyHlsManifests.push_back(lowLatencyHlsManifestsJsonList[lowLatencyHlsManifestsIndex].AsObject()); } m_lowLatencyHlsManifestsHasBeenSet = true; } return *this; } JsonValue OriginEndpointListConfiguration::Jsonize() const { JsonValue payload; if(m_arnHasBeenSet) { payload.WithString("Arn", m_arn); } if(m_channelGroupNameHasBeenSet) { payload.WithString("ChannelGroupName", m_channelGroupName); } if(m_channelNameHasBeenSet) { payload.WithString("ChannelName", m_channelName); } if(m_originEndpointNameHasBeenSet) { payload.WithString("OriginEndpointName", m_originEndpointName); } if(m_containerTypeHasBeenSet) { payload.WithString("ContainerType", ContainerTypeMapper::GetNameForContainerType(m_containerType)); } if(m_descriptionHasBeenSet) { payload.WithString("Description", m_description); } if(m_createdAtHasBeenSet) { payload.WithDouble("CreatedAt", m_createdAt.SecondsWithMSPrecision()); } if(m_modifiedAtHasBeenSet) { payload.WithDouble("ModifiedAt", m_modifiedAt.SecondsWithMSPrecision()); } if(m_hlsManifestsHasBeenSet) { Aws::Utils::Array hlsManifestsJsonList(m_hlsManifests.size()); for(unsigned hlsManifestsIndex = 0; hlsManifestsIndex < hlsManifestsJsonList.GetLength(); ++hlsManifestsIndex) { hlsManifestsJsonList[hlsManifestsIndex].AsObject(m_hlsManifests[hlsManifestsIndex].Jsonize()); } payload.WithArray("HlsManifests", std::move(hlsManifestsJsonList)); } if(m_lowLatencyHlsManifestsHasBeenSet) { Aws::Utils::Array lowLatencyHlsManifestsJsonList(m_lowLatencyHlsManifests.size()); for(unsigned lowLatencyHlsManifestsIndex = 0; lowLatencyHlsManifestsIndex < lowLatencyHlsManifestsJsonList.GetLength(); ++lowLatencyHlsManifestsIndex) { lowLatencyHlsManifestsJsonList[lowLatencyHlsManifestsIndex].AsObject(m_lowLatencyHlsManifests[lowLatencyHlsManifestsIndex].Jsonize()); } payload.WithArray("LowLatencyHlsManifests", std::move(lowLatencyHlsManifestsJsonList)); } return payload; } } // namespace Model } // namespace mediapackagev2 } // namespace Aws