/// <summary> /// Initiates the asynchronous execution of the Publish operation. /// <seealso cref="Amazon.SimpleNotificationService.IAmazonSimpleNotificationService"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the Publish 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 <PublishResponse> PublishAsync(PublishRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new PublishRequestMarshaller(); var unmarshaller = PublishResponseUnmarshaller.Instance; return(Invoke <IRequest, PublishRequest, PublishResponse>(request, marshaller, unmarshaller, signer, cancellationToken)); }
internal PublishResponse Publish(PublishRequest request) { var marshaller = new PublishRequestMarshaller(); var unmarshaller = PublishResponseUnmarshaller.Instance; return(Invoke <PublishRequest, PublishResponse>(request, marshaller, unmarshaller)); }
/// <summary> /// Initiates the asynchronous execution of the Publish operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the Publish operation on AmazonIotDataClient.</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 EndPublish /// operation.</returns> public IAsyncResult BeginPublish(PublishRequest request, AsyncCallback callback, object state) { var marshaller = new PublishRequestMarshaller(); var unmarshaller = PublishResponseUnmarshaller.Instance; return(BeginInvoke <PublishRequest>(request, marshaller, unmarshaller, callback, state)); }
/// <summary> /// Initiates the asynchronous execution of the Publish operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the Publish 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 virtual Task <PublishResponse> PublishAsync(PublishRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new PublishRequestMarshaller(); var unmarshaller = PublishResponseUnmarshaller.Instance; return(InvokeAsync <PublishRequest, PublishResponse>(request, marshaller, unmarshaller, cancellationToken)); }
public void PublishMarshallTest() { var operation = service_model.FindOperation("Publish"); var request = InstantiateClassGenerator.Execute <PublishRequest>(); var marshaller = new PublishRequestMarshaller(); var internalRequest = marshaller.Marshall(request); RequestValidator.Validate("Publish", request, internalRequest, service_model); }
public void PublishMarshallTest() { var operation = service_model.FindOperation("Publish"); var request = InstantiateClassGenerator.Execute <PublishRequest>(); var marshaller = new PublishRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var validator = new AWSQueryValidator(internalRequest.Parameters, request, service_model, operation); validator.Validate(); var payloadResponse = new XmlSampleGenerator(service_model, operation).Execute(); var context = new XmlUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, null); var response = PublishResponseUnmarshaller.Instance.Unmarshall(context) as PublishResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
/// <summary> /// Initiates the asynchronous execution of the Publish operation. /// <seealso cref="Amazon.SimpleNotificationService.IAmazonSimpleNotificationService.Publish"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the Publish 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<PublishResponse> PublishAsync(PublishRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new PublishRequestMarshaller(); var unmarshaller = PublishResponseUnmarshaller.GetInstance(); return Invoke<IRequest, PublishRequest, PublishResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the Publish operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the Publish 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 EndPublish /// operation.</returns> public IAsyncResult BeginPublish(PublishRequest request, AsyncCallback callback, object state) { var marshaller = new PublishRequestMarshaller(); var unmarshaller = PublishResponseUnmarshaller.Instance; return BeginInvoke<PublishRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Sends a message to all of a topic's subscribed endpoints. When a <code>messageId</code> /// is returned, the message has been saved and Amazon SNS will attempt to deliver it /// to the topic's subscribers shortly. The format of the outgoing message to each /// subscribed endpoint depends on the notification protocol selected. /// /// /// <para> /// To use the <code>Publish</code> action for sending a message to a mobile endpoint, /// such as an app on a Kindle device or mobile phone, you must specify the EndpointArn. /// The EndpointArn is returned when making a call with the <code>CreatePlatformEndpoint</code> /// action. The second example below shows a request and response for publishing /// to a mobile endpoint. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the Publish service method.</param> /// /// <returns>The response from the Publish 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.EndpointDisabledException"> /// Exception error indicating endpoint disabled. /// </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.InvalidParameterValueException"> /// /// </exception> /// <exception cref="Amazon.SimpleNotificationService.Model.NotFoundException"> /// Indicates that the requested resource does not exist. /// </exception> /// <exception cref="Amazon.SimpleNotificationService.Model.PlatformApplicationDisabledException"> /// Exception error indicating platform application disabled. /// </exception> public PublishResponse Publish(PublishRequest request) { var marshaller = new PublishRequestMarshaller(); var unmarshaller = PublishResponseUnmarshaller.Instance; return Invoke<PublishRequest,PublishResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the Publish operation. /// <seealso cref="Amazon.SimpleNotificationService.IAmazonSimpleNotificationService"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the Publish 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<PublishResponse> PublishAsync(PublishRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new PublishRequestMarshaller(); var unmarshaller = PublishResponseUnmarshaller.Instance; return InvokeAsync<PublishRequest,PublishResponse>(request, marshaller, unmarshaller, cancellationToken); }
IAsyncResult invokePublish(PublishRequest publishRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new PublishRequestMarshaller().Marshall(publishRequest); var unmarshaller = PublishResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
public void PublishMarshallTest() { var operation = service_model.FindOperation("Publish"); var request = InstantiateClassGenerator.Execute<PublishRequest>(); var marshaller = new PublishRequestMarshaller(); var internalRequest = marshaller.Marshall(request); RequestValidator.Validate("Publish", request, internalRequest, service_model); }
/// <summary> /// <para>The <c>Publish</c> action sends a message to all of a topic's subscribed endpoints. When a <c>messageId</c> is returned, the message /// has been saved and Amazon SNS will attempt to deliver it to the topic's subscribers shortly. The format of the outgoing message to each /// subscribed endpoint depends on the notification protocol selected.</para> <para>To use the <c>Publish</c> action for sending a message to a /// mobile endpoint, such as an app on a Kindle device or mobile phone, you must specify the EndpointArn. The EndpointArn is returned when /// making a call with the <c>CreatePlatformEndpoint</c> action. The second example below shows a request and response for publishing to a /// mobile endpoint. </para> /// </summary> /// /// <param name="publishRequest">Container for the necessary parameters to execute the Publish service method on /// AmazonSimpleNotificationService.</param> /// /// <returns>The response from the Publish service method, as returned by AmazonSimpleNotificationService.</returns> /// /// <exception cref="T:Amazon.SimpleNotificationService.Model.NotFoundException" /> /// <exception cref="T:Amazon.SimpleNotificationService.Model.PlatformApplicationDisabledException" /> /// <exception cref="T:Amazon.SimpleNotificationService.Model.EndpointDisabledException" /> /// <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<PublishResponse> PublishAsync(PublishRequest publishRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new PublishRequestMarshaller(); var unmarshaller = PublishResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, PublishRequest, PublishResponse>(publishRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
public void PublishMarshallTest() { var operation = service_model.FindOperation("Publish"); var request = InstantiateClassGenerator.Execute<PublishRequest>(); var marshaller = new PublishRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var validator = new AWSQueryValidator(internalRequest.Parameters, request, service_model, operation); validator.Validate(); var payloadResponse = new XmlSampleGenerator(service_model, operation).Execute(); var context = new XmlUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, null); var response = PublishResponseUnmarshaller.Instance.Unmarshall(context) as PublishResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
/// <summary> /// Initiates the asynchronous execution of the Publish operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the Publish 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 PublishAsync(PublishRequest request, AmazonServiceCallback<PublishRequest, PublishResponse> callback, AsyncOptions options = null) { options = options == null?new AsyncOptions():options; var marshaller = new PublishRequestMarshaller(); var unmarshaller = PublishResponseUnmarshaller.Instance; Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null; if(callback !=null ) callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { AmazonServiceResult<PublishRequest,PublishResponse> responseObject = new AmazonServiceResult<PublishRequest,PublishResponse>((PublishRequest)req, (PublishResponse)res, ex , ao.State); callback(responseObject); }; BeginInvoke<PublishRequest>(request, marshaller, unmarshaller, options, callbackHelper); }
IAsyncResult invokePublish(PublishRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new PublishRequestMarshaller(); var unmarshaller = PublishResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }