< Summary

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

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\applicationinsights\Microsoft.Azure.ApplicationInsights.Query\src\Generated\Models\MetricsResultsItem.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    public partial class MetricsResultsItem
 18    {
 19        /// <summary>
 20        /// Initializes a new instance of the MetricsResultsItem class.
 21        /// </summary>
 022        public MetricsResultsItem()
 23        {
 24            CustomInit();
 025        }
 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>
 034        public MetricsResultsItem(string id, int status, MetricsResult body)
 35        {
 036            Id = id;
 037            Status = status;
 038            Body = body;
 39            CustomInit();
 040        }
 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")]
 051        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")]
 057        public int Status { get; set; }
 58
 59        /// <summary>
 60        /// Gets or sets the results of this metric query.
 61        /// </summary>
 62        [JsonProperty(PropertyName = "body")]
 063        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        {
 073            if (Id == null)
 74            {
 075                throw new ValidationException(ValidationRules.CannotBeNull, "Id");
 76            }
 077            if (Body == null)
 78            {
 079                throw new ValidationException(ValidationRules.CannotBeNull, "Body");
 80            }
 081        }
 82    }
 83}