| | | 1 | | // <auto-generated> |
| | | 2 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | | 3 | | // Licensed under the MIT License. See License.txt in the project root for |
| | | 4 | | // license information. |
| | | 5 | | // |
| | | 6 | | // Code generated by Microsoft (R) AutoRest Code Generator. |
| | | 7 | | // Changes may cause incorrect behavior and will be lost if the code is |
| | | 8 | | // regenerated. |
| | | 9 | | // </auto-generated> |
| | | 10 | | |
| | | 11 | | namespace Microsoft.Azure.CognitiveServices.AnomalyDetector.Models |
| | | 12 | | { |
| | | 13 | | using Newtonsoft.Json; |
| | | 14 | | using Newtonsoft.Json.Converters; |
| | | 15 | | using System.Runtime; |
| | | 16 | | using System.Runtime.Serialization; |
| | | 17 | | |
| | | 18 | | /// <summary> |
| | | 19 | | /// Defines values for Granularity. |
| | | 20 | | /// </summary> |
| | | 21 | | [JsonConverter(typeof(StringEnumConverter))] |
| | | 22 | | public enum Granularity |
| | | 23 | | { |
| | | 24 | | [EnumMember(Value = "yearly")] |
| | | 25 | | Yearly, |
| | | 26 | | [EnumMember(Value = "monthly")] |
| | | 27 | | Monthly, |
| | | 28 | | [EnumMember(Value = "weekly")] |
| | | 29 | | Weekly, |
| | | 30 | | [EnumMember(Value = "daily")] |
| | | 31 | | Daily, |
| | | 32 | | [EnumMember(Value = "hourly")] |
| | | 33 | | Hourly, |
| | | 34 | | [EnumMember(Value = "minutely")] |
| | | 35 | | Minutely |
| | | 36 | | } |
| | | 37 | | internal static class GranularityEnumExtension |
| | | 38 | | { |
| | | 39 | | internal static string ToSerializedValue(this Granularity? value) |
| | | 40 | | { |
| | 0 | 41 | | return value == null ? null : ((Granularity)value).ToSerializedValue(); |
| | | 42 | | } |
| | | 43 | | |
| | | 44 | | internal static string ToSerializedValue(this Granularity value) |
| | | 45 | | { |
| | | 46 | | switch( value ) |
| | | 47 | | { |
| | | 48 | | case Granularity.Yearly: |
| | 0 | 49 | | return "yearly"; |
| | | 50 | | case Granularity.Monthly: |
| | 0 | 51 | | return "monthly"; |
| | | 52 | | case Granularity.Weekly: |
| | 0 | 53 | | return "weekly"; |
| | | 54 | | case Granularity.Daily: |
| | 0 | 55 | | return "daily"; |
| | | 56 | | case Granularity.Hourly: |
| | 0 | 57 | | return "hourly"; |
| | | 58 | | case Granularity.Minutely: |
| | 0 | 59 | | return "minutely"; |
| | | 60 | | } |
| | 0 | 61 | | return null; |
| | | 62 | | } |
| | | 63 | | |
| | | 64 | | internal static Granularity? ParseGranularity(this string value) |
| | | 65 | | { |
| | | 66 | | switch( value ) |
| | | 67 | | { |
| | | 68 | | case "yearly": |
| | 0 | 69 | | return Granularity.Yearly; |
| | | 70 | | case "monthly": |
| | 0 | 71 | | return Granularity.Monthly; |
| | | 72 | | case "weekly": |
| | 0 | 73 | | return Granularity.Weekly; |
| | | 74 | | case "daily": |
| | 0 | 75 | | return Granularity.Daily; |
| | | 76 | | case "hourly": |
| | 0 | 77 | | return Granularity.Hourly; |
| | | 78 | | case "minutely": |
| | 0 | 79 | | return Granularity.Minutely; |
| | | 80 | | } |
| | 0 | 81 | | return null; |
| | | 82 | | } |
| | | 83 | | } |
| | | 84 | | } |