public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.Redshift.Model.ModifySnapshotCopyRetentionPeriodRequest(); if (cmdletContext.ClusterIdentifier != null) { request.ClusterIdentifier = cmdletContext.ClusterIdentifier; } if (cmdletContext.Manual != null) { request.Manual = cmdletContext.Manual.Value; } if (cmdletContext.RetentionPeriod != null) { request.RetentionPeriod = cmdletContext.RetentionPeriod.Value; } 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); }
IAsyncResult invokeModifySnapshotCopyRetentionPeriod(ModifySnapshotCopyRetentionPeriodRequest modifySnapshotCopyRetentionPeriodRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new ModifySnapshotCopyRetentionPeriodRequestMarshaller().Marshall(modifySnapshotCopyRetentionPeriodRequest); var unmarshaller = ModifySnapshotCopyRetentionPeriodResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the ModifySnapshotCopyRetentionPeriod operation. /// <seealso cref="Amazon.Redshift.IAmazonRedshift.ModifySnapshotCopyRetentionPeriod"/> /// </summary> /// /// <param name="modifySnapshotCopyRetentionPeriodRequest">Container for the necessary parameters to execute the /// ModifySnapshotCopyRetentionPeriod operation on AmazonRedshift.</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 /// EndModifySnapshotCopyRetentionPeriod operation.</returns> public IAsyncResult BeginModifySnapshotCopyRetentionPeriod(ModifySnapshotCopyRetentionPeriodRequest modifySnapshotCopyRetentionPeriodRequest, AsyncCallback callback, object state) { return invokeModifySnapshotCopyRetentionPeriod(modifySnapshotCopyRetentionPeriodRequest, callback, state, false); }
/// <summary> /// <para> Modifies the number of days to retain automated snapshots in the destination region after they are copied from the source region. /// </para> /// </summary> /// /// <param name="modifySnapshotCopyRetentionPeriodRequest">Container for the necessary parameters to execute the /// ModifySnapshotCopyRetentionPeriod service method on AmazonRedshift.</param> /// /// <returns>The response from the ModifySnapshotCopyRetentionPeriod service method, as returned by AmazonRedshift.</returns> /// /// <exception cref="SnapshotCopyDisabledException"/> /// <exception cref="UnauthorizedOperationException"/> /// <exception cref="InvalidClusterStateException"/> /// <exception cref="ClusterNotFoundException"/> public ModifySnapshotCopyRetentionPeriodResponse ModifySnapshotCopyRetentionPeriod(ModifySnapshotCopyRetentionPeriodRequest modifySnapshotCopyRetentionPeriodRequest) { IAsyncResult asyncResult = invokeModifySnapshotCopyRetentionPeriod(modifySnapshotCopyRetentionPeriodRequest, null, null, true); return EndModifySnapshotCopyRetentionPeriod(asyncResult); }
private Amazon.Redshift.Model.ModifySnapshotCopyRetentionPeriodResponse CallAWSServiceOperation(IAmazonRedshift client, Amazon.Redshift.Model.ModifySnapshotCopyRetentionPeriodRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Redshift", "ModifySnapshotCopyRetentionPeriod"); try { #if DESKTOP return(client.ModifySnapshotCopyRetentionPeriod(request)); #elif CORECLR return(client.ModifySnapshotCopyRetentionPeriodAsync(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 ModifySnapshotCopyRetentionPeriod operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ModifySnapshotCopyRetentionPeriod operation on AmazonRedshiftClient.</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 EndModifySnapshotCopyRetentionPeriod /// operation.</returns> public IAsyncResult BeginModifySnapshotCopyRetentionPeriod(ModifySnapshotCopyRetentionPeriodRequest request, AsyncCallback callback, object state) { var marshaller = new ModifySnapshotCopyRetentionPeriodRequestMarshaller(); var unmarshaller = ModifySnapshotCopyRetentionPeriodResponseUnmarshaller.Instance; return BeginInvoke<ModifySnapshotCopyRetentionPeriodRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// <para> Modifies the number of days to retain automated snapshots in the destination region after they are copied from the source region. /// </para> /// </summary> /// /// <param name="modifySnapshotCopyRetentionPeriodRequest">Container for the necessary parameters to execute the /// ModifySnapshotCopyRetentionPeriod service method on AmazonRedshift.</param> /// /// <returns>The response from the ModifySnapshotCopyRetentionPeriod service method, as returned by AmazonRedshift.</returns> /// /// <exception cref="T:Amazon.Redshift.Model.SnapshotCopyDisabledException" /> /// <exception cref="T:Amazon.Redshift.Model.UnauthorizedOperationException" /> /// <exception cref="T:Amazon.Redshift.Model.InvalidClusterStateException" /> /// <exception cref="T:Amazon.Redshift.Model.ClusterNotFoundException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task<ModifySnapshotCopyRetentionPeriodResponse> ModifySnapshotCopyRetentionPeriodAsync(ModifySnapshotCopyRetentionPeriodRequest modifySnapshotCopyRetentionPeriodRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ModifySnapshotCopyRetentionPeriodRequestMarshaller(); var unmarshaller = ModifySnapshotCopyRetentionPeriodResponseUnmarshaller.GetInstance(); return Invoke<IRequest, ModifySnapshotCopyRetentionPeriodRequest, ModifySnapshotCopyRetentionPeriodResponse>(modifySnapshotCopyRetentionPeriodRequest, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// Modifies the number of days to retain automated snapshots in the destination region /// after they are copied from the source region. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ModifySnapshotCopyRetentionPeriod service method.</param> /// /// <returns>The response from the ModifySnapshotCopyRetentionPeriod service method, as returned by Redshift.</returns> /// <exception cref="Amazon.Redshift.Model.ClusterNotFoundException"> /// The <i>ClusterIdentifier</i> parameter does not refer to an existing cluster. /// </exception> /// <exception cref="Amazon.Redshift.Model.InvalidClusterStateException"> /// The specified cluster is not in the <code>available</code> state. /// </exception> /// <exception cref="Amazon.Redshift.Model.SnapshotCopyDisabledException"> /// Cross-region snapshot copy was temporarily disabled. Try your request again. /// </exception> /// <exception cref="Amazon.Redshift.Model.UnauthorizedOperationException"> /// Your account is not authorized to perform the requested operation. /// </exception> public ModifySnapshotCopyRetentionPeriodResponse ModifySnapshotCopyRetentionPeriod(ModifySnapshotCopyRetentionPeriodRequest request) { var marshaller = new ModifySnapshotCopyRetentionPeriodRequestMarshaller(); var unmarshaller = ModifySnapshotCopyRetentionPeriodResponseUnmarshaller.Instance; return Invoke<ModifySnapshotCopyRetentionPeriodRequest,ModifySnapshotCopyRetentionPeriodResponse>(request, marshaller, unmarshaller); }
internal ModifySnapshotCopyRetentionPeriodResponse ModifySnapshotCopyRetentionPeriod(ModifySnapshotCopyRetentionPeriodRequest request) { var task = ModifySnapshotCopyRetentionPeriodAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// <para> Modifies the number of days to retain automated snapshots in the destination region after they are copied from the source region. /// </para> /// </summary> /// /// <param name="modifySnapshotCopyRetentionPeriodRequest">Container for the necessary parameters to execute the /// ModifySnapshotCopyRetentionPeriod service method on AmazonRedshift.</param> /// /// <returns>The response from the ModifySnapshotCopyRetentionPeriod service method, as returned by AmazonRedshift.</returns> /// /// <exception cref="T:Amazon.Redshift.Model.SnapshotCopyDisabledException" /> /// <exception cref="T:Amazon.Redshift.Model.UnauthorizedOperationException" /> /// <exception cref="T:Amazon.Redshift.Model.ClusterNotFoundException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public async Task<ModifySnapshotCopyRetentionPeriodResponse> ModifySnapshotCopyRetentionPeriodAsync(ModifySnapshotCopyRetentionPeriodRequest modifySnapshotCopyRetentionPeriodRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ModifySnapshotCopyRetentionPeriodRequestMarshaller(); var unmarshaller = ModifySnapshotCopyRetentionPeriodResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, ModifySnapshotCopyRetentionPeriodRequest, ModifySnapshotCopyRetentionPeriodResponse>(modifySnapshotCopyRetentionPeriodRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
internal ModifySnapshotCopyRetentionPeriodResponse ModifySnapshotCopyRetentionPeriod(ModifySnapshotCopyRetentionPeriodRequest request) { var task = ModifySnapshotCopyRetentionPeriodAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// Initiates the asynchronous execution of the ModifySnapshotCopyRetentionPeriod operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ModifySnapshotCopyRetentionPeriod 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<ModifySnapshotCopyRetentionPeriodResponse> ModifySnapshotCopyRetentionPeriodAsync(ModifySnapshotCopyRetentionPeriodRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ModifySnapshotCopyRetentionPeriodRequestMarshaller(); var unmarshaller = ModifySnapshotCopyRetentionPeriodResponseUnmarshaller.Instance; return InvokeAsync<ModifySnapshotCopyRetentionPeriodRequest,ModifySnapshotCopyRetentionPeriodResponse>(request, marshaller, unmarshaller, cancellationToken); }
IAsyncResult invokeModifySnapshotCopyRetentionPeriod(ModifySnapshotCopyRetentionPeriodRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new ModifySnapshotCopyRetentionPeriodRequestMarshaller(); var unmarshaller = ModifySnapshotCopyRetentionPeriodResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }