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

/**
 * Job details.
 *
 * @extends models['Resource']
 */
class Job extends models['Resource'] {
  /**
   * Create a Job.
   * @member {object} [properties] The custom data.
   * @member {string} [properties.activityId] The activity id.
   * @member {string} [properties.scenarioName] The ScenarioName.
   * @member {string} [properties.friendlyName] The DisplayName.
   * @member {string} [properties.state] The status of the Job. It is one of
   * these values - NotStarted, InProgress, Succeeded, Failed, Cancelled,
   * Suspended or Other.
   * @member {string} [properties.stateDescription] The description of the
   * state of the Job. For e.g. - For Succeeded state, description can be
   * Completed, PartiallySucceeded, CompletedWithInformation or Skipped.
   * @member {array} [properties.tasks] The tasks.
   * @member {array} [properties.errors] The errors.
   * @member {date} [properties.startTime] The start time.
   * @member {date} [properties.endTime] The end time.
   * @member {array} [properties.allowedActions] The Allowed action the job.
   * @member {string} [properties.targetObjectId] The affected Object Id.
   * @member {string} [properties.targetObjectName] The name of the affected
   * object.
   * @member {string} [properties.targetInstanceType] The type of the affected
   * object which is of
   * {Microsoft.Azure.SiteRecovery.V2015_11_10.AffectedObjectType} class.
   * @member {object} [properties.customDetails] The custom job details like
   * test failover job details.
   * @member {object} [properties.customDetails.affectedObjectDetails] The
   * affected object properties like source server, source cloud, target
   * server, target cloud etc. based on the workflow object details.
   * @member {string} [properties.customDetails.instanceType] Polymorphic
   * Discriminator
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of Job
   *
   * @returns {object} metadata of Job
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Job',
      type: {
        name: 'Composite',
        className: 'Job',
        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'
            }
          },
          location: {
            required: false,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          properties: {
            required: false,
            serializedName: 'properties',
            type: {
              name: 'Composite',
              className: 'JobProperties'
            }
          }
        }
      }
    };
  }
}

module.exports = Job;
