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

/**
 * Defines workload agnostic properties for a job.
 *
 */
class Job {
  /**
   * Create a Job.
   * @member {string} [entityFriendlyName] Friendly name of the entity on which
   * the current job is executing.
   * @member {string} [backupManagementType] Backup management type to execute
   * the current job. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB',
   * 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload',
   * 'DefaultBackup'
   * @member {string} [operation] The operation name.
   * @member {string} [status] Job status.
   * @member {date} [startTime] The start time.
   * @member {date} [endTime] The end time.
   * @member {string} [activityId] ActivityId of job.
   * @member {string} jobType Polymorphic Discriminator
   */
  constructor() {
  }

  /**
   * Defines the metadata of Job
   *
   * @returns {object} metadata of Job
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Job',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'jobType',
          clientName: 'jobType'
        },
        uberParent: 'Job',
        className: 'Job',
        modelProperties: {
          entityFriendlyName: {
            required: false,
            serializedName: 'entityFriendlyName',
            type: {
              name: 'String'
            }
          },
          backupManagementType: {
            required: false,
            serializedName: 'backupManagementType',
            type: {
              name: 'String'
            }
          },
          operation: {
            required: false,
            serializedName: 'operation',
            type: {
              name: 'String'
            }
          },
          status: {
            required: false,
            serializedName: 'status',
            type: {
              name: 'String'
            }
          },
          startTime: {
            required: false,
            serializedName: 'startTime',
            type: {
              name: 'DateTime'
            }
          },
          endTime: {
            required: false,
            serializedName: 'endTime',
            type: {
              name: 'DateTime'
            }
          },
          activityId: {
            required: false,
            serializedName: 'activityId',
            type: {
              name: 'String'
            }
          },
          jobType: {
            required: true,
            serializedName: 'jobType',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = Job;
