| | 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.Linq; |
| | 16 | |
|
| | 17 | | /// <summary> |
| | 18 | | /// Tokenizer for path-like hierarchies. This tokenizer is implemented |
| | 19 | | /// using Apache Lucene. |
| | 20 | | /// <see |
| | 21 | | /// href="http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/path/PathHierarchyTokeniz |
| | 22 | | /// /> |
| | 23 | | /// </summary> |
| | 24 | | [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.PathHierarchyTokenizerV2")] |
| | 25 | | public partial class PathHierarchyTokenizerV2 : Tokenizer |
| | 26 | | { |
| | 27 | | /// <summary> |
| | 28 | | /// Initializes a new instance of the PathHierarchyTokenizerV2 class. |
| | 29 | | /// </summary> |
| 4 | 30 | | public PathHierarchyTokenizerV2() |
| | 31 | | { |
| | 32 | | CustomInit(); |
| 4 | 33 | | } |
| | 34 | |
|
| | 35 | | /// <summary> |
| | 36 | | /// Initializes a new instance of the PathHierarchyTokenizerV2 class. |
| | 37 | | /// </summary> |
| | 38 | | /// <param name="name">The name of the tokenizer. It must only contain |
| | 39 | | /// letters, digits, spaces, dashes or underscores, can only start and |
| | 40 | | /// end with alphanumeric characters, and is limited to 128 |
| | 41 | | /// characters.</param> |
| | 42 | | /// <param name="delimiter">The delimiter character to use. Default is |
| | 43 | | /// "/".</param> |
| | 44 | | /// <param name="replacement">A value that, if set, replaces the |
| | 45 | | /// delimiter character. Default is "/".</param> |
| | 46 | | /// <param name="maxTokenLength">The maximum token length. Default and |
| | 47 | | /// maximum is 300.</param> |
| | 48 | | /// <param name="reverseTokenOrder">A value indicating whether to |
| | 49 | | /// generate tokens in reverse order. Default is false.</param> |
| | 50 | | /// <param name="numberOfTokensToSkip">The number of initial tokens to |
| | 51 | | /// skip. Default is 0.</param> |
| | 52 | | public PathHierarchyTokenizerV2(string name, char? delimiter = default(char?), char? replacement = default(char? |
| 6 | 53 | | : base(name) |
| | 54 | | { |
| 6 | 55 | | Delimiter = delimiter; |
| 6 | 56 | | Replacement = replacement; |
| 6 | 57 | | MaxTokenLength = maxTokenLength; |
| 6 | 58 | | ReverseTokenOrder = reverseTokenOrder; |
| 6 | 59 | | NumberOfTokensToSkip = numberOfTokensToSkip; |
| | 60 | | CustomInit(); |
| 6 | 61 | | } |
| | 62 | |
|
| | 63 | | /// <summary> |
| | 64 | | /// An initialization method that performs custom operations like setting defaults |
| | 65 | | /// </summary> |
| | 66 | | partial void CustomInit(); |
| | 67 | |
|
| | 68 | | /// <summary> |
| | 69 | | /// Gets or sets the delimiter character to use. Default is "/". |
| | 70 | | /// </summary> |
| | 71 | | [JsonProperty(PropertyName = "delimiter")] |
| 22 | 72 | | public char? Delimiter { get; set; } |
| | 73 | |
|
| | 74 | | /// <summary> |
| | 75 | | /// Gets or sets a value that, if set, replaces the delimiter |
| | 76 | | /// character. Default is "/". |
| | 77 | | /// </summary> |
| | 78 | | [JsonProperty(PropertyName = "replacement")] |
| 22 | 79 | | public char? Replacement { get; set; } |
| | 80 | |
|
| | 81 | | /// <summary> |
| | 82 | | /// Gets or sets the maximum token length. Default and maximum is 300. |
| | 83 | | /// </summary> |
| | 84 | | [JsonProperty(PropertyName = "maxTokenLength")] |
| 26 | 85 | | public int? MaxTokenLength { get; set; } |
| | 86 | |
|
| | 87 | | /// <summary> |
| | 88 | | /// Gets or sets a value indicating whether to generate tokens in |
| | 89 | | /// reverse order. Default is false. |
| | 90 | | /// </summary> |
| | 91 | | [JsonProperty(PropertyName = "reverse")] |
| 22 | 92 | | public bool? ReverseTokenOrder { get; set; } |
| | 93 | |
|
| | 94 | | /// <summary> |
| | 95 | | /// Gets or sets the number of initial tokens to skip. Default is 0. |
| | 96 | | /// </summary> |
| | 97 | | [JsonProperty(PropertyName = "skip")] |
| 22 | 98 | | public int? NumberOfTokensToSkip { get; set; } |
| | 99 | |
|
| | 100 | | /// <summary> |
| | 101 | | /// Validate the object. |
| | 102 | | /// </summary> |
| | 103 | | /// <exception cref="ValidationException"> |
| | 104 | | /// Thrown if validation fails |
| | 105 | | /// </exception> |
| | 106 | | public override void Validate() |
| | 107 | | { |
| 4 | 108 | | base.Validate(); |
| 4 | 109 | | if (MaxTokenLength > 300) |
| | 110 | | { |
| 0 | 111 | | throw new ValidationException(ValidationRules.InclusiveMaximum, "MaxTokenLength", 300); |
| | 112 | | } |
| 4 | 113 | | } |
| | 114 | | } |
| | 115 | | } |