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

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

            ListOutpostsResponse resp = new ListOutpostsResponse();

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

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

                foreach (var obj in resp.Outposts)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
コード例 #2
0
        /// <summary>
        /// List the Outposts for your AWS account.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the ListOutposts 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 ListOutposts service method, as returned by Outposts.</returns>
        /// <exception cref="Amazon.Outposts.Model.AccessDeniedException">
        /// You do not have permission to perform this operation.
        /// </exception>
        /// <exception cref="Amazon.Outposts.Model.InternalServerException">
        /// An internal error has occurred.
        /// </exception>
        /// <exception cref="Amazon.Outposts.Model.ValidationException">
        /// A parameter is not valid.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/outposts-2019-12-03/ListOutposts">REST API Reference for ListOutposts Operation</seealso>
        public virtual Task <ListOutpostsResponse> ListOutpostsAsync(ListOutpostsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListOutpostsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListOutpostsResponseUnmarshaller.Instance;

            return(InvokeAsync <ListOutpostsResponse>(request, options, cancellationToken));
        }
コード例 #3
0
        internal virtual ListOutpostsResponse ListOutposts(ListOutpostsRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListOutpostsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListOutpostsResponseUnmarshaller.Instance;

            return(Invoke <ListOutpostsResponse>(request, options));
        }
コード例 #4
0
        /// <summary>
        /// Initiates the asynchronous execution of the ListOutposts operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the ListOutposts operation on AmazonOutpostsClient.</param>
        /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
        /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
        ///          procedure using the AsyncState property.</param>
        ///
        /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListOutposts
        ///         operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/outposts-2019-12-03/ListOutposts">REST API Reference for ListOutposts Operation</seealso>
        public virtual IAsyncResult BeginListOutposts(ListOutpostsRequest request, AsyncCallback callback, object state)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListOutpostsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListOutpostsResponseUnmarshaller.Instance;

            return(BeginInvoke(request, options, callback, state));
        }