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

/**
 * Defines the certificate source parameters using CDN managed certificate for
 * enabling SSL.
 *
 * @extends models['CustomDomainHttpsParameters']
 */
class CdnManagedHttpsParameters extends models['CustomDomainHttpsParameters'] {
  /**
   * Create a CdnManagedHttpsParameters.
   * @property {object} certificateSourceParameters Defines the certificate
   * source parameters using CDN managed certificate for enabling SSL.
   * @property {string} [certificateSourceParameters.certificateType] Type of
   * certificate used. Possible values include: 'Shared', 'Dedicated'
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of CdnManagedHttpsParameters
   *
   * @returns {object} metadata of CdnManagedHttpsParameters
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Cdn',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'certificateSource',
          clientName: 'certificateSource'
        },
        uberParent: 'CustomDomainHttpsParameters',
        className: 'CdnManagedHttpsParameters',
        modelProperties: {
          protocolType: {
            required: true,
            serializedName: 'protocolType',
            type: {
              name: 'String'
            }
          },
          certificateSource: {
            required: true,
            serializedName: 'certificateSource',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          },
          certificateSourceParameters: {
            required: true,
            serializedName: 'certificateSourceParameters',
            defaultValue: {},
            type: {
              name: 'Composite',
              className: 'CdnCertificateSourceParameters'
            }
          }
        }
      }
    };
  }
}

module.exports = CdnManagedHttpsParameters;
