public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonOrganizationsConfig config = new AmazonOrganizationsConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonOrganizationsClient client = new AmazonOrganizationsClient(creds, config); ListHandshakesForOrganizationResponse resp = new ListHandshakesForOrganizationResponse(); do { ListHandshakesForOrganizationRequest req = new ListHandshakesForOrganizationRequest { NextToken = resp.NextToken , MaxResults = maxItems }; resp = client.ListHandshakesForOrganization(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.Handshakes) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.NextToken)); }
protected IAmazonOrganizations CreateClient(AWSCredentials credentials, RegionEndpoint region) { var config = new AmazonOrganizationsConfig { RegionEndpoint = region }; Amazon.PowerShell.Utils.Common.PopulateConfig(this, config); this.CustomizeClientConfig(config); var client = new AmazonOrganizationsClient(credentials, config); client.BeforeRequestEvent += RequestEventHandler; client.AfterResponseEvent += ResponseEventHandler; return(client); }