public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonIoTSecureTunnelingConfig config = new AmazonIoTSecureTunnelingConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonIoTSecureTunnelingClient client = new AmazonIoTSecureTunnelingClient(creds, config); ListTunnelsResponse resp = new ListTunnelsResponse(); do { ListTunnelsRequest req = new ListTunnelsRequest { NextToken = resp.NextToken , MaxResults = maxItems }; resp = client.ListTunnels(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.TunnelSummaries) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.NextToken)); }
/// <summary> /// Initiates the asynchronous execution of the ListTunnels operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListTunnels operation on AmazonIoTSecureTunnelingClient.</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 EndListTunnels /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotsecuretunneling-2018-10-05/ListTunnels">REST API Reference for ListTunnels Operation</seealso> public virtual IAsyncResult BeginListTunnels(ListTunnelsRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = ListTunnelsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListTunnelsResponseUnmarshaller.Instance; return(BeginInvoke(request, options, callback, state)); }
/// <summary> /// List all tunnels for an AWS account. Tunnels are listed by creation time in descending /// order, newer tunnels will be listed before older tunnels. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListTunnels service method.</param> /// /// <returns>The response from the ListTunnels service method, as returned by IoTSecureTunneling.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotsecuretunneling-2018-10-05/ListTunnels">REST API Reference for ListTunnels Operation</seealso> public virtual ListTunnelsResponse ListTunnels(ListTunnelsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListTunnelsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListTunnelsResponseUnmarshaller.Instance; return(Invoke <ListTunnelsResponse>(request, options)); }
/// <summary> /// List all tunnels for an AWS account. Tunnels are listed by creation time in descending /// order, newer tunnels will be listed before older tunnels. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListTunnels 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 ListTunnels service method, as returned by IoTSecureTunneling.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotsecuretunneling-2018-10-05/ListTunnels">REST API Reference for ListTunnels Operation</seealso> public virtual Task <ListTunnelsResponse> ListTunnelsAsync(ListTunnelsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListTunnelsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListTunnelsResponseUnmarshaller.Instance; return(InvokeAsync <ListTunnelsResponse>(request, options, cancellationToken)); }