/*
 * 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';

const models = require('./index');

/**
 * EventGrid Domain
 *
 * @extends models['TrackedResource']
 */
class Domain extends models['TrackedResource'] {
  /**
   * Create a Domain.
   * @property {string} [provisioningState] Provisioning state of the domain.
   * Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded',
   * 'Canceled', 'Failed'
   * @property {string} [endpoint] Endpoint for the domain.
   * @property {string} [inputSchema] This determines the format that Event
   * Grid should expect for incoming events published to the domain. Possible
   * values include: 'EventGridSchema', 'CustomEventSchema',
   * 'CloudEventV01Schema'. Default value: 'EventGridSchema' .
   * @property {object} [inputSchemaMapping] Information about the
   * InputSchemaMapping which specified the info about mapping event payload.
   * @property {string} [inputSchemaMapping.inputSchemaMappingType] Polymorphic
   * Discriminator
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of Domain
   *
   * @returns {object} metadata of Domain
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Domain',
      type: {
        name: 'Composite',
        className: 'Domain',
        modelProperties: {
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          location: {
            required: true,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          tags: {
            required: false,
            serializedName: 'tags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          provisioningState: {
            required: false,
            readOnly: true,
            serializedName: 'properties.provisioningState',
            type: {
              name: 'String'
            }
          },
          endpoint: {
            required: false,
            readOnly: true,
            serializedName: 'properties.endpoint',
            type: {
              name: 'String'
            }
          },
          inputSchema: {
            required: false,
            serializedName: 'properties.inputSchema',
            defaultValue: 'EventGridSchema',
            type: {
              name: 'String'
            }
          },
          inputSchemaMapping: {
            required: false,
            serializedName: 'properties.inputSchemaMapping',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: 'inputSchemaMappingType',
                clientName: 'inputSchemaMappingType'
              },
              uberParent: 'InputSchemaMapping',
              className: 'InputSchemaMapping'
            }
          }
        }
      }
    };
  }
}

module.exports = Domain;
