| | | 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 | | |
| | | 11 | | namespace Microsoft.Azure.Search.Models |
| | | 12 | | { |
| | | 13 | | using Microsoft.Rest; |
| | | 14 | | using Newtonsoft.Json; |
| | | 15 | | using System.Collections; |
| | | 16 | | using System.Collections.Generic; |
| | | 17 | | using System.Linq; |
| | | 18 | | |
| | | 19 | | /// <summary> |
| | | 20 | | /// Input field mapping for a skill. |
| | | 21 | | /// </summary> |
| | | 22 | | public partial class InputFieldMappingEntry |
| | | 23 | | { |
| | | 24 | | /// <summary> |
| | | 25 | | /// Initializes a new instance of the InputFieldMappingEntry class. |
| | | 26 | | /// </summary> |
| | 368 | 27 | | public InputFieldMappingEntry() |
| | | 28 | | { |
| | | 29 | | CustomInit(); |
| | 368 | 30 | | } |
| | | 31 | | |
| | | 32 | | /// <summary> |
| | | 33 | | /// Initializes a new instance of the InputFieldMappingEntry class. |
| | | 34 | | /// </summary> |
| | | 35 | | /// <param name="name">The name of the input.</param> |
| | | 36 | | /// <param name="source">The source of the input.</param> |
| | | 37 | | /// <param name="sourceContext">The source context used for selecting |
| | | 38 | | /// recursive inputs.</param> |
| | | 39 | | /// <param name="inputs">The recursive inputs used when creating a |
| | | 40 | | /// complex type.</param> |
| | 0 | 41 | | public InputFieldMappingEntry(string name, string source = default(string), string sourceContext = default(strin |
| | | 42 | | { |
| | 0 | 43 | | Name = name; |
| | 0 | 44 | | Source = source; |
| | 0 | 45 | | SourceContext = sourceContext; |
| | 0 | 46 | | Inputs = inputs; |
| | | 47 | | CustomInit(); |
| | 0 | 48 | | } |
| | | 49 | | |
| | | 50 | | /// <summary> |
| | | 51 | | /// An initialization method that performs custom operations like setting defaults |
| | | 52 | | /// </summary> |
| | | 53 | | partial void CustomInit(); |
| | | 54 | | |
| | | 55 | | /// <summary> |
| | | 56 | | /// Gets or sets the name of the input. |
| | | 57 | | /// </summary> |
| | | 58 | | [JsonProperty(PropertyName = "name")] |
| | 1028 | 59 | | public string Name { get; set; } |
| | | 60 | | |
| | | 61 | | /// <summary> |
| | | 62 | | /// Gets or sets the source of the input. |
| | | 63 | | /// </summary> |
| | | 64 | | [JsonProperty(PropertyName = "source")] |
| | 844 | 65 | | public string Source { get; set; } |
| | | 66 | | |
| | | 67 | | /// <summary> |
| | | 68 | | /// Gets or sets the source context used for selecting recursive |
| | | 69 | | /// inputs. |
| | | 70 | | /// </summary> |
| | | 71 | | [JsonProperty(PropertyName = "sourceContext")] |
| | 484 | 72 | | public string SourceContext { get; set; } |
| | | 73 | | |
| | | 74 | | /// <summary> |
| | | 75 | | /// Gets or sets the recursive inputs used when creating a complex |
| | | 76 | | /// type. |
| | | 77 | | /// </summary> |
| | | 78 | | [JsonProperty(PropertyName = "inputs")] |
| | 1048 | 79 | | public IList<InputFieldMappingEntry> Inputs { get; set; } |
| | | 80 | | |
| | | 81 | | /// <summary> |
| | | 82 | | /// Validate the object. |
| | | 83 | | /// </summary> |
| | | 84 | | /// <exception cref="ValidationException"> |
| | | 85 | | /// Thrown if validation fails |
| | | 86 | | /// </exception> |
| | | 87 | | public virtual void Validate() |
| | | 88 | | { |
| | 180 | 89 | | if (Name == null) |
| | | 90 | | { |
| | 0 | 91 | | throw new ValidationException(ValidationRules.CannotBeNull, "Name"); |
| | | 92 | | } |
| | 180 | 93 | | if (Inputs != null) |
| | | 94 | | { |
| | 12 | 95 | | foreach (var element in Inputs) |
| | | 96 | | { |
| | 4 | 97 | | if (element != null) |
| | | 98 | | { |
| | 4 | 99 | | element.Validate(); |
| | | 100 | | } |
| | | 101 | | } |
| | | 102 | | } |
| | 180 | 103 | | } |
| | | 104 | | } |
| | | 105 | | } |