/*
 * 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 backup policy.
 *
 * @extends models['BaseModel']
 */
class BackupPolicy extends models['BaseModel'] {
  /**
   * Create a BackupPolicy.
   * @member {array} volumeIds The path IDs of the volumes which are part of
   * the backup policy.
   * @member {date} [nextBackupTime] The time of the next backup for the backup
   * policy.
   * @member {date} [lastBackupTime] The time of the last backup for the backup
   * policy.
   * @member {number} [schedulesCount] The count of schedules the backup policy
   * contains.
   * @member {string} [scheduledBackupStatus] Indicates whether atleast one of
   * the schedules in the backup policy is active or not. Possible values
   * include: 'Disabled', 'Enabled'
   * @member {string} [backupPolicyCreationType] The backup policy creation
   * type. Indicates whether this was created through SaaS or through
   * StorSimple Snapshot Manager. Possible values include: 'BySaaS', 'BySSM'
   * @member {string} [ssmHostName] If the backup policy was created by
   * StorSimple Snapshot Manager, then this field indicates the hostname of the
   * StorSimple Snapshot Manager.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of BackupPolicy
   *
   * @returns {object} metadata of BackupPolicy
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'BackupPolicy',
      type: {
        name: 'Composite',
        className: 'BackupPolicy',
        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'
            }
          },
          kind: {
            required: false,
            serializedName: 'kind',
            type: {
              name: 'Enum',
              allowedValues: [ 'Series8000' ]
            }
          },
          volumeIds: {
            required: true,
            serializedName: 'properties.volumeIds',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          nextBackupTime: {
            required: false,
            readOnly: true,
            serializedName: 'properties.nextBackupTime',
            type: {
              name: 'DateTime'
            }
          },
          lastBackupTime: {
            required: false,
            readOnly: true,
            serializedName: 'properties.lastBackupTime',
            type: {
              name: 'DateTime'
            }
          },
          schedulesCount: {
            required: false,
            readOnly: true,
            serializedName: 'properties.schedulesCount',
            type: {
              name: 'Number'
            }
          },
          scheduledBackupStatus: {
            required: false,
            readOnly: true,
            serializedName: 'properties.scheduledBackupStatus',
            type: {
              name: 'Enum',
              allowedValues: [ 'Disabled', 'Enabled' ]
            }
          },
          backupPolicyCreationType: {
            required: false,
            readOnly: true,
            serializedName: 'properties.backupPolicyCreationType',
            type: {
              name: 'Enum',
              allowedValues: [ 'BySaaS', 'BySSM' ]
            }
          },
          ssmHostName: {
            required: false,
            readOnly: true,
            serializedName: 'properties.ssmHostName',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = BackupPolicy;
