| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | // <auto-generated/> |
| | 5 | |
|
| | 6 | | #nullable disable |
| | 7 | |
|
| | 8 | | using System; |
| | 9 | |
|
| | 10 | | namespace Azure.ResourceManager.Resources.Models |
| | 11 | | { |
| | 12 | | internal static class SpendingLimitExtensions |
| | 13 | | { |
| 0 | 14 | | public static string ToSerialString(this SpendingLimit value) => value switch |
| 0 | 15 | | { |
| 0 | 16 | | SpendingLimit.On => "On", |
| 0 | 17 | | SpendingLimit.Off => "Off", |
| 0 | 18 | | SpendingLimit.CurrentPeriodOff => "CurrentPeriodOff", |
| 0 | 19 | | _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SpendingLimit value.") |
| 0 | 20 | | }; |
| | 21 | |
|
| | 22 | | public static SpendingLimit ToSpendingLimit(this string value) |
| | 23 | | { |
| 16 | 24 | | if (string.Equals(value, "On", StringComparison.InvariantCultureIgnoreCase)) return SpendingLimit.On; |
| 0 | 25 | | if (string.Equals(value, "Off", StringComparison.InvariantCultureIgnoreCase)) return SpendingLimit.Off; |
| 0 | 26 | | if (string.Equals(value, "CurrentPeriodOff", StringComparison.InvariantCultureIgnoreCase)) return SpendingLi |
| 0 | 27 | | throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SpendingLimit value."); |
| | 28 | | } |
| | 29 | | } |
| | 30 | | } |