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

/**
 * Task of the Job.
 *
 */
class ASRTask {
  /**
   * Create a ASRTask.
   * @member {string} [taskId] The Id.
   * @member {string} [name] The unique Task name.
   * @member {date} [startTime] The start time.
   * @member {date} [endTime] The end time.
   * @member {array} [allowedActions] The state/actions applicable on this
   * task.
   * @member {string} [friendlyName] The name.
   * @member {string} [state] The State. It is one of these values -
   * NotStarted, InProgress, Succeeded, Failed, Cancelled, Suspended or Other.
   * @member {string} [stateDescription] The description of the task state. For
   * example - For Succeeded state, description can be Completed,
   * PartiallySucceeded, CompletedWithInformation or Skipped.
   * @member {string} [taskType] The type of task. Details in CustomDetails
   * property depend on this type.
   * @member {object} [customDetails] The custom task details based on the task
   * type.
   * @member {string} [customDetails.instanceType] Polymorphic Discriminator
   * @member {object} [groupTaskCustomDetails] The custom task details based on
   * the task type, if the task type is GroupTaskDetails or one of the types
   * derived from it.
   * @member {array} [groupTaskCustomDetails.childTasks] The child tasks.
   * @member {string} [groupTaskCustomDetails.instanceType] Polymorphic
   * Discriminator
   * @member {array} [errors] The task error details.
   */
  constructor() {
  }

  /**
   * Defines the metadata of ASRTask
   *
   * @returns {object} metadata of ASRTask
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ASRTask',
      type: {
        name: 'Composite',
        className: 'ASRTask',
        modelProperties: {
          taskId: {
            required: false,
            serializedName: 'taskId',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          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'
                  }
              }
            }
          },
          friendlyName: {
            required: false,
            serializedName: 'friendlyName',
            type: {
              name: 'String'
            }
          },
          state: {
            required: false,
            serializedName: 'state',
            type: {
              name: 'String'
            }
          },
          stateDescription: {
            required: false,
            serializedName: 'stateDescription',
            type: {
              name: 'String'
            }
          },
          taskType: {
            required: false,
            serializedName: 'taskType',
            type: {
              name: 'String'
            }
          },
          customDetails: {
            required: false,
            serializedName: 'customDetails',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: 'instanceType',
                clientName: 'instanceType'
              },
              uberParent: 'TaskTypeDetails',
              className: 'TaskTypeDetails'
            }
          },
          groupTaskCustomDetails: {
            required: false,
            serializedName: 'groupTaskCustomDetails',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: 'instanceType',
                clientName: 'instanceType'
              },
              uberParent: 'GroupTaskDetails',
              className: 'GroupTaskDetails'
            }
          },
          errors: {
            required: false,
            serializedName: 'errors',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'JobErrorDetailsElementType',
                  type: {
                    name: 'Composite',
                    className: 'JobErrorDetails'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = ASRTask;
