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

/**
 * The main origin of CDN content which is added when creating a CDN endpoint.
 *
 * @extends models['BaseResource']
 */
class DeepCreatedOrigin extends models['BaseResource'] {
  /**
   * Create a DeepCreatedOrigin.
   * @property {string} name Origin name
   * @property {string} hostName The address of the origin. It can be a domain
   * name, IPv4 address, or IPv6 address.
   * @property {number} [httpPort] The value of the HTTP port. Must be between
   * 1 and 65535
   * @property {number} [httpsPort] The value of the HTTPS port. Must be
   * between 1 and 65535
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of DeepCreatedOrigin
   *
   * @returns {object} metadata of DeepCreatedOrigin
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'DeepCreatedOrigin',
      type: {
        name: 'Composite',
        className: 'DeepCreatedOrigin',
        modelProperties: {
          name: {
            required: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          hostName: {
            required: true,
            serializedName: 'properties.hostName',
            type: {
              name: 'String'
            }
          },
          httpPort: {
            required: false,
            serializedName: 'properties.httpPort',
            constraints: {
              InclusiveMaximum: 65535,
              InclusiveMinimum: 1
            },
            type: {
              name: 'Number'
            }
          },
          httpsPort: {
            required: false,
            serializedName: 'properties.httpsPort',
            constraints: {
              InclusiveMaximum: 65535,
              InclusiveMinimum: 1
            },
            type: {
              name: 'Number'
            }
          }
        }
      }
    };
  }
}

module.exports = DeepCreatedOrigin;
