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

/**
 * Certificate details representing the Vault credentials for AAD.
 *
 * @extends models['ResourceCertificateDetails']
 */
class ResourceCertificateAndAadDetails extends models['ResourceCertificateDetails'] {
  /**
   * Create a ResourceCertificateAndAadDetails.
   * @property {string} aadAuthority AAD tenant authority.
   * @property {string} aadTenantId AAD tenant Id.
   * @property {string} servicePrincipalClientId AAD service principal
   * clientId.
   * @property {string} servicePrincipalObjectId AAD service principal
   * ObjectId.
   * @property {string} azureManagementEndpointAudience Azure Management
   * Endpoint Audience.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of ResourceCertificateAndAadDetails
   *
   * @returns {object} metadata of ResourceCertificateAndAadDetails
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'AzureActiveDirectory',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'authType',
          clientName: 'authType'
        },
        uberParent: 'ResourceCertificateDetails',
        className: 'ResourceCertificateAndAadDetails',
        modelProperties: {
          certificate: {
            required: false,
            serializedName: 'certificate',
            type: {
              name: 'ByteArray'
            }
          },
          friendlyName: {
            required: false,
            serializedName: 'friendlyName',
            type: {
              name: 'String'
            }
          },
          issuer: {
            required: false,
            serializedName: 'issuer',
            type: {
              name: 'String'
            }
          },
          resourceId: {
            required: false,
            serializedName: 'resourceId',
            type: {
              name: 'Number'
            }
          },
          subject: {
            required: false,
            serializedName: 'subject',
            type: {
              name: 'String'
            }
          },
          thumbprint: {
            required: false,
            serializedName: 'thumbprint',
            type: {
              name: 'String'
            }
          },
          validFrom: {
            required: false,
            serializedName: 'validFrom',
            type: {
              name: 'DateTime'
            }
          },
          validTo: {
            required: false,
            serializedName: 'validTo',
            type: {
              name: 'DateTime'
            }
          },
          authType: {
            required: true,
            serializedName: 'authType',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          },
          aadAuthority: {
            required: true,
            serializedName: 'aadAuthority',
            type: {
              name: 'String'
            }
          },
          aadTenantId: {
            required: true,
            serializedName: 'aadTenantId',
            type: {
              name: 'String'
            }
          },
          servicePrincipalClientId: {
            required: true,
            serializedName: 'servicePrincipalClientId',
            type: {
              name: 'String'
            }
          },
          servicePrincipalObjectId: {
            required: true,
            serializedName: 'servicePrincipalObjectId',
            type: {
              name: 'String'
            }
          },
          azureManagementEndpointAudience: {
            required: true,
            serializedName: 'azureManagementEndpointAudience',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = ResourceCertificateAndAadDetails;
