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

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

            ListLedgersResponse resp = new ListLedgersResponse();

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

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

                foreach (var obj in resp.Ledgers)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
Esempio n. 2
0
        /// <summary>
        /// Returns an array of ledger summaries that are associated with the current AWS account
        /// and Region.
        ///
        ///
        /// <para>
        /// This action returns a maximum of 100 items and is paginated so that you can retrieve
        /// all the items by calling <code>ListLedgers</code> multiple times.
        /// </para>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the ListLedgers service method.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        ///
        /// <returns>The response from the ListLedgers service method, as returned by QLDB.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/qldb-2019-01-02/ListLedgers">REST API Reference for ListLedgers Operation</seealso>
        public virtual Task <ListLedgersResponse> ListLedgersAsync(ListLedgersRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListLedgersRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListLedgersResponseUnmarshaller.Instance;

            return(InvokeAsync <ListLedgersResponse>(request, options, cancellationToken));
        }
Esempio n. 3
0
        internal virtual ListLedgersResponse ListLedgers(ListLedgersRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListLedgersRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListLedgersResponseUnmarshaller.Instance;

            return(Invoke <ListLedgersResponse>(request, options));
        }