public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonFMSConfig config = new AmazonFMSConfig();

            config.RegionEndpoint = region;
            ConfigureClient(config);
            AmazonFMSClient client = new AmazonFMSClient(creds, config);

            ListMemberAccountsResponse resp = new ListMemberAccountsResponse();

            do
            {
                ListMemberAccountsRequest req = new ListMemberAccountsRequest
                {
                    NextToken = resp.NextToken
                    ,
                    MaxResults = maxItems
                };

                resp = client.ListMemberAccounts(req);
                CheckError(resp.HttpStatusCode, "200");

                foreach (var obj in resp.MemberAccounts)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
Exemple #2
0
        protected IAmazonFMS CreateClient(AWSCredentials credentials, RegionEndpoint region)
        {
            var config = new AmazonFMSConfig {
                RegionEndpoint = region
            };

            Amazon.PowerShell.Utils.Common.PopulateConfig(this, config);
            this.CustomizeClientConfig(config);
            var client = new AmazonFMSClient(credentials, config);

            client.BeforeRequestEvent += RequestEventHandler;
            client.AfterResponseEvent += ResponseEventHandler;
            return(client);
        }