Esempio n. 1
0
 /// <summary>
 /// Defines the OTP token that must be passed to the client.
 /// </summary>
 /// <param name="builder">The builder.</param>
 /// <param name="token">The token.</param>
 public static PushNotificationMessageBuilder WithToken(this PushNotificationMessageBuilder builder, string token)
 {
     if (string.IsNullOrEmpty(token))
     {
         throw new ArgumentException("You must define the otp token of the Push Notification.", nameof(token));
     }
     builder.Token = token;
     return(builder);
 }
Esempio n. 2
0
 /// <summary>
 /// Defines the message to the push notification.
 /// </summary>
 /// <param name="builder">The builder.</param>
 /// <param name="title">The title to add to the push notification.</param>
 public static PushNotificationMessageBuilder WithTitle(this PushNotificationMessageBuilder builder, string title)
 {
     if (string.IsNullOrEmpty(title))
     {
         throw new ArgumentException("You must define a title for the push notification.", nameof(title));
     }
     builder.Title = title;
     return(builder);
 }
Esempio n. 3
0
 /// <summary>
 /// Defines the body of the push notification.
 /// </summary>
 /// <param name="builder">The builder.</param>
 /// <param name="body">The body of the push notification.</param>
 public static PushNotificationMessageBuilder WithBody(this PushNotificationMessageBuilder builder, string body)
 {
     if (string.IsNullOrEmpty(body))
     {
         throw new ArgumentException("You must define a body for the push notification.", nameof(body));
     }
     builder.Body = body;
     return(builder);
 }
Esempio n. 4
0
 /// <summary>
 /// Defines the tags that will be sent to the push notification.
 /// </summary>
 /// <param name="builder">The builder.</param>
 /// <param name="tags">The tags to send.</param>
 public static PushNotificationMessageBuilder WithTags(this PushNotificationMessageBuilder builder, params string[] tags)
 {
     if (tags?.Length == 0)
     {
         throw new ArgumentException("You must set the tags to the push notification.", nameof(tags));
     }
     builder.Tags = tags;
     return(builder);
 }
Esempio n. 5
0
 /// <summary>
 /// Defines the user that will receive the push notification.
 /// </summary>
 /// <param name="builder">The builder.</param>
 /// <param name="userTag">The Id of the user.</param>
 public static PushNotificationMessageBuilder To(this PushNotificationMessageBuilder builder, string userTag)
 {
     if (string.IsNullOrEmpty(userTag))
     {
         throw new ArgumentException("You must define the userId of the push notification.", nameof(userTag));
     }
     builder.UserTag = userTag;
     return(builder);
 }
Esempio n. 6
0
 /// <summary>
 /// Returns the <see cref="PushNotificationMessage"/> instance made by the builder.
 /// </summary>
 /// <param name="builder">The builder.</param>
 public static PushNotificationMessage Build(this PushNotificationMessageBuilder builder) =>
Esempio n. 7
0
 /// <summary>
 /// Defines the type of the push notification.
 /// </summary>
 /// <param name="builder">the builder.</param>
 /// <param name="classification">The type of the push notification.</param>
 public static PushNotificationMessageBuilder WithClassification(this PushNotificationMessageBuilder builder, string classification)
 {
     builder.Classification = classification;
     return(builder);
 }
Esempio n. 8
0
 /// <summary>
 /// Defines the data of the push notification. Data is optional.
 /// </summary>
 /// <param name="builder">The builder.</param>
 /// <param name="data">The data that will be sent to the push notification.</param>
 public static PushNotificationMessageBuilder WithData(this PushNotificationMessageBuilder builder, string data)
 {
     builder.Data = data;
     return(builder);
 }