コード例 #1
0
        public void GetKinesisStreamMarshallTest()
        {
            var request    = InstantiateClassGenerator.Execute <GetKinesisStreamRequest>();
            var marshaller = new GetKinesisStreamRequestMarshaller();

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

            Comparer.CompareObjectToJson <GetKinesisStreamRequest>(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("GetKinesisStream").ResponseStructure).Execute();

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

            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
コード例 #2
0
        internal GetKinesisStreamResponse GetKinesisStream(GetKinesisStreamRequest request)
        {
            var marshaller   = new GetKinesisStreamRequestMarshaller();
            var unmarshaller = GetKinesisStreamResponseUnmarshaller.Instance;

            return(Invoke <GetKinesisStreamRequest, GetKinesisStreamResponse>(request, marshaller, unmarshaller));
        }
コード例 #3
0
        /// <summary>
        /// Initiates the asynchronous execution of the GetKinesisStream operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the GetKinesisStream 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/firehose-2015-08-04/GetKinesisStream">REST API Reference for GetKinesisStream Operation</seealso>
        public Task <GetKinesisStreamResponse> GetKinesisStreamAsync(GetKinesisStreamRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new GetKinesisStreamRequestMarshaller();
            var unmarshaller = GetKinesisStreamResponseUnmarshaller.Instance;

            return(InvokeAsync <GetKinesisStreamRequest, GetKinesisStreamResponse>(request, marshaller,
                                                                                   unmarshaller, cancellationToken));
        }
コード例 #4
0
        /// <summary>
        /// Initiates the asynchronous execution of the GetKinesisStream operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the GetKinesisStream operation on AmazonKinesisFirehoseClient.</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>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/GetKinesisStream">REST API Reference for GetKinesisStream Operation</seealso>
        public void GetKinesisStreamAsync(GetKinesisStreamRequest request, AmazonServiceCallback <GetKinesisStreamRequest, GetKinesisStreamResponse> callback, AsyncOptions options = null)
        {
            options = options == null?new AsyncOptions():options;
            var marshaller   = new GetKinesisStreamRequestMarshaller();
            var unmarshaller = GetKinesisStreamResponseUnmarshaller.Instance;
            Action <AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;

            if (callback != null)
            {
                callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => {
                    AmazonServiceResult <GetKinesisStreamRequest, GetKinesisStreamResponse> responseObject
                        = new AmazonServiceResult <GetKinesisStreamRequest, GetKinesisStreamResponse>((GetKinesisStreamRequest)req, (GetKinesisStreamResponse)res, ex, ao.State);
                    callback(responseObject);
                }
            }
            ;
            BeginInvoke <GetKinesisStreamRequest>(request, marshaller, unmarshaller, options, callbackHelper);
        }