< Summary

Class:Microsoft.Azure.CognitiveServices.FormRecognizer.Models.TrainRequest
Assembly:Microsoft.Azure.CognitiveServices.Vision.FormRecognizer
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\FormRecognizer\src\Generated\Models\TrainRequest.cs
Covered lines:0
Uncovered lines:14
Coverable lines:14
Total lines:76
Line coverage:0% (0 of 14)
Covered branches:0
Total branches:8
Branch coverage:0% (0 of 8)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\FormRecognizer\src\Generated\Models\TrainRequest.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.CognitiveServices.FormRecognizer.Models
 12{
 13    using Microsoft.Rest;
 14    using Newtonsoft.Json;
 15    using System.Linq;
 16
 17    /// <summary>
 18    /// Contract to initiate a train request.
 19    /// </summary>
 20    public partial class TrainRequest
 21    {
 22        /// <summary>
 23        /// Initializes a new instance of the TrainRequest class.
 24        /// </summary>
 025        public TrainRequest()
 26        {
 27            CustomInit();
 028        }
 29
 30        /// <summary>
 31        /// Initializes a new instance of the TrainRequest class.
 32        /// </summary>
 33        /// <param name="source">Get or set source path.</param>
 034        public TrainRequest(string source)
 35        {
 036            Source = source;
 37            CustomInit();
 038        }
 39
 40        /// <summary>
 41        /// An initialization method that performs custom operations like setting defaults
 42        /// </summary>
 43        partial void CustomInit();
 44
 45        /// <summary>
 46        /// Gets or sets get or set source path.
 47        /// </summary>
 48        [JsonProperty(PropertyName = "source")]
 049        public string Source { get; set; }
 50
 51        /// <summary>
 52        /// Validate the object.
 53        /// </summary>
 54        /// <exception cref="ValidationException">
 55        /// Thrown if validation fails
 56        /// </exception>
 57        public virtual void Validate()
 58        {
 059            if (Source == null)
 60            {
 061                throw new ValidationException(ValidationRules.CannotBeNull, "Source");
 62            }
 063            if (Source != null)
 64            {
 065                if (Source.Length > 2048)
 66                {
 067                    throw new ValidationException(ValidationRules.MaxLength, "Source", 2048);
 68                }
 069                if (Source.Length < 0)
 70                {
 071                    throw new ValidationException(ValidationRules.MinLength, "Source", 0);
 72                }
 73            }
 074        }
 75    }
 76}