| | 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 | | /// <summary> |
| | 18 | | /// A metric request |
| | 19 | | /// </summary> |
| | 20 | | public partial class MetricsPostBodySchema |
| | 21 | | { |
| | 22 | | /// <summary> |
| | 23 | | /// Initializes a new instance of the MetricsPostBodySchema class. |
| | 24 | | /// </summary> |
| 0 | 25 | | public MetricsPostBodySchema() |
| | 26 | | { |
| | 27 | | CustomInit(); |
| 0 | 28 | | } |
| | 29 | |
|
| | 30 | | /// <summary> |
| | 31 | | /// Initializes a new instance of the MetricsPostBodySchema class. |
| | 32 | | /// </summary> |
| | 33 | | /// <param name="id">An identifier for this query. Must be unique |
| | 34 | | /// within the post body of the request. This identifier will be the |
| | 35 | | /// 'id' property of the response object representing this |
| | 36 | | /// query.</param> |
| | 37 | | /// <param name="parameters">The parameters for a single metrics |
| | 38 | | /// query</param> |
| 0 | 39 | | public MetricsPostBodySchema(string id, MetricsPostBodySchemaParameters parameters) |
| | 40 | | { |
| 0 | 41 | | Id = id; |
| 0 | 42 | | Parameters = parameters; |
| | 43 | | CustomInit(); |
| 0 | 44 | | } |
| | 45 | |
|
| | 46 | | /// <summary> |
| | 47 | | /// An initialization method that performs custom operations like setting defaults |
| | 48 | | /// </summary> |
| | 49 | | partial void CustomInit(); |
| | 50 | |
|
| | 51 | | /// <summary> |
| | 52 | | /// Gets or sets an identifier for this query. Must be unique within |
| | 53 | | /// the post body of the request. This identifier will be the 'id' |
| | 54 | | /// property of the response object representing this query. |
| | 55 | | /// </summary> |
| | 56 | | [JsonProperty(PropertyName = "id")] |
| 0 | 57 | | public string Id { get; set; } |
| | 58 | |
|
| | 59 | | /// <summary> |
| | 60 | | /// Gets or sets the parameters for a single metrics query |
| | 61 | | /// </summary> |
| | 62 | | [JsonProperty(PropertyName = "parameters")] |
| 0 | 63 | | public MetricsPostBodySchemaParameters Parameters { 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 (Parameters == null) |
| | 78 | | { |
| 0 | 79 | | throw new ValidationException(ValidationRules.CannotBeNull, "Parameters"); |
| | 80 | | } |
| 0 | 81 | | if (Parameters != null) |
| | 82 | | { |
| 0 | 83 | | Parameters.Validate(); |
| | 84 | | } |
| 0 | 85 | | } |
| | 86 | | } |
| | 87 | | } |