/// <summary> /// Decreases the stream's retention period, which is the length of time data records /// are accessible after they are added to the stream. The minimum value of a stream’s /// retention period is 24 hours. /// /// /// <para> /// This operation may result in lost data. For example, if the stream's retention period /// is 48 hours and is decreased to 24 hours, any data already in the stream that is older /// than 24 hours is inaccessible. /// </para> /// </summary> /// <param name="streamName">The name of the stream to modify.</param> /// <param name="retentionPeriodHours">The new retention period of the stream, in hours. Must be less than the current retention period.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DecreaseStreamRetentionPeriod service method, as returned by Kinesis.</returns> /// <exception cref="Amazon.Kinesis.Model.InvalidArgumentException"> /// A specified parameter exceeds its restrictions, is not supported, or can't be used. /// For more information, see the returned message. /// </exception> /// <exception cref="Amazon.Kinesis.Model.LimitExceededException"> /// The requested resource exceeds the maximum number allowed, or the number of concurrent /// stream requests exceeds the maximum number allowed (5). /// </exception> /// <exception cref="Amazon.Kinesis.Model.ResourceInUseException"> /// The resource is not available for this operation. For successful operation, the resource /// needs to be in the <code>ACTIVE</code> state. /// </exception> /// <exception cref="Amazon.Kinesis.Model.ResourceNotFoundException"> /// The requested resource could not be found. The stream might not be specified correctly, /// or it might not be in the <code>ACTIVE</code> state if the operation requires it. /// </exception> public Task<DecreaseStreamRetentionPeriodResponse> DecreaseStreamRetentionPeriodAsync(string streamName, int retentionPeriodHours, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new DecreaseStreamRetentionPeriodRequest(); request.StreamName = streamName; request.RetentionPeriodHours = retentionPeriodHours; return DecreaseStreamRetentionPeriodAsync(request, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the DecreaseStreamRetentionPeriod operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DecreaseStreamRetentionPeriod 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<DecreaseStreamRetentionPeriodResponse> DecreaseStreamRetentionPeriodAsync(DecreaseStreamRetentionPeriodRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DecreaseStreamRetentionPeriodRequestMarshaller(); var unmarshaller = DecreaseStreamRetentionPeriodResponseUnmarshaller.Instance; return InvokeAsync<DecreaseStreamRetentionPeriodRequest,DecreaseStreamRetentionPeriodResponse>(request, marshaller, unmarshaller, cancellationToken); }
internal DecreaseStreamRetentionPeriodResponse DecreaseStreamRetentionPeriod(DecreaseStreamRetentionPeriodRequest request) { var marshaller = new DecreaseStreamRetentionPeriodRequestMarshaller(); var unmarshaller = DecreaseStreamRetentionPeriodResponseUnmarshaller.Instance; return Invoke<DecreaseStreamRetentionPeriodRequest,DecreaseStreamRetentionPeriodResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the DecreaseStreamRetentionPeriod operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DecreaseStreamRetentionPeriod 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 DecreaseStreamRetentionPeriodAsync(DecreaseStreamRetentionPeriodRequest request, AmazonServiceCallback<DecreaseStreamRetentionPeriodRequest, DecreaseStreamRetentionPeriodResponse> callback, AsyncOptions options = null) { options = options == null?new AsyncOptions():options; var marshaller = new DecreaseStreamRetentionPeriodRequestMarshaller(); var unmarshaller = DecreaseStreamRetentionPeriodResponseUnmarshaller.Instance; Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null; if(callback !=null ) callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { AmazonServiceResult<DecreaseStreamRetentionPeriodRequest,DecreaseStreamRetentionPeriodResponse> responseObject = new AmazonServiceResult<DecreaseStreamRetentionPeriodRequest,DecreaseStreamRetentionPeriodResponse>((DecreaseStreamRetentionPeriodRequest)req, (DecreaseStreamRetentionPeriodResponse)res, ex , ao.State); callback(responseObject); }; BeginInvoke<DecreaseStreamRetentionPeriodRequest>(request, marshaller, unmarshaller, options, callbackHelper); }
/// <summary> /// Decreases the Amazon Kinesis stream's retention period, which is the length of time /// data records are accessible after they are added to the stream. The minimum value /// of a stream's retention period is 24 hours. /// /// /// <para> /// This operation may result in lost data. For example, if the stream's retention period /// is 48 hours and is decreased to 24 hours, any data already in the stream that is older /// than 24 hours is inaccessible. /// </para> /// </summary> /// <param name="streamName">The name of the stream to modify.</param> /// <param name="retentionPeriodHours">The new retention period of the stream, in hours. Must be less than the current retention period.</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> /// /// <returns>The response from the DecreaseStreamRetentionPeriod service method, as returned by Kinesis.</returns> /// <exception cref="Amazon.Kinesis.Model.InvalidArgumentException"> /// A specified parameter exceeds its restrictions, is not supported, or can't be used. /// For more information, see the returned message. /// </exception> /// <exception cref="Amazon.Kinesis.Model.ResourceInUseException"> /// The resource is not available for this operation. For successful operation, the resource /// needs to be in the <code>ACTIVE</code> state. /// </exception> /// <exception cref="Amazon.Kinesis.Model.ResourceNotFoundException"> /// The requested resource could not be found. The stream might not be specified correctly. /// </exception> public void DecreaseStreamRetentionPeriodAsync(string streamName, int retentionPeriodHours, AmazonServiceCallback<DecreaseStreamRetentionPeriodRequest, DecreaseStreamRetentionPeriodResponse> callback, AsyncOptions options = null) { var request = new DecreaseStreamRetentionPeriodRequest(); request.StreamName = streamName; request.RetentionPeriodHours = retentionPeriodHours; DecreaseStreamRetentionPeriodAsync(request, callback, options); }
/// <summary> /// Decreases the stream's retention period, which is the length of time data records /// are accessible after they are added to the stream. The minimum value of a stream’s /// retention period is 24 hours. /// /// /// <para> /// This operation may result in lost data. For example, if the stream's retention period /// is 48 hours and is decreased to 24 hours, any data already in the stream that is older /// than 24 hours is inaccessible. /// </para> /// </summary> /// <param name="streamName">The name of the stream to modify.</param> /// <param name="retentionPeriodHours">The new retention period of the stream, in hours. Must be less than the current retention period.</param> /// /// <returns>The response from the DecreaseStreamRetentionPeriod service method, as returned by Kinesis.</returns> /// <exception cref="Amazon.Kinesis.Model.InvalidArgumentException"> /// A specified parameter exceeds its restrictions, is not supported, or can't be used. /// For more information, see the returned message. /// </exception> /// <exception cref="Amazon.Kinesis.Model.LimitExceededException"> /// The requested resource exceeds the maximum number allowed, or the number of concurrent /// stream requests exceeds the maximum number allowed (5). /// </exception> /// <exception cref="Amazon.Kinesis.Model.ResourceInUseException"> /// The resource is not available for this operation. For successful operation, the resource /// needs to be in the <code>ACTIVE</code> state. /// </exception> /// <exception cref="Amazon.Kinesis.Model.ResourceNotFoundException"> /// The requested resource could not be found. The stream might not be specified correctly, /// or it might not be in the <code>ACTIVE</code> state if the operation requires it. /// </exception> public DecreaseStreamRetentionPeriodResponse DecreaseStreamRetentionPeriod(string streamName, int retentionPeriodHours) { var request = new DecreaseStreamRetentionPeriodRequest(); request.StreamName = streamName; request.RetentionPeriodHours = retentionPeriodHours; return DecreaseStreamRetentionPeriod(request); }
/// <summary> /// Initiates the asynchronous execution of the DecreaseStreamRetentionPeriod operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DecreaseStreamRetentionPeriod 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 EndDecreaseStreamRetentionPeriod /// operation.</returns> public IAsyncResult BeginDecreaseStreamRetentionPeriod(DecreaseStreamRetentionPeriodRequest request, AsyncCallback callback, object state) { var marshaller = new DecreaseStreamRetentionPeriodRequestMarshaller(); var unmarshaller = DecreaseStreamRetentionPeriodResponseUnmarshaller.Instance; return BeginInvoke<DecreaseStreamRetentionPeriodRequest>(request, marshaller, unmarshaller, callback, state); }