/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::ivsrealtime::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; CreateParticipantTokenRequest::CreateParticipantTokenRequest() : m_attributesHasBeenSet(false), m_capabilitiesHasBeenSet(false), m_duration(0), m_durationHasBeenSet(false), m_stageArnHasBeenSet(false), m_userIdHasBeenSet(false) { } Aws::String CreateParticipantTokenRequest::SerializePayload() const { JsonValue payload; if(m_attributesHasBeenSet) { JsonValue attributesJsonMap; for(auto& attributesItem : m_attributes) { attributesJsonMap.WithString(attributesItem.first, attributesItem.second); } payload.WithObject("attributes", std::move(attributesJsonMap)); } if(m_capabilitiesHasBeenSet) { Aws::Utils::Array capabilitiesJsonList(m_capabilities.size()); for(unsigned capabilitiesIndex = 0; capabilitiesIndex < capabilitiesJsonList.GetLength(); ++capabilitiesIndex) { capabilitiesJsonList[capabilitiesIndex].AsString(ParticipantTokenCapabilityMapper::GetNameForParticipantTokenCapability(m_capabilities[capabilitiesIndex])); } payload.WithArray("capabilities", std::move(capabilitiesJsonList)); } if(m_durationHasBeenSet) { payload.WithInteger("duration", m_duration); } if(m_stageArnHasBeenSet) { payload.WithString("stageArn", m_stageArn); } if(m_userIdHasBeenSet) { payload.WithString("userId", m_userId); } return payload.View().WriteReadable(); }