/// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            GetOperationsResponse response = new GetOperationsResponse();

            context.Read();
            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("nextPageToken", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.NextPageToken = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("operations", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller <Operation, OperationUnmarshaller>(OperationUnmarshaller.Instance);
                    response.Operations = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }
Ejemplo n.º 2
0
        public override async Task <GetOperationsResponse> GetOperations(GetOperationsRequest request, ServerCallContext context)
        {
            var operationNames = await _ServiceQuery.GetOperation(request.Service, context.CancellationToken);

            GetOperationsResponse response = new GetOperationsResponse();

            response.OperationNames.Add(operationNames.Distinct().ToArray());
            return(response);
        }