Esempio n. 1
0
        /// <summary>
        /// Initiates the asynchronous execution of the DescribeStream operation.
        /// <seealso cref="Amazon.Kinesis.IAmazonKinesis.DescribeStream"/>
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DescribeStream 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 <DescribeStreamResponse> DescribeStreamAsync(DescribeStreamRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new DescribeStreamRequestMarshaller();
            var unmarshaller = DescribeStreamResponseUnmarshaller.GetInstance();

            return(Invoke <IRequest, DescribeStreamRequest, DescribeStreamResponse>(request, marshaller, unmarshaller, signer, cancellationToken));
        }
Esempio n. 2
0
        /// <summary>
        /// Returns information about a stream, including the current status of the stream, its
        /// Amazon Resource Name (ARN), the composition of its shards, and its corresponding DynamoDB
        /// table.
        ///
        ///  <note>
        /// <para>
        /// You can call <i>DescribeStream</i> at a maximum rate of 10 times per second.
        /// </para>
        /// </note>
        /// <para>
        /// Each shard in the stream has a <code>SequenceNumberRange</code> associated with it.
        /// If the <code>SequenceNumberRange</code> has a <code>StartingSequenceNumber</code>
        /// but no <code>EndingSequenceNumber</code>, then the shard is still open (able to receive
        /// more stream records). If both <code>StartingSequenceNumber</code> and <code>EndingSequenceNumber</code>
        /// are present, the that shared is closed and can no longer receive more data.
        /// </para>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the DescribeStream service method.</param>
        ///
        /// <returns>The response from the DescribeStream service method, as returned by DynamoDBStreams.</returns>
        /// <exception cref="Amazon.DynamoDBv2.Model.InternalServerErrorException">
        /// An error occurred on the server side.
        /// </exception>
        /// <exception cref="Amazon.DynamoDBv2.Model.ResourceNotFoundException">
        /// The operation tried to access a nonexistent stream.
        /// </exception>
        public DescribeStreamResponse DescribeStream(DescribeStreamRequest request)
        {
            var marshaller   = new DescribeStreamRequestMarshaller();
            var unmarshaller = DescribeStreamResponseUnmarshaller.Instance;

            return(Invoke <DescribeStreamRequest, DescribeStreamResponse>(request, marshaller, unmarshaller));
        }
        public void DescribeStreamMarshallTest()
        {
            var operation = service_model.FindOperation("DescribeStream");

            var request    = InstantiateClassGenerator.Execute <DescribeStreamRequest>();
            var marshaller = new DescribeStreamRequestMarshaller();

            var internalRequest = marshaller.Marshall(request);

            TestTools.RequestValidator.Validate("DescribeStream", 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 = DescribeStreamResponseUnmarshaller.Instance;
            var response = unmarshaller.Unmarshall(context)
                           as DescribeStreamResponse;

            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
Esempio n. 4
0
        public void DescribeStreamMarshallTest()
        {
            var request    = InstantiateClassGenerator.Execute <DescribeStreamRequest>();
            var marshaller = new DescribeStreamRequestMarshaller();

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

            Comparer.CompareObjectToJson <DescribeStreamRequest>(request, jsonRequest);

            var webResponse = new WebResponseData
            {
                Headers =
                {
                    { "x-amzn-RequestId", Guid.NewGuid().ToString() },
                    { "x-amz-crc32",      "0"                       }
                }
            };
            var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("DescribeStream").ResponseStructure).Execute();

            webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString());
            UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse);
            var response = DescribeStreamResponseUnmarshaller.Instance.Unmarshall(context)
                           as DescribeStreamResponse;

            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
        public void DescribeStream_InternalServerErrorExceptionMarshallTest()
        {
            var operation = service_model.FindOperation("DescribeStream");

            var request         = InstantiateClassGenerator.Execute <DescribeStreamRequest>();
            var marshaller      = new DescribeStreamRequestMarshaller();
            var internalRequest = marshaller.Marshall(request);
            var jsonRequest     = UTF8Encoding.UTF8.GetString(internalRequest.Content);

            Comparer.CompareObjectToJson <DescribeStreamRequest>(request, jsonRequest);

            var exception    = operation.Exceptions.First(e => e.Name.Equals("InternalServerErrorException"));
            var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute();
            var webResponse  = new WebResponseData
            {
                Headers =
                {
                    { "x-amzn-RequestId", Guid.NewGuid().ToString()                                  },
                    { "x-amz-crc32",      "0"                                                        },
                    { "x-amzn-ErrorType", "InternalServerErrorException"                             },
                    { "Content-Length",   UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString() }
                }
            };
            var context  = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true);
            var response = DescribeStreamResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK);

            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
