< Summary

Class:Microsoft.Azure.ApplicationInsights.Query.Models.MetricsPostBodySchema
Assembly:Microsoft.Azure.ApplicationInsights.Query
File(s):C:\Git\azure-sdk-for-net\sdk\applicationinsights\Microsoft.Azure.ApplicationInsights.Query\src\Generated\Models\MetricsPostBodySchema.cs
Covered lines:0
Uncovered lines:15
Coverable lines:15
Total lines:87
Line coverage:0% (0 of 15)
Covered branches:0
Total branches:6
Branch coverage:0% (0 of 6)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Id()-0%100%
get_Parameters()-0%100%
Validate()-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\applicationinsights\Microsoft.Azure.ApplicationInsights.Query\src\Generated\Models\MetricsPostBodySchema.cs

#LineLine coverage
 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
 11namespace 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>
 025        public MetricsPostBodySchema()
 26        {
 27            CustomInit();
 028        }
 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>
 039        public MetricsPostBodySchema(string id, MetricsPostBodySchemaParameters parameters)
 40        {
 041            Id = id;
 042            Parameters = parameters;
 43            CustomInit();
 044        }
 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")]
 057        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")]
 063        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        {
 073            if (Id == null)
 74            {
 075                throw new ValidationException(ValidationRules.CannotBeNull, "Id");
 76            }
 077            if (Parameters == null)
 78            {
 079                throw new ValidationException(ValidationRules.CannotBeNull, "Parameters");
 80            }
 081            if (Parameters != null)
 82            {
 083                Parameters.Validate();
 84            }
 085        }
 86    }
 87}