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

/**
 * Describes additional filters to be applied, while listing backups, and
 * backup storage details from where to fetch the backups.
 *
 */
class GetBackupByStorageQueryDescription {
  /**
   * Create a GetBackupByStorageQueryDescription.
   * @property {date} [startDateTimeFilter] Specifies the start date time in
   * ISO8601 from which to enumerate backups. If not specified, backups are
   * enumerated from the beginning.
   * @property {date} [endDateTimeFilter] Specifies the end date time in
   * ISO8601 till which to enumerate backups. If not specified, backups are
   * enumerated till the end.
   * @property {boolean} [latest] If specified as true, gets the most recent
   * backup (within the specified time range) for every partition under the
   * specified backup entity. Default value: false .
   * @property {object} storage Describes the parameters for the backup storage
   * from where to enumerate backups. This is optional and by default backups
   * are enumerated from the backup storage where this backup entity is
   * currently being backed up (as specified in backup policy). This parameter
   * is useful to be able to enumerate backups from another cluster where you
   * may intend to restore.
   * @property {string} [storage.friendlyName] Friendly name for this backup
   * storage.
   * @property {string} [storage.storageKind] Polymorphic Discriminator
   * @property {object} backupEntity Indicates the entity for which to
   * enumerate backups.
   * @property {string} [backupEntity.entityKind] Polymorphic Discriminator
   */
  constructor() {
  }

  /**
   * Defines the metadata of GetBackupByStorageQueryDescription
   *
   * @returns {object} metadata of GetBackupByStorageQueryDescription
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'GetBackupByStorageQueryDescription',
      type: {
        name: 'Composite',
        className: 'GetBackupByStorageQueryDescription',
        modelProperties: {
          startDateTimeFilter: {
            required: false,
            serializedName: 'StartDateTimeFilter',
            type: {
              name: 'DateTime'
            }
          },
          endDateTimeFilter: {
            required: false,
            serializedName: 'EndDateTimeFilter',
            type: {
              name: 'DateTime'
            }
          },
          latest: {
            required: false,
            serializedName: 'Latest',
            defaultValue: false,
            type: {
              name: 'Boolean'
            }
          },
          storage: {
            required: true,
            serializedName: 'Storage',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: 'StorageKind',
                clientName: 'storageKind'
              },
              uberParent: 'BackupStorageDescription',
              className: 'BackupStorageDescription'
            }
          },
          backupEntity: {
            required: true,
            serializedName: 'BackupEntity',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: 'EntityKind',
                clientName: 'entityKind'
              },
              uberParent: 'BackupEntity',
              className: 'BackupEntity'
            }
          }
        }
      }
    };
  }
}

module.exports = GetBackupByStorageQueryDescription;
