/*
 * 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.
 *
 * @extends models['BaseModel']
 */
class Backup extends models['BaseModel'] {
  /**
   * Create a Backup.
   * @member {date} createdOn The time when the backup was created.
   * @member {number} sizeInBytes The backup size in bytes.
   * @member {string} [backupType] The type of the backup. Possible values
   * include: 'LocalSnapshot', 'CloudSnapshot'
   * @member {string} [backupJobCreationType] The backup job creation type.
   * Possible values include: 'Adhoc', 'BySchedule', 'BySSM'
   * @member {string} [backupPolicyId] The path ID of the backup policy.
   * @member {string} [ssmHostName] The StorSimple Snapshot Manager host name.
   * @member {array} elements The backup elements.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of Backup
   *
   * @returns {object} metadata of Backup
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Backup',
      type: {
        name: 'Composite',
        className: 'Backup',
        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' ]
            }
          },
          createdOn: {
            required: true,
            serializedName: 'properties.createdOn',
            type: {
              name: 'DateTime'
            }
          },
          sizeInBytes: {
            required: true,
            serializedName: 'properties.sizeInBytes',
            type: {
              name: 'Number'
            }
          },
          backupType: {
            required: false,
            serializedName: 'properties.backupType',
            type: {
              name: 'Enum',
              allowedValues: [ 'LocalSnapshot', 'CloudSnapshot' ]
            }
          },
          backupJobCreationType: {
            required: false,
            serializedName: 'properties.backupJobCreationType',
            type: {
              name: 'Enum',
              allowedValues: [ 'Adhoc', 'BySchedule', 'BySSM' ]
            }
          },
          backupPolicyId: {
            required: false,
            serializedName: 'properties.backupPolicyId',
            type: {
              name: 'String'
            }
          },
          ssmHostName: {
            required: false,
            serializedName: 'properties.ssmHostName',
            type: {
              name: 'String'
            }
          },
          elements: {
            required: true,
            serializedName: 'properties.elements',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'BackupElementElementType',
                  type: {
                    name: 'Composite',
                    className: 'BackupElement'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = Backup;
