// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.

namespace Microsoft.Azure.Management.Search.Fluent.Models
{
    using Microsoft.Azure;
    using Microsoft.Azure.Management;
    using Microsoft.Azure.Management.Search;
    using Microsoft.Azure.Management.Search.Fluent;
    using Microsoft.Rest;
    using Newtonsoft.Json;
    using System.Linq;

    /// <summary>
    /// Input of check name availability API.
    /// </summary>
    public partial class CheckNameAvailabilityInput
    {
        /// <summary>
        /// Initializes a new instance of the CheckNameAvailabilityInput class.
        /// </summary>
        public CheckNameAvailabilityInput()
        {
          CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the CheckNameAvailabilityInput class.
        /// </summary>
        /// <param name="name">The Search service name to validate. Search
        /// service names must only contain lowercase letters, digits or
        /// dashes, cannot use dash as the first two or last one characters,
        /// cannot contain consecutive dashes, and must be between 2 and 60
        /// characters in length.</param>
        public CheckNameAvailabilityInput(string name)
        {
            Name = name;
            CustomInit();
        }
        /// <summary>
        /// Static constructor for CheckNameAvailabilityInput class.
        /// </summary>
        static CheckNameAvailabilityInput()
        {
            Type = "searchServices";
        }

        /// <summary>
        /// An initialization method that performs custom operations like setting defaults
        /// </summary>
        partial void CustomInit();

        /// <summary>
        /// Gets or sets the Search service name to validate. Search service
        /// names must only contain lowercase letters, digits or dashes, cannot
        /// use dash as the first two or last one characters, cannot contain
        /// consecutive dashes, and must be between 2 and 60 characters in
        /// length.
        /// </summary>
        [JsonProperty(PropertyName = "name")]
        public string Name { get; set; }

        /// <summary>
        /// The type of the resource whose name is to be validated. This value
        /// must always be 'searchServices'.
        /// </summary>
        [JsonProperty(PropertyName = "type")]
        public static string Type { get; private set; }

        /// <summary>
        /// Validate the object.
        /// </summary>
        /// <exception cref="ValidationException">
        /// Thrown if validation fails
        /// </exception>
        public virtual void Validate()
        {
            if (Name == null)
            {
                throw new ValidationException(ValidationRules.CannotBeNull, "Name");
            }
        }
    }
}
