public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.RDS.Model.ModifyEventSubscriptionRequest(); if (cmdletContext.Enabled != null) { request.Enabled = cmdletContext.Enabled.Value; } if (cmdletContext.EventCategory != null) { request.EventCategories = cmdletContext.EventCategory; } if (cmdletContext.SnsTopicArn != null) { request.SnsTopicArn = cmdletContext.SnsTopicArn; } if (cmdletContext.SourceType != null) { request.SourceType = cmdletContext.SourceType; } if (cmdletContext.SubscriptionName != null) { request.SubscriptionName = cmdletContext.SubscriptionName; } 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 invokeModifyEventSubscription(ModifyEventSubscriptionRequest modifyEventSubscriptionRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new ModifyEventSubscriptionRequestMarshaller().Marshall(modifyEventSubscriptionRequest); var unmarshaller = ModifyEventSubscriptionResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// <para>Modifies an existing RDS event notification subscription. Note that you cannot modify the source identifiers using this call; to /// change source identifiers for a subscription, use the AddSourceIdentifierToSubscription and RemoveSourceIdentifierFromSubscription /// calls.</para> <para>You can see a list of the event categories for a given SourceType in the Events topic in the Amazon RDS User Guide or by /// using the <b>DescribeEventCategories</b> action.</para> /// </summary> /// /// <param name="modifyEventSubscriptionRequest">Container for the necessary parameters to execute the ModifyEventSubscription service method on /// AmazonRDS.</param> /// /// <returns>The response from the ModifyEventSubscription service method, as returned by AmazonRDS.</returns> /// /// <exception cref="SNSTopicArnNotFoundException"/> /// <exception cref="SNSInvalidTopicException"/> /// <exception cref="SubscriptionCategoryNotFoundException"/> /// <exception cref="SubscriptionNotFoundException"/> /// <exception cref="SNSNoAuthorizationException"/> /// <exception cref="EventSubscriptionQuotaExceededException"/> public ModifyEventSubscriptionResponse ModifyEventSubscription(ModifyEventSubscriptionRequest modifyEventSubscriptionRequest) { IAsyncResult asyncResult = invokeModifyEventSubscription(modifyEventSubscriptionRequest, null, null, true); return EndModifyEventSubscription(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the ModifyEventSubscription operation. /// <seealso cref="Amazon.RDS.AmazonRDS.ModifyEventSubscription"/> /// </summary> /// /// <param name="modifyEventSubscriptionRequest">Container for the necessary parameters to execute the ModifyEventSubscription 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 /// EndModifyEventSubscription operation.</returns> public IAsyncResult BeginModifyEventSubscription(ModifyEventSubscriptionRequest modifyEventSubscriptionRequest, AsyncCallback callback, object state) { return invokeModifyEventSubscription(modifyEventSubscriptionRequest, callback, state, false); }
/// <summary> /// Initiates the asynchronous execution of the ModifyEventSubscription operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ModifyEventSubscription 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<ModifyEventSubscriptionResponse> ModifyEventSubscriptionAsync(ModifyEventSubscriptionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ModifyEventSubscriptionRequestMarshaller(); var unmarshaller = ModifyEventSubscriptionResponseUnmarshaller.Instance; return InvokeAsync<ModifyEventSubscriptionRequest,ModifyEventSubscriptionResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Modifies an existing RDS event notification subscription. Note that you cannot modify /// the source identifiers using this call; to change source identifiers for a subscription, /// use the <a>AddSourceIdentifierToSubscription</a> and <a>RemoveSourceIdentifierFromSubscription</a> /// calls. /// /// /// <para> /// You can see a list of the event categories for a given SourceType in the <a href="http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html">Events</a> /// topic in the Amazon RDS User Guide or by using the <b>DescribeEventCategories</b> /// action. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the ModifyEventSubscription service method.</param> /// /// <returns>The response from the ModifyEventSubscription service method, as returned by RDS.</returns> /// <exception cref="Amazon.RDS.Model.EventSubscriptionQuotaExceededException"> /// You have reached the maximum number of event subscriptions. /// </exception> /// <exception cref="Amazon.RDS.Model.SNSInvalidTopicException"> /// SNS has responded that there is a problem with the SND topic specified. /// </exception> /// <exception cref="Amazon.RDS.Model.SNSNoAuthorizationException"> /// You do not have permission to publish to the SNS topic ARN. /// </exception> /// <exception cref="Amazon.RDS.Model.SNSTopicArnNotFoundException"> /// The SNS topic ARN does not exist. /// </exception> /// <exception cref="Amazon.RDS.Model.SubscriptionCategoryNotFoundException"> /// The supplied category does not exist. /// </exception> /// <exception cref="Amazon.RDS.Model.SubscriptionNotFoundException"> /// The subscription name does not exist. /// </exception> public ModifyEventSubscriptionResponse ModifyEventSubscription(ModifyEventSubscriptionRequest request) { var marshaller = new ModifyEventSubscriptionRequestMarshaller(); var unmarshaller = ModifyEventSubscriptionResponseUnmarshaller.Instance; return Invoke<ModifyEventSubscriptionRequest,ModifyEventSubscriptionResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the ModifyEventSubscription operation. /// <seealso cref="Amazon.RDS.IAmazonRDS.ModifyEventSubscription"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ModifyEventSubscription 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<ModifyEventSubscriptionResponse> ModifyEventSubscriptionAsync(ModifyEventSubscriptionRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ModifyEventSubscriptionRequestMarshaller(); var unmarshaller = ModifyEventSubscriptionResponseUnmarshaller.GetInstance(); return Invoke<IRequest, ModifyEventSubscriptionRequest, ModifyEventSubscriptionResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// <para>Modifies an existing RDS event notification subscription. Note that you cannot modify the source identifiers using this call; to /// change source identifiers for a subscription, use the AddSourceIdentifierToSubscription and RemoveSourceIdentifierFromSubscription /// calls.</para> <para>You can see a list of the event categories for a given SourceType in the <a href="http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html">Events</a> topic in the Amazon RDS User Guide or by using the /// <b>DescribeEventCategories</b> action.</para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ModifyEventSubscription service method on /// AmazonRDS.</param> /// /// <returns>The response from the ModifyEventSubscription service method, as returned by AmazonRDS.</returns> /// /// <exception cref="T:Amazon.RDS.Model.SNSTopicArnNotFoundException" /> /// <exception cref="T:Amazon.RDS.Model.SNSInvalidTopicException" /> /// <exception cref="T:Amazon.RDS.Model.SubscriptionCategoryNotFoundException" /> /// <exception cref="T:Amazon.RDS.Model.SubscriptionNotFoundException" /> /// <exception cref="T:Amazon.RDS.Model.SNSNoAuthorizationException" /> /// <exception cref="T:Amazon.RDS.Model.EventSubscriptionQuotaExceededException" /> public ModifyEventSubscriptionResponse ModifyEventSubscription(ModifyEventSubscriptionRequest request) { var task = ModifyEventSubscriptionAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// <para>Modifies an existing RDS event notification subscription. Note that you cannot modify the source identifiers using this call; to /// change source identifiers for a subscription, use the AddSourceIdentifierToSubscription and RemoveSourceIdentifierFromSubscription /// calls.</para> <para>You can see a list of the event categories for a given SourceType in the <a href="http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html">Events</a> topic in the Amazon RDS User Guide or by using the /// <b>DescribeEventCategories</b> action.</para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ModifyEventSubscription service method on /// AmazonRDS.</param> /// /// <returns>The response from the ModifyEventSubscription service method, as returned by AmazonRDS.</returns> /// /// <exception cref="T:Amazon.RDS.Model.SNSTopicArnNotFoundException" /> /// <exception cref="T:Amazon.RDS.Model.SNSInvalidTopicException" /> /// <exception cref="T:Amazon.RDS.Model.SubscriptionCategoryNotFoundException" /> /// <exception cref="T:Amazon.RDS.Model.SubscriptionNotFoundException" /> /// <exception cref="T:Amazon.RDS.Model.SNSNoAuthorizationException" /> /// <exception cref="T:Amazon.RDS.Model.EventSubscriptionQuotaExceededException" /> public ModifyEventSubscriptionResponse ModifyEventSubscription(ModifyEventSubscriptionRequest request) { var task = ModifyEventSubscriptionAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// <para>Modifies an existing RDS event notification subscription. Note that you cannot modify the source identifiers using this call; to /// change source identifiers for a subscription, use the AddSourceIdentifierToSubscription and RemoveSourceIdentifierFromSubscription /// calls.</para> <para>You can see a list of the event categories for a given SourceType in the <a href="http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html">Events</a> topic in the Amazon RDS User Guide or by using the /// <b>DescribeEventCategories</b> action.</para> /// </summary> /// /// <param name="modifyEventSubscriptionRequest">Container for the necessary parameters to execute the ModifyEventSubscription service method on /// AmazonRDS.</param> /// /// <returns>The response from the ModifyEventSubscription service method, as returned by AmazonRDS.</returns> /// /// <exception cref="T:Amazon.RDS.Model.SNSTopicArnNotFoundException" /> /// <exception cref="T:Amazon.RDS.Model.SNSInvalidTopicException" /> /// <exception cref="T:Amazon.RDS.Model.SubscriptionCategoryNotFoundException" /> /// <exception cref="T:Amazon.RDS.Model.SubscriptionNotFoundException" /> /// <exception cref="T:Amazon.RDS.Model.SNSNoAuthorizationException" /> /// <exception cref="T:Amazon.RDS.Model.EventSubscriptionQuotaExceededException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public async Task<ModifyEventSubscriptionResponse> ModifyEventSubscriptionAsync(ModifyEventSubscriptionRequest modifyEventSubscriptionRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ModifyEventSubscriptionRequestMarshaller(); var unmarshaller = ModifyEventSubscriptionResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, ModifyEventSubscriptionRequest, ModifyEventSubscriptionResponse>(modifyEventSubscriptionRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
/// <summary> /// Initiates the asynchronous execution of the ModifyEventSubscription operation. /// <seealso cref="Amazon.RDS.IAmazonRDS"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ModifyEventSubscription 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 EndModifyEventSubscription /// operation.</returns> public IAsyncResult BeginModifyEventSubscription(ModifyEventSubscriptionRequest request, AsyncCallback callback, object state) { var marshaller = new ModifyEventSubscriptionRequestMarshaller(); var unmarshaller = ModifyEventSubscriptionResponseUnmarshaller.Instance; return BeginInvoke<ModifyEventSubscriptionRequest>(request, marshaller, unmarshaller, callback, state); }
private Amazon.RDS.Model.ModifyEventSubscriptionResponse CallAWSServiceOperation(IAmazonRDS client, Amazon.RDS.Model.ModifyEventSubscriptionRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Relational Database Service", "ModifyEventSubscription"); try { #if DESKTOP return client.ModifyEventSubscription(request); #elif CORECLR return client.ModifyEventSubscriptionAsync(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; } }