/*
 * 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 user's keyvault certificate
 * for enabling SSL.
 *
 * @extends models['CustomDomainHttpsParameters']
 */
class UserManagedHttpsParameters extends models['CustomDomainHttpsParameters'] {
  /**
   * Create a UserManagedHttpsParameters.
   * @property {object} certificateSourceParameters Defines the certificate
   * source parameters using user's keyvault certificate for enabling SSL.
   * @property {string} [certificateSourceParameters.subscriptionId]
   * Subscription Id of the user's Key Vault containing the SSL certificate
   * @property {string} [certificateSourceParameters.resourceGroupName]
   * Resource group of the user's Key Vault containing the SSL certificate
   * @property {string} [certificateSourceParameters.vaultName] The name of the
   * user's Key Vault containing the SSL certificate
   * @property {string} [certificateSourceParameters.secretName] The name of
   * Key Vault Secret (representing the full certificate PFX) in Key Vault.
   * @property {string} [certificateSourceParameters.secretVersion] The
   * version(GUID) of Key Vault Secret in Key Vault.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of UserManagedHttpsParameters
   *
   * @returns {object} metadata of UserManagedHttpsParameters
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'AzureKeyVault',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'certificateSource',
          clientName: 'certificateSource'
        },
        uberParent: 'CustomDomainHttpsParameters',
        className: 'UserManagedHttpsParameters',
        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: 'KeyVaultCertificateSourceParameters'
            }
          }
        }
      }
    };
  }
}

module.exports = UserManagedHttpsParameters;
