public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonServerlessApplicationRepositoryConfig config = new AmazonServerlessApplicationRepositoryConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonServerlessApplicationRepositoryClient client = new AmazonServerlessApplicationRepositoryClient(creds, config); ListApplicationsResponse resp = new ListApplicationsResponse(); do { ListApplicationsRequest req = new ListApplicationsRequest { NextToken = resp.NextToken , MaxItems = maxItems }; resp = client.ListApplications(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.Applications) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.NextToken)); }
protected IAmazonServerlessApplicationRepository CreateClient(AWSCredentials credentials, RegionEndpoint region) { var config = new AmazonServerlessApplicationRepositoryConfig { RegionEndpoint = region }; Amazon.PowerShell.Utils.Common.PopulateConfig(this, config); this.CustomizeClientConfig(config); var client = new AmazonServerlessApplicationRepositoryClient(credentials, config); client.BeforeRequestEvent += RequestEventHandler; client.AfterResponseEvent += ResponseEventHandler; return(client); }