/*
 * 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 key import parameters.
 *
 */
class KeyImportParameters {
  /**
   * Create a KeyImportParameters.
   * @member {boolean} [hsm] Whether to import as a hardware key (HSM) or
   * software key.
   * @member {object} key The Json web key
   * @member {string} [key.kid] Key identifier.
   * @member {string} [key.kty] JsonWebKey Key Type (kty), as defined in
   * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40.
   * Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct'
   * @member {array} [key.keyOps]
   * @member {buffer} [key.n] RSA modulus.
   * @member {buffer} [key.e] RSA public exponent.
   * @member {buffer} [key.d] RSA private exponent, or the D component of an EC
   * private key.
   * @member {buffer} [key.dp] RSA private key parameter.
   * @member {buffer} [key.dq] RSA private key parameter.
   * @member {buffer} [key.qi] RSA private key parameter.
   * @member {buffer} [key.p] RSA secret prime.
   * @member {buffer} [key.q] RSA secret prime, with p < q.
   * @member {buffer} [key.k] Symmetric key.
   * @member {buffer} [key.t] HSM Token, used with 'Bring Your Own Key'.
   * @member {string} [key.crv] Elliptic curve name. For valid values, see
   * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521',
   * 'P-256K'
   * @member {buffer} [key.x] X component of an EC public key.
   * @member {buffer} [key.y] Y component of an EC public key.
   * @member {object} [keyAttributes] The key management attributes.
   * @member {string} [keyAttributes.recoveryLevel] Reflects the deletion
   * recovery level currently in effect for keys in the current vault. If it
   * contains 'Purgeable' the key can be permanently deleted by a privileged
   * user; otherwise, only the system can purge the key, 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.
   */
  constructor() {
  }

  /**
   * Defines the metadata of KeyImportParameters
   *
   * @returns {object} metadata of KeyImportParameters
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'KeyImportParameters',
      type: {
        name: 'Composite',
        className: 'KeyImportParameters',
        modelProperties: {
          hsm: {
            required: false,
            serializedName: 'Hsm',
            type: {
              name: 'Boolean'
            }
          },
          key: {
            required: true,
            serializedName: 'key',
            type: {
              name: 'Composite',
              className: 'JsonWebKey'
            }
          },
          keyAttributes: {
            required: false,
            serializedName: 'attributes',
            type: {
              name: 'Composite',
              className: 'KeyAttributes'
            }
          },
          tags: {
            required: false,
            serializedName: 'tags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = KeyImportParameters;
