public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.Kinesis.Model.IncreaseStreamRetentionPeriodRequest(); if (cmdletContext.RetentionPeriodHour != null) { request.RetentionPeriodHours = cmdletContext.RetentionPeriodHour.Value; } if (cmdletContext.StreamName != null) { request.StreamName = cmdletContext.StreamName; } CmdletOutput output; // issue call var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; pipelineOutput = cmdletContext.Select(response, this); output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; } catch (Exception e) { output = new CmdletOutput { ErrorResponse = e }; } return(output); }
/// <summary> /// Initiates the asynchronous execution of the IncreaseStreamRetentionPeriod operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the IncreaseStreamRetentionPeriod 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<IncreaseStreamRetentionPeriodResponse> IncreaseStreamRetentionPeriodAsync(IncreaseStreamRetentionPeriodRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new IncreaseStreamRetentionPeriodRequestMarshaller(); var unmarshaller = IncreaseStreamRetentionPeriodResponseUnmarshaller.Instance; return InvokeAsync<IncreaseStreamRetentionPeriodRequest,IncreaseStreamRetentionPeriodResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Increases the stream's retention period, which is the length of time data records /// are accessible after they are added to the stream. The maximum value of a stream’s /// retention period is 168 hours (7 days). /// /// /// <para> /// Upon choosing a longer stream retention period, this operation will increase the time /// period records are accessible that have not yet expired. However, it will not make /// previous data that has expired (older than the stream’s previous retention period) /// accessible after the operation has been called. For example, if a stream’s retention /// period is set to 24 hours and is increased to 168 hours, any data that is older than /// 24 hours will remain inaccessible to consumer applications. /// </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 more 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 IncreaseStreamRetentionPeriod 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<IncreaseStreamRetentionPeriodResponse> IncreaseStreamRetentionPeriodAsync(string streamName, int retentionPeriodHours, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new IncreaseStreamRetentionPeriodRequest(); request.StreamName = streamName; request.RetentionPeriodHours = retentionPeriodHours; return IncreaseStreamRetentionPeriodAsync(request, cancellationToken); }
internal IncreaseStreamRetentionPeriodResponse IncreaseStreamRetentionPeriod(IncreaseStreamRetentionPeriodRequest request) { var marshaller = new IncreaseStreamRetentionPeriodRequestMarshaller(); var unmarshaller = IncreaseStreamRetentionPeriodResponseUnmarshaller.Instance; return Invoke<IncreaseStreamRetentionPeriodRequest,IncreaseStreamRetentionPeriodResponse>(request, marshaller, unmarshaller); }
private Amazon.Kinesis.Model.IncreaseStreamRetentionPeriodResponse CallAWSServiceOperation(IAmazonKinesis client, Amazon.Kinesis.Model.IncreaseStreamRetentionPeriodRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Kinesis", "IncreaseStreamRetentionPeriod"); try { #if DESKTOP return(client.IncreaseStreamRetentionPeriod(request)); #elif CORECLR return(client.IncreaseStreamRetentionPeriodAsync(request).GetAwaiter().GetResult()); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } }
/// <summary> /// Initiates the asynchronous execution of the IncreaseStreamRetentionPeriod operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the IncreaseStreamRetentionPeriod 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 IncreaseStreamRetentionPeriodAsync(IncreaseStreamRetentionPeriodRequest request, AmazonServiceCallback<IncreaseStreamRetentionPeriodRequest, IncreaseStreamRetentionPeriodResponse> callback, AsyncOptions options = null) { options = options == null?new AsyncOptions():options; var marshaller = new IncreaseStreamRetentionPeriodRequestMarshaller(); var unmarshaller = IncreaseStreamRetentionPeriodResponseUnmarshaller.Instance; Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null; if(callback !=null ) callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { AmazonServiceResult<IncreaseStreamRetentionPeriodRequest,IncreaseStreamRetentionPeriodResponse> responseObject = new AmazonServiceResult<IncreaseStreamRetentionPeriodRequest,IncreaseStreamRetentionPeriodResponse>((IncreaseStreamRetentionPeriodRequest)req, (IncreaseStreamRetentionPeriodResponse)res, ex , ao.State); callback(responseObject); }; BeginInvoke<IncreaseStreamRetentionPeriodRequest>(request, marshaller, unmarshaller, options, callbackHelper); }
/// <summary> /// Increases 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 maximum value /// of a stream's retention period is 168 hours (7 days). /// /// /// <para> /// Upon choosing a longer stream retention period, this operation will increase the time /// period records are accessible that have not yet expired. However, it will not make /// previous data that has expired (older than the stream's previous retention period) /// accessible after the operation has been called. For example, if a stream's retention /// period is set to 24 hours and is increased to 168 hours, any data that is older than /// 24 hours will remain inaccessible to consumer applications. /// </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 more 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 IncreaseStreamRetentionPeriod 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 IncreaseStreamRetentionPeriodAsync(string streamName, int retentionPeriodHours, AmazonServiceCallback<IncreaseStreamRetentionPeriodRequest, IncreaseStreamRetentionPeriodResponse> callback, AsyncOptions options = null) { var request = new IncreaseStreamRetentionPeriodRequest(); request.StreamName = streamName; request.RetentionPeriodHours = retentionPeriodHours; IncreaseStreamRetentionPeriodAsync(request, callback, options); }
/// <summary> /// Increases the stream's retention period, which is the length of time data records /// are accessible after they are added to the stream. The maximum value of a stream’s /// retention period is 168 hours (7 days). /// /// /// <para> /// Upon choosing a longer stream retention period, this operation will increase the time /// period records are accessible that have not yet expired. However, it will not make /// previous data that has expired (older than the stream’s previous retention period) /// accessible after the operation has been called. For example, if a stream’s retention /// period is set to 24 hours and is increased to 168 hours, any data that is older than /// 24 hours will remain inaccessible to consumer applications. /// </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 more than the current retention period.</param> /// /// <returns>The response from the IncreaseStreamRetentionPeriod 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 IncreaseStreamRetentionPeriodResponse IncreaseStreamRetentionPeriod(string streamName, int retentionPeriodHours) { var request = new IncreaseStreamRetentionPeriodRequest(); request.StreamName = streamName; request.RetentionPeriodHours = retentionPeriodHours; return IncreaseStreamRetentionPeriod(request); }
/// <summary> /// Initiates the asynchronous execution of the IncreaseStreamRetentionPeriod operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the IncreaseStreamRetentionPeriod 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 EndIncreaseStreamRetentionPeriod /// operation.</returns> public IAsyncResult BeginIncreaseStreamRetentionPeriod(IncreaseStreamRetentionPeriodRequest request, AsyncCallback callback, object state) { var marshaller = new IncreaseStreamRetentionPeriodRequestMarshaller(); var unmarshaller = IncreaseStreamRetentionPeriodResponseUnmarshaller.Instance; return BeginInvoke<IncreaseStreamRetentionPeriodRequest>(request, marshaller, unmarshaller, callback, state); }