Пример #1
0
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            DescribeExecutionResponse response = new DescribeExecutionResponse();

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

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("Execution", targetDepth))
                {
                    var unmarshaller = DescribedExecutionUnmarshaller.Instance;
                    response.Execution = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("WorkflowId", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.WorkflowId = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }
Пример #2
0
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            DescribeExecutionResponse response = new DescribeExecutionResponse();

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

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("executionId", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.ExecutionId = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("lastUpdatedAt", targetDepth))
                {
                    var unmarshaller = DateTimeUnmarshaller.Instance;
                    response.LastUpdatedAt = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("managedDeviceId", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.ManagedDeviceId = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("startedAt", targetDepth))
                {
                    var unmarshaller = DateTimeUnmarshaller.Instance;
                    response.StartedAt = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("state", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.State = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("taskId", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.TaskId = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }
        public static DescribeExecutionResponse Unmarshall(UnmarshallerContext context)
        {
            DescribeExecutionResponse describeExecutionResponse = new DescribeExecutionResponse();

            describeExecutionResponse.HttpResponse   = context.HttpResponse;
            describeExecutionResponse.RequestId      = context.StringValue("DescribeExecution.RequestId");
            describeExecutionResponse.Name           = context.StringValue("DescribeExecution.Name");
            describeExecutionResponse.FlowName       = context.StringValue("DescribeExecution.FlowName");
            describeExecutionResponse.FlowDefinition = context.StringValue("DescribeExecution.FlowDefinition");
            describeExecutionResponse.Input          = context.StringValue("DescribeExecution.Input");
            describeExecutionResponse.Output         = context.StringValue("DescribeExecution.Output");
            describeExecutionResponse.Status         = context.StringValue("DescribeExecution.Status");
            describeExecutionResponse.StartedTime    = context.StringValue("DescribeExecution.StartedTime");
            describeExecutionResponse.StoppedTime    = context.StringValue("DescribeExecution.StoppedTime");

            return(describeExecutionResponse);
        }
        public DescribeExecutionResponse FunctionHandler(JObject input)
        {
            LambdaLogger.Log(input.ToString());
            AmazonStepFunctionsClient client = new AmazonStepFunctionsClient();

            string executionArn = string.Format("{0}:{1}", Environment.GetEnvironmentVariable("stepFunctionsArn").Replace("stateMachine", "execution"), input.SelectToken("path.id"));

            LambdaLogger.Log(executionArn);

            DescribeExecutionRequest request = new DescribeExecutionRequest()
            {
                ExecutionArn = executionArn
            };

            DescribeExecutionResponse response = client.DescribeExecutionAsync(request).Result;

            return(response);
        }
        public static DescribeExecutionResponse Unmarshall(UnmarshallerContext _ctx)
        {
            DescribeExecutionResponse describeExecutionResponse = new DescribeExecutionResponse();

            describeExecutionResponse.HttpResponse      = _ctx.HttpResponse;
            describeExecutionResponse.RequestId         = _ctx.StringValue("DescribeExecution.RequestId");
            describeExecutionResponse.Name              = _ctx.StringValue("DescribeExecution.Name");
            describeExecutionResponse.FlowName          = _ctx.StringValue("DescribeExecution.FlowName");
            describeExecutionResponse.FlowDefinition    = _ctx.StringValue("DescribeExecution.FlowDefinition");
            describeExecutionResponse.Input             = _ctx.StringValue("DescribeExecution.Input");
            describeExecutionResponse.Output            = _ctx.StringValue("DescribeExecution.Output");
            describeExecutionResponse.Status            = _ctx.StringValue("DescribeExecution.Status");
            describeExecutionResponse.StartedTime       = _ctx.StringValue("DescribeExecution.StartedTime");
            describeExecutionResponse.StoppedTime       = _ctx.StringValue("DescribeExecution.StoppedTime");
            describeExecutionResponse.ExternalInputUri  = _ctx.StringValue("DescribeExecution.ExternalInputUri");
            describeExecutionResponse.ExternalOutputUri = _ctx.StringValue("DescribeExecution.ExternalOutputUri");

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

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

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("executionArn", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.ExecutionArn = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("input", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.Input = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("name", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.Name = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("output", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.Output = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("startDate", targetDepth))
                {
                    var unmarshaller = DateTimeUnmarshaller.Instance;
                    response.StartDate = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("stateMachineArn", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.StateMachineArn = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("status", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.Status = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("stopDate", targetDepth))
                {
                    var unmarshaller = DateTimeUnmarshaller.Instance;
                    response.StopDate = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }