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

/**
 * Job custom data details.
 *
 */
class JobProperties {
  /**
   * Create a JobProperties.
   * @member {string} [activityId] The activity id.
   * @member {string} [scenarioName] The ScenarioName.
   * @member {string} [friendlyName] The DisplayName.
   * @member {string} [state] The status of the Job. It is one of these values
   * - NotStarted, InProgress, Succeeded, Failed, Cancelled, Suspended or
   * Other.
   * @member {string} [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} [tasks] The tasks.
   * @member {array} [errors] The errors.
   * @member {date} [startTime] The start time.
   * @member {date} [endTime] The end time.
   * @member {array} [allowedActions] The Allowed action the job.
   * @member {string} [targetObjectId] The affected Object Id.
   * @member {string} [targetObjectName] The name of the affected object.
   * @member {string} [targetInstanceType] The type of the affected object
   * which is of {Microsoft.Azure.SiteRecovery.V2015_11_10.AffectedObjectType}
   * class.
   * @member {object} [customDetails] The custom job details like test failover
   * job details.
   * @member {object} [customDetails.affectedObjectDetails] The affected object
   * properties like source server, source cloud, target server, target cloud
   * etc. based on the workflow object details.
   * @member {string} [customDetails.instanceType] Polymorphic Discriminator
   */
  constructor() {
  }

  /**
   * Defines the metadata of JobProperties
   *
   * @returns {object} metadata of JobProperties
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'JobProperties',
      type: {
        name: 'Composite',
        className: 'JobProperties',
        modelProperties: {
          activityId: {
            required: false,
            serializedName: 'activityId',
            type: {
              name: 'String'
            }
          },
          scenarioName: {
            required: false,
            serializedName: 'scenarioName',
            type: {
              name: 'String'
            }
          },
          friendlyName: {
            required: false,
            serializedName: 'friendlyName',
            type: {
              name: 'String'
            }
          },
          state: {
            required: false,
            serializedName: 'state',
            type: {
              name: 'String'
            }
          },
          stateDescription: {
            required: false,
            serializedName: 'stateDescription',
            type: {
              name: 'String'
            }
          },
          tasks: {
            required: false,
            serializedName: 'tasks',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ASRTaskElementType',
                  type: {
                    name: 'Composite',
                    className: 'ASRTask'
                  }
              }
            }
          },
          errors: {
            required: false,
            serializedName: 'errors',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'JobErrorDetailsElementType',
                  type: {
                    name: 'Composite',
                    className: 'JobErrorDetails'
                  }
              }
            }
          },
          startTime: {
            required: false,
            serializedName: 'startTime',
            type: {
              name: 'DateTime'
            }
          },
          endTime: {
            required: false,
            serializedName: 'endTime',
            type: {
              name: 'DateTime'
            }
          },
          allowedActions: {
            required: false,
            serializedName: 'allowedActions',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          targetObjectId: {
            required: false,
            serializedName: 'targetObjectId',
            type: {
              name: 'String'
            }
          },
          targetObjectName: {
            required: false,
            serializedName: 'targetObjectName',
            type: {
              name: 'String'
            }
          },
          targetInstanceType: {
            required: false,
            serializedName: 'targetInstanceType',
            type: {
              name: 'String'
            }
          },
          customDetails: {
            required: false,
            serializedName: 'customDetails',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: 'instanceType',
                clientName: 'instanceType'
              },
              uberParent: 'JobDetails',
              className: 'JobDetails'
            }
          }
        }
      }
    };
  }
}

module.exports = JobProperties;
