

'use strict';

const models = require('./index');

/**
 * A database vulnerability assessment.
 *
 * @extends models['ProxyResource']
 */
class DatabaseVulnerabilityAssessment extends models['ProxyResource'] {
  /**
   * Create a DatabaseVulnerabilityAssessment.
   * @property {string} [storageContainerPath] A blob storage container path to
   * hold the scan results (e.g.
   * https://myStorage.blob.core.windows.net/VaScans/).  It is required if
   * server level vulnerability assessment policy doesn't set
   * @property {string} [storageContainerSasKey] A shared access signature (SAS
   * Key) that has write access to the blob container specified in
   * 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't
   * specified, StorageContainerSasKey is required.
   * @property {string} [storageAccountAccessKey] Specifies the identifier key
   * of the storage account for vulnerability assessment scan results. If
   * 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is
   * required.
   * @property {object} [recurringScans] The recurring scans settings
   * @property {boolean} [recurringScans.isEnabled] Recurring scans state.
   * @property {boolean} [recurringScans.emailSubscriptionAdmins] Specifies
   * that the schedule scan notification will be is sent to the subscription
   * administrators.
   * @property {array} [recurringScans.emails] Specifies an array of e-mail
   * addresses to which the scan notification is sent.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of DatabaseVulnerabilityAssessment
   *
   * @returns {object} metadata of DatabaseVulnerabilityAssessment
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'DatabaseVulnerabilityAssessment',
      type: {
        name: 'Composite',
        className: 'DatabaseVulnerabilityAssessment',
        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'
            }
          },
          storageContainerPath: {
            required: false,
            serializedName: 'properties.storageContainerPath',
            type: {
              name: 'String'
            }
          },
          storageContainerSasKey: {
            required: false,
            serializedName: 'properties.storageContainerSasKey',
            type: {
              name: 'String'
            }
          },
          storageAccountAccessKey: {
            required: false,
            serializedName: 'properties.storageAccountAccessKey',
            type: {
              name: 'String'
            }
          },
          recurringScans: {
            required: false,
            serializedName: 'properties.recurringScans',
            type: {
              name: 'Composite',
              className: 'VulnerabilityAssessmentRecurringScansProperties'
            }
          }
        }
      }
    };
  }
}

module.exports = DatabaseVulnerabilityAssessment;
