public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonGlueConfig config = new AmazonGlueConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonGlueClient client = new AmazonGlueClient(creds, config); GetTriggersResponse resp = new GetTriggersResponse(); do { GetTriggersRequest req = new GetTriggersRequest { NextToken = resp.NextToken , MaxResults = maxItems }; resp = client.GetTriggers(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.Triggers) { 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) { GetTriggersResponse response = new GetTriggersResponse(); 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("Triggers", targetDepth)) { var unmarshaller = new ListUnmarshaller <Trigger, TriggerUnmarshaller>(TriggerUnmarshaller.Instance); response.Triggers = unmarshaller.Unmarshall(context); continue; } } return(response); }