< Summary

Class:Microsoft.Azure.CognitiveServices.ContentModerator.Models.CreateVideoReviewsBodyItemVideoFramesItem
Assembly:Microsoft.Azure.CognitiveServices.Vision.ContentModerator
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Vision.ContentModerator\src\Generated\Models\CreateVideoReviewsBodyItemVideoFramesItem.cs
Covered lines:20
Uncovered lines:7
Coverable lines:27
Total lines:116
Line coverage:74% (20 of 27)
Covered branches:12
Total branches:16
Branch coverage:75% (12 of 16)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Id()-100%100%
get_Timestamp()-100%100%
get_FrameImage()-100%100%
get_ReviewerResultTags()-100%100%
get_Metadata()-100%100%
Validate()-61.54%75%

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Vision.ContentModerator\src\Generated\Models\CreateVideoReviewsBodyItemVideoFramesItem.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.ContentModerator.Models
 8{
 9    using Microsoft.Rest;
 10    using Newtonsoft.Json;
 11    using System.Collections;
 12    using System.Collections.Generic;
 13    using System.Linq;
 14
 15    public partial class CreateVideoReviewsBodyItemVideoFramesItem
 16    {
 17        /// <summary>
 18        /// Initializes a new instance of the
 19        /// CreateVideoReviewsBodyItemVideoFramesItem class.
 20        /// </summary>
 021        public CreateVideoReviewsBodyItemVideoFramesItem()
 22        {
 23            CustomInit();
 024        }
 25
 26        /// <summary>
 27        /// Initializes a new instance of the
 28        /// CreateVideoReviewsBodyItemVideoFramesItem class.
 29        /// </summary>
 30        /// <param name="id">Id of the frame.</param>
 31        /// <param name="timestamp">Timestamp of the frame.</param>
 32        /// <param name="frameImage">Frame image Url.</param>
 33        /// <param name="metadata">Optional metadata details.</param>
 334        public CreateVideoReviewsBodyItemVideoFramesItem(string id, int timestamp, string frameImage, IList<CreateVideoR
 35        {
 336            Id = id;
 337            Timestamp = timestamp;
 338            FrameImage = frameImage;
 339            ReviewerResultTags = reviewerResultTags;
 340            Metadata = metadata;
 41            CustomInit();
 342        }
 43
 44        /// <summary>
 45        /// An initialization method that performs custom operations like setting defaults
 46        /// </summary>
 47        partial void CustomInit();
 48
 49        /// <summary>
 50        /// Gets or sets id of the frame.
 51        /// </summary>
 52        [JsonProperty(PropertyName = "Id")]
 953        public string Id { get; set; }
 54
 55        /// <summary>
 56        /// Gets or sets timestamp of the frame.
 57        /// </summary>
 58        [JsonProperty(PropertyName = "Timestamp")]
 659        public int Timestamp { get; set; }
 60
 61        /// <summary>
 62        /// Gets or sets frame image Url.
 63        /// </summary>
 64        [JsonProperty(PropertyName = "FrameImage")]
 965        public string FrameImage { get; set; }
 66
 67        /// <summary>
 68        /// </summary>
 69        [JsonProperty(PropertyName = "ReviewerResultTags")]
 1270        public IList<CreateVideoReviewsBodyItemVideoFramesItemReviewerResultTagsItem> ReviewerResultTags { get; set; }
 71
 72        /// <summary>
 73        /// Gets or sets optional metadata details.
 74        /// </summary>
 75        [JsonProperty(PropertyName = "Metadata")]
 1276        public IList<CreateVideoReviewsBodyItemVideoFramesItemMetadataItem> Metadata { get; set; }
 77
 78        /// <summary>
 79        /// Validate the object.
 80        /// </summary>
 81        /// <exception cref="ValidationException">
 82        /// Thrown if validation fails
 83        /// </exception>
 84        public virtual void Validate()
 85        {
 386            if (Id == null)
 87            {
 088                throw new ValidationException(ValidationRules.CannotBeNull, "Id");
 89            }
 390            if (FrameImage == null)
 91            {
 092                throw new ValidationException(ValidationRules.CannotBeNull, "FrameImage");
 93            }
 394            if (ReviewerResultTags != null)
 95            {
 096                foreach (var element in ReviewerResultTags)
 97                {
 098                    if (element != null)
 99                    {
 0100                        element.Validate();
 101                    }
 102                }
 103            }
 3104            if (Metadata != null)
 105            {
 18106                foreach (var element1 in Metadata)
 107                {
 6108                    if (element1 != null)
 109                    {
 6110                        element1.Validate();
 111                    }
 112                }
 113            }
 3114        }
 115    }
 116}