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

/**
 * A secret consisting of a value, id and its attributes.
 *
 */
class SecretBundle {
  /**
   * Create a SecretBundle.
   * @member {string} [value] The secret value.
   * @member {string} [id] The secret id.
   * @member {string} [contentType] The content type of the secret.
   * @member {object} [attributes] The secret management attributes.
   * @member {string} [attributes.recoveryLevel] Reflects the deletion recovery
   * level currently in effect for secrets in the current vault. If it contains
   * 'Purgeable', the secret can be permanently deleted by a privileged user;
   * otherwise, only the system can purge the secret, 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 {string} [kid] If this is a secret backing a KV certificate, then
   * this field specifies the corresponding key backing the KV certificate.
   * @member {boolean} [managed] True if the secret's lifetime is managed by
   * key vault. If this is a secret backing a certificate, then managed will be
   * true.
   */
  constructor() {
  }

  /**
   * Defines the metadata of SecretBundle
   *
   * @returns {object} metadata of SecretBundle
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'SecretBundle',
      type: {
        name: 'Composite',
        className: 'SecretBundle',
        modelProperties: {
          value: {
            required: false,
            serializedName: 'value',
            type: {
              name: 'String'
            }
          },
          id: {
            required: false,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          contentType: {
            required: false,
            serializedName: 'contentType',
            type: {
              name: 'String'
            }
          },
          attributes: {
            required: false,
            serializedName: 'attributes',
            type: {
              name: 'Composite',
              className: 'SecretAttributes'
            }
          },
          tags: {
            required: false,
            serializedName: 'tags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          kid: {
            required: false,
            readOnly: true,
            serializedName: 'kid',
            type: {
              name: 'String'
            }
          },
          managed: {
            required: false,
            readOnly: true,
            serializedName: 'managed',
            type: {
              name: 'Boolean'
            }
          }
        }
      }
    };
  }
}

module.exports = SecretBundle;
