Modifies an existing option group.
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.RDS.Model.ModifyOptionGroupRequest(); if (cmdletContext.ApplyImmediately != null) { request.ApplyImmediately = cmdletContext.ApplyImmediately.Value; } if (cmdletContext.OptionGroupName != null) { request.OptionGroupName = cmdletContext.OptionGroupName; } if (cmdletContext.OptionsToInclude != null) { request.OptionsToInclude = cmdletContext.OptionsToInclude; } if (cmdletContext.OptionsToRemove != null) { request.OptionsToRemove = cmdletContext.OptionsToRemove; } 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 invokeModifyOptionGroup(ModifyOptionGroupRequest modifyOptionGroupRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new ModifyOptionGroupRequestMarshaller().Marshall(modifyOptionGroupRequest); var unmarshaller = ModifyOptionGroupResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// <para> Modifies an existing Option Group. </para> /// </summary> /// /// <param name="modifyOptionGroupRequest">Container for the necessary parameters to execute the ModifyOptionGroup service method on /// AmazonRDS.</param> /// /// <returns>The response from the ModifyOptionGroup service method, as returned by AmazonRDS.</returns> /// /// <exception cref="InvalidOptionGroupStateException"/> /// <exception cref="OptionGroupNotFoundException"/> public ModifyOptionGroupResponse ModifyOptionGroup(ModifyOptionGroupRequest modifyOptionGroupRequest) { IAsyncResult asyncResult = invokeModifyOptionGroup(modifyOptionGroupRequest, null, null, true); return EndModifyOptionGroup(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the ModifyOptionGroup operation. /// <seealso cref="Amazon.RDS.AmazonRDS.ModifyOptionGroup"/> /// </summary> /// /// <param name="modifyOptionGroupRequest">Container for the necessary parameters to execute the ModifyOptionGroup 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 EndModifyOptionGroup /// operation.</returns> public IAsyncResult BeginModifyOptionGroup(ModifyOptionGroupRequest modifyOptionGroupRequest, AsyncCallback callback, object state) { return invokeModifyOptionGroup(modifyOptionGroupRequest, callback, state, false); }
/// <summary> /// Initiates the asynchronous execution of the ModifyOptionGroup operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ModifyOptionGroup 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<ModifyOptionGroupResponse> ModifyOptionGroupAsync(ModifyOptionGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ModifyOptionGroupRequestMarshaller(); var unmarshaller = ModifyOptionGroupResponseUnmarshaller.Instance; return InvokeAsync<ModifyOptionGroupRequest,ModifyOptionGroupResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Modifies an existing option group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ModifyOptionGroup service method.</param> /// /// <returns>The response from the ModifyOptionGroup service method, as returned by RDS.</returns> /// <exception cref="Amazon.RDS.Model.InvalidOptionGroupStateException"> /// The option group is not in the <i>available</i> state. /// </exception> /// <exception cref="Amazon.RDS.Model.OptionGroupNotFoundException"> /// The specified option group could not be found. /// </exception> public ModifyOptionGroupResponse ModifyOptionGroup(ModifyOptionGroupRequest request) { var marshaller = new ModifyOptionGroupRequestMarshaller(); var unmarshaller = ModifyOptionGroupResponseUnmarshaller.Instance; return Invoke<ModifyOptionGroupRequest,ModifyOptionGroupResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the ModifyOptionGroup operation. /// <seealso cref="Amazon.RDS.IAmazonRDS.ModifyOptionGroup"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ModifyOptionGroup 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<ModifyOptionGroupResponse> ModifyOptionGroupAsync(ModifyOptionGroupRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ModifyOptionGroupRequestMarshaller(); var unmarshaller = ModifyOptionGroupResponseUnmarshaller.GetInstance(); return Invoke<IRequest, ModifyOptionGroupRequest, ModifyOptionGroupResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// <para> Modifies an existing option group. </para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ModifyOptionGroup service method on /// AmazonRDS.</param> /// /// <returns>The response from the ModifyOptionGroup service method, as returned by AmazonRDS.</returns> /// /// <exception cref="T:Amazon.RDS.Model.InvalidOptionGroupStateException" /> /// <exception cref="T:Amazon.RDS.Model.OptionGroupNotFoundException" /> public ModifyOptionGroupResponse ModifyOptionGroup(ModifyOptionGroupRequest request) { var task = ModifyOptionGroupAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// <para> Modifies an existing option group. </para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ModifyOptionGroup service method on /// AmazonRDS.</param> /// /// <returns>The response from the ModifyOptionGroup service method, as returned by AmazonRDS.</returns> /// /// <exception cref="T:Amazon.RDS.Model.InvalidOptionGroupStateException" /> /// <exception cref="T:Amazon.RDS.Model.OptionGroupNotFoundException" /> public ModifyOptionGroupResponse ModifyOptionGroup(ModifyOptionGroupRequest request) { var task = ModifyOptionGroupAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// <para> Modifies an existing option group. </para> /// </summary> /// /// <param name="modifyOptionGroupRequest">Container for the necessary parameters to execute the ModifyOptionGroup service method on /// AmazonRDS.</param> /// /// <returns>The response from the ModifyOptionGroup service method, as returned by AmazonRDS.</returns> /// /// <exception cref="T:Amazon.RDS.Model.InvalidOptionGroupStateException" /> /// <exception cref="T:Amazon.RDS.Model.OptionGroupNotFoundException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public async Task<ModifyOptionGroupResponse> ModifyOptionGroupAsync(ModifyOptionGroupRequest modifyOptionGroupRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ModifyOptionGroupRequestMarshaller(); var unmarshaller = ModifyOptionGroupResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, ModifyOptionGroupRequest, ModifyOptionGroupResponse>(modifyOptionGroupRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
/// <summary> /// Initiates the asynchronous execution of the ModifyOptionGroup operation. /// <seealso cref="Amazon.RDS.IAmazonRDS"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ModifyOptionGroup 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 EndModifyOptionGroup /// operation.</returns> public IAsyncResult BeginModifyOptionGroup(ModifyOptionGroupRequest request, AsyncCallback callback, object state) { var marshaller = new ModifyOptionGroupRequestMarshaller(); var unmarshaller = ModifyOptionGroupResponseUnmarshaller.Instance; return BeginInvoke<ModifyOptionGroupRequest>(request, marshaller, unmarshaller, callback, state); }
private Amazon.RDS.Model.ModifyOptionGroupResponse CallAWSServiceOperation(IAmazonRDS client, Amazon.RDS.Model.ModifyOptionGroupRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Relational Database Service", "ModifyOptionGroup"); try { #if DESKTOP return(client.ModifyOptionGroup(request)); #elif CORECLR return(client.ModifyOptionGroupAsync(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; } }