| | 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 | | /// Abstract base class for token filters. |
| | 19 | | /// <see |
| | 20 | | /// href="https://docs.microsoft.com/rest/api/searchservice/Custom-analyzers-in-Azure-Search" |
| | 21 | | /// /> |
| | 22 | | /// </summary> |
| | 23 | | public partial class TokenFilter |
| | 24 | | { |
| | 25 | | /// <summary> |
| | 26 | | /// Initializes a new instance of the TokenFilter class. |
| | 27 | | /// </summary> |
| 330 | 28 | | public TokenFilter() |
| | 29 | | { |
| | 30 | | CustomInit(); |
| 330 | 31 | | } |
| | 32 | |
|
| | 33 | | /// <summary> |
| | 34 | | /// Initializes a new instance of the TokenFilter class. |
| | 35 | | /// </summary> |
| | 36 | | /// <param name="name">The name of the token filter. It must only |
| | 37 | | /// contain letters, digits, spaces, dashes or underscores, can only |
| | 38 | | /// start and end with alphanumeric characters, and is limited to 128 |
| | 39 | | /// characters.</param> |
| 354 | 40 | | public TokenFilter(string name) |
| | 41 | | { |
| 354 | 42 | | Name = name; |
| | 43 | | CustomInit(); |
| 354 | 44 | | } |
| | 45 | |
|
| | 46 | | /// <summary> |
| | 47 | | /// An initialization method that performs custom operations like setting defaults |
| | 48 | | /// </summary> |
| | 49 | | partial void CustomInit(); |
| | 50 | |
|
| | 51 | | /// <summary> |
| | 52 | | /// Gets or sets the name of the token filter. It must only contain |
| | 53 | | /// letters, digits, spaces, dashes or underscores, can only start and |
| | 54 | | /// end with alphanumeric characters, and is limited to 128 characters. |
| | 55 | | /// </summary> |
| | 56 | | [JsonProperty(PropertyName = "name")] |
| 2004 | 57 | | public string Name { 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 | | { |
| 330 | 67 | | if (Name == null) |
| | 68 | | { |
| 0 | 69 | | throw new ValidationException(ValidationRules.CannotBeNull, "Name"); |
| | 70 | | } |
| 330 | 71 | | } |
| | 72 | | } |
| | 73 | | } |