| | | 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.ApplicationInsights.Query.Models |
| | | 12 | | { |
| | | 13 | | using Microsoft.Rest; |
| | | 14 | | using Newtonsoft.Json; |
| | | 15 | | using System.Linq; |
| | | 16 | | |
| | | 17 | | public partial class MetricsResultsItem |
| | | 18 | | { |
| | | 19 | | /// <summary> |
| | | 20 | | /// Initializes a new instance of the MetricsResultsItem class. |
| | | 21 | | /// </summary> |
| | 0 | 22 | | public MetricsResultsItem() |
| | | 23 | | { |
| | | 24 | | CustomInit(); |
| | 0 | 25 | | } |
| | | 26 | | |
| | | 27 | | /// <summary> |
| | | 28 | | /// Initializes a new instance of the MetricsResultsItem class. |
| | | 29 | | /// </summary> |
| | | 30 | | /// <param name="id">The specified ID for this metric.</param> |
| | | 31 | | /// <param name="status">The HTTP status code of this metric |
| | | 32 | | /// query.</param> |
| | | 33 | | /// <param name="body">The results of this metric query.</param> |
| | 0 | 34 | | public MetricsResultsItem(string id, int status, MetricsResult body) |
| | | 35 | | { |
| | 0 | 36 | | Id = id; |
| | 0 | 37 | | Status = status; |
| | 0 | 38 | | Body = body; |
| | | 39 | | CustomInit(); |
| | 0 | 40 | | } |
| | | 41 | | |
| | | 42 | | /// <summary> |
| | | 43 | | /// An initialization method that performs custom operations like setting defaults |
| | | 44 | | /// </summary> |
| | | 45 | | partial void CustomInit(); |
| | | 46 | | |
| | | 47 | | /// <summary> |
| | | 48 | | /// Gets or sets the specified ID for this metric. |
| | | 49 | | /// </summary> |
| | | 50 | | [JsonProperty(PropertyName = "id")] |
| | 0 | 51 | | public string Id { get; set; } |
| | | 52 | | |
| | | 53 | | /// <summary> |
| | | 54 | | /// Gets or sets the HTTP status code of this metric query. |
| | | 55 | | /// </summary> |
| | | 56 | | [JsonProperty(PropertyName = "status")] |
| | 0 | 57 | | public int Status { get; set; } |
| | | 58 | | |
| | | 59 | | /// <summary> |
| | | 60 | | /// Gets or sets the results of this metric query. |
| | | 61 | | /// </summary> |
| | | 62 | | [JsonProperty(PropertyName = "body")] |
| | 0 | 63 | | public MetricsResult Body { get; set; } |
| | | 64 | | |
| | | 65 | | /// <summary> |
| | | 66 | | /// Validate the object. |
| | | 67 | | /// </summary> |
| | | 68 | | /// <exception cref="ValidationException"> |
| | | 69 | | /// Thrown if validation fails |
| | | 70 | | /// </exception> |
| | | 71 | | public virtual void Validate() |
| | | 72 | | { |
| | 0 | 73 | | if (Id == null) |
| | | 74 | | { |
| | 0 | 75 | | throw new ValidationException(ValidationRules.CannotBeNull, "Id"); |
| | | 76 | | } |
| | 0 | 77 | | if (Body == null) |
| | | 78 | | { |
| | 0 | 79 | | throw new ValidationException(ValidationRules.CannotBeNull, "Body"); |
| | | 80 | | } |
| | 0 | 81 | | } |
| | | 82 | | } |
| | | 83 | | } |