/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { ListExecutionsResponse response = new ListExecutionsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("Executions", targetDepth)) { var unmarshaller = new ListUnmarshaller <ListedExecution, ListedExecutionUnmarshaller>(ListedExecutionUnmarshaller.Instance); response.Executions = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("NextToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextToken = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("WorkflowId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.WorkflowId = unmarshaller.Unmarshall(context); continue; } } return(response); }
public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonStepFunctionsConfig config = new AmazonStepFunctionsConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonStepFunctionsClient client = new AmazonStepFunctionsClient(creds, config); ListExecutionsResponse resp = new ListExecutionsResponse(); do { ListExecutionsRequest req = new ListExecutionsRequest { NextToken = resp.NextToken , MaxResults = maxItems }; resp = client.ListExecutions(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.Executions) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.NextToken)); }
public static ListExecutionsResponse Unmarshall(UnmarshallerContext context) { ListExecutionsResponse listExecutionsResponse = new ListExecutionsResponse(); listExecutionsResponse.HttpResponse = context.HttpResponse; listExecutionsResponse.RequestId = context.StringValue("ListExecutions.RequestId"); listExecutionsResponse.NextToken = context.StringValue("ListExecutions.NextToken"); List <ListExecutionsResponse.ListExecutions_ExecutionsItem> listExecutionsResponse_executions = new List <ListExecutionsResponse.ListExecutions_ExecutionsItem>(); for (int i = 0; i < context.Length("ListExecutions.Executions.Length"); i++) { ListExecutionsResponse.ListExecutions_ExecutionsItem executionsItem = new ListExecutionsResponse.ListExecutions_ExecutionsItem(); executionsItem.Name = context.StringValue("ListExecutions.Executions[" + i + "].Name"); executionsItem.FlowName = context.StringValue("ListExecutions.Executions[" + i + "].FlowName"); executionsItem.FlowDefinition = context.StringValue("ListExecutions.Executions[" + i + "].FlowDefinition"); executionsItem.Input = context.StringValue("ListExecutions.Executions[" + i + "].Input"); executionsItem.Output = context.StringValue("ListExecutions.Executions[" + i + "].Output"); executionsItem.Status = context.StringValue("ListExecutions.Executions[" + i + "].Status"); executionsItem.StartedTime = context.StringValue("ListExecutions.Executions[" + i + "].StartedTime"); executionsItem.StoppedTime = context.StringValue("ListExecutions.Executions[" + i + "].StoppedTime"); executionsItem.ExternalInputUri = context.StringValue("ListExecutions.Executions[" + i + "].ExternalInputUri"); executionsItem.ExternalOutputUri = context.StringValue("ListExecutions.Executions[" + i + "].ExternalOutputUri"); listExecutionsResponse_executions.Add(executionsItem); } listExecutionsResponse.Executions = listExecutionsResponse_executions; return(listExecutionsResponse); }
public static ListExecutionsResponse Unmarshall(UnmarshallerContext context) { ListExecutionsResponse listExecutionsResponse = new ListExecutionsResponse(); listExecutionsResponse.HttpResponse = context.HttpResponse; listExecutionsResponse.RequestId = context.StringValue("ListExecutions.RequestId"); listExecutionsResponse.MaxResults = context.IntegerValue("ListExecutions.MaxResults"); listExecutionsResponse.NextToken = context.StringValue("ListExecutions.NextToken"); List <ListExecutionsResponse.ListExecutions_Execution> listExecutionsResponse_executions = new List <ListExecutionsResponse.ListExecutions_Execution>(); for (int i = 0; i < context.Length("ListExecutions.Executions.Length"); i++) { ListExecutionsResponse.ListExecutions_Execution execution = new ListExecutionsResponse.ListExecutions_Execution(); execution.ExecutionId = context.StringValue("ListExecutions.Executions[" + i + "].ExecutionId"); execution.TemplateName = context.StringValue("ListExecutions.Executions[" + i + "].TemplateName"); execution.TemplateId = context.StringValue("ListExecutions.Executions[" + i + "].TemplateId"); execution.TemplateVersion = context.StringValue("ListExecutions.Executions[" + i + "].TemplateVersion"); execution.Mode = context.StringValue("ListExecutions.Executions[" + i + "].Mode"); execution.ExecutedBy = context.StringValue("ListExecutions.Executions[" + i + "].ExecutedBy"); execution.StartDate = context.StringValue("ListExecutions.Executions[" + i + "].StartDate"); execution.EndDate = context.StringValue("ListExecutions.Executions[" + i + "].EndDate"); execution.CreateDate = context.StringValue("ListExecutions.Executions[" + i + "].CreateDate"); execution.UpdateDate = context.StringValue("ListExecutions.Executions[" + i + "].UpdateDate"); execution.Status = context.StringValue("ListExecutions.Executions[" + i + "].Status"); execution.StatusMessage = context.StringValue("ListExecutions.Executions[" + i + "].StatusMessage"); execution.StatusReason = context.StringValue("ListExecutions.Executions[" + i + "].StatusReason"); execution.WaitingStatus = context.StringValue("ListExecutions.Executions[" + i + "].WaitingStatus"); execution.ParentExecutionId = context.StringValue("ListExecutions.Executions[" + i + "].ParentExecutionId"); execution.Parameters = context.StringValue("ListExecutions.Executions[" + i + "].Parameters"); execution.Outputs = context.StringValue("ListExecutions.Executions[" + i + "].Outputs"); execution.SafetyCheck = context.StringValue("ListExecutions.Executions[" + i + "].SafetyCheck"); execution.IsParent = context.BooleanValue("ListExecutions.Executions[" + i + "].IsParent"); execution.RamRole = context.StringValue("ListExecutions.Executions[" + i + "].RamRole"); execution.Counters = context.StringValue("ListExecutions.Executions[" + i + "].Counters"); execution.Category = context.StringValue("ListExecutions.Executions[" + i + "].Category"); execution.Tags = context.StringValue("ListExecutions.Executions[" + i + "].Tags"); execution.Description = context.StringValue("ListExecutions.Executions[" + i + "].Description"); List <ListExecutionsResponse.ListExecutions_Execution.ListExecutions_CurrentTask> execution_currentTasks = new List <ListExecutionsResponse.ListExecutions_Execution.ListExecutions_CurrentTask>(); for (int j = 0; j < context.Length("ListExecutions.Executions[" + i + "].CurrentTasks.Length"); j++) { ListExecutionsResponse.ListExecutions_Execution.ListExecutions_CurrentTask currentTask = new ListExecutionsResponse.ListExecutions_Execution.ListExecutions_CurrentTask(); currentTask.TaskExecutionId = context.StringValue("ListExecutions.Executions[" + i + "].CurrentTasks[" + j + "].TaskExecutionId"); currentTask.TaskName = context.StringValue("ListExecutions.Executions[" + i + "].CurrentTasks[" + j + "].TaskName"); currentTask.TaskAction = context.StringValue("ListExecutions.Executions[" + i + "].CurrentTasks[" + j + "].TaskAction"); execution_currentTasks.Add(currentTask); } execution.CurrentTasks = execution_currentTasks; listExecutionsResponse_executions.Add(execution); } listExecutionsResponse.Executions = listExecutionsResponse_executions; return(listExecutionsResponse); }