Example #1
0
        /// <summary>
        /// Initiates the asynchronous execution of the CreateStream operation.
        /// <seealso cref="Amazon.Kinesis.IAmazonKinesis.CreateStream"/>
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the CreateStream 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 <CreateStreamResponse> CreateStreamAsync(CreateStreamRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new CreateStreamRequestMarshaller();
            var unmarshaller = CreateStreamResponseUnmarshaller.GetInstance();

            return(Invoke <IRequest, CreateStreamRequest, CreateStreamResponse>(request, marshaller, unmarshaller, signer, cancellationToken));
        }
        /// <summary>
        /// Creates a new Kinesis video stream.
        ///
        ///
        /// <para>
        /// When you create a new stream, Kinesis Video Streams assigns it a version number. When
        /// you change the stream's metadata, Kinesis Video Streams updates the version.
        /// </para>
        ///
        /// <para>
        ///  <code>CreateStream</code> is an asynchronous operation.
        /// </para>
        ///
        /// <para>
        /// For information about how the service works, see <a href="http://docs.aws.amazon.com/kinesisvideostreams/latest/dg/how-it-works.html">How
        /// it Works</a>.
        /// </para>
        ///
        /// <para>
        /// You must have permissions for the <code>KinesisVideo:CreateStream</code> action.
        /// </para>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the CreateStream service method.</param>
        ///
        /// <returns>The response from the CreateStream service method, as returned by KinesisVideo.</returns>
        /// <exception cref="Amazon.KinesisVideo.Model.AccountStreamLimitExceededException">
        /// The number of streams created for the account is too high.
        /// </exception>
        /// <exception cref="Amazon.KinesisVideo.Model.ClientLimitExceededException">
        /// Kinesis Video Streams has throttled the request because you have exceeded the limit
        /// of allowed client calls. Try making the call later.
        /// </exception>
        /// <exception cref="Amazon.KinesisVideo.Model.DeviceStreamLimitExceededException">
        /// Not implemented.
        /// </exception>
        /// <exception cref="Amazon.KinesisVideo.Model.InvalidArgumentException">
        /// The value for this input parameter is invalid.
        /// </exception>
        /// <exception cref="Amazon.KinesisVideo.Model.InvalidDeviceException">
        /// Not implemented.
        /// </exception>
        /// <exception cref="Amazon.KinesisVideo.Model.ResourceInUseException">
        /// The stream is currently not available for this operation.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/CreateStream">REST API Reference for CreateStream Operation</seealso>
        public virtual CreateStreamResponse CreateStream(CreateStreamRequest request)
        {
            var marshaller   = new CreateStreamRequestMarshaller();
            var unmarshaller = CreateStreamResponseUnmarshaller.Instance;

            return(Invoke <CreateStreamRequest, CreateStreamResponse>(request, marshaller, unmarshaller));
        }
        public void CreateStreamMarshallTest()
        {
            var operation = service_model.FindOperation("CreateStream");

            var request    = InstantiateClassGenerator.Execute <CreateStreamRequest>();
            var marshaller = new CreateStreamRequestMarshaller();

            var internalRequest = marshaller.Marshall(request);

            TestTools.RequestValidator.Validate("CreateStream", request, internalRequest, service_model);

            var webResponse = new WebResponseData
            {
                Headers =
                {
                    { "x-amzn-RequestId", Guid.NewGuid().ToString() },
                    { "x-amz-crc32",      "0"                       }
                }
            };

            var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();

            webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
            var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
            ResponseUnmarshaller unmarshaller = CreateStreamResponseUnmarshaller.Instance;
            var response = unmarshaller.Unmarshall(context)
                           as CreateStreamResponse;

            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the CreateStream operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the CreateStream 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/kinesisvideo-2017-09-30/CreateStream">REST API Reference for CreateStream Operation</seealso>
        public virtual Task <CreateStreamResponse> CreateStreamAsync(CreateStreamRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new CreateStreamRequestMarshaller();
            var unmarshaller = CreateStreamResponseUnmarshaller.Instance;

            return(InvokeAsync <CreateStreamRequest, CreateStreamResponse>(request, marshaller,
                                                                           unmarshaller, cancellationToken));
        }
        public void CreateStreamMarshallTest()
        {
            var request = InstantiateClassGenerator.Execute<CreateStreamRequest>();
            var marshaller = new CreateStreamRequestMarshaller();

            var internalRequest = marshaller.Marshall(request);
            var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content);                        
            Comparer.CompareObjectToJson<CreateStreamRequest>(request,jsonRequest);

        }
