Exemplo n.º 1
0
        /// <summary>
        /// Gets notification configuration for this bucket
        /// </summary>
        /// <param name="bucketName">Bucket name</param>
        /// <param name="cancellationToken">Optional cancellation token to cancel the operation</param>
        /// <returns></returns>
        public async Task <BucketNotification> GetBucketNotificationsAsync(string bucketName, CancellationToken cancellationToken = default(CancellationToken))
        {
            GetBucketNotificationsArgs args = new GetBucketNotificationsArgs()
                                              .WithBucket(bucketName);

            return(await this.GetBucketNotificationsAsync(args, cancellationToken));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets notification configuration for this bucket
        /// </summary>
        /// <param name="args">GetBucketNotificationsArgs Arguments Object with information like Bucket name</param>
        /// <param name="cancellationToken">Optional cancellation token to cancel the operation</param>
        /// <returns></returns>
        public async Task <BucketNotification> GetBucketNotificationsAsync(GetBucketNotificationsArgs args, CancellationToken cancellationToken = default(CancellationToken))
        {
            RestRequest request = await this.CreateRequest(args).ConfigureAwait(false);

            IRestResponse response = await this.ExecuteAsync(this.NoErrorHandlers, request, cancellationToken).ConfigureAwait(false);

            GetBucketNotificationsResponse getBucketNotificationsResponse = new GetBucketNotificationsResponse(response.StatusCode, response.Content);

            return(getBucketNotificationsResponse.BucketNotificationConfiguration);
        }