< Summary

Class:Microsoft.Azure.CognitiveServices.ContentModerator.Models.TranscriptModerationBodyItem
Assembly:Microsoft.Azure.CognitiveServices.Vision.ContentModerator
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Vision.ContentModerator\src\Generated\Models\TranscriptModerationBodyItem.cs
Covered lines:0
Uncovered lines:17
Coverable lines:17
Total lines:87
Line coverage:0% (0 of 17)
Covered branches:0
Total branches:10
Branch coverage:0% (0 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Timestamp()-0%100%
get_Terms()-0%100%
Validate()-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Vision.ContentModerator\src\Generated\Models\TranscriptModerationBodyItem.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 TranscriptModerationBodyItem
 19    {
 20        /// <summary>
 21        /// Initializes a new instance of the TranscriptModerationBodyItem
 22        /// class.
 23        /// </summary>
 024        public TranscriptModerationBodyItem()
 25        {
 26            CustomInit();
 027        }
 28
 29        /// <summary>
 30        /// Initializes a new instance of the TranscriptModerationBodyItem
 31        /// class.
 32        /// </summary>
 33        /// <param name="timestamp">Timestamp of the image.</param>
 34        /// <param name="terms">Optional metadata details.</param>
 035        public TranscriptModerationBodyItem(string timestamp, IList<TranscriptModerationBodyItemTermsItem> terms)
 36        {
 037            Timestamp = timestamp;
 038            Terms = terms;
 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 timestamp of the image.
 49        /// </summary>
 50        [JsonProperty(PropertyName = "Timestamp")]
 051        public string Timestamp { get; set; }
 52
 53        /// <summary>
 54        /// Gets or sets optional metadata details.
 55        /// </summary>
 56        [JsonProperty(PropertyName = "Terms")]
 057        public IList<TranscriptModerationBodyItemTermsItem> Terms { get; set; }
 58
 59        /// <summary>
 60        /// Validate the object.
 61        /// </summary>
 62        /// <exception cref="ValidationException">
 63        /// Thrown if validation fails
 64        /// </exception>
 65        public virtual void Validate()
 66        {
 067            if (Timestamp == null)
 68            {
 069                throw new ValidationException(ValidationRules.CannotBeNull, "Timestamp");
 70            }
 071            if (Terms == null)
 72            {
 073                throw new ValidationException(ValidationRules.CannotBeNull, "Terms");
 74            }
 075            if (Terms != null)
 76            {
 077                foreach (var element in Terms)
 78                {
 079                    if (element != null)
 80                    {
 081                        element.Validate();
 82                    }
 83                }
 84            }
 085        }
 86    }
 87}