public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonAthenaConfig config = new AmazonAthenaConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonAthenaClient client = new AmazonAthenaClient(creds, config); ListWorkGroupsResponse resp = new ListWorkGroupsResponse(); do { ListWorkGroupsRequest req = new ListWorkGroupsRequest { NextToken = resp.NextToken , MaxResults = maxItems }; resp = client.ListWorkGroups(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.WorkGroups) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.NextToken)); }
/// <summary> /// Initiates the asynchronous execution of the ListWorkGroups operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListWorkGroups 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/athena-2017-05-18/ListWorkGroups">REST API Reference for ListWorkGroups Operation</seealso> public virtual Task <ListWorkGroupsResponse> ListWorkGroupsAsync(ListWorkGroupsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListWorkGroupsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListWorkGroupsResponseUnmarshaller.Instance; return(InvokeAsync <ListWorkGroupsResponse>(request, options, cancellationToken)); }
internal virtual ListWorkGroupsResponse ListWorkGroups(ListWorkGroupsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListWorkGroupsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListWorkGroupsResponseUnmarshaller.Instance; return(Invoke <ListWorkGroupsResponse>(request, options)); }