Esempio n. 6
0
        /// <summary>
        /// Initiates the asynchronous execution of the DescribeStream operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DescribeStream operation on AmazonDynamoDBStreamsClient.</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 EndDescribeStream
        ///         operation.</returns>
        public IAsyncResult BeginDescribeStream(DescribeStreamRequest request, AsyncCallback callback, object state)
        {
            var marshaller   = new DescribeStreamRequestMarshaller();
            var unmarshaller = DescribeStreamResponseUnmarshaller.Instance;

            return(BeginInvoke <DescribeStreamRequest>(request, marshaller, unmarshaller,
                                                       callback, state));
        }
        /// <summary>
        /// Initiates the asynchronous execution of the DescribeStream operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DescribeStream 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/DescribeStream">REST API Reference for DescribeStream Operation</seealso>
        public virtual Task <DescribeStreamResponse> DescribeStreamAsync(DescribeStreamRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new DescribeStreamRequestMarshaller();
            var unmarshaller = DescribeStreamResponseUnmarshaller.Instance;

            return(InvokeAsync <DescribeStreamRequest, DescribeStreamResponse>(request, marshaller,
                                                                               unmarshaller, cancellationToken));
        }
        /// <summary>
        /// Initiates the asynchronous execution of the DescribeStream operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DescribeStream 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 DescribeStreamAsync(DescribeStreamRequest request, AmazonServiceCallback <DescribeStreamRequest, DescribeStreamResponse> callback, AsyncOptions options = null)
        {
            options = options == null?new AsyncOptions():options;
            var marshaller   = new DescribeStreamRequestMarshaller();
            var unmarshaller = DescribeStreamResponseUnmarshaller.Instance;
            Action <AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;

            if (callback != null)
            {
                callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => {
                    AmazonServiceResult <DescribeStreamRequest, DescribeStreamResponse> responseObject
                        = new AmazonServiceResult <DescribeStreamRequest, DescribeStreamResponse>((DescribeStreamRequest)req, (DescribeStreamResponse)res, ex, ao.State);
                    callback(responseObject);
                }
            }
            ;
            BeginInvoke <DescribeStreamRequest>(request, marshaller, unmarshaller, options, callbackHelper);
        }
        public void DescribeStreamMarshallTest()
        {
            var request = InstantiateClassGenerator.Execute<DescribeStreamRequest>();
            var marshaller = new DescribeStreamRequestMarshaller();

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

            var webResponse = new WebResponseData
            {
                Headers = {
                    {"x-amzn-RequestId", Guid.NewGuid().ToString()},
                    {"x-amz-crc32","0"}
                }
            };
            var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("DescribeStream").ResponseStructure).Execute();
            webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString());
            UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse);
            var response = DescribeStreamResponseUnmarshaller.Instance.Unmarshall(context)
                as DescribeStreamResponse;
            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
