public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.RDS.Model.PurchaseReservedDBInstancesOfferingRequest(); if (cmdletContext.DBInstanceCount != null) { request.DBInstanceCount = cmdletContext.DBInstanceCount.Value; } if (cmdletContext.ReservedDBInstanceId != null) { request.ReservedDBInstanceId = cmdletContext.ReservedDBInstanceId; } if (cmdletContext.ReservedDBInstancesOfferingId != null) { request.ReservedDBInstancesOfferingId = cmdletContext.ReservedDBInstancesOfferingId; } if (cmdletContext.Tag != null) { request.Tags = cmdletContext.Tag; } 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 invokePurchaseReservedDBInstancesOffering(PurchaseReservedDBInstancesOfferingRequest purchaseReservedDBInstancesOfferingRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new PurchaseReservedDBInstancesOfferingRequestMarshaller().Marshall(purchaseReservedDBInstancesOfferingRequest); var unmarshaller = PurchaseReservedDBInstancesOfferingResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// <para> Purchases a reserved DB Instance offering. </para> /// </summary> /// /// <param name="purchaseReservedDBInstancesOfferingRequest">Container for the necessary parameters to execute the /// PurchaseReservedDBInstancesOffering service method on AmazonRDS.</param> /// /// <returns>The response from the PurchaseReservedDBInstancesOffering service method, as returned by AmazonRDS.</returns> /// /// <exception cref="ReservedDBInstancesOfferingNotFoundException"/> /// <exception cref="ReservedDBInstanceQuotaExceededException"/> /// <exception cref="ReservedDBInstanceAlreadyExistsException"/> public PurchaseReservedDBInstancesOfferingResponse PurchaseReservedDBInstancesOffering(PurchaseReservedDBInstancesOfferingRequest purchaseReservedDBInstancesOfferingRequest) { IAsyncResult asyncResult = invokePurchaseReservedDBInstancesOffering(purchaseReservedDBInstancesOfferingRequest, null, null, true); return EndPurchaseReservedDBInstancesOffering(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the PurchaseReservedDBInstancesOffering operation. /// <seealso cref="Amazon.RDS.AmazonRDS.PurchaseReservedDBInstancesOffering"/> /// </summary> /// /// <param name="purchaseReservedDBInstancesOfferingRequest">Container for the necessary parameters to execute the /// PurchaseReservedDBInstancesOffering operation on AmazonRDS.</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 /// EndPurchaseReservedDBInstancesOffering operation.</returns> public IAsyncResult BeginPurchaseReservedDBInstancesOffering(PurchaseReservedDBInstancesOfferingRequest purchaseReservedDBInstancesOfferingRequest, AsyncCallback callback, object state) { return invokePurchaseReservedDBInstancesOffering(purchaseReservedDBInstancesOfferingRequest, callback, state, false); }
/// <summary> /// Initiates the asynchronous execution of the PurchaseReservedDBInstancesOffering operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the PurchaseReservedDBInstancesOffering 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<PurchaseReservedDBInstancesOfferingResponse> PurchaseReservedDBInstancesOfferingAsync(PurchaseReservedDBInstancesOfferingRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new PurchaseReservedDBInstancesOfferingRequestMarshaller(); var unmarshaller = PurchaseReservedDBInstancesOfferingResponseUnmarshaller.Instance; return InvokeAsync<PurchaseReservedDBInstancesOfferingRequest,PurchaseReservedDBInstancesOfferingResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Purchases a reserved DB instance offering. /// </summary> /// <param name="request">Container for the necessary parameters to execute the PurchaseReservedDBInstancesOffering service method.</param> /// /// <returns>The response from the PurchaseReservedDBInstancesOffering service method, as returned by RDS.</returns> /// <exception cref="Amazon.RDS.Model.ReservedDBInstanceAlreadyExistsException"> /// User already has a reservation with the given identifier. /// </exception> /// <exception cref="Amazon.RDS.Model.ReservedDBInstanceQuotaExceededException"> /// Request would exceed the user's DB Instance quota. /// </exception> /// <exception cref="Amazon.RDS.Model.ReservedDBInstancesOfferingNotFoundException"> /// Specified offering does not exist. /// </exception> public PurchaseReservedDBInstancesOfferingResponse PurchaseReservedDBInstancesOffering(PurchaseReservedDBInstancesOfferingRequest request) { var marshaller = new PurchaseReservedDBInstancesOfferingRequestMarshaller(); var unmarshaller = PurchaseReservedDBInstancesOfferingResponseUnmarshaller.Instance; return Invoke<PurchaseReservedDBInstancesOfferingRequest,PurchaseReservedDBInstancesOfferingResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the PurchaseReservedDBInstancesOffering operation. /// <seealso cref="Amazon.RDS.IAmazonRDS.PurchaseReservedDBInstancesOffering"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the PurchaseReservedDBInstancesOffering 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<PurchaseReservedDBInstancesOfferingResponse> PurchaseReservedDBInstancesOfferingAsync(PurchaseReservedDBInstancesOfferingRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new PurchaseReservedDBInstancesOfferingRequestMarshaller(); var unmarshaller = PurchaseReservedDBInstancesOfferingResponseUnmarshaller.GetInstance(); return Invoke<IRequest, PurchaseReservedDBInstancesOfferingRequest, PurchaseReservedDBInstancesOfferingResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// <para> Purchases a reserved DB instance offering. </para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the /// PurchaseReservedDBInstancesOffering service method on AmazonRDS.</param> /// /// <returns>The response from the PurchaseReservedDBInstancesOffering service method, as returned by AmazonRDS.</returns> /// /// <exception cref="T:Amazon.RDS.Model.ReservedDBInstancesOfferingNotFoundException" /> /// <exception cref="T:Amazon.RDS.Model.ReservedDBInstanceQuotaExceededException" /> /// <exception cref="T:Amazon.RDS.Model.ReservedDBInstanceAlreadyExistsException" /> public PurchaseReservedDBInstancesOfferingResponse PurchaseReservedDBInstancesOffering(PurchaseReservedDBInstancesOfferingRequest request) { var task = PurchaseReservedDBInstancesOfferingAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// <para> Purchases a reserved DB instance offering. </para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the /// PurchaseReservedDBInstancesOffering service method on AmazonRDS.</param> /// /// <returns>The response from the PurchaseReservedDBInstancesOffering service method, as returned by AmazonRDS.</returns> /// /// <exception cref="T:Amazon.RDS.Model.ReservedDBInstancesOfferingNotFoundException" /> /// <exception cref="T:Amazon.RDS.Model.ReservedDBInstanceQuotaExceededException" /> /// <exception cref="T:Amazon.RDS.Model.ReservedDBInstanceAlreadyExistsException" /> public PurchaseReservedDBInstancesOfferingResponse PurchaseReservedDBInstancesOffering(PurchaseReservedDBInstancesOfferingRequest request) { var task = PurchaseReservedDBInstancesOfferingAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// <para> Purchases a reserved DB instance offering. </para> /// </summary> /// /// <param name="purchaseReservedDBInstancesOfferingRequest">Container for the necessary parameters to execute the /// PurchaseReservedDBInstancesOffering service method on AmazonRDS.</param> /// /// <returns>The response from the PurchaseReservedDBInstancesOffering service method, as returned by AmazonRDS.</returns> /// /// <exception cref="T:Amazon.RDS.Model.ReservedDBInstancesOfferingNotFoundException" /> /// <exception cref="T:Amazon.RDS.Model.ReservedDBInstanceQuotaExceededException" /> /// <exception cref="T:Amazon.RDS.Model.ReservedDBInstanceAlreadyExistsException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public async Task<PurchaseReservedDBInstancesOfferingResponse> PurchaseReservedDBInstancesOfferingAsync(PurchaseReservedDBInstancesOfferingRequest purchaseReservedDBInstancesOfferingRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new PurchaseReservedDBInstancesOfferingRequestMarshaller(); var unmarshaller = PurchaseReservedDBInstancesOfferingResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, PurchaseReservedDBInstancesOfferingRequest, PurchaseReservedDBInstancesOfferingResponse>(purchaseReservedDBInstancesOfferingRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
private Amazon.RDS.Model.PurchaseReservedDBInstancesOfferingResponse CallAWSServiceOperation(IAmazonRDS client, Amazon.RDS.Model.PurchaseReservedDBInstancesOfferingRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Relational Database Service", "PurchaseReservedDBInstancesOffering"); try { #if DESKTOP return(client.PurchaseReservedDBInstancesOffering(request)); #elif CORECLR return(client.PurchaseReservedDBInstancesOfferingAsync(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 PurchaseReservedDBInstancesOffering operation. /// <seealso cref="Amazon.RDS.IAmazonRDS"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the PurchaseReservedDBInstancesOffering operation on AmazonRDSClient.</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 EndPurchaseReservedDBInstancesOffering /// operation.</returns> public IAsyncResult BeginPurchaseReservedDBInstancesOffering(PurchaseReservedDBInstancesOfferingRequest request, AsyncCallback callback, object state) { var marshaller = new PurchaseReservedDBInstancesOfferingRequestMarshaller(); var unmarshaller = PurchaseReservedDBInstancesOfferingResponseUnmarshaller.Instance; return BeginInvoke<PurchaseReservedDBInstancesOfferingRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// <para> Purchases a reserved DB Instance offering. </para> /// </summary> /// /// <param name="purchaseReservedDBInstancesOfferingRequest">Container for the necessary parameters to execute the /// PurchaseReservedDBInstancesOffering service method on AmazonRDS.</param> /// /// <returns>The response from the PurchaseReservedDBInstancesOffering service method, as returned by AmazonRDS.</returns> /// /// <exception cref="ReservedDBInstancesOfferingNotFoundException"/> /// <exception cref="ReservedDBInstanceQuotaExceededException"/> /// <exception cref="ReservedDBInstanceAlreadyExistsException"/> public PurchaseReservedDBInstancesOfferingResponse PurchaseReservedDBInstancesOffering(PurchaseReservedDBInstancesOfferingRequest purchaseReservedDBInstancesOfferingRequest) { IRequest<PurchaseReservedDBInstancesOfferingRequest> request = new PurchaseReservedDBInstancesOfferingRequestMarshaller().Marshall(purchaseReservedDBInstancesOfferingRequest); PurchaseReservedDBInstancesOfferingResponse response = Invoke<PurchaseReservedDBInstancesOfferingRequest, PurchaseReservedDBInstancesOfferingResponse> (request, this.signer, PurchaseReservedDBInstancesOfferingResponseUnmarshaller.GetInstance()); return response; }