public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.SimpleNotificationService.Model.GetSubscriptionAttributesRequest(); 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 GetSubscriptionAttributes operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetSubscriptionAttributes 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 EndGetSubscriptionAttributes /// operation.</returns> public IAsyncResult BeginGetSubscriptionAttributes(GetSubscriptionAttributesRequest request, AsyncCallback callback, object state) { var marshaller = new GetSubscriptionAttributesRequestMarshaller(); var unmarshaller = GetSubscriptionAttributesResponseUnmarshaller.Instance; return BeginInvoke<GetSubscriptionAttributesRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Returns all of the properties of a subscription. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetSubscriptionAttributes service method.</param> /// /// <returns>The response from the GetSubscriptionAttributes 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 GetSubscriptionAttributesResponse GetSubscriptionAttributes(GetSubscriptionAttributesRequest request) { var marshaller = new GetSubscriptionAttributesRequestMarshaller(); var unmarshaller = GetSubscriptionAttributesResponseUnmarshaller.Instance; return Invoke<GetSubscriptionAttributesRequest,GetSubscriptionAttributesResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Returns all of the properties of a subscription. /// </summary> /// <param name="subscriptionArn">The ARN of the subscription whose properties you want to get.</param> /// /// <returns>The response from the GetSubscriptionAttributes 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 GetSubscriptionAttributesResponse GetSubscriptionAttributes(string subscriptionArn) { var request = new GetSubscriptionAttributesRequest(); request.SubscriptionArn = subscriptionArn; return GetSubscriptionAttributes(request); }
/// <summary> /// <para>The <c>GetSubscriptionAttribtues</c> action returns all of the properties of a subscription.</para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetSubscriptionAttributes service /// method on AmazonSimpleNotificationService.</param> /// /// <returns>The response from the GetSubscriptionAttributes service method, as returned by AmazonSimpleNotificationService.</returns> /// /// <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 GetSubscriptionAttributesResponse GetSubscriptionAttributes(GetSubscriptionAttributesRequest request) { var task = GetSubscriptionAttributesAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// Initiates the asynchronous execution of the GetSubscriptionAttributes operation. /// <seealso cref="Amazon.SimpleNotificationService.IAmazonSimpleNotificationService"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetSubscriptionAttributes 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<GetSubscriptionAttributesResponse> GetSubscriptionAttributesAsync(GetSubscriptionAttributesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new GetSubscriptionAttributesRequestMarshaller(); var unmarshaller = GetSubscriptionAttributesResponseUnmarshaller.Instance; return InvokeAsync<GetSubscriptionAttributesRequest,GetSubscriptionAttributesResponse>(request, marshaller, unmarshaller, cancellationToken); }
IAsyncResult invokeGetSubscriptionAttributes(GetSubscriptionAttributesRequest getSubscriptionAttributesRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new GetSubscriptionAttributesRequestMarshaller().Marshall(getSubscriptionAttributesRequest); var unmarshaller = GetSubscriptionAttributesResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
private Amazon.SimpleNotificationService.Model.GetSubscriptionAttributesResponse CallAWSServiceOperation(IAmazonSimpleNotificationService client, Amazon.SimpleNotificationService.Model.GetSubscriptionAttributesRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Simple Notification Service (SNS)", "GetSubscriptionAttributes"); try { #if DESKTOP return(client.GetSubscriptionAttributes(request)); #elif CORECLR return(client.GetSubscriptionAttributesAsync(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> /// <para>The <c>GetSubscriptionAttribtues</c> action returns all of the properties of a subscription.</para> /// </summary> /// /// <param name="getSubscriptionAttributesRequest">Container for the necessary parameters to execute the GetSubscriptionAttributes service /// method on AmazonSimpleNotificationService.</param> /// /// <returns>The response from the GetSubscriptionAttributes service method, as returned by AmazonSimpleNotificationService.</returns> /// /// <exception cref="NotFoundException"/> /// <exception cref="AuthorizationErrorException"/> /// <exception cref="InternalErrorException"/> /// <exception cref="InvalidParameterException"/> public GetSubscriptionAttributesResponse GetSubscriptionAttributes(GetSubscriptionAttributesRequest getSubscriptionAttributesRequest) { IAsyncResult asyncResult = invokeGetSubscriptionAttributes(getSubscriptionAttributesRequest, null, null, true); return EndGetSubscriptionAttributes(asyncResult); }
/// <summary> /// <para>The <c>GetSubscriptionAttribtues</c> action returns all of the properties of a subscription.</para> /// </summary> /// /// <param name="getSubscriptionAttributesRequest">Container for the necessary parameters to execute the GetSubscriptionAttributes service /// method on AmazonSimpleNotificationService.</param> /// /// <returns>The response from the GetSubscriptionAttributes service method, as returned by AmazonSimpleNotificationService.</returns> /// /// <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<GetSubscriptionAttributesResponse> GetSubscriptionAttributesAsync(GetSubscriptionAttributesRequest getSubscriptionAttributesRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new GetSubscriptionAttributesRequestMarshaller(); var unmarshaller = GetSubscriptionAttributesResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, GetSubscriptionAttributesRequest, GetSubscriptionAttributesResponse>(getSubscriptionAttributesRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
/// <summary> /// Returns all of the properties of a subscription. /// </summary> /// <param name="subscriptionArn">The ARN of the subscription whose properties you want to get.</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 GetSubscriptionAttributes 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<GetSubscriptionAttributesResponse> GetSubscriptionAttributesAsync(string subscriptionArn, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new GetSubscriptionAttributesRequest(); request.SubscriptionArn = subscriptionArn; return GetSubscriptionAttributesAsync(request, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the GetSubscriptionAttributes operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetSubscriptionAttributes 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 GetSubscriptionAttributesAsync(GetSubscriptionAttributesRequest request, AmazonServiceCallback<GetSubscriptionAttributesRequest, GetSubscriptionAttributesResponse> callback, AsyncOptions options = null) { options = options == null?new AsyncOptions():options; var marshaller = new GetSubscriptionAttributesRequestMarshaller(); var unmarshaller = GetSubscriptionAttributesResponseUnmarshaller.Instance; Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null; if(callback !=null ) callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { AmazonServiceResult<GetSubscriptionAttributesRequest,GetSubscriptionAttributesResponse> responseObject = new AmazonServiceResult<GetSubscriptionAttributesRequest,GetSubscriptionAttributesResponse>((GetSubscriptionAttributesRequest)req, (GetSubscriptionAttributesResponse)res, ex , ao.State); callback(responseObject); }; BeginInvoke<GetSubscriptionAttributesRequest>(request, marshaller, unmarshaller, options, callbackHelper); }
/// <summary> /// Returns all of the properties of a subscription. /// </summary> /// <param name="subscriptionArn">The ARN of the subscription whose properties you want to get.</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 GetSubscriptionAttributes 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 GetSubscriptionAttributesAsync(string subscriptionArn, AmazonServiceCallback<GetSubscriptionAttributesRequest, GetSubscriptionAttributesResponse> callback, AsyncOptions options = null) { var request = new GetSubscriptionAttributesRequest(); request.SubscriptionArn = subscriptionArn; GetSubscriptionAttributesAsync(request, callback, options); }
IAsyncResult invokeGetSubscriptionAttributes(GetSubscriptionAttributesRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new GetSubscriptionAttributesRequestMarshaller(); var unmarshaller = GetSubscriptionAttributesResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }
/// <summary> /// <para>The <c>GetSubscriptionAttribtues</c> action returns all of the properties of a subscription.</para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetSubscriptionAttributes service /// method on AmazonSimpleNotificationService.</param> /// /// <returns>The response from the GetSubscriptionAttributes service method, as returned by AmazonSimpleNotificationService.</returns> /// /// <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 GetSubscriptionAttributesResponse GetSubscriptionAttributes(GetSubscriptionAttributesRequest request) { var task = GetSubscriptionAttributesAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// Initiates the asynchronous execution of the GetSubscriptionAttributes operation. /// <seealso cref="Amazon.SimpleNotificationService.IAmazonSimpleNotificationService.GetSubscriptionAttributes"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetSubscriptionAttributes 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<GetSubscriptionAttributesResponse> GetSubscriptionAttributesAsync(GetSubscriptionAttributesRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new GetSubscriptionAttributesRequestMarshaller(); var unmarshaller = GetSubscriptionAttributesResponseUnmarshaller.GetInstance(); return Invoke<IRequest, GetSubscriptionAttributesRequest, GetSubscriptionAttributesResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the GetSubscriptionAttributes operation. /// <seealso cref="Amazon.SimpleNotificationService.IAmazonSimpleNotificationService.GetSubscriptionAttributes"/> /// </summary> /// /// <param name="getSubscriptionAttributesRequest">Container for the necessary parameters to execute the GetSubscriptionAttributes 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> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking /// EndGetSubscriptionAttributes operation.</returns> public IAsyncResult BeginGetSubscriptionAttributes(GetSubscriptionAttributesRequest getSubscriptionAttributesRequest, AsyncCallback callback, object state) { return invokeGetSubscriptionAttributes(getSubscriptionAttributesRequest, callback, state, false); }