Container for the parameters to the SetSubscriptionAttributes operation. Allows a subscription owner to set an attribute of the topic to a new value.
Inheritance: AmazonSimpleNotificationServiceRequest
Example #1
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.SimpleNotificationService.Model.SetSubscriptionAttributesRequest();

            if (cmdletContext.AttributeName != null)
            {
                request.AttributeName = cmdletContext.AttributeName;
            }
            if (cmdletContext.AttributeValue != null)
            {
                request.AttributeValue = cmdletContext.AttributeValue;
            }
            if (cmdletContext.SubscriptionArn != null)
            {
                request.SubscriptionArn = cmdletContext.SubscriptionArn;
            }

            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 SetSubscriptionAttributes operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the SetSubscriptionAttributes operation on AmazonSimpleNotificationServiceClient.</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 EndSetSubscriptionAttributes
        ///         operation.</returns>
        public IAsyncResult BeginSetSubscriptionAttributes(SetSubscriptionAttributesRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new SetSubscriptionAttributesRequestMarshaller();
            var unmarshaller = SetSubscriptionAttributesResponseUnmarshaller.Instance;

            return BeginInvoke<SetSubscriptionAttributesRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
        /// <summary>
        /// Allows a subscription owner to set an attribute of the topic to a new value.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the SetSubscriptionAttributes service method.</param>
        /// 
        /// <returns>The response from the SetSubscriptionAttributes service method, as returned by SimpleNotificationService.</returns>
        /// <exception cref="Amazon.SimpleNotificationService.Model.AuthorizationErrorException">
        /// Indicates that the user has been denied access to the requested resource.
        /// </exception>
        /// <exception cref="Amazon.SimpleNotificationService.Model.InternalErrorException">
        /// Indicates an internal service error.
        /// </exception>
        /// <exception cref="Amazon.SimpleNotificationService.Model.InvalidParameterException">
        /// Indicates that a request parameter does not comply with the associated constraints.
        /// </exception>
        /// <exception cref="Amazon.SimpleNotificationService.Model.NotFoundException">
        /// Indicates that the requested resource does not exist.
        /// </exception>
        public SetSubscriptionAttributesResponse SetSubscriptionAttributes(SetSubscriptionAttributesRequest request)
        {
            var marshaller = new SetSubscriptionAttributesRequestMarshaller();
            var unmarshaller = SetSubscriptionAttributesResponseUnmarshaller.Instance;

            return Invoke<SetSubscriptionAttributesRequest,SetSubscriptionAttributesResponse>(request, marshaller, unmarshaller);
        }
 /// <summary>
 /// Allows a subscription owner to set an attribute of the topic to a new value.
 /// </summary>
 /// <param name="subscriptionArn">The ARN of the subscription to modify.</param>
 /// <param name="attributeName">The name of the attribute you want to set. Only a subset of the subscriptions attributes are mutable. Valid values: <code>DeliveryPolicy</code> | <code>RawMessageDelivery</code></param>
 /// <param name="attributeValue">The new value for the attribute in JSON format.</param>
 /// 
 /// <returns>The response from the SetSubscriptionAttributes service method, as returned by SimpleNotificationService.</returns>
 /// <exception cref="Amazon.SimpleNotificationService.Model.AuthorizationErrorException">
 /// Indicates that the user has been denied access to the requested resource.
 /// </exception>
 /// <exception cref="Amazon.SimpleNotificationService.Model.InternalErrorException">
 /// Indicates an internal service error.
 /// </exception>
 /// <exception cref="Amazon.SimpleNotificationService.Model.InvalidParameterException">
 /// Indicates that a request parameter does not comply with the associated constraints.
 /// </exception>
 /// <exception cref="Amazon.SimpleNotificationService.Model.NotFoundException">
 /// Indicates that the requested resource does not exist.
 /// </exception>
 public SetSubscriptionAttributesResponse SetSubscriptionAttributes(string subscriptionArn, string attributeName, string attributeValue)
 {
     var request = new SetSubscriptionAttributesRequest();
     request.SubscriptionArn = subscriptionArn;
     request.AttributeName = attributeName;
     request.AttributeValue = attributeValue;
     return SetSubscriptionAttributes(request);
 }
        /// <summary>
        /// <para>The <c>SetSubscriptionAttributes</c> action allows a subscription owner to set an attribute of the topic to a new value.</para>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the SetSubscriptionAttributes service
        /// method on AmazonSimpleNotificationService.</param>
        /// 
        /// <exception cref="T:Amazon.SimpleNotificationService.Model.NotFoundException" />
        /// <exception cref="T:Amazon.SimpleNotificationService.Model.AuthorizationErrorException" />
        /// <exception cref="T:Amazon.SimpleNotificationService.Model.InternalErrorException" />
        /// <exception cref="T:Amazon.SimpleNotificationService.Model.InvalidParameterException" />
		public SetSubscriptionAttributesResponse SetSubscriptionAttributes(SetSubscriptionAttributesRequest request)
        {
            var task = SetSubscriptionAttributesAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return null;
            }
        }
        /// <summary>
        /// Initiates the asynchronous execution of the SetSubscriptionAttributes operation.
        /// <seealso cref="Amazon.SimpleNotificationService.IAmazonSimpleNotificationService"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the SetSubscriptionAttributes 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<SetSubscriptionAttributesResponse> SetSubscriptionAttributesAsync(SetSubscriptionAttributesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new SetSubscriptionAttributesRequestMarshaller();
            var unmarshaller = SetSubscriptionAttributesResponseUnmarshaller.Instance;

            return InvokeAsync<SetSubscriptionAttributesRequest,SetSubscriptionAttributesResponse>(request, marshaller,
                unmarshaller, cancellationToken);
        }
 IAsyncResult invokeSetSubscriptionAttributes(SetSubscriptionAttributesRequest setSubscriptionAttributesRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new SetSubscriptionAttributesRequestMarshaller().Marshall(setSubscriptionAttributesRequest);
     var unmarshaller = SetSubscriptionAttributesResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }
 /// <summary>
 /// Allows a subscription owner to set an attribute of the topic to a new value.
 /// </summary>
 /// <param name="subscriptionArn">The ARN of the subscription to modify.</param>
 /// <param name="attributeName">The name of the attribute you want to set. Only a subset of the subscriptions attributes are mutable. Valid values: <code>DeliveryPolicy</code> | <code>RawMessageDelivery</code> </param>
 /// <param name="attributeValue">The new value for the attribute in JSON format.</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 SetSubscriptionAttributes service method, as returned by SimpleNotificationService.</returns>
 /// <exception cref="Amazon.SimpleNotificationService.Model.AuthorizationErrorException">
 /// Indicates that the user has been denied access to the requested resource.
 /// </exception>
 /// <exception cref="Amazon.SimpleNotificationService.Model.InternalErrorException">
 /// Indicates an internal service error.
 /// </exception>
 /// <exception cref="Amazon.SimpleNotificationService.Model.InvalidParameterException">
 /// Indicates that a request parameter does not comply with the associated constraints.
 /// </exception>
 /// <exception cref="Amazon.SimpleNotificationService.Model.NotFoundException">
 /// Indicates that the requested resource does not exist.
 /// </exception>
 public void SetSubscriptionAttributesAsync(string subscriptionArn, string attributeName, string attributeValue,  AmazonServiceCallback<SetSubscriptionAttributesRequest, SetSubscriptionAttributesResponse> callback, AsyncOptions options = null)
 {
     var request = new SetSubscriptionAttributesRequest();
     request.SubscriptionArn = subscriptionArn;
     request.AttributeName = attributeName;
     request.AttributeValue = attributeValue;
     SetSubscriptionAttributesAsync(request, callback, options);
 }
 /// <summary>
 /// <para>The <c>SetSubscriptionAttributes</c> action allows a subscription owner to set an attribute of the topic to a new value.</para>
 /// </summary>
 /// 
 /// <param name="setSubscriptionAttributesRequest">Container for the necessary parameters to execute the SetSubscriptionAttributes service
 ///          method on AmazonSimpleNotificationService.</param>
 /// 
 /// <exception cref="NotFoundException"/>
 /// <exception cref="AuthorizationErrorException"/>
 /// <exception cref="InternalErrorException"/>
 /// <exception cref="InvalidParameterException"/>
 public SetSubscriptionAttributesResponse SetSubscriptionAttributes(SetSubscriptionAttributesRequest setSubscriptionAttributesRequest)
 {
     IAsyncResult asyncResult = invokeSetSubscriptionAttributes(setSubscriptionAttributesRequest, null, null, true);
     return EndSetSubscriptionAttributes(asyncResult);
 }
        /// <summary>
        /// <para>The <c>SetSubscriptionAttributes</c> action allows a subscription owner to set an attribute of the topic to a new value.</para>
        /// </summary>
        /// 
        /// <param name="setSubscriptionAttributesRequest">Container for the necessary parameters to execute the SetSubscriptionAttributes service
        /// method on AmazonSimpleNotificationService.</param>
        /// 
        /// <exception cref="T:Amazon.SimpleNotificationService.Model.NotFoundException" />
        /// <exception cref="T:Amazon.SimpleNotificationService.Model.AuthorizationErrorException" />
        /// <exception cref="T:Amazon.SimpleNotificationService.Model.InternalErrorException" />
        /// <exception cref="T:Amazon.SimpleNotificationService.Model.InvalidParameterException" />
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
		public async Task<SetSubscriptionAttributesResponse> SetSubscriptionAttributesAsync(SetSubscriptionAttributesRequest setSubscriptionAttributesRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new SetSubscriptionAttributesRequestMarshaller();
            var unmarshaller = SetSubscriptionAttributesResponseUnmarshaller.GetInstance();
            var response = await Invoke<IRequest, SetSubscriptionAttributesRequest, SetSubscriptionAttributesResponse>(setSubscriptionAttributesRequest, marshaller, unmarshaller, signer, cancellationToken)
                .ConfigureAwait(continueOnCapturedContext: false);
            return response;
        }
 /// <summary>
 /// Allows a subscription owner to set an attribute of the topic to a new value.
 /// </summary>
 /// <param name="subscriptionArn">The ARN of the subscription to modify.</param>
 /// <param name="attributeName">The name of the attribute you want to set. Only a subset of the subscriptions attributes are mutable. Valid values: <code>DeliveryPolicy</code> | <code>RawMessageDelivery</code></param>
 /// <param name="attributeValue">The new value for the attribute in JSON format.</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 SetSubscriptionAttributes service method, as returned by SimpleNotificationService.</returns>
 /// <exception cref="Amazon.SimpleNotificationService.Model.AuthorizationErrorException">
 /// Indicates that the user has been denied access to the requested resource.
 /// </exception>
 /// <exception cref="Amazon.SimpleNotificationService.Model.InternalErrorException">
 /// Indicates an internal service error.
 /// </exception>
 /// <exception cref="Amazon.SimpleNotificationService.Model.InvalidParameterException">
 /// Indicates that a request parameter does not comply with the associated constraints.
 /// </exception>
 /// <exception cref="Amazon.SimpleNotificationService.Model.NotFoundException">
 /// Indicates that the requested resource does not exist.
 /// </exception>
 public Task<SetSubscriptionAttributesResponse> SetSubscriptionAttributesAsync(string subscriptionArn, string attributeName, string attributeValue, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
 {
     var request = new SetSubscriptionAttributesRequest();
     request.SubscriptionArn = subscriptionArn;
     request.AttributeName = attributeName;
     request.AttributeValue = attributeValue;
     return SetSubscriptionAttributesAsync(request, cancellationToken);
 }
Example #12
0
 private Amazon.SimpleNotificationService.Model.SetSubscriptionAttributesResponse CallAWSServiceOperation(IAmazonSimpleNotificationService client, Amazon.SimpleNotificationService.Model.SetSubscriptionAttributesRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Simple Notification Service (SNS)", "SetSubscriptionAttributes");
     try
     {
         #if DESKTOP
         return(client.SetSubscriptionAttributes(request));
         #elif CORECLR
         return(client.SetSubscriptionAttributesAsync(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 SetSubscriptionAttributes operation.
 /// </summary>
 /// 
 /// <param name="request">Container for the necessary parameters to execute the SetSubscriptionAttributes operation on AmazonSimpleNotificationServiceClient.</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 SetSubscriptionAttributesAsync(SetSubscriptionAttributesRequest request, AmazonServiceCallback<SetSubscriptionAttributesRequest, SetSubscriptionAttributesResponse> callback, AsyncOptions options = null)
 {
     options = options == null?new AsyncOptions():options;
     var marshaller = new SetSubscriptionAttributesRequestMarshaller();
     var unmarshaller = SetSubscriptionAttributesResponseUnmarshaller.Instance;
     Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;
     if(callback !=null )
         callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { 
             AmazonServiceResult<SetSubscriptionAttributesRequest,SetSubscriptionAttributesResponse> responseObject 
                     = new AmazonServiceResult<SetSubscriptionAttributesRequest,SetSubscriptionAttributesResponse>((SetSubscriptionAttributesRequest)req, (SetSubscriptionAttributesResponse)res, ex , ao.State);    
                 callback(responseObject); 
         };
     BeginInvoke<SetSubscriptionAttributesRequest>(request, marshaller, unmarshaller, options, callbackHelper);
 }
        /// <summary>
        /// <para>The <c>SetSubscriptionAttributes</c> action allows a subscription owner to set an attribute of the topic to a new value.</para>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the SetSubscriptionAttributes service
        /// method on AmazonSimpleNotificationService.</param>
        /// 
        /// <exception cref="T:Amazon.SimpleNotificationService.Model.NotFoundException" />
        /// <exception cref="T:Amazon.SimpleNotificationService.Model.AuthorizationErrorException" />
        /// <exception cref="T:Amazon.SimpleNotificationService.Model.InternalErrorException" />
        /// <exception cref="T:Amazon.SimpleNotificationService.Model.InvalidParameterException" />
		public SetSubscriptionAttributesResponse SetSubscriptionAttributes(SetSubscriptionAttributesRequest request)
        {
            var task = SetSubscriptionAttributesAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                throw e.InnerException;
            }
        }
 /// <summary>
 /// Initiates the asynchronous execution of the SetSubscriptionAttributes operation.
 /// <seealso cref="Amazon.SimpleNotificationService.IAmazonSimpleNotificationService.SetSubscriptionAttributes"/>
 /// </summary>
 /// 
 /// <param name="setSubscriptionAttributesRequest">Container for the necessary parameters to execute the SetSubscriptionAttributes operation on
 ///          AmazonSimpleNotificationService.</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>
 public IAsyncResult BeginSetSubscriptionAttributes(SetSubscriptionAttributesRequest setSubscriptionAttributesRequest, AsyncCallback callback, object state)
 {
     return invokeSetSubscriptionAttributes(setSubscriptionAttributesRequest, callback, state, false);
 }
        /// <summary>
        /// Initiates the asynchronous execution of the SetSubscriptionAttributes operation.
        /// <seealso cref="Amazon.SimpleNotificationService.IAmazonSimpleNotificationService.SetSubscriptionAttributes"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the SetSubscriptionAttributes 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<SetSubscriptionAttributesResponse> SetSubscriptionAttributesAsync(SetSubscriptionAttributesRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new SetSubscriptionAttributesRequestMarshaller();
            var unmarshaller = SetSubscriptionAttributesResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, SetSubscriptionAttributesRequest, SetSubscriptionAttributesResponse>(request, marshaller, unmarshaller, signer, cancellationToken);
        }
        IAsyncResult invokeSetSubscriptionAttributes(SetSubscriptionAttributesRequest request, AsyncCallback callback, object state, bool synchronized)
        {
            var marshaller = new SetSubscriptionAttributesRequestMarshaller();
            var unmarshaller = SetSubscriptionAttributesResponseUnmarshaller.Instance;

            return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer);
        }