public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.Kinesis.Model.ListStreamsRequest(); if (cmdletContext.ExclusiveStartStreamName != null) { request.ExclusiveStartStreamName = cmdletContext.ExclusiveStartStreamName; } if (cmdletContext.Limit != null) { request.Limit = cmdletContext.Limit.Value; } CmdletOutput output; // issue call var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; pipelineOutput = cmdletContext.Select(response, this); output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; } catch (Exception e) { output = new CmdletOutput { ErrorResponse = e }; } return(output); }
/// <summary> /// <para> This operation returns an array of the names of all the streams that are associated with the AWS account making the /// <c>ListStreams</c> request. A given AWS account can have many streams active at one time. </para> <para> The number of streams may be too /// large to return from a single call to <c>ListStreams</c> . /// You can limit the number of returned streams using the <c>Limit</c> parameter. If you do not specify a value for the /// <c>Limit</c> parameter, Amazon Kinesis uses the default limit, which is currently 10.</para> <para> You can detect if there are more streams /// available to list by using the <c>HasMoreStreams</c> flag from the returned output. If there are more streams available, you can request /// more streams by using the name of the last stream returned by the <c>ListStreams</c> request in the <c>ExclusiveStartStreamName</c> /// parameter in a subsequent request to <c>ListStreams</c> . /// The group of stream names returned by the subsequent request is then added to the list. You can continue this process until all /// the stream names have been collected in the list. </para> <para> <c>ListStreams</c> has a limit of 5 transactions per second per /// account.</para> /// </summary> /// /// <param name="listStreamsRequest">Container for the necessary parameters to execute the ListStreams service method on AmazonKinesis.</param> /// /// <returns>The response from the ListStreams service method, as returned by AmazonKinesis.</returns> /// /// <exception cref="T:Amazon.Kinesis.Model.LimitExceededException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task<ListStreamsResponse> ListStreamsAsync(ListStreamsRequest listStreamsRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ListStreamsRequestMarshaller(); var unmarshaller = ListStreamsResponseUnmarshaller.GetInstance(); return Invoke<IRequest, ListStreamsRequest, ListStreamsResponse>(listStreamsRequest, marshaller, unmarshaller, signer, cancellationToken); }
internal ListStreamsResponse ListStreams(ListStreamsRequest request) { var task = ListStreamsAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// Initiates the asynchronous execution of the ListStreams operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListStreams 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> public Task<ListStreamsResponse> ListStreamsAsync(ListStreamsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ListStreamsRequestMarshaller(); var unmarshaller = ListStreamsResponseUnmarshaller.Instance; return InvokeAsync<ListStreamsRequest,ListStreamsResponse>(request, marshaller, unmarshaller, cancellationToken); }
internal ListStreamsResponse ListStreams(ListStreamsRequest request) { var marshaller = new ListStreamsRequestMarshaller(); var unmarshaller = ListStreamsResponseUnmarshaller.Instance; return Invoke<ListStreamsRequest,ListStreamsResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the ListStreams operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListStreams operation on AmazonKinesisClient.</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 EndListStreams /// operation.</returns> public IAsyncResult BeginListStreams(ListStreamsRequest request, AsyncCallback callback, object state) { var marshaller = new ListStreamsRequestMarshaller(); var unmarshaller = ListStreamsResponseUnmarshaller.Instance; return BeginInvoke<ListStreamsRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// <para> This operation returns an array of the names of all the streams that are associated with the AWS account making the /// <c>ListStreams</c> request. A given AWS account can have many streams active at one time. </para> <para> The number of streams may be too /// large to return from a single call to <c>ListStreams</c> . /// You can limit the number of returned streams using the <c>Limit</c> parameter. If you do not specify a value for the /// <c>Limit</c> parameter, Amazon Kinesis uses the default limit, which is currently 10.</para> <para> You can detect if there are more streams /// available to list by using the <c>HasMoreStreams</c> flag from the returned output. If there are more streams available, you can request /// more streams by using the name of the last stream returned by the <c>ListStreams</c> request in the <c>ExclusiveStartStreamName</c> /// parameter in a subsequent request to <c>ListStreams</c> . /// The group of stream names returned by the subsequent request is then added to the list. You can continue this process until all /// the stream names have been collected in the list. </para> <para> <c>ListStreams</c> has a limit of 5 transactions per second per /// account.</para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListStreams service method on AmazonKinesis.</param> /// /// <returns>The response from the ListStreams service method, as returned by AmazonKinesis.</returns> /// /// <exception cref="T:Amazon.Kinesis.Model.LimitExceededException" /> public ListStreamsResponse ListStreams(ListStreamsRequest request) { var task = ListStreamsAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// Initiates the asynchronous execution of the ListStreams operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListStreams operation on AmazonKinesisClient.</param> /// <param name="callback">An Action delegate that is invoked when the operation completes.</param> /// <param name="options">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> public void ListStreamsAsync(ListStreamsRequest request, AmazonServiceCallback<ListStreamsRequest, ListStreamsResponse> callback, AsyncOptions options = null) { options = options == null?new AsyncOptions():options; var marshaller = new ListStreamsRequestMarshaller(); var unmarshaller = ListStreamsResponseUnmarshaller.Instance; Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null; if(callback !=null ) callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { AmazonServiceResult<ListStreamsRequest,ListStreamsResponse> responseObject = new AmazonServiceResult<ListStreamsRequest,ListStreamsResponse>((ListStreamsRequest)req, (ListStreamsResponse)res, ex , ao.State); callback(responseObject); }; BeginInvoke<ListStreamsRequest>(request, marshaller, unmarshaller, options, callbackHelper); }
IAsyncResult invokeListStreams(ListStreamsRequest listStreamsRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new ListStreamsRequestMarshaller().Marshall(listStreamsRequest); var unmarshaller = ListStreamsResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the ListStreams operation. /// <seealso cref="Amazon.Kinesis.IAmazonKinesis.ListStreams"/> /// </summary> /// /// <param name="listStreamsRequest">Container for the necessary parameters to execute the ListStreams operation on AmazonKinesis.</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 EndListStreams /// operation.</returns> public IAsyncResult BeginListStreams(ListStreamsRequest listStreamsRequest, AsyncCallback callback, object state) { return invokeListStreams(listStreamsRequest, callback, state, false); }
/// <summary> /// <para> This operation returns an array of the names of all the streams that are associated with the AWS account making the /// <c>ListStreams</c> request. A given AWS account can have many streams active at one time. </para> <para> The number of streams may be too /// large to return from a single call to <c>ListStreams</c> . /// You can limit the number of returned streams using the <c>Limit</c> parameter. If you do not specify a value for the /// <c>Limit</c> parameter, Amazon Kinesis uses the default limit, which is currently 10.</para> <para> You can detect if there are more streams /// available to list by using the <c>HasMoreStreams</c> flag from the returned output. If there are more streams available, you can request /// more streams by using the name of the last stream returned by the <c>ListStreams</c> request in the <c>ExclusiveStartStreamName</c> /// parameter in a subsequent request to <c>ListStreams</c> . /// The group of stream names returned by the subsequent request is then added to the list. You can continue this process until all /// the stream names have been collected in the list. </para> <para> <c>ListStreams</c> has a limit of 5 transactions per second per /// account.</para> /// </summary> /// /// <param name="listStreamsRequest">Container for the necessary parameters to execute the ListStreams service method on AmazonKinesis.</param> /// /// <returns>The response from the ListStreams service method, as returned by AmazonKinesis.</returns> /// /// <exception cref="LimitExceededException"/> public ListStreamsResponse ListStreams(ListStreamsRequest listStreamsRequest) { IAsyncResult asyncResult = invokeListStreams(listStreamsRequest, null, null, true); return EndListStreams(asyncResult); }
private Amazon.Kinesis.Model.ListStreamsResponse CallAWSServiceOperation(IAmazonKinesis client, Amazon.Kinesis.Model.ListStreamsRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Kinesis", "ListStreams"); try { #if DESKTOP return(client.ListStreams(request)); #elif CORECLR return(client.ListStreamsAsync(request).GetAwaiter().GetResult()); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } }