/// <summary> /// Updates stream metadata, such as the device name and media type. /// /// /// <para> /// You must provide the stream name or the Amazon Resource Name (ARN) of the stream. /// </para> /// /// <para> /// To make sure that you have the latest version of the stream before updating it, you /// can specify the stream version. Kinesis Video Streams assigns a version to each stream. /// When you update a stream, Kinesis Video Streams assigns a new version number. To get /// the latest stream version, use the <code>DescribeStream</code> API. /// </para> /// /// <para> /// <code>UpdateStream</code> is an asynchronous operation, and takes time to complete. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateStream service method.</param> /// /// <returns>The response from the UpdateStream service method, as returned by KinesisVideo.</returns> /// <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.InvalidArgumentException"> /// The value for this input parameter is invalid. /// </exception> /// <exception cref="Amazon.KinesisVideo.Model.NotAuthorizedException"> /// The caller is not authorized to perform this operation. /// </exception> /// <exception cref="Amazon.KinesisVideo.Model.ResourceInUseException"> /// The stream is currently not available for this operation. /// </exception> /// <exception cref="Amazon.KinesisVideo.Model.ResourceNotFoundException"> /// Amazon Kinesis Video Streams can't find the stream that you specified. /// </exception> /// <exception cref="Amazon.KinesisVideo.Model.VersionMismatchException"> /// The stream version that you specified is not the latest version. To get the latest /// version, use the <a href="http://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_DescribeStream.html">DescribeStream</a> /// API. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/UpdateStream">REST API Reference for UpdateStream Operation</seealso> public virtual UpdateStreamResponse UpdateStream(UpdateStreamRequest request) { var marshaller = UpdateStreamRequestMarshaller.Instance; var unmarshaller = UpdateStreamResponseUnmarshaller.Instance; return(Invoke <UpdateStreamRequest, UpdateStreamResponse>(request, marshaller, unmarshaller)); }
/// <summary> /// Updates the stream. Only specified values will be updated. /// /// </summary> /// <param name="request">The request object containing the details to send. Required.</param> /// <param name="retryConfiguration">The retry configuration that will be used by to send this request. Optional.</param> /// <param name="cancellationToken">The cancellation token to cancel this operation. Optional.</param> /// <returns>A response object containing details about the completed operation</returns> /// <example>Click <a href="https://docs.cloud.oracle.com/en-us/iaas/tools/dot-net-examples/latest/streaming/UpdateStream.cs.html">here</a> to see an example of how to use UpdateStream API.</example> public async Task <UpdateStreamResponse> UpdateStream(UpdateStreamRequest request, RetryConfiguration retryConfiguration = null, CancellationToken cancellationToken = default) { logger.Trace("Called updateStream"); Uri uri = new Uri(this.restClient.GetEndpoint(), System.IO.Path.Combine(basePathWithoutHost, "/streams/{streamId}".Trim('/'))); HttpMethod method = new HttpMethod("PUT"); HttpRequestMessage requestMessage = Converter.ToHttpRequestMessage(uri, method, request); requestMessage.Headers.Add("Accept", "application/json"); GenericRetrier retryingClient = Retrier.GetPreferredRetrier(retryConfiguration, this.retryConfiguration); HttpResponseMessage responseMessage; try { if (retryingClient != null) { responseMessage = await retryingClient.MakeRetryingCall(this.restClient.HttpSend, requestMessage, cancellationToken).ConfigureAwait(false); } else { responseMessage = await this.restClient.HttpSend(requestMessage).ConfigureAwait(false); } this.restClient.CheckHttpResponseMessage(requestMessage, responseMessage); return(Converter.FromHttpResponseMessage <UpdateStreamResponse>(responseMessage)); } catch (Exception e) { logger.Error($"UpdateStream failed with error: {e.Message}"); throw; } }
/// <summary> /// Initiates the asynchronous execution of the UpdateStream operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateStream 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/UpdateStream">REST API Reference for UpdateStream Operation</seealso> public virtual Task <UpdateStreamResponse> UpdateStreamAsync(UpdateStreamRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = UpdateStreamRequestMarshaller.Instance; var unmarshaller = UpdateStreamResponseUnmarshaller.Instance; return(InvokeAsync <UpdateStreamRequest, UpdateStreamResponse>(request, marshaller, unmarshaller, cancellationToken)); }
/// <summary> /// Initiates the asynchronous execution of the UpdateStream operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateStream 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/UpdateStream">REST API Reference for UpdateStream Operation</seealso> public virtual Task <UpdateStreamResponse> UpdateStreamAsync(UpdateStreamRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateStreamRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateStreamResponseUnmarshaller.Instance; return(InvokeAsync <UpdateStreamResponse>(request, options, cancellationToken)); }
internal virtual UpdateStreamResponse UpdateStream(UpdateStreamRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateStreamRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateStreamResponseUnmarshaller.Instance; return(Invoke <UpdateStreamResponse>(request, options)); }
protected override void ProcessRecord() { base.ProcessRecord(); UpdateStreamRequest request; try { request = new UpdateStreamRequest { StreamId = StreamId, UpdateStreamDetails = UpdateStreamDetails, OpcRequestId = OpcRequestId, IfMatch = IfMatch }; response = client.UpdateStream(request).GetAwaiter().GetResult(); WriteOutput(response, response.Stream); FinishProcessing(response); } catch (Exception ex) { TerminatingErrorDuringExecution(ex); } }