/// <summary> /// Asynchronously creates a notification configuration. /// </summary> /// <param name="bucket">The bucket for which to create the notification configuration. Must not be null.</param> /// <param name="notification">The notification configuration to create. 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 /// <see cref="Notification"/> representation of the newly-created notification configuration.</returns> public virtual Task <Notification> CreateNotificationAsync(string bucket, Notification notification, CreateNotificationOptions options = null, CancellationToken cancellationToken = default) => throw new NotImplementedException();
/// <summary> /// Creates a notification configuration. /// </summary> /// <param name="bucket">The bucket for which to create the notification configuration. Must not be null.</param> /// <param name="notification">The notification configuration to create. 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>The <see cref="Notification"/> representation of the newly-created notification configuration.</returns> public virtual Notification CreateNotification(string bucket, Notification notification, CreateNotificationOptions options = null) => throw new NotImplementedException();
/// <inheritdoc /> public override Task <Notification> CreateNotificationAsync(string bucket, Notification notification, CreateNotificationOptions options = null, CancellationToken cancellationToken = default) => CreateCreateNotificationRequest(bucket, notification, options).ExecuteAsync(cancellationToken);
private NotificationsResource.InsertRequest CreateCreateNotificationRequest(string bucket, Notification notification, CreateNotificationOptions options) { ValidateBucketName(bucket); GaxPreconditions.CheckNotNull(notification, nameof(notification)); var request = Service.Notifications.Insert(notification, bucket); request.ModifyRequest += _versionHeaderAction; options?.ModifyRequest(request); return(request); }
/// <inheritdoc /> public override Notification CreateNotification(string bucket, Notification notification, CreateNotificationOptions options = null) => CreateCreateNotificationRequest(bucket, notification, options).Execute();