< Summary

Class:Microsoft.Azure.CognitiveServices.Search.VisualSearch.Models.NormalizedQuadrilateral
Assembly:Microsoft.Azure.CognitiveServices.Search.BingVisualSearch
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingVisualSearch\src\Generated\Models\NormalizedQuadrilateral.cs
Covered lines:2
Uncovered lines:27
Coverable lines:29
Total lines:133
Line coverage:6.8% (2 of 29)
Covered branches:0
Total branches:16
Branch coverage:0% (0 of 16)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-0%100%
get_TopLeft()-0%100%
get_TopRight()-0%100%
get_BottomRight()-0%100%
get_BottomLeft()-0%100%
Validate()-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingVisualSearch\src\Generated\Models\NormalizedQuadrilateral.cs

#LineLine coverage
 1// <auto-generated>
 2// Code generated by Microsoft (R) AutoRest Code Generator.
 3// Changes may cause incorrect behavior and will be lost if the code is
 4// regenerated.
 5// </auto-generated>
 6
 7namespace Microsoft.Azure.CognitiveServices.Search.VisualSearch.Models
 8{
 9    using Microsoft.Rest;
 10    using Newtonsoft.Json;
 11    using System.Linq;
 12
 13    /// <summary>
 14    /// Defines a region of an image. The region is a convex quadrilateral
 15    /// defined by coordinates of its top left, top right, bottom left, and
 16    /// bottom right points. The coordinates are fractional values of the
 17    /// original image's width and height in the range 0.0 through 1.0.
 18    /// </summary>
 19    public partial class NormalizedQuadrilateral : StructuredValue
 20    {
 21        /// <summary>
 22        /// Initializes a new instance of the NormalizedQuadrilateral class.
 23        /// </summary>
 5624        public NormalizedQuadrilateral()
 25        {
 26            CustomInit();
 5627        }
 28
 29        /// <summary>
 30        /// Initializes a new instance of the NormalizedQuadrilateral class.
 31        /// </summary>
 32        /// <param name="topLeft">The top left corner coordinate.</param>
 33        /// <param name="topRight">The top right corner coordinate.</param>
 34        /// <param name="bottomRight">The bottom right corner
 35        /// coordinate.</param>
 36        /// <param name="bottomLeft">The bottom left corner coordinate.</param>
 37        /// <param name="id">A String identifier.</param>
 38        /// <param name="readLink">The URL that returns this resource. To use
 39        /// the URL, append query parameters as appropriate and include the
 40        /// Ocp-Apim-Subscription-Key header.</param>
 41        /// <param name="webSearchUrl">The URL to Bing's search result for this
 42        /// item.</param>
 43        /// <param name="name">The name of the thing represented by this
 44        /// object.</param>
 45        /// <param name="url">The URL to get more information about the thing
 46        /// represented by this object.</param>
 47        /// <param name="image">An image of the item.</param>
 48        /// <param name="description">A short description of the item.</param>
 49        /// <param name="alternateName">An alias for the item.</param>
 50        /// <param name="bingId">An ID that uniquely identifies this
 51        /// item.</param>
 52        public NormalizedQuadrilateral(Point2D topLeft, Point2D topRight, Point2D bottomRight, Point2D bottomLeft, strin
 053            : base(id, readLink, webSearchUrl, name, url, image, description, alternateName, bingId)
 54        {
 055            TopLeft = topLeft;
 056            TopRight = topRight;
 057            BottomRight = bottomRight;
 058            BottomLeft = bottomLeft;
 59            CustomInit();
 060        }
 61
 62        /// <summary>
 63        /// An initialization method that performs custom operations like setting defaults
 64        /// </summary>
 65        partial void CustomInit();
 66
 67        /// <summary>
 68        /// Gets or sets the top left corner coordinate.
 69        /// </summary>
 70        [JsonProperty(PropertyName = "topLeft")]
 071        public Point2D TopLeft { get; set; }
 72
 73        /// <summary>
 74        /// Gets or sets the top right corner coordinate.
 75        /// </summary>
 76        [JsonProperty(PropertyName = "topRight")]
 077        public Point2D TopRight { get; set; }
 78
 79        /// <summary>
 80        /// Gets or sets the bottom right corner coordinate.
 81        /// </summary>
 82        [JsonProperty(PropertyName = "bottomRight")]
 083        public Point2D BottomRight { get; set; }
 84
 85        /// <summary>
 86        /// Gets or sets the bottom left corner coordinate.
 87        /// </summary>
 88        [JsonProperty(PropertyName = "bottomLeft")]
 089        public Point2D BottomLeft { get; set; }
 90
 91        /// <summary>
 92        /// Validate the object.
 93        /// </summary>
 94        /// <exception cref="ValidationException">
 95        /// Thrown if validation fails
 96        /// </exception>
 97        public virtual void Validate()
 98        {
 099            if (TopLeft == null)
 100            {
 0101                throw new ValidationException(ValidationRules.CannotBeNull, "TopLeft");
 102            }
 0103            if (TopRight == null)
 104            {
 0105                throw new ValidationException(ValidationRules.CannotBeNull, "TopRight");
 106            }
 0107            if (BottomRight == null)
 108            {
 0109                throw new ValidationException(ValidationRules.CannotBeNull, "BottomRight");
 110            }
 0111            if (BottomLeft == null)
 112            {
 0113                throw new ValidationException(ValidationRules.CannotBeNull, "BottomLeft");
 114            }
 0115            if (TopLeft != null)
 116            {
 0117                TopLeft.Validate();
 118            }
 0119            if (TopRight != null)
 120            {
 0121                TopRight.Validate();
 122            }
 0123            if (BottomRight != null)
 124            {
 0125                BottomRight.Validate();
 126            }
 0127            if (BottomLeft != null)
 128            {
 0129                BottomLeft.Validate();
 130            }
 0131        }
 132    }
 133}