internal PutBucketNotificationResponse PutBucketNotification(PutBucketNotificationRequest request) { var marshaller = new PutBucketNotificationRequestMarshaller(); var unmarshaller = PutBucketNotificationResponseUnmarshaller.Instance; return Invoke<PutBucketNotificationRequest,PutBucketNotificationResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the PutBucketNotification operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the PutBucketNotification 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<PutBucketNotificationResponse> PutBucketNotificationAsync(PutBucketNotificationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new PutBucketNotificationRequestMarshaller(); var unmarshaller = PutBucketNotificationResponseUnmarshaller.Instance; return InvokeAsync<PutBucketNotificationRequest,PutBucketNotificationResponse>(request, marshaller, unmarshaller, cancellationToken); }
IAsyncResult invokePutBucketNotification(PutBucketNotificationRequest putBucketNotificationRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new PutBucketNotificationRequestMarshaller().Marshall(putBucketNotificationRequest); var unmarshaller = PutBucketNotificationResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the PutBucketNotification operation. /// This API is supported only when AWSConfigs.HttpClient is set to AWSConfigs.HttpClientOption.UnityWebRequest, the default value for this configuration option is AWSConfigs.HttpClientOption.UnityWWW /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the PutBucketNotification operation on AmazonS3Client.</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 PutBucketNotificationAsync(PutBucketNotificationRequest request, AmazonServiceCallback<PutBucketNotificationRequest, PutBucketNotificationResponse> callback, AsyncOptions options = null) { if (AWSConfigs.HttpClient == AWSConfigs.HttpClientOption.UnityWWW) { throw new InvalidOperationException("PutBucketNotification is only allowed with AWSConfigs.HttpClientOption.UnityWebRequest API option"); } options = options == null?new AsyncOptions():options; var marshaller = new PutBucketNotificationRequestMarshaller(); var unmarshaller = PutBucketNotificationResponseUnmarshaller.Instance; Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null; if(callback !=null ) callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { AmazonServiceResult<PutBucketNotificationRequest,PutBucketNotificationResponse> responseObject = new AmazonServiceResult<PutBucketNotificationRequest,PutBucketNotificationResponse>((PutBucketNotificationRequest)req, (PutBucketNotificationResponse)res, ex , ao.State); callback(responseObject); }; BeginInvoke<PutBucketNotificationRequest>(request, marshaller, unmarshaller, options, callbackHelper); }
/// <summary> /// Initiates the asynchronous execution of the PutBucketNotification operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the PutBucketNotification operation on AmazonS3Client.</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 EndPutBucketNotification /// operation.</returns> public IAsyncResult BeginPutBucketNotification(PutBucketNotificationRequest request, AsyncCallback callback, object state) { var marshaller = new PutBucketNotificationRequestMarshaller(); var unmarshaller = PutBucketNotificationResponseUnmarshaller.Instance; return BeginInvoke<PutBucketNotificationRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Initiates the asynchronous execution of the PutBucketNotification operation. /// <seealso cref="Amazon.S3.IAmazonS3.PutBucketNotification"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the PutBucketNotification 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<PutBucketNotificationResponse> PutBucketNotificationAsync(PutBucketNotificationRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new PutBucketNotificationRequestMarshaller(); var unmarshaller = PutBucketNotificationResponseUnmarshaller.GetInstance(); return Invoke<IRequest, PutBucketNotificationRequest, PutBucketNotificationResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// <para>Enables notifications of specified events for a bucket.</para> /// </summary> /// /// <param name="putBucketNotificationRequest">Container for the necessary parameters to execute the PutBucketNotification service method on /// AmazonS3.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public async Task<PutBucketNotificationResponse> PutBucketNotificationAsync(PutBucketNotificationRequest putBucketNotificationRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new PutBucketNotificationRequestMarshaller(); var unmarshaller = PutBucketNotificationResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, PutBucketNotificationRequest, PutBucketNotificationResponse>(putBucketNotificationRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }