| | 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 Microsoft.Rest; |
| | 14 | | using Newtonsoft.Json; |
| | 15 | | using System.Collections; |
| | 16 | | using System.Collections.Generic; |
| | 17 | | using System.Linq; |
| | 18 | |
|
| | 19 | | public partial class EntireDetectResponse |
| | 20 | | { |
| | 21 | | /// <summary> |
| | 22 | | /// Initializes a new instance of the EntireDetectResponse class. |
| | 23 | | /// </summary> |
| 0 | 24 | | public EntireDetectResponse() |
| | 25 | | { |
| | 26 | | CustomInit(); |
| 0 | 27 | | } |
| | 28 | |
|
| | 29 | | /// <summary> |
| | 30 | | /// Initializes a new instance of the EntireDetectResponse class. |
| | 31 | | /// </summary> |
| | 32 | | /// <param name="period">Frequency extracted from the series, zero |
| | 33 | | /// means no recurrent pattern has been found.</param> |
| | 34 | | /// <param name="expectedValues">ExpectedValues contain expected value |
| | 35 | | /// for each input point. The index of the array is consistent with the |
| | 36 | | /// input series.</param> |
| | 37 | | /// <param name="upperMargins">UpperMargins contain upper margin of |
| | 38 | | /// each input point. UpperMargin is used to calculate upperBoundary, |
| | 39 | | /// which equals to expectedValue + (100 - marginScale)*upperMargin. |
| | 40 | | /// Anomalies in response can be filtered by upperBoundary and |
| | 41 | | /// lowerBoundary. By adjusting marginScale value, less significant |
| | 42 | | /// anomalies can be filtered in client side. The index of the array is |
| | 43 | | /// consistent with the input series.</param> |
| | 44 | | /// <param name="lowerMargins">LowerMargins contain lower margin of |
| | 45 | | /// each input point. LowerMargin is used to calculate lowerBoundary, |
| | 46 | | /// which equals to expectedValue - (100 - marginScale)*lowerMargin. |
| | 47 | | /// Points between the boundary can be marked as normal ones in client |
| | 48 | | /// side. The index of the array is consistent with the input |
| | 49 | | /// series.</param> |
| | 50 | | /// <param name="isAnomaly">IsAnomaly contains anomaly properties for |
| | 51 | | /// each input point. True means an anomaly either negative or positive |
| | 52 | | /// has been detected. The index of the array is consistent with the |
| | 53 | | /// input series.</param> |
| | 54 | | /// <param name="isNegativeAnomaly">IsNegativeAnomaly contains anomaly |
| | 55 | | /// status in negative direction for each input point. True means a |
| | 56 | | /// negative anomaly has been detected. A negative anomaly means the |
| | 57 | | /// point is detected as an anomaly and its real value is smaller than |
| | 58 | | /// the expected one. The index of the array is consistent with the |
| | 59 | | /// input series.</param> |
| | 60 | | /// <param name="isPositiveAnomaly">IsPositiveAnomaly contain anomaly |
| | 61 | | /// status in positive direction for each input point. True means a |
| | 62 | | /// positive anomaly has been detected. A positive anomaly means the |
| | 63 | | /// point is detected as an anomaly and its real value is larger than |
| | 64 | | /// the expected one. The index of the array is consistent with the |
| | 65 | | /// input series.</param> |
| 0 | 66 | | public EntireDetectResponse(int period, IList<double> expectedValues, IList<double> upperMargins, IList<double> |
| | 67 | | { |
| 0 | 68 | | Period = period; |
| 0 | 69 | | ExpectedValues = expectedValues; |
| 0 | 70 | | UpperMargins = upperMargins; |
| 0 | 71 | | LowerMargins = lowerMargins; |
| 0 | 72 | | IsAnomaly = isAnomaly; |
| 0 | 73 | | IsNegativeAnomaly = isNegativeAnomaly; |
| 0 | 74 | | IsPositiveAnomaly = isPositiveAnomaly; |
| | 75 | | CustomInit(); |
| 0 | 76 | | } |
| | 77 | |
|
| | 78 | | /// <summary> |
| | 79 | | /// An initialization method that performs custom operations like setting defaults |
| | 80 | | /// </summary> |
| | 81 | | partial void CustomInit(); |
| | 82 | |
|
| | 83 | | /// <summary> |
| | 84 | | /// Gets or sets frequency extracted from the series, zero means no |
| | 85 | | /// recurrent pattern has been found. |
| | 86 | | /// </summary> |
| | 87 | | [JsonProperty(PropertyName = "period")] |
| 0 | 88 | | public int Period { get; set; } |
| | 89 | |
|
| | 90 | | /// <summary> |
| | 91 | | /// Gets or sets expectedValues contain expected value for each input |
| | 92 | | /// point. The index of the array is consistent with the input series. |
| | 93 | | /// </summary> |
| | 94 | | [JsonProperty(PropertyName = "expectedValues")] |
| 0 | 95 | | public IList<double> ExpectedValues { get; set; } |
| | 96 | |
|
| | 97 | | /// <summary> |
| | 98 | | /// Gets or sets upperMargins contain upper margin of each input point. |
| | 99 | | /// UpperMargin is used to calculate upperBoundary, which equals to |
| | 100 | | /// expectedValue + (100 - marginScale)*upperMargin. Anomalies in |
| | 101 | | /// response can be filtered by upperBoundary and lowerBoundary. By |
| | 102 | | /// adjusting marginScale value, less significant anomalies can be |
| | 103 | | /// filtered in client side. The index of the array is consistent with |
| | 104 | | /// the input series. |
| | 105 | | /// </summary> |
| | 106 | | [JsonProperty(PropertyName = "upperMargins")] |
| 0 | 107 | | public IList<double> UpperMargins { get; set; } |
| | 108 | |
|
| | 109 | | /// <summary> |
| | 110 | | /// Gets or sets lowerMargins contain lower margin of each input point. |
| | 111 | | /// LowerMargin is used to calculate lowerBoundary, which equals to |
| | 112 | | /// expectedValue - (100 - marginScale)*lowerMargin. Points between the |
| | 113 | | /// boundary can be marked as normal ones in client side. The index of |
| | 114 | | /// the array is consistent with the input series. |
| | 115 | | /// </summary> |
| | 116 | | [JsonProperty(PropertyName = "lowerMargins")] |
| 0 | 117 | | public IList<double> LowerMargins { get; set; } |
| | 118 | |
|
| | 119 | | /// <summary> |
| | 120 | | /// Gets or sets isAnomaly contains anomaly properties for each input |
| | 121 | | /// point. True means an anomaly either negative or positive has been |
| | 122 | | /// detected. The index of the array is consistent with the input |
| | 123 | | /// series. |
| | 124 | | /// </summary> |
| | 125 | | [JsonProperty(PropertyName = "isAnomaly")] |
| 0 | 126 | | public IList<bool> IsAnomaly { get; set; } |
| | 127 | |
|
| | 128 | | /// <summary> |
| | 129 | | /// Gets or sets isNegativeAnomaly contains anomaly status in negative |
| | 130 | | /// direction for each input point. True means a negative anomaly has |
| | 131 | | /// been detected. A negative anomaly means the point is detected as an |
| | 132 | | /// anomaly and its real value is smaller than the expected one. The |
| | 133 | | /// index of the array is consistent with the input series. |
| | 134 | | /// </summary> |
| | 135 | | [JsonProperty(PropertyName = "isNegativeAnomaly")] |
| 0 | 136 | | public IList<bool> IsNegativeAnomaly { get; set; } |
| | 137 | |
|
| | 138 | | /// <summary> |
| | 139 | | /// Gets or sets isPositiveAnomaly contain anomaly status in positive |
| | 140 | | /// direction for each input point. True means a positive anomaly has |
| | 141 | | /// been detected. A positive anomaly means the point is detected as an |
| | 142 | | /// anomaly and its real value is larger than the expected one. The |
| | 143 | | /// index of the array is consistent with the input series. |
| | 144 | | /// </summary> |
| | 145 | | [JsonProperty(PropertyName = "isPositiveAnomaly")] |
| 0 | 146 | | public IList<bool> IsPositiveAnomaly { get; set; } |
| | 147 | |
|
| | 148 | | /// <summary> |
| | 149 | | /// Validate the object. |
| | 150 | | /// </summary> |
| | 151 | | /// <exception cref="ValidationException"> |
| | 152 | | /// Thrown if validation fails |
| | 153 | | /// </exception> |
| | 154 | | public virtual void Validate() |
| | 155 | | { |
| 0 | 156 | | if (ExpectedValues == null) |
| | 157 | | { |
| 0 | 158 | | throw new ValidationException(ValidationRules.CannotBeNull, "ExpectedValues"); |
| | 159 | | } |
| 0 | 160 | | if (UpperMargins == null) |
| | 161 | | { |
| 0 | 162 | | throw new ValidationException(ValidationRules.CannotBeNull, "UpperMargins"); |
| | 163 | | } |
| 0 | 164 | | if (LowerMargins == null) |
| | 165 | | { |
| 0 | 166 | | throw new ValidationException(ValidationRules.CannotBeNull, "LowerMargins"); |
| | 167 | | } |
| 0 | 168 | | if (IsAnomaly == null) |
| | 169 | | { |
| 0 | 170 | | throw new ValidationException(ValidationRules.CannotBeNull, "IsAnomaly"); |
| | 171 | | } |
| 0 | 172 | | if (IsNegativeAnomaly == null) |
| | 173 | | { |
| 0 | 174 | | throw new ValidationException(ValidationRules.CannotBeNull, "IsNegativeAnomaly"); |
| | 175 | | } |
| 0 | 176 | | if (IsPositiveAnomaly == null) |
| | 177 | | { |
| 0 | 178 | | throw new ValidationException(ValidationRules.CannotBeNull, "IsPositiveAnomaly"); |
| | 179 | | } |
| 0 | 180 | | } |
| | 181 | | } |
| | 182 | | } |