< Summary

Class:Azure.Search.Documents.Indexes.Models.ImageAnalysisSkill
Assembly:Azure.Search.Documents
File(s):C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\ImageAnalysisSkill.cs
C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\ImageAnalysisSkill.Serialization.cs
C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Indexes\Models\ImageAnalysisSkill.cs
Covered lines:0
Uncovered lines:106
Coverable lines:106
Total lines:235
Line coverage:0% (0 of 106)
Covered branches:0
Total branches:54
Branch coverage:0% (0 of 54)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
get_DefaultLanguageCode()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeImageAnalysisSkill(...)-0%0%
get_VisualFeatures()-0%100%
get_Details()-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\ImageAnalysisSkill.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System;
 9using System.Collections.Generic;
 10using Azure.Core;
 11
 12namespace Azure.Search.Documents.Indexes.Models
 13{
 14    /// <summary> A skill that analyzes image files. It extracts a rich set of visual features based on the image conten
 15    public partial class ImageAnalysisSkill : SearchIndexerSkill
 16    {
 17        /// <summary> Initializes a new instance of ImageAnalysisSkill. </summary>
 18        /// <param name="inputs"> Inputs of the skills could be a column in the source data set, or the output of an ups
 19        /// <param name="outputs"> The output of a skill is either a field in a search index, or a value that can be con
 20        /// <exception cref="ArgumentNullException"> <paramref name="inputs"/> or <paramref name="outputs"/> is null. </
 021        public ImageAnalysisSkill(IEnumerable<InputFieldMappingEntry> inputs, IEnumerable<OutputFieldMappingEntry> outpu
 22        {
 023            if (inputs == null)
 24            {
 025                throw new ArgumentNullException(nameof(inputs));
 26            }
 027            if (outputs == null)
 28            {
 029                throw new ArgumentNullException(nameof(outputs));
 30            }
 31
 032            VisualFeatures = new ChangeTrackingList<VisualFeature>();
 033            Details = new ChangeTrackingList<ImageDetail>();
 034            ODataType = "#Microsoft.Skills.Vision.ImageAnalysisSkill";
 035        }
 36
 37        /// <summary> Initializes a new instance of ImageAnalysisSkill. </summary>
 38        /// <param name="oDataType"> Identifies the concrete type of the skill. </param>
 39        /// <param name="name"> The name of the skill which uniquely identifies it within the skillset. A skill with no 
 40        /// <param name="description"> The description of the skill which describes the inputs, outputs, and usage of th
 41        /// <param name="context"> Represents the level at which operations take place, such as the document root or doc
 42        /// <param name="inputs"> Inputs of the skills could be a column in the source data set, or the output of an ups
 43        /// <param name="outputs"> The output of a skill is either a field in a search index, or a value that can be con
 44        /// <param name="defaultLanguageCode"> A value indicating which language code to use. Default is en. </param>
 45        /// <param name="visualFeatures"> A list of visual features. </param>
 46        /// <param name="details"> A string indicating which domain-specific details to return. </param>
 047        internal ImageAnalysisSkill(string oDataType, string name, string description, string context, IList<InputFieldM
 48        {
 049            DefaultLanguageCode = defaultLanguageCode;
 050            VisualFeatures = visualFeatures;
 051            Details = details;
 052            ODataType = oDataType ?? "#Microsoft.Skills.Vision.ImageAnalysisSkill";
 053        }
 54
 55        /// <summary> A value indicating which language code to use. Default is en. </summary>
 056        public ImageAnalysisSkillLanguage? DefaultLanguageCode { get; set; }
 57    }
 58}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\ImageAnalysisSkill.Serialization.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System.Collections.Generic;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.Search.Documents.Indexes.Models
 13{
 14    public partial class ImageAnalysisSkill : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Optional.IsDefined(DefaultLanguageCode))
 20            {
 021                writer.WritePropertyName("defaultLanguageCode");
 022                writer.WriteStringValue(DefaultLanguageCode.Value.ToString());
 23            }
 024            if (Optional.IsCollectionDefined(VisualFeatures))
 25            {
 026                writer.WritePropertyName("visualFeatures");
 027                writer.WriteStartArray();
 028                foreach (var item in VisualFeatures)
 29                {
 030                    writer.WriteStringValue(item.ToString());
 31                }
 032                writer.WriteEndArray();
 33            }
 034            if (Optional.IsCollectionDefined(Details))
 35            {
 036                writer.WritePropertyName("details");
 037                writer.WriteStartArray();
 038                foreach (var item in Details)
 39                {
 040                    writer.WriteStringValue(item.ToString());
 41                }
 042                writer.WriteEndArray();
 43            }
 044            writer.WritePropertyName("@odata.type");
 045            writer.WriteStringValue(ODataType);
 046            if (Optional.IsDefined(Name))
 47            {
 048                writer.WritePropertyName("name");
 049                writer.WriteStringValue(Name);
 50            }
 051            if (Optional.IsDefined(Description))
 52            {
 053                writer.WritePropertyName("description");
 054                writer.WriteStringValue(Description);
 55            }
 056            if (Optional.IsDefined(Context))
 57            {
 058                writer.WritePropertyName("context");
 059                writer.WriteStringValue(Context);
 60            }
 061            writer.WritePropertyName("inputs");
 062            writer.WriteStartArray();
 063            foreach (var item in Inputs)
 64            {
 065                writer.WriteObjectValue(item);
 66            }
 067            writer.WriteEndArray();
 068            writer.WritePropertyName("outputs");
 069            writer.WriteStartArray();
 070            foreach (var item in Outputs)
 71            {
 072                writer.WriteObjectValue(item);
 73            }
 074            writer.WriteEndArray();
 075            writer.WriteEndObject();
 076        }
 77
 78        internal static ImageAnalysisSkill DeserializeImageAnalysisSkill(JsonElement element)
 79        {
 080            Optional<ImageAnalysisSkillLanguage> defaultLanguageCode = default;
 081            Optional<IList<VisualFeature>> visualFeatures = default;
 082            Optional<IList<ImageDetail>> details = default;
 083            string odataType = default;
 084            Optional<string> name = default;
 085            Optional<string> description = default;
 086            Optional<string> context = default;
 087            IList<InputFieldMappingEntry> inputs = default;
 088            IList<OutputFieldMappingEntry> outputs = default;
 089            foreach (var property in element.EnumerateObject())
 90            {
 091                if (property.NameEquals("defaultLanguageCode"))
 92                {
 093                    defaultLanguageCode = new ImageAnalysisSkillLanguage(property.Value.GetString());
 094                    continue;
 95                }
 096                if (property.NameEquals("visualFeatures"))
 97                {
 098                    List<VisualFeature> array = new List<VisualFeature>();
 099                    foreach (var item in property.Value.EnumerateArray())
 100                    {
 0101                        array.Add(new VisualFeature(item.GetString()));
 102                    }
 0103                    visualFeatures = array;
 0104                    continue;
 105                }
 0106                if (property.NameEquals("details"))
 107                {
 0108                    List<ImageDetail> array = new List<ImageDetail>();
 0109                    foreach (var item in property.Value.EnumerateArray())
 110                    {
 0111                        array.Add(new ImageDetail(item.GetString()));
 112                    }
 0113                    details = array;
 0114                    continue;
 115                }
 0116                if (property.NameEquals("@odata.type"))
 117                {
 0118                    odataType = property.Value.GetString();
 0119                    continue;
 120                }
 0121                if (property.NameEquals("name"))
 122                {
 0123                    name = property.Value.GetString();
 0124                    continue;
 125                }
 0126                if (property.NameEquals("description"))
 127                {
 0128                    description = property.Value.GetString();
 0129                    continue;
 130                }
 0131                if (property.NameEquals("context"))
 132                {
 0133                    context = property.Value.GetString();
 0134                    continue;
 135                }
 0136                if (property.NameEquals("inputs"))
 137                {
 0138                    List<InputFieldMappingEntry> array = new List<InputFieldMappingEntry>();
 0139                    foreach (var item in property.Value.EnumerateArray())
 140                    {
 0141                        array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item));
 142                    }
 0143                    inputs = array;
 0144                    continue;
 145                }
 0146                if (property.NameEquals("outputs"))
 147                {
 0148                    List<OutputFieldMappingEntry> array = new List<OutputFieldMappingEntry>();
 0149                    foreach (var item in property.Value.EnumerateArray())
 150                    {
 0151                        array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item));
 152                    }
 0153                    outputs = array;
 154                    continue;
 155                }
 156            }
 0157            return new ImageAnalysisSkill(odataType, name.Value, description.Value, context.Value, inputs, outputs, Opti
 158        }
 159    }
 160}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Indexes\Models\ImageAnalysisSkill.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System.Collections.Generic;
 5using Azure.Core;
 6
 7namespace Azure.Search.Documents.Indexes.Models
 8{
 9    public partial class ImageAnalysisSkill
 10    {
 11        /// <summary> A list of visual features. </summary>
 012        public IList<VisualFeature> VisualFeatures { get; }
 13
 14        /// <summary> A string indicating which domain-specific details to return. </summary>
 015        public IList<ImageDetail> Details { get; }
 16    }
 17}