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

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

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("NextToken", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.NextToken = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("TaskExecutions", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller <TaskExecutionListEntry, TaskExecutionListEntryUnmarshaller>(TaskExecutionListEntryUnmarshaller.Instance);
                    response.TaskExecutions = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonDataSyncConfig config = new AmazonDataSyncConfig();

            config.RegionEndpoint = region;
            ConfigureClient(config);
            AmazonDataSyncClient client = new AmazonDataSyncClient(creds, config);

            ListTaskExecutionsResponse resp = new ListTaskExecutionsResponse();

            do
            {
                ListTaskExecutionsRequest req = new ListTaskExecutionsRequest
                {
                    NextToken = resp.NextToken
                    ,
                    MaxResults = maxItems
                };

                resp = client.ListTaskExecutions(req);
                CheckError(resp.HttpStatusCode, "200");

                foreach (var obj in resp.TaskExecutions)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
Esempio n. 3
0
        public static ListTaskExecutionsResponse Unmarshall(UnmarshallerContext context)
        {
            ListTaskExecutionsResponse listTaskExecutionsResponse = new ListTaskExecutionsResponse();

            listTaskExecutionsResponse.HttpResponse = context.HttpResponse;
            listTaskExecutionsResponse.RequestId    = context.StringValue("ListTaskExecutions.RequestId");
            listTaskExecutionsResponse.MaxResults   = context.IntegerValue("ListTaskExecutions.MaxResults");
            listTaskExecutionsResponse.NextToken    = context.StringValue("ListTaskExecutions.NextToken");

            List <ListTaskExecutionsResponse.ListTaskExecutions_TaskExecution> listTaskExecutionsResponse_taskExecutions = new List <ListTaskExecutionsResponse.ListTaskExecutions_TaskExecution>();

            for (int i = 0; i < context.Length("ListTaskExecutions.TaskExecutions.Length"); i++)
            {
                ListTaskExecutionsResponse.ListTaskExecutions_TaskExecution taskExecution = new ListTaskExecutionsResponse.ListTaskExecutions_TaskExecution();
                taskExecution.ExecutionId           = context.StringValue("ListTaskExecutions.TaskExecutions[" + i + "].ExecutionId");
                taskExecution.TaskExecutionId       = context.StringValue("ListTaskExecutions.TaskExecutions[" + i + "].TaskExecutionId");
                taskExecution.TemplateId            = context.StringValue("ListTaskExecutions.TaskExecutions[" + i + "].TemplateId");
                taskExecution.StartDate             = context.StringValue("ListTaskExecutions.TaskExecutions[" + i + "].StartDate");
                taskExecution.EndDate               = context.StringValue("ListTaskExecutions.TaskExecutions[" + i + "].EndDate");
                taskExecution.CreateDate            = context.StringValue("ListTaskExecutions.TaskExecutions[" + i + "].CreateDate");
                taskExecution.UpdateDate            = context.StringValue("ListTaskExecutions.TaskExecutions[" + i + "].UpdateDate");
                taskExecution.Status                = context.StringValue("ListTaskExecutions.TaskExecutions[" + i + "].Status");
                taskExecution.Properties            = context.StringValue("ListTaskExecutions.TaskExecutions[" + i + "].Properties");
                taskExecution.Outputs               = context.StringValue("ListTaskExecutions.TaskExecutions[" + i + "].Outputs");
                taskExecution.TaskAction            = context.StringValue("ListTaskExecutions.TaskExecutions[" + i + "].TaskAction");
                taskExecution.TaskName              = context.StringValue("ListTaskExecutions.TaskExecutions[" + i + "].TaskName");
                taskExecution.StatusMessage         = context.StringValue("ListTaskExecutions.TaskExecutions[" + i + "].StatusMessage");
                taskExecution.ChildExecutionId      = context.StringValue("ListTaskExecutions.TaskExecutions[" + i + "].ChildExecutionId");
                taskExecution.ParentTaskExecutionId = context.StringValue("ListTaskExecutions.TaskExecutions[" + i + "].ParentTaskExecutionId");
                taskExecution.LoopItem              = context.StringValue("ListTaskExecutions.TaskExecutions[" + i + "].LoopItem");
                taskExecution.Loop            = context.StringValue("ListTaskExecutions.TaskExecutions[" + i + "].Loop");
                taskExecution.ExtraData       = context.StringValue("ListTaskExecutions.TaskExecutions[" + i + "].ExtraData");
                taskExecution.LoopBatchNumber = context.IntegerValue("ListTaskExecutions.TaskExecutions[" + i + "].LoopBatchNumber");

                listTaskExecutionsResponse_taskExecutions.Add(taskExecution);
            }
            listTaskExecutionsResponse.TaskExecutions = listTaskExecutionsResponse_taskExecutions;

            return(listTaskExecutionsResponse);
        }