/*
 * 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 ACS.
 *
 * @extends models['ResourceCertificateDetails']
 */
class ResourceCertificateAndAcsDetails extends models['ResourceCertificateDetails'] {
  /**
   * Create a ResourceCertificateAndAcsDetails.
   * @property {string} globalAcsNamespace ACS namespace name - tenant for our
   * service.
   * @property {string} globalAcsHostName Acs mgmt host name to connect to.
   * @property {string} globalAcsRPRealm Global ACS namespace RP realm.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of ResourceCertificateAndAcsDetails
   *
   * @returns {object} metadata of ResourceCertificateAndAcsDetails
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'AccessControlService',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'authType',
          clientName: 'authType'
        },
        uberParent: 'ResourceCertificateDetails',
        className: 'ResourceCertificateAndAcsDetails',
        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'
            }
          },
          globalAcsNamespace: {
            required: true,
            serializedName: 'globalAcsNamespace',
            type: {
              name: 'String'
            }
          },
          globalAcsHostName: {
            required: true,
            serializedName: 'globalAcsHostName',
            type: {
              name: 'String'
            }
          },
          globalAcsRPRealm: {
            required: true,
            serializedName: 'globalAcsRPRealm',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = ResourceCertificateAndAcsDetails;