Esempio n. 10
0
        /// <summary>
        /// <para>This operation returns the following information about the stream: the current status of the stream, the stream Amazon Resource Name
        /// (ARN), and an array of shard objects that comprise the stream. For each shard object there is information about the hash key and sequence
        /// number ranges that the shard spans, and the IDs of any earlier shards that played in a role in a MergeShards or SplitShard operation that
        /// created the shard. A sequence number is the identifier associated with every record ingested in the Amazon Kinesis stream. The sequence
        /// number is assigned by the Amazon Kinesis service when a record is put into the stream. </para> <para>You can limit the number of returned
        /// shards using the <c>Limit</c> parameter. The number of shards in a stream may be too large to return from a single call to
        /// <c>DescribeStream</c> .
        /// You can detect this by using the <c>HasMoreShards</c> flag in the returned output. <c>HasMoreShards</c> is set to <c>true</c>
        /// when there is more data available. </para> <para>If there are more shards available, you can request more shards by using the shard ID of
        /// the last shard returned by the <c>DescribeStream</c> request, in the <c>ExclusiveStartShardId</c> parameter in a subsequent request to
        /// <c>DescribeStream</c> .
        /// 
        /// <c>DescribeStream</c> is a paginated operation. </para> <para> <c>DescribeStream</c> has a limit of 10 transactions per
        /// second per account.</para>
        /// </summary>
        /// 
        /// <param name="describeStreamRequest">Container for the necessary parameters to execute the DescribeStream service method on
        /// AmazonKinesis.</param>
        /// 
        /// <returns>The response from the DescribeStream service method, as returned by AmazonKinesis.</returns>
        /// 
        /// <exception cref="T:Amazon.Kinesis.Model.LimitExceededException" />
        /// <exception cref="T:Amazon.Kinesis.Model.ResourceNotFoundException" />
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
		public Task<DescribeStreamResponse> DescribeStreamAsync(DescribeStreamRequest describeStreamRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new DescribeStreamRequestMarshaller();
            var unmarshaller = DescribeStreamResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, DescribeStreamRequest, DescribeStreamResponse>(describeStreamRequest, marshaller, unmarshaller, signer, cancellationToken);
        }
Esempio n. 11
0
        /// <summary>
        /// Initiates the asynchronous execution of the DescribeStream operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DescribeStream 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<DescribeStreamResponse> DescribeStreamAsync(DescribeStreamRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new DescribeStreamRequestMarshaller();
            var unmarshaller = DescribeStreamResponseUnmarshaller.Instance;

            return InvokeAsync<DescribeStreamRequest,DescribeStreamResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
Esempio n. 12
0
        internal DescribeStreamResponse DescribeStream(DescribeStreamRequest request)
        {
            var marshaller = new DescribeStreamRequestMarshaller();
            var unmarshaller = DescribeStreamResponseUnmarshaller.Instance;

            return Invoke<DescribeStreamRequest,DescribeStreamResponse>(request, marshaller, unmarshaller);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the DescribeStream operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DescribeStream 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 EndDescribeStream
        ///         operation.</returns>
        public IAsyncResult BeginDescribeStream(DescribeStreamRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new DescribeStreamRequestMarshaller();
            var unmarshaller = DescribeStreamResponseUnmarshaller.Instance;

            return BeginInvoke<DescribeStreamRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
Esempio n. 14
0
 /// <summary>
 /// Initiates the asynchronous execution of the DescribeStream operation.
 /// </summary>
 /// 
 /// <param name="request">Container for the necessary parameters to execute the DescribeStream 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 DescribeStreamAsync(DescribeStreamRequest request, AmazonServiceCallback<DescribeStreamRequest, DescribeStreamResponse> callback, AsyncOptions options = null)
 {
     options = options == null?new AsyncOptions():options;
     var marshaller = new DescribeStreamRequestMarshaller();
     var unmarshaller = DescribeStreamResponseUnmarshaller.Instance;
     Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;
     if(callback !=null )
         callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { 
             AmazonServiceResult<DescribeStreamRequest,DescribeStreamResponse> responseObject 
                     = new AmazonServiceResult<DescribeStreamRequest,DescribeStreamResponse>((DescribeStreamRequest)req, (DescribeStreamResponse)res, ex , ao.State);    
                 callback(responseObject); 
         };
     BeginInvoke<DescribeStreamRequest>(request, marshaller, unmarshaller, options, callbackHelper);
 }
Esempio n. 15
0
 IAsyncResult invokeDescribeStream(DescribeStreamRequest describeStreamRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new DescribeStreamRequestMarshaller().Marshall(describeStreamRequest);
     var unmarshaller = DescribeStreamResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }