/*
 * 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 create parameters.
 *
 */
class KeyCreateParameters {
  /**
   * Create a KeyCreateParameters.
   * @member {string} kty The type of key to create. For valid values, see
   * JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM',
   * 'oct'
   * @member {number} [keySize] The key size in bits. For example: 2048, 3072,
   * or 4096 for RSA.
   * @member {array} [keyOps]
   * @member {object} [keyAttributes]
   * @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.
   * @member {string} [curve] Elliptic curve name. For valid values, see
   * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521',
   * 'P-256K'
   */
  constructor() {
  }

  /**
   * Defines the metadata of KeyCreateParameters
   *
   * @returns {object} metadata of KeyCreateParameters
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'KeyCreateParameters',
      type: {
        name: 'Composite',
        className: 'KeyCreateParameters',
        modelProperties: {
          kty: {
            required: true,
            serializedName: 'kty',
            constraints: {
              MinLength: 1
            },
            type: {
              name: 'String'
            }
          },
          keySize: {
            required: false,
            serializedName: 'key_size',
            type: {
              name: 'Number'
            }
          },
          keyOps: {
            required: false,
            serializedName: 'key_ops',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          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'
                  }
              }
            }
          },
          curve: {
            required: false,
            serializedName: 'crv',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = KeyCreateParameters;
