| | | 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.Management.Search.Models |
| | | 12 | | { |
| | | 13 | | using Microsoft.Rest; |
| | | 14 | | using Newtonsoft.Json; |
| | | 15 | | using System.Linq; |
| | | 16 | | |
| | | 17 | | /// <summary> |
| | | 18 | | /// Input of check name availability API. |
| | | 19 | | /// </summary> |
| | | 20 | | public partial class CheckNameAvailabilityInput |
| | | 21 | | { |
| | | 22 | | /// <summary> |
| | | 23 | | /// Initializes a new instance of the CheckNameAvailabilityInput class. |
| | | 24 | | /// </summary> |
| | 0 | 25 | | public CheckNameAvailabilityInput() |
| | | 26 | | { |
| | | 27 | | CustomInit(); |
| | 0 | 28 | | } |
| | | 29 | | |
| | | 30 | | /// <summary> |
| | | 31 | | /// Initializes a new instance of the CheckNameAvailabilityInput class. |
| | | 32 | | /// </summary> |
| | | 33 | | /// <param name="name">The Search service name to validate. Search |
| | | 34 | | /// service names must only contain lowercase letters, digits or |
| | | 35 | | /// dashes, cannot use dash as the first two or last one characters, |
| | | 36 | | /// cannot contain consecutive dashes, and must be between 2 and 60 |
| | | 37 | | /// characters in length.</param> |
| | 0 | 38 | | public CheckNameAvailabilityInput(string name) |
| | | 39 | | { |
| | 0 | 40 | | Name = name; |
| | | 41 | | CustomInit(); |
| | 0 | 42 | | } |
| | | 43 | | /// <summary> |
| | | 44 | | /// Static constructor for CheckNameAvailabilityInput class. |
| | | 45 | | /// </summary> |
| | | 46 | | static CheckNameAvailabilityInput() |
| | | 47 | | { |
| | 0 | 48 | | Type = "searchServices"; |
| | 0 | 49 | | } |
| | | 50 | | |
| | | 51 | | /// <summary> |
| | | 52 | | /// An initialization method that performs custom operations like setting defaults |
| | | 53 | | /// </summary> |
| | | 54 | | partial void CustomInit(); |
| | | 55 | | |
| | | 56 | | /// <summary> |
| | | 57 | | /// Gets or sets the Search service name to validate. Search service |
| | | 58 | | /// names must only contain lowercase letters, digits or dashes, cannot |
| | | 59 | | /// use dash as the first two or last one characters, cannot contain |
| | | 60 | | /// consecutive dashes, and must be between 2 and 60 characters in |
| | | 61 | | /// length. |
| | | 62 | | /// </summary> |
| | | 63 | | [JsonProperty(PropertyName = "name")] |
| | 0 | 64 | | public string Name { get; set; } |
| | | 65 | | |
| | | 66 | | /// <summary> |
| | | 67 | | /// The type of the resource whose name is to be validated. This value |
| | | 68 | | /// must always be 'searchServices'. |
| | | 69 | | /// </summary> |
| | | 70 | | [JsonProperty(PropertyName = "type")] |
| | 0 | 71 | | public static string Type { get; private set; } |
| | | 72 | | |
| | | 73 | | /// <summary> |
| | | 74 | | /// Validate the object. |
| | | 75 | | /// </summary> |
| | | 76 | | /// <exception cref="ValidationException"> |
| | | 77 | | /// Thrown if validation fails |
| | | 78 | | /// </exception> |
| | | 79 | | public virtual void Validate() |
| | | 80 | | { |
| | 0 | 81 | | if (Name == null) |
| | | 82 | | { |
| | 0 | 83 | | throw new ValidationException(ValidationRules.CannotBeNull, "Name"); |
| | | 84 | | } |
| | 0 | 85 | | } |
| | | 86 | | } |
| | | 87 | | } |