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

/**
 * The certificate item containing certificate metadata.
 *
 */
class CertificateItem {
  /**
   * Create a CertificateItem.
   * @member {string} [id] Certificate identifier.
   * @member {object} [attributes] The certificate management attributes.
   * @member {string} [attributes.recoveryLevel] Reflects the deletion recovery
   * level currently in effect for certificates in the current vault. If it
   * contains 'Purgeable', the certificate can be permanently deleted by a
   * privileged user; otherwise, only the system can purge the certificate, at
   * the end of the retention interval. Possible values include: 'Purgeable',
   * 'Recoverable+Purgeable', 'Recoverable',
   * 'Recoverable+ProtectedSubscription'
   * @member {object} [tags] Application specific metadata in the form of
   * key-value pairs.
   * @member {buffer} [x509Thumbprint] Thumbprint of the certificate.
   */
  constructor() {
  }

  /**
   * Defines the metadata of CertificateItem
   *
   * @returns {object} metadata of CertificateItem
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'CertificateItem',
      type: {
        name: 'Composite',
        className: 'CertificateItem',
        modelProperties: {
          id: {
            required: false,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          attributes: {
            required: false,
            serializedName: 'attributes',
            type: {
              name: 'Composite',
              className: 'CertificateAttributes'
            }
          },
          tags: {
            required: false,
            serializedName: 'tags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          x509Thumbprint: {
            required: false,
            serializedName: 'x5t',
            type: {
              name: 'Base64Url'
            }
          }
        }
      }
    };
  }
}

module.exports = CertificateItem;
