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); DescribeConnectorProfilesResponse resp = new DescribeConnectorProfilesResponse(); do { DescribeConnectorProfilesRequest req = new DescribeConnectorProfilesRequest { NextToken = resp.NextToken , MaxResults = maxItems }; resp = client.DescribeConnectorProfiles(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.ConnectorProfileDetails) { 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) { DescribeConnectorProfilesResponse response = new DescribeConnectorProfilesResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("connectorProfileDetails", targetDepth)) { var unmarshaller = new ListUnmarshaller <ConnectorProfile, ConnectorProfileUnmarshaller>(ConnectorProfileUnmarshaller.Instance); response.ConnectorProfileDetails = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("nextToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextToken = unmarshaller.Unmarshall(context); continue; } } return(response); }