Skip to content

Commit

Permalink
Merge pull request #215 from aimankhan/master
Browse files Browse the repository at this point in the history
Re-introducing properties used by SBExplorer to NotificationHubDescri…
  • Loading branch information
aimankhan authored Feb 9, 2022
2 parents b1e6a6a + 56af9b2 commit d3e75d1
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ static class Constants
public static readonly int DefaultMaxDeliveryCount = 10;
public static readonly TimeSpan DefaultRegistrationTtl = TimeSpan.MaxValue;
public static readonly TimeSpan MinimumRegistrationTtl = TimeSpan.FromDays(1);
public const int MaximumUserMetadataLength = 1024;

public const string NotificationHub = "NotificationHub";
public const string PathDelimiter = @"/";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,5 +144,10 @@ internal static class ManagementStrings

public const string OutputFilePath = "OutputFilePath";
public const string FailedFilePath = "FailedFilePath";

public const string DailyMaxActiveRegistrations = "DailyMaxActiveRegistrations";
public const string DailyMaxActiveDevices = "DailyMaxActiveDevices";
public const string DailyOperations = "DailyOperations";
public const string UserMetadata = "UserMetadata";
}
}
76 changes: 76 additions & 0 deletions src/Microsoft.Azure.NotificationHubs/NotificationHubDescription.cs
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,52 @@ public MpnsCredential MpnsCredential
set;
}

/// <summary>
/// Gets the daily operations for the Notificationhub.
/// </summary>
///
/// <returns>
/// The daily operations for the Notificationhub.
/// </returns>
[DataMember(Name = ManagementStrings.DailyOperations, IsRequired = false, EmitDefaultValue = false, Order = 1007)]
public long DailyOperations
{
get;
internal set;
}

/// <summary>
/// Gets the daily maximum active devices for Notificationhub.
/// </summary>
///
/// <returns>
/// The daily maximum active devices for Notificationhub.
/// </returns>
[DataMember(Name = ManagementStrings.DailyMaxActiveDevices, IsRequired = false, EmitDefaultValue = false, Order = 1008)]
public long DailyMaxActiveDevices
{
get;
internal set;
}

/// <summary>
/// Gets the daily maximum active registrations for the Notificationhub.
/// </summary>
///
/// <returns>
/// The daily maximum active registrations for the Notificationhub.
/// </returns>
[DataMember(Name = ManagementStrings.DailyMaxActiveRegistrations, IsRequired = false, EmitDefaultValue = false, Order = 1009)]
public long DailyMaxActiveRegistrations
{
get;
internal set;
}


[DataMember(Name = ManagementStrings.UserMetadata, IsRequired = false, EmitDefaultValue = false, Order = 1010)]
internal string InternalUserMetadata { get; set; }

/// <summary>
/// Gets or sets the Adm credential credential.
/// </summary>
Expand Down Expand Up @@ -353,6 +399,36 @@ public BaiduCredential BaiduCredential
set;
}

/// <summary>
/// Gets/Sets any User Metadata associated with the NotificationHub.
/// </summary>
///
/// <returns>
/// The user metadata associated with the NotificationHub.
/// </returns>
public string UserMetadata
{
get
{
return this.InternalUserMetadata;
}
set
{
this.ThrowIfReadOnly();
if (string.IsNullOrWhiteSpace(value))
{
this.InternalUserMetadata = null;
return;
}

if (value.Length > Constants.MaximumUserMetadataLength)
{
throw new ArgumentOutOfRangeException(nameof(UserMetadata));
}
this.InternalUserMetadata = value;
}
}

internal override bool RequiresEncryption
{
get { return true; }
Expand Down

0 comments on commit d3e75d1

Please sign in to comment.