public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonAppflowConfig config = new AmazonAppflowConfig();

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

            ListFlowsResponse resp = new ListFlowsResponse();

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

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

                foreach (var obj in resp.Flows)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            ListFlowsResponse response = new ListFlowsResponse();

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

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("flows", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller <ListedFlow, ListedFlowUnmarshaller>(ListedFlowUnmarshaller.Instance);
                    response.Flows = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("nextToken", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.NextToken = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }
Пример #3
0
        public static ListFlowsResponse Unmarshall(UnmarshallerContext context)
        {
            ListFlowsResponse listFlowsResponse = new ListFlowsResponse();

            listFlowsResponse.HttpResponse = context.HttpResponse;
            listFlowsResponse.RequestId    = context.StringValue("ListFlows.RequestId");
            listFlowsResponse.NextToken    = context.StringValue("ListFlows.NextToken");

            List <ListFlowsResponse.ListFlows_FlowsItem> listFlowsResponse_flows = new List <ListFlowsResponse.ListFlows_FlowsItem>();

            for (int i = 0; i < context.Length("ListFlows.Flows.Length"); i++)
            {
                ListFlowsResponse.ListFlows_FlowsItem flowsItem = new ListFlowsResponse.ListFlows_FlowsItem();
                flowsItem.Name             = context.StringValue("ListFlows.Flows[" + i + "].Name");
                flowsItem.Description      = context.StringValue("ListFlows.Flows[" + i + "].Description");
                flowsItem.Definition       = context.StringValue("ListFlows.Flows[" + i + "].Definition");
                flowsItem.Id               = context.StringValue("ListFlows.Flows[" + i + "].Id");
                flowsItem.Type             = context.StringValue("ListFlows.Flows[" + i + "].Type");
                flowsItem.RoleArn          = context.StringValue("ListFlows.Flows[" + i + "].RoleArn");
                flowsItem.CreatedTime      = context.StringValue("ListFlows.Flows[" + i + "].CreatedTime");
                flowsItem.LastModifiedTime = context.StringValue("ListFlows.Flows[" + i + "].LastModifiedTime");

                listFlowsResponse_flows.Add(flowsItem);
            }
            listFlowsResponse.Flows = listFlowsResponse_flows;

            return(listFlowsResponse);
        }