コード例 #1
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonManagedBlockchainConfig config = new AmazonManagedBlockchainConfig();

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

            ListProposalsResponse resp = new ListProposalsResponse();

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

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

                foreach (var obj in resp.Proposals)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
        /// <summary>
        /// Initiates the asynchronous execution of the ListProposals operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the ListProposals operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/managedblockchain-2018-09-24/ListProposals">REST API Reference for ListProposals Operation</seealso>
        public virtual Task <ListProposalsResponse> ListProposalsAsync(ListProposalsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListProposalsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListProposalsResponseUnmarshaller.Instance;

            return(InvokeAsync <ListProposalsResponse>(request, options, cancellationToken));
        }
        internal virtual ListProposalsResponse ListProposals(ListProposalsRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListProposalsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListProposalsResponseUnmarshaller.Instance;

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