Exemple #1
0
        public DescribePlayerSessionsOutcome DescribePlayerSessions(Aws.GameLift.Server.Model.DescribePlayerSessionsRequest request)
        {
            log.DebugFormat("Describing player sessions {0}", request);
            var translation = DescribePlayerSessionsRequestMapper.ParseFromDescribePlayerSessionsRequest(request);

            var future = new TaskCompletionSource <DescribePlayerSessionsOutcome>();

            var ackFunction = CreateAckFunction(future);

            return(EmitEvent(translation, ackFunction, future, DESCRIBE_PLAYER_SESSIONS_ERROR));
        }
        public async Task <DescribePlayerSessionsOutcome> DescribePlayerSessions(Model.DescribePlayerSessionsRequest request)
        {
            var body     = DescribePlayerSessionsRequestMapper.ParseFromDescribePlayerSessionsRequest(request);
            var response = await SendAsync(body).ConfigureAwait(false);

            if (response.IsSuccessStatusCode)
            {
                var deserialized = DescribePlayerSessionsResponse.Parser.ParseJson(await response.Content.ReadAsStringAsync().ConfigureAwait(false));
                var translation  = DescribePlayerSessionsResult.ParseFromBufferedDescribePlayerSessionsResponse(deserialized);
                return(new DescribePlayerSessionsOutcome(translation));
            }

            return(new DescribePlayerSessionsOutcome(new GameLiftError(GameLiftErrorType.BAD_REQUEST_EXCEPTION)));
        }