Example #6
0
        public void CreateStreamMarshallTest()
        {
            var request    = InstantiateClassGenerator.Execute <CreateStreamRequest>();
            var marshaller = new CreateStreamRequestMarshaller();

            var internalRequest = marshaller.Marshall(request);
            var jsonRequest     = UTF8Encoding.UTF8.GetString(internalRequest.Content);

            Comparer.CompareObjectToJson <CreateStreamRequest>(request, jsonRequest);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the CreateStream operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the CreateStream 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 CreateStreamAsync(CreateStreamRequest request, AmazonServiceCallback <CreateStreamRequest, CreateStreamResponse> callback, AsyncOptions options = null)
        {
            options = options == null?new AsyncOptions():options;
            var marshaller   = new CreateStreamRequestMarshaller();
            var unmarshaller = CreateStreamResponseUnmarshaller.Instance;
            Action <AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;

            if (callback != null)
            {
                callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => {
                    AmazonServiceResult <CreateStreamRequest, CreateStreamResponse> responseObject
                        = new AmazonServiceResult <CreateStreamRequest, CreateStreamResponse>((CreateStreamRequest)req, (CreateStreamResponse)res, ex, ao.State);
                    callback(responseObject);
                }
            }
            ;
            BeginInvoke <CreateStreamRequest>(request, marshaller, unmarshaller, options, callbackHelper);
        }
        /// <summary>
        /// <para>This operation adds a new Amazon Kinesis stream to your AWS account. A stream captures and transports data records that are
        /// continuously emitted from different data sources or <i>producers</i> .
        /// Scale-out within an Amazon Kinesis stream is explicitly supported by means of shards, which are uniquely identified groups of
        /// data records in an Amazon Kinesis stream.</para> <para>You specify and control the number of shards that a stream is composed of. Each shard
        /// can support up to 5 read transactions per second up to a maximum total of 2 MB of data read per second. Each shard can support up to 1000
        /// write transactions per second up to a maximum total of 1 MB data written per second. You can add shards to a stream if the amount of data
        /// input increases and you can remove shards if the amount of data input decreases.</para> <para>The stream name identifies the stream. The
        /// name is scoped to the AWS account used by the application. It is also scoped by region. That is, two streams in two different accounts can
        /// have the same name, and two streams in the same account, but in two different regions, can have the same name. </para> <para>
        /// <c>CreateStream</c> is an asynchronous operation. Upon receiving a <c>CreateStream</c> request, Amazon Kinesis immediately returns and sets
        /// the stream status to CREATING. After the stream is created, Amazon Kinesis sets the stream status to ACTIVE. You should perform read and
        /// write operations only on an ACTIVE stream. </para> <para>You receive a <c>LimitExceededException</c> when making a <c>CreateStream</c>
        /// request if you try to do one of the following:</para>
        /// <ul>
        /// <li>Have more than five streams in the CREATING state at any point in time.</li>
        /// <li>Create more shards than are authorized for your account.</li>
        /// 
        /// </ul>
        /// <para> <b>Note:</b> The default limit for an AWS account is two shards per stream. If you need to create a stream with more than two
        /// shards, contact AWS Support to increase the limit on your account.</para> <para>You can use the <c>DescribeStream</c> operation to check the
        /// stream status, which is returned in <c>StreamStatus</c> .</para> <para> <c>CreateStream</c> has a limit of 5 transactions per second per
        /// account.</para>
        /// </summary>
        /// 
        /// <param name="createStreamRequest">Container for the necessary parameters to execute the CreateStream service method on
        /// AmazonKinesis.</param>
        /// 
        /// <exception cref="T:Amazon.Kinesis.Model.LimitExceededException" />
        /// <exception cref="T:Amazon.Kinesis.Model.ResourceInUseException" />
        /// <exception cref="T:Amazon.Kinesis.Model.InvalidArgumentException" />
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
		public Task<CreateStreamResponse> CreateStreamAsync(CreateStreamRequest createStreamRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CreateStreamRequestMarshaller();
            var unmarshaller = CreateStreamResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, CreateStreamRequest, CreateStreamResponse>(createStreamRequest, marshaller, unmarshaller, signer, cancellationToken);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the CreateStream operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateStream 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<CreateStreamResponse> CreateStreamAsync(CreateStreamRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CreateStreamRequestMarshaller();
            var unmarshaller = CreateStreamResponseUnmarshaller.Instance;

            return InvokeAsync<CreateStreamRequest,CreateStreamResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
        internal CreateStreamResponse CreateStream(CreateStreamRequest request)
        {
            var marshaller = new CreateStreamRequestMarshaller();
            var unmarshaller = CreateStreamResponseUnmarshaller.Instance;

            return Invoke<CreateStreamRequest,CreateStreamResponse>(request, marshaller, unmarshaller);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the CreateStream operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateStream 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 EndCreateStream
        ///         operation.</returns>
        public IAsyncResult BeginCreateStream(CreateStreamRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new CreateStreamRequestMarshaller();
            var unmarshaller = CreateStreamResponseUnmarshaller.Instance;

            return BeginInvoke<CreateStreamRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
Example #12
0
 /// <summary>
 /// Initiates the asynchronous execution of the CreateStream operation.
 /// </summary>
 /// 
 /// <param name="request">Container for the necessary parameters to execute the CreateStream 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 CreateStreamAsync(CreateStreamRequest request, AmazonServiceCallback<CreateStreamRequest, CreateStreamResponse> callback, AsyncOptions options = null)
 {
     options = options == null?new AsyncOptions():options;
     var marshaller = new CreateStreamRequestMarshaller();
     var unmarshaller = CreateStreamResponseUnmarshaller.Instance;
     Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;
     if(callback !=null )
         callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { 
             AmazonServiceResult<CreateStreamRequest,CreateStreamResponse> responseObject 
                     = new AmazonServiceResult<CreateStreamRequest,CreateStreamResponse>((CreateStreamRequest)req, (CreateStreamResponse)res, ex , ao.State);    
                 callback(responseObject); 
         };
     BeginInvoke<CreateStreamRequest>(request, marshaller, unmarshaller, options, callbackHelper);
 }
 IAsyncResult invokeCreateStream(CreateStreamRequest createStreamRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new CreateStreamRequestMarshaller().Marshall(createStreamRequest);
     var unmarshaller = CreateStreamResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }