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); ListStreamsResponse resp = new ListStreamsResponse(); do { ListStreamsRequest req = new ListStreamsRequest { NextToken = resp.NextToken , MaxResults = maxItems }; resp = client.ListStreams(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.Streams) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.NextToken)); }
protected IAmazonIVS CreateClient(AWSCredentials credentials, RegionEndpoint region) { var config = new AmazonIVSConfig { RegionEndpoint = region }; Amazon.PowerShell.Utils.Common.PopulateConfig(this, config); this.CustomizeClientConfig(config); var client = new AmazonIVSClient(credentials, config); client.BeforeRequestEvent += RequestEventHandler; client.AfterResponseEvent += ResponseEventHandler; return(client); }