/// <summary>
 /// Lists notification configurations associated with a bucket.
 /// </summary>
 /// <param name="bucket">The bucket for which to list associated notification configurations. Must not be null.</param>
 /// <param name="options">The options for the operation. May be null, in which case defaults will be supplied.</param>
 /// <returns>A list of notification configurations associated with the specified bucket. This method never returns null.</returns>
 public virtual IReadOnlyList <Notification> ListNotifications(string bucket, ListNotificationsOptions options = null) =>
 throw new NotImplementedException();
 /// <summary>
 /// Asynchronously lists notification configurations associated with a bucket.
 /// </summary>
 /// <param name="bucket">The bucket for which to list associated notification configurations. Must not be null.</param>
 /// <param name="options">The options for the operation. May be null, in which case defaults will be supplied.</param>
 /// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
 /// <returns>A task representing the asynchronous operation, with a result returning the
 /// list of notification configurations associated with the specified bucket. The result is never null.</returns>
 public virtual Task <IReadOnlyList <Notification> > ListNotificationsAsync(string bucket, ListNotificationsOptions options = null, CancellationToken cancellationToken = default) =>
 throw new NotImplementedException();
Example #3
0
        /// <inheritdoc />
        public override IReadOnlyList <Notification> ListNotifications(string bucket, ListNotificationsOptions options = null)
        {
            ValidateBucketName(bucket);
            var list = CreateListNotificationsRequest(bucket, options).Execute().Items ?? new List <Notification>();

            return(new ReadOnlyCollection <Notification>(list));
        }
Example #4
0
        /// <inheritdoc />
        public override async Task <IReadOnlyList <Notification> > ListNotificationsAsync(string bucket, ListNotificationsOptions options = null, CancellationToken cancellationToken = default)
        {
            ValidateBucketName(bucket);
            var request  = CreateListNotificationsRequest(bucket, options);
            var response = await request.ExecuteAsync(cancellationToken).ConfigureAwait(false);

            var list = response.Items ?? new List <Notification>();

            return(new ReadOnlyCollection <Notification>(list));
        }
Example #5
0
        private NotificationsResource.ListRequest CreateListNotificationsRequest(string bucket, ListNotificationsOptions options)
        {
            var request = Service.Notifications.List(bucket);

            request.ModifyRequest += _versionHeaderAction;
            options?.ModifyRequest(request);
            return(request);
        }