public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonMWAAConfig config = new AmazonMWAAConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonMWAAClient client = new AmazonMWAAClient(creds, config); ListEnvironmentsResponse resp = new ListEnvironmentsResponse(); do { ListEnvironmentsRequest req = new ListEnvironmentsRequest { NextToken = resp.NextToken , MaxResults = maxItems }; resp = client.ListEnvironments(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.Environments) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.NextToken)); }
/// <summary> /// Gets a list of AWS Cloud9 development environment identifiers. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListEnvironments service method.</param> /// /// <returns>The response from the ListEnvironments service method, as returned by Cloud9.</returns> /// <exception cref="Amazon.Cloud9.Model.BadRequestException"> /// The target request is invalid. /// </exception> /// <exception cref="Amazon.Cloud9.Model.ConflictException"> /// A conflict occurred. /// </exception> /// <exception cref="Amazon.Cloud9.Model.ForbiddenException"> /// An access permissions issue occurred. /// </exception> /// <exception cref="Amazon.Cloud9.Model.InternalServerErrorException"> /// An internal server error occurred. /// </exception> /// <exception cref="Amazon.Cloud9.Model.LimitExceededException"> /// A service limit was exceeded. /// </exception> /// <exception cref="Amazon.Cloud9.Model.NotFoundException"> /// The target resource cannot be found. /// </exception> /// <exception cref="Amazon.Cloud9.Model.TooManyRequestsException"> /// Too many service requests were made over the given time period. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cloud9-2017-09-23/ListEnvironments">REST API Reference for ListEnvironments Operation</seealso> public virtual ListEnvironmentsResponse ListEnvironments(ListEnvironmentsRequest request) { var marshaller = ListEnvironmentsRequestMarshaller.Instance; var unmarshaller = ListEnvironmentsResponseUnmarshaller.Instance; return(Invoke <ListEnvironmentsRequest, ListEnvironmentsResponse>(request, marshaller, unmarshaller)); }
/// <summary> /// Initiates the asynchronous execution of the ListEnvironments operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListEnvironments 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/cloud9-2017-09-23/ListEnvironments">REST API Reference for ListEnvironments Operation</seealso> public virtual Task <ListEnvironmentsResponse> ListEnvironmentsAsync(ListEnvironmentsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = ListEnvironmentsRequestMarshaller.Instance; var unmarshaller = ListEnvironmentsResponseUnmarshaller.Instance; return(InvokeAsync <ListEnvironmentsRequest, ListEnvironmentsResponse>(request, marshaller, unmarshaller, cancellationToken)); }
/// <summary> /// Lists the Amazon Managed Workflows for Apache Airflow (MWAA) environments. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListEnvironments 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 ListEnvironments service method, as returned by MWAA.</returns> /// <exception cref="Amazon.MWAA.Model.InternalServerException"> /// InternalServerException: An internal error has occurred. /// </exception> /// <exception cref="Amazon.MWAA.Model.ValidationException"> /// ValidationException: The provided input is not valid. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/mwaa-2020-07-01/ListEnvironments">REST API Reference for ListEnvironments Operation</seealso> public virtual Task <ListEnvironmentsResponse> ListEnvironmentsAsync(ListEnvironmentsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListEnvironmentsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListEnvironmentsResponseUnmarshaller.Instance; return(InvokeAsync <ListEnvironmentsResponse>(request, options, cancellationToken)); }
internal virtual ListEnvironmentsResponse ListEnvironments(ListEnvironmentsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListEnvironmentsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListEnvironmentsResponseUnmarshaller.Instance; return(Invoke <ListEnvironmentsResponse>(request, options)); }
/// <summary> /// Initiates the asynchronous execution of the ListEnvironments operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListEnvironments operation on AmazonFinspaceClient.</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 EndListEnvironments /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/finspace-2021-03-12/ListEnvironments">REST API Reference for ListEnvironments Operation</seealso> public virtual IAsyncResult BeginListEnvironments(ListEnvironmentsRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = ListEnvironmentsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListEnvironmentsResponseUnmarshaller.Instance; return(BeginInvoke(request, options, callback, state)); }
/// <summary>Snippet for ListEnvironments</summary> public async Task ListEnvironmentsRequestObjectAsync() { // Snippet: ListEnvironmentsAsync(ListEnvironmentsRequest, CallSettings) // Create client EnvironmentsClient environmentsClient = await EnvironmentsClient.CreateAsync(); // Initialize request argument(s) ListEnvironmentsRequest request = new ListEnvironmentsRequest { ParentAsAgentName = AgentName.FromProject("[PROJECT]"), }; // Make the request PagedAsyncEnumerable <ListEnvironmentsResponse, gcdv::Environment> response = environmentsClient.ListEnvironmentsAsync(request); // Iterate over all response items, lazily performing RPCs as required await response.ForEachAsync((gcdv::Environment item) => { // Do something with each item Console.WriteLine(item); }); // Or iterate over pages (of server-defined size), performing one RPC per page await response.AsRawResponses().ForEachAsync((ListEnvironmentsResponse page) => { // Do something with each page of items Console.WriteLine("A page of results:"); foreach (gcdv::Environment item in page) { // Do something with each item Console.WriteLine(item); } }); // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; Page <gcdv::Environment> singlePage = await response.ReadPageAsync(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); foreach (gcdv::Environment item in singlePage) { // Do something with each item Console.WriteLine(item); } // Store the pageToken, for when the next page is required. string nextPageToken = singlePage.NextPageToken; // End snippet }
/// <summary>Snippet for ListEnvironments</summary> public void ListEnvironmentsRequestObject() { // Snippet: ListEnvironments(ListEnvironmentsRequest, CallSettings) // Create client EnvironmentsClient environmentsClient = EnvironmentsClient.Create(); // Initialize request argument(s) ListEnvironmentsRequest request = new ListEnvironmentsRequest { Parent = "", }; // Make the request PagedEnumerable <ListEnvironmentsResponse, gcoasv::Environment> response = environmentsClient.ListEnvironments(request); // Iterate over all response items, lazily performing RPCs as required foreach (gcoasv::Environment item in response) { // Do something with each item Console.WriteLine(item); } // Or iterate over pages (of server-defined size), performing one RPC per page foreach (ListEnvironmentsResponse page in response.AsRawResponses()) { // Do something with each page of items Console.WriteLine("A page of results:"); foreach (gcoasv::Environment item in page) { // Do something with each item Console.WriteLine(item); } } // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; Page <gcoasv::Environment> singlePage = response.ReadPage(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); foreach (gcoasv::Environment item in singlePage) { // Do something with each item Console.WriteLine(item); } // Store the pageToken, for when the next page is required. string nextPageToken = singlePage.NextPageToken; // End snippet }