/*
 * 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 corresponding to a vault that can be used by clients to register
 * themselves with the vault.
 *
 * @extends models['BaseResource']
 */
class VaultCertificateResponse extends models['BaseResource'] {
  /**
   * Create a VaultCertificateResponse.
   * @property {string} [name] Resource name associated with the resource.
   * @property {string} [type] Resource type represents the complete path of
   * the form Namespace/ResourceType/ResourceType/...
   * @property {string} [id] Resource Id represents the complete path to the
   * resource.
   * @property {object} [properties]
   * @property {buffer} [properties.certificate] The base64 encoded certificate
   * raw data string.
   * @property {string} [properties.friendlyName] Certificate friendly name.
   * @property {string} [properties.issuer] Certificate issuer.
   * @property {number} [properties.resourceId] Resource ID of the vault.
   * @property {string} [properties.subject] Certificate Subject Name.
   * @property {string} [properties.thumbprint] Certificate thumbprint.
   * @property {date} [properties.validFrom] Certificate Validity start Date
   * time.
   * @property {date} [properties.validTo] Certificate Validity End Date time.
   * @property {string} [properties.authType] Polymorphic Discriminator
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of VaultCertificateResponse
   *
   * @returns {object} metadata of VaultCertificateResponse
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'VaultCertificateResponse',
      type: {
        name: 'Composite',
        className: 'VaultCertificateResponse',
        modelProperties: {
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          properties: {
            required: false,
            serializedName: 'properties',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: 'authType',
                clientName: 'authType'
              },
              uberParent: 'ResourceCertificateDetails',
              className: 'ResourceCertificateDetails'
            }
          }
        }
      }
    };
  }
}

module.exports = VaultCertificateResponse;
