public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonRedshiftDataAPIServiceConfig config = new AmazonRedshiftDataAPIServiceConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonRedshiftDataAPIServiceClient client = new AmazonRedshiftDataAPIServiceClient(creds, config); ListStatementsResponse resp = new ListStatementsResponse(); do { ListStatementsRequest req = new ListStatementsRequest { NextToken = resp.NextToken , MaxResults = maxItems }; resp = client.ListStatements(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.Statements) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.NextToken)); }
/// <summary> /// List of SQL statements. By default, only finished statements are shown. A token is /// returned to page through the statement list. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListStatements 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 ListStatements service method, as returned by RedshiftDataAPIService.</returns> /// <exception cref="Amazon.RedshiftDataAPIService.Model.InternalServerException"> /// The Amazon Redshift Data API operation failed due to invalid input. /// </exception> /// <exception cref="Amazon.RedshiftDataAPIService.Model.ValidationException"> /// The Amazon Redshift Data API operation failed due to invalid input. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/redshift-data-2019-12-20/ListStatements">REST API Reference for ListStatements Operation</seealso> public virtual Task <ListStatementsResponse> ListStatementsAsync(ListStatementsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListStatementsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListStatementsResponseUnmarshaller.Instance; return(InvokeAsync <ListStatementsResponse>(request, options, cancellationToken)); }
internal virtual ListStatementsResponse ListStatements(ListStatementsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListStatementsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListStatementsResponseUnmarshaller.Instance; return(Invoke <ListStatementsResponse>(request, options)); }
/// <summary> /// Initiates the asynchronous execution of the ListStatements operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListStatements operation on AmazonRedshiftDataAPIServiceClient.</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 EndListStatements /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/redshift-data-2019-12-20/ListStatements">REST API Reference for ListStatements Operation</seealso> public virtual IAsyncResult BeginListStatements(ListStatementsRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = ListStatementsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListStatementsResponseUnmarshaller.Instance; return(BeginInvoke(request, options, callback, state)); }