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

var models = require('./index');

/**
 * @class
 * Initializes a new instance of the Certificate class.
 * @constructor
 * A certificate that can be installed on compute nodes and can be used to
 * authenticate operations on the machine.
 * @member {string} [thumbprint] The X.509 thumbprint of the certificate. This
 * is a sequence of up to 40 hex digits (it may include spaces but these are
 * removed).
 * 
 * @member {string} [thumbprintAlgorithm] The algorithm used to derive the
 * thumbprint. This must be sha1.
 * 
 * @member {string} [url] The URL of the certificate.
 * 
 * @member {string} [state] The current state of the certificate. Possible
 * values include: 'active', 'deleting', 'deletefailed'
 * 
 * @member {date} [stateTransitionTime] The time at which the certificate
 * entered its current state.
 * 
 * @member {string} [previousState] The previous state of the certificate.
 * This property is not set if the certificate is in its initial Active
 * state. Possible values include: 'active', 'deleting', 'deletefailed'
 * 
 * @member {date} [previousStateTransitionTime] The time at which the
 * certificate entered its previous state. This property is not set if the
 * certificate is in its initial Active state.
 * 
 * @member {string} [publicData] The public part of the certificate as a
 * base-64 encoded .cer file.
 * 
 * @member {object} [deleteCertificateError] The error that occurred on the
 * last attempt to delete this certificate. This property is set only if the
 * certificate is in the deletefailed state.
 * 
 * @member {string} [deleteCertificateError.code] An identifier for the
 * certificate deletion error. Codes are invariant and are intended to be
 * consumed programmatically.
 * 
 * @member {string} [deleteCertificateError.message] A message describing the
 * certificate deletion error, intended to be suitable for display in a user
 * interface.
 * 
 * @member {array} [deleteCertificateError.values] A list of additional error
 * details related to the certificate deletion error.
 * 
 */
function Certificate() {
}

/**
 * Defines the metadata of Certificate
 *
 * @returns {object} metadata of Certificate
 *
 */
Certificate.prototype.mapper = function () {
  return {
    required: false,
    serializedName: 'Certificate',
    type: {
      name: 'Composite',
      className: 'Certificate',
      modelProperties: {
        thumbprint: {
          required: false,
          serializedName: 'thumbprint',
          type: {
            name: 'String'
          }
        },
        thumbprintAlgorithm: {
          required: false,
          serializedName: 'thumbprintAlgorithm',
          type: {
            name: 'String'
          }
        },
        url: {
          required: false,
          serializedName: 'url',
          type: {
            name: 'String'
          }
        },
        state: {
          required: false,
          serializedName: 'state',
          type: {
            name: 'Enum',
            allowedValues: [ 'active', 'deleting', 'deletefailed' ]
          }
        },
        stateTransitionTime: {
          required: false,
          serializedName: 'stateTransitionTime',
          type: {
            name: 'DateTime'
          }
        },
        previousState: {
          required: false,
          serializedName: 'previousState',
          type: {
            name: 'Enum',
            allowedValues: [ 'active', 'deleting', 'deletefailed' ]
          }
        },
        previousStateTransitionTime: {
          required: false,
          serializedName: 'previousStateTransitionTime',
          type: {
            name: 'DateTime'
          }
        },
        publicData: {
          required: false,
          serializedName: 'publicData',
          type: {
            name: 'String'
          }
        },
        deleteCertificateError: {
          required: false,
          serializedName: 'deleteCertificateError',
          type: {
            name: 'Composite',
            className: 'DeleteCertificateError'
          }
        }
      }
    }
  };
};

module.exports = Certificate;
