/*
 * 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.
 * Changes may cause incorrect behavior and will be lost if the code is
 * regenerated.
 */

'use strict';

/**
 * Response of the CheckNameAvailability operation.
 *
 */
class ApiManagementServiceNameAvailabilityResult {
  /**
   * Create a ApiManagementServiceNameAvailabilityResult.
   * @property {boolean} [nameAvailable] True if the name is available and can
   * be used to create a new API Management service; otherwise false.
   * @property {string} [message] If reason == invalid, provide the user with
   * the reason why the given name is invalid, and provide the resource naming
   * requirements so that the user can select a valid name. If reason ==
   * AlreadyExists, explain that <resourceName> is already in use, and direct
   * them to select a different name.
   * @property {string} [reason] Invalid indicates the name provided does not
   * match the resource provider’s naming requirements (incorrect length,
   * unsupported characters, etc.)  AlreadyExists indicates that the name is
   * already in use and is therefore unavailable. Possible values include:
   * 'Valid', 'Invalid', 'AlreadyExists'
   */
  constructor() {
  }

  /**
   * Defines the metadata of ApiManagementServiceNameAvailabilityResult
   *
   * @returns {object} metadata of ApiManagementServiceNameAvailabilityResult
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ApiManagementServiceNameAvailabilityResult',
      type: {
        name: 'Composite',
        className: 'ApiManagementServiceNameAvailabilityResult',
        modelProperties: {
          nameAvailable: {
            required: false,
            readOnly: true,
            serializedName: 'nameAvailable',
            type: {
              name: 'Boolean'
            }
          },
          message: {
            required: false,
            readOnly: true,
            serializedName: 'message',
            type: {
              name: 'String'
            }
          },
          reason: {
            required: false,
            serializedName: 'reason',
            type: {
              name: 'Enum',
              allowedValues: [ 'Valid', 'Invalid', 'AlreadyExists' ]
            }
          }
        }
      }
    };
  }
}

module.exports = ApiManagementServiceNameAvailabilityResult;
