You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sdk/keyvault/Azure.Security.KeyVault.Administration/api/Azure.Security.KeyVault.Administration.netstandard2.0.cs
+18-10Lines changed: 18 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -63,6 +63,7 @@ public static partial class KeyVaultAdministrationModelFactory
@@ -21,59 +28,40 @@ public KeyVaultSetting(string name, bool value)
21
28
Argument.AssertNotNullOrEmpty(name,nameof(name));
22
29
23
30
Name=name;
24
-
Type=SettingType.Boolean;
25
-
26
-
// bool.ToString() returns "True" or "False", but the service wants "true" or "false".
27
-
Value=value?"true":"false";
31
+
Value=newKeyVaultSettingValue(value);
28
32
}
29
33
30
-
// TODO: Consider using Azure.Value and making this class mutable: https://github.com/Azure/azure-sdk-for-net/issues/32174
34
+
// TODO: Move construction to KeyVaultSettingValue and hide constructors here when the number of supported value types warrants it e.g., more than 3 intrinsic types.
31
35
32
36
/// <summary>
33
-
/// Gets the boolean value of this account setting if <see cref="Type"/> is <see cref="SettingType.Boolean"/>.
37
+
/// Creates a new instance of the <see cref="KeyVaultSetting"/> class.
34
38
/// </summary>
35
-
/// <returns>A boolean value if <see cref="Type"/> is <see cref="SettingType.Boolean"/>.</returns>
36
-
/// <exception cref="InvalidOperationException">The <see cref="Type"/> is not <see cref="SettingType.Boolean"/>, or the value cannot be normalized as a Boolean.</exception>
/// Gets the string value of this account setting. Use <see cref="Type"/> to determine if a more appropriate method like <see cref="AsBoolean"/> should be used instead.
52
+
/// Gets the type specifier of the value.
41
53
/// </summary>
42
-
/// <returns>The string value of this account setting.</returns>
thrownewInvalidOperationException($"Cannot get setting as {SettingType.Boolean}. Setting type is {Type}.");
68
-
}
69
-
70
-
(boolisValid,TparsedValue)=converter();
71
-
if(isValid)
72
-
{
73
-
returnparsedValue;
74
-
}
59
+
publicKeyVaultSettingValueValue{get;}
75
60
76
-
thrownewInvalidOperationException($"Cannot normalize the setting as {expectedType}. Use {nameof(AsString)}() for a textual representation of the setting.");
0 commit comments