public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonIVSConfig config = new AmazonIVSConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonIVSClient client = new AmazonIVSClient(creds, config); ListPlaybackKeyPairsResponse resp = new ListPlaybackKeyPairsResponse(); do { ListPlaybackKeyPairsRequest req = new ListPlaybackKeyPairsRequest { NextToken = resp.NextToken , MaxResults = maxItems }; resp = client.ListPlaybackKeyPairs(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.KeyPairs) { 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) { ListPlaybackKeyPairsResponse response = new ListPlaybackKeyPairsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("keyPairs", targetDepth)) { var unmarshaller = new ListUnmarshaller <PlaybackKeyPairSummary, PlaybackKeyPairSummaryUnmarshaller>(PlaybackKeyPairSummaryUnmarshaller.Instance); response.KeyPairs = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("nextToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextToken = unmarshaller.Unmarshall(context); continue; } } return(response); }