Aws::GameLift::Model::CreateGameSessionRequest BuildAWSGameLiftCreateGameSessionRequest()

in Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftCreateSessionActivity.cpp [24:71]


        Aws::GameLift::Model::CreateGameSessionRequest BuildAWSGameLiftCreateGameSessionRequest(
            const AWSGameLiftCreateSessionRequest& createSessionRequest)
        {
            Aws::GameLift::Model::CreateGameSessionRequest request;
            // Optional attributes
            if (!createSessionRequest.m_creatorId.empty())
            {
                request.SetCreatorId(createSessionRequest.m_creatorId.c_str());
            }
            if (!createSessionRequest.m_sessionName.empty())
            {
                request.SetName(createSessionRequest.m_sessionName.c_str());
            }
            if (!createSessionRequest.m_idempotencyToken.empty())
            {
                request.SetIdempotencyToken(createSessionRequest.m_idempotencyToken.c_str());
            }
            AZStd::string propertiesOutput = "";
            Aws::Vector<Aws::GameLift::Model::GameProperty> properties;
            AWSGameLiftActivityUtils::GetGameProperties(createSessionRequest.m_sessionProperties, properties, propertiesOutput);
            if (!properties.empty())
            {
                request.SetGameProperties(properties);
            }

            // Required attributes
            if (!createSessionRequest.m_aliasId.empty())
            {
                request.SetAliasId(createSessionRequest.m_aliasId.c_str());
            }
            if (!createSessionRequest.m_fleetId.empty())
            {
                request.SetFleetId(createSessionRequest.m_fleetId.c_str());
            }
            request.SetMaximumPlayerSessionCount(static_cast<int>(createSessionRequest.m_maxPlayer));

            AZ_TracePrintf(AWSGameLiftCreateSessionActivityName,
                "Built CreateGameSessionRequest with CreatorId=%s, Name=%s, IdempotencyToken=%s, GameProperties=%s, AliasId=%s, FleetId=%s and MaximumPlayerSessionCount=%d",
                request.GetCreatorId().c_str(),
                request.GetName().c_str(),
                request.GetIdempotencyToken().c_str(),
                AZStd::string::format("[%s]", propertiesOutput.c_str()).c_str(),
                request.GetAliasId().c_str(),
                request.GetFleetId().c_str(),
                request.GetMaximumPlayerSessionCount());

            return request;
        }