public void PutTraceSegmentsMarshallTest()
        {
            var operation = service_model.FindOperation("PutTraceSegments");

            var request    = InstantiateClassGenerator.Execute <PutTraceSegmentsRequest>();
            var marshaller = new PutTraceSegmentsRequestMarshaller();

            var internalRequest = marshaller.Marshall(request);

            RequestValidator.Validate("PutTraceSegments", 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.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString());
            var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
            ResponseUnmarshaller unmarshaller = PutTraceSegmentsResponseUnmarshaller.Instance;
            var response = unmarshaller.Unmarshall(context)
                           as PutTraceSegmentsResponse;

            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
Exemple #2
0
        /// <summary>
        /// Uploads segment documents to AWS X-Ray. The X-Ray SDK generates segment documents
        /// and sends them to the X-Ray daemon, which uploads them in batches. A segment document
        /// can be a completed segment, an in-progress segment, or an array of subsegments.
        ///
        ///
        /// <para>
        /// Segments must include the following fields. For the full segment document schema,
        /// see <a href="http://docs.aws.amazon.com/xray/latest/devguide/xray-api-segmentdocuments.html">AWS
        /// X-Ray Segment Documents</a> in the <i>AWS X-Ray Developer Guide</i>.
        /// </para>
        ///  <p class="title"> <b>Required Segment Document Fields</b>
        /// </para>
        ///  <ul> <li>
        /// <para>
        ///  <code>name</code> - The name of the service that handled the request.
        /// </para>
        ///  </li> <li>
        /// <para>
        ///  <code>id</code> - A 64-bit identifier for the segment, unique among segments in the
        /// same trace, in 16 hexadecimal digits.
        /// </para>
        ///  </li> <li>
        /// <para>
        ///  <code>trace_id</code> - A unique identifier that connects all segments and subsegments
        /// originating from a single client request.
        /// </para>
        ///  </li> <li>
        /// <para>
        ///  <code>start_time</code> - Time the segment or subsegment was created, in floating
        /// point seconds in epoch time, accurate to milliseconds. For example, <code>1480615200.010</code>
        /// or <code>1.480615200010E9</code>.
        /// </para>
        ///  </li> <li>
        /// <para>
        ///  <code>end_time</code> - Time the segment or subsegment was closed. For example, <code>1480615200.090</code>
        /// or <code>1.480615200090E9</code>. Specify either an <code>end_time</code> or <code>in_progress</code>.
        /// </para>
        ///  </li> <li>
        /// <para>
        ///  <code>in_progress</code> - Set to <code>true</code> instead of specifying an <code>end_time</code>
        /// to record that a segment has been started, but is not complete. Send an in progress
        /// segment when your application receives a request that will take a long time to serve,
        /// to trace the fact that the request was received. When the response is sent, send the
        /// complete segment to overwrite the in-progress segment.
        /// </para>
        ///  </li> </ul>
        /// <para>
        /// A <code>trace_id</code> consists of three numbers separated by hyphens. For example,
        /// 1-58406520-a006649127e371903a2de979. This includes:
        /// </para>
        ///  <p class="title"> <b>Trace ID Format</b>
        /// </para>
        ///  <ul> <li>
        /// <para>
        /// The version number, i.e. <code>1</code>.
        /// </para>
        ///  </li> <li>
        /// <para>
        /// The time of the original request, in Unix epoch time, in 8 hexadecimal digits. For
        /// example, 10:00AM December 2nd, 2016 PST in epoch time is <code>1480615200</code> seconds,
        /// or <code>58406520</code> in hexadecimal.
        /// </para>
        ///  </li> <li>
        /// <para>
        /// A 96-bit identifier for the trace, globally unique, in 24 hexadecimal digits.
        /// </para>
        ///  </li> </ul>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the PutTraceSegments service method.</param>
        ///
        /// <returns>The response from the PutTraceSegments service method, as returned by XRay.</returns>
        /// <exception cref="Amazon.XRay.Model.InvalidRequestException">
        /// The request is missing required parameters or has invalid parameters.
        /// </exception>
        /// <exception cref="Amazon.XRay.Model.ThrottledException">
        /// The request exceeds the maximum number of requests per second.
        /// </exception>
        public virtual PutTraceSegmentsResponse PutTraceSegments(PutTraceSegmentsRequest request)
        {
            var marshaller   = new PutTraceSegmentsRequestMarshaller();
            var unmarshaller = PutTraceSegmentsResponseUnmarshaller.Instance;

            return(Invoke <PutTraceSegmentsRequest, PutTraceSegmentsResponse>(request, marshaller, unmarshaller));
        }
Exemple #3
0
        /// <summary>
        /// Initiates the asynchronous execution of the PutTraceSegments operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the PutTraceSegments 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 virtual Task <PutTraceSegmentsResponse> PutTraceSegmentsAsync(PutTraceSegmentsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new PutTraceSegmentsRequestMarshaller();
            var unmarshaller = PutTraceSegmentsResponseUnmarshaller.Instance;

            return(InvokeAsync <PutTraceSegmentsRequest, PutTraceSegmentsResponse>(request, marshaller,
                                                                                   unmarshaller, cancellationToken));
        }
        /// <summary>
        /// Initiates the asynchronous execution of the PutTraceSegments operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the PutTraceSegments operation on AmazonXRayClient.</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 EndPutTraceSegments
        ///         operation.</returns>
        public virtual IAsyncResult BeginPutTraceSegments(PutTraceSegmentsRequest request, AsyncCallback callback, object state)
        {
            var marshaller   = new PutTraceSegmentsRequestMarshaller();
            var unmarshaller = PutTraceSegmentsResponseUnmarshaller.Instance;

            return(BeginInvoke <PutTraceSegmentsRequest>(request, marshaller, unmarshaller,
                                                         callback, state));
        }
        public void PutTraceSegmentsMarshallTest()
        {
            var operation = service_model.FindOperation("PutTraceSegments");

            var request = InstantiateClassGenerator.Execute<PutTraceSegmentsRequest>();
            var marshaller = new PutTraceSegmentsRequestMarshaller();

            var internalRequest = marshaller.Marshall(request);
            RequestValidator.Validate("PutTraceSegments", 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.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString());
            var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
            ResponseUnmarshaller unmarshaller = PutTraceSegmentsResponseUnmarshaller.Instance;
            var response = unmarshaller.Unmarshall(context)
                as PutTraceSegmentsResponse;   
            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);               
        }
Exemple #6
0
        /// <summary>
        /// Initiates the asynchronous execution of the PutTraceSegments operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the PutTraceSegments operation on AmazonXRayClient.</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 EndPutTraceSegments
        ///         operation.</returns>
        public IAsyncResult BeginPutTraceSegments(PutTraceSegmentsRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new PutTraceSegmentsRequestMarshaller();
            var unmarshaller = PutTraceSegmentsResponseUnmarshaller.Instance;

            return BeginInvoke<PutTraceSegmentsRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
Exemple #7
0
        /// <summary>
        /// Uploads segment documents to AWS X-Ray. The X-Ray SDK generates segment documents
        /// and sends them to the X-Ray daemon, which uploads them in batches. A segment document
        /// can be a completed segment, an in-progress segment, or an array of subsegments.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the PutTraceSegments service method.</param>
        /// 
        /// <returns>The response from the PutTraceSegments service method, as returned by XRay.</returns>
        /// <exception cref="Amazon.XRay.Model.InvalidRequestException">
        /// The request is missing required parameters or has invalid parameters.
        /// </exception>
        /// <exception cref="Amazon.XRay.Model.ThrottledException">
        /// The request exceeds the maximum number of requests per second.
        /// </exception>
        public PutTraceSegmentsResponse PutTraceSegments(PutTraceSegmentsRequest request)
        {
            var marshaller = new PutTraceSegmentsRequestMarshaller();
            var unmarshaller = PutTraceSegmentsResponseUnmarshaller.Instance;

            return Invoke<PutTraceSegmentsRequest,PutTraceSegmentsResponse>(request, marshaller, unmarshaller);
        }
Exemple #8
0
        /// <summary>
        /// Initiates the asynchronous execution of the PutTraceSegments operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the PutTraceSegments 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<PutTraceSegmentsResponse> PutTraceSegmentsAsync(PutTraceSegmentsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new PutTraceSegmentsRequestMarshaller();
            var unmarshaller = PutTraceSegmentsResponseUnmarshaller.Instance;

            return InvokeAsync<PutTraceSegmentsRequest,PutTraceSegmentsResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }