-
Notifications
You must be signed in to change notification settings - Fork 4.5k
/
SignalRFeatureFlag.cs
63 lines (54 loc) · 4 KB
/
SignalRFeatureFlag.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
using System.ComponentModel;
namespace Azure.ResourceManager.SignalR.Models
{
/// <summary>
/// FeatureFlags is the supported features of Azure SignalR service.
/// - ServiceMode: Flag for backend server for SignalR service. Values allowed: "Default": have your own backend server; "Serverless": your application doesn't have a backend server; "Classic": for backward compatibility. Support both Default and Serverless mode but not recommended; "PredefinedOnly": for future use.
/// - EnableConnectivityLogs: "true"/"false", to enable/disable the connectivity log category respectively.
/// - EnableMessagingLogs: "true"/"false", to enable/disable the connectivity log category respectively.
/// - EnableLiveTrace: Live Trace allows you to know what's happening inside Azure SignalR service, it will give you live traces in real time, it will be helpful when you developing your own Azure SignalR based web application or self-troubleshooting some issues. Please note that live traces are counted as outbound messages that will be charged. Values allowed: "true"/"false", to enable/disable live trace feature.
/// </summary>
public readonly partial struct SignalRFeatureFlag : IEquatable<SignalRFeatureFlag>
{
private readonly string _value;
/// <summary> Initializes a new instance of <see cref="SignalRFeatureFlag"/>. </summary>
/// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception>
public SignalRFeatureFlag(string value)
{
_value = value ?? throw new ArgumentNullException(nameof(value));
}
private const string ServiceModeValue = "ServiceMode";
private const string EnableConnectivityLogsValue = "EnableConnectivityLogs";
private const string EnableMessagingLogsValue = "EnableMessagingLogs";
private const string EnableLiveTraceValue = "EnableLiveTrace";
/// <summary> ServiceMode. </summary>
public static SignalRFeatureFlag ServiceMode { get; } = new SignalRFeatureFlag(ServiceModeValue);
/// <summary> EnableConnectivityLogs. </summary>
public static SignalRFeatureFlag EnableConnectivityLogs { get; } = new SignalRFeatureFlag(EnableConnectivityLogsValue);
/// <summary> EnableMessagingLogs. </summary>
public static SignalRFeatureFlag EnableMessagingLogs { get; } = new SignalRFeatureFlag(EnableMessagingLogsValue);
/// <summary> EnableLiveTrace. </summary>
public static SignalRFeatureFlag EnableLiveTrace { get; } = new SignalRFeatureFlag(EnableLiveTraceValue);
/// <summary> Determines if two <see cref="SignalRFeatureFlag"/> values are the same. </summary>
public static bool operator ==(SignalRFeatureFlag left, SignalRFeatureFlag right) => left.Equals(right);
/// <summary> Determines if two <see cref="SignalRFeatureFlag"/> values are not the same. </summary>
public static bool operator !=(SignalRFeatureFlag left, SignalRFeatureFlag right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="SignalRFeatureFlag"/>. </summary>
public static implicit operator SignalRFeatureFlag(string value) => new SignalRFeatureFlag(value);
/// <inheritdoc />
[EditorBrowsable(EditorBrowsableState.Never)]
public override bool Equals(object obj) => obj is SignalRFeatureFlag other && Equals(other);
/// <inheritdoc />
public bool Equals(SignalRFeatureFlag other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
/// <inheritdoc />
[EditorBrowsable(EditorBrowsableState.Never)]
public override int GetHashCode() => _value?.GetHashCode() ?? 0;
/// <inheritdoc />
public override string ToString() => _value;
}
}