< Summary

Class:Microsoft.Azure.CognitiveServices.ContentModerator.Models.CreateVideoReviewsBodyItem
Assembly:Microsoft.Azure.CognitiveServices.Vision.ContentModerator
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Vision.ContentModerator\src\Generated\Models\CreateVideoReviewsBodyItem.cs
Covered lines:24
Uncovered lines:12
Coverable lines:36
Total lines:155
Line coverage:66.6% (24 of 36)
Covered branches:15
Total branches:18
Branch coverage:83.3% (15 of 18)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-0%100%
.cctor()-100%100%
get_VideoFrames()-100%100%
get_Metadata()-100%100%
get_Content()-100%100%
get_ContentId()-100%100%
get_Status()-100%100%
get_Timescale()-100%100%
get_CallbackEndpoint()-100%100%
get_Type()-100%100%
Validate()-80%83.33%

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Vision.ContentModerator\src\Generated\Models\CreateVideoReviewsBodyItem.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    /// <summary>
 16    /// Schema items of the body.
 17    /// </summary>
 18    public partial class CreateVideoReviewsBodyItem
 19    {
 20        /// <summary>
 21        /// Initializes a new instance of the CreateVideoReviewsBodyItem class.
 22        /// </summary>
 123        public CreateVideoReviewsBodyItem()
 24        {
 25            CustomInit();
 126        }
 27
 28        /// <summary>
 29        /// Initializes a new instance of the CreateVideoReviewsBodyItem class.
 30        /// </summary>
 31        /// <param name="content">Video content url to review.</param>
 32        /// <param name="contentId">Content Identifier.</param>
 33        /// <param name="status">Status of the
 34        /// video(Complete,Unpublished,Pending). Possible values include:
 35        /// 'Complete', 'Unpublished', 'Pending'</param>
 36        /// <param name="videoFrames">Optional metadata details.</param>
 37        /// <param name="metadata">Optional metadata details.</param>
 38        /// <param name="timescale">Timescale of the video.</param>
 39        /// <param name="callbackEndpoint">Optional CallbackEndpoint.</param>
 040        public CreateVideoReviewsBodyItem(string content, string contentId, string status, IList<CreateVideoReviewsBodyI
 41        {
 042            VideoFrames = videoFrames;
 043            Metadata = metadata;
 044            Content = content;
 045            ContentId = contentId;
 046            Status = status;
 047            Timescale = timescale;
 048            CallbackEndpoint = callbackEndpoint;
 49            CustomInit();
 050        }
 51        /// <summary>
 52        /// Static constructor for CreateVideoReviewsBodyItem class.
 53        /// </summary>
 54        static CreateVideoReviewsBodyItem()
 55        {
 156            Type = "Video";
 157        }
 58
 59        /// <summary>
 60        /// An initialization method that performs custom operations like setting defaults
 61        /// </summary>
 62        partial void CustomInit();
 63
 64        /// <summary>
 65        /// Gets or sets optional metadata details.
 66        /// </summary>
 67        [JsonProperty(PropertyName = "VideoFrames")]
 468        public IList<CreateVideoReviewsBodyItemVideoFramesItem> VideoFrames { get; set; }
 69
 70        /// <summary>
 71        /// Gets or sets optional metadata details.
 72        /// </summary>
 73        [JsonProperty(PropertyName = "Metadata")]
 474        public IList<CreateVideoReviewsBodyItemMetadataItem> Metadata { get; set; }
 75
 76        /// <summary>
 77        /// Gets or sets video content url to review.
 78        /// </summary>
 79        [JsonProperty(PropertyName = "Content")]
 380        public string Content { get; set; }
 81
 82        /// <summary>
 83        /// Gets or sets content Identifier.
 84        /// </summary>
 85        [JsonProperty(PropertyName = "ContentId")]
 386        public string ContentId { get; set; }
 87
 88        /// <summary>
 89        /// Gets or sets status of the video(Complete,Unpublished,Pending).
 90        /// Possible values include: 'Complete', 'Unpublished', 'Pending'
 91        /// </summary>
 92        [JsonProperty(PropertyName = "Status")]
 393        public string Status { get; set; }
 94
 95        /// <summary>
 96        /// Gets or sets timescale of the video.
 97        /// </summary>
 98        [JsonProperty(PropertyName = "Timescale")]
 299        public int? Timescale { get; set; }
 100
 101        /// <summary>
 102        /// Gets or sets optional CallbackEndpoint.
 103        /// </summary>
 104        [JsonProperty(PropertyName = "CallbackEndpoint")]
 2105        public string CallbackEndpoint { get; set; }
 106
 107        /// <summary>
 108        /// Type of the content.
 109        /// </summary>
 110        [JsonProperty(PropertyName = "Type")]
 2111        public static string Type { get; private set; }
 112
 113        /// <summary>
 114        /// Validate the object.
 115        /// </summary>
 116        /// <exception cref="ValidationException">
 117        /// Thrown if validation fails
 118        /// </exception>
 119        public virtual void Validate()
 120        {
 1121            if (Content == null)
 122            {
 0123                throw new ValidationException(ValidationRules.CannotBeNull, "Content");
 124            }
 1125            if (ContentId == null)
 126            {
 0127                throw new ValidationException(ValidationRules.CannotBeNull, "ContentId");
 128            }
 1129            if (Status == null)
 130            {
 0131                throw new ValidationException(ValidationRules.CannotBeNull, "Status");
 132            }
 1133            if (VideoFrames != null)
 134            {
 8135                foreach (var element in VideoFrames)
 136                {
 3137                    if (element != null)
 138                    {
 3139                        element.Validate();
 140                    }
 141                }
 142            }
 1143            if (Metadata != null)
 144            {
 10145                foreach (var element1 in Metadata)
 146                {
 4147                    if (element1 != null)
 148                    {
 4149                        element1.Validate();
 150                    }
 151                }
 152            }
 1153        }
 154    }
 155}