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

/**
 * Contains information about a certificate.
 *
 * @extends models['ProxyResource']
 */
class CertificateCreateOrUpdateParameters extends models['ProxyResource'] {
  /**
   * Create a CertificateCreateOrUpdateParameters.
   * @property {string} [thumbprintAlgorithm] The algorithm of the certificate
   * thumbprint. This must match the first portion of the certificate name.
   * Currently required to be 'SHA1'.
   * @property {string} [thumbprint] The thumbprint of the certificate. This
   * must match the thumbprint from the name.
   * @property {string} [format] The format of the certificate - either Pfx or
   * Cer. If omitted, the default is Pfx. Possible values include: 'Pfx', 'Cer'
   * @property {string} data The base64-encoded contents of the certificate.
   * The maximum size is 10KB.
   * @property {string} [password] The password to access the certificate's
   * private key. This must not be specified if the certificate format is Cer.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of CertificateCreateOrUpdateParameters
   *
   * @returns {object} metadata of CertificateCreateOrUpdateParameters
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'CertificateCreateOrUpdateParameters',
      type: {
        name: 'Composite',
        className: 'CertificateCreateOrUpdateParameters',
        modelProperties: {
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          etag: {
            required: false,
            readOnly: true,
            serializedName: 'etag',
            type: {
              name: 'String'
            }
          },
          thumbprintAlgorithm: {
            required: false,
            serializedName: 'properties.thumbprintAlgorithm',
            type: {
              name: 'String'
            }
          },
          thumbprint: {
            required: false,
            serializedName: 'properties.thumbprint',
            type: {
              name: 'String'
            }
          },
          format: {
            required: false,
            nullable: false,
            serializedName: 'properties.format',
            type: {
              name: 'Enum',
              allowedValues: [ 'Pfx', 'Cer' ]
            }
          },
          data: {
            required: true,
            serializedName: 'properties.data',
            type: {
              name: 'String'
            }
          },
          password: {
            required: false,
            serializedName: 'properties.password',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = CertificateCreateOrUpdateParameters;
