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

/**
 * The execution details of a script action.
 *
 * @extends models['RuntimeScriptAction']
 */
class RuntimeScriptActionDetail extends models['RuntimeScriptAction'] {
  /**
   * Create a RuntimeScriptActionDetail.
   * @property {number} [scriptExecutionId] The execution id of the script
   * action.
   * @property {string} [startTime] The start time of script action execution.
   * @property {string} [endTime] The end time of script action execution.
   * @property {string} [status] The current execution status of the script
   * action.
   * @property {string} [operation] The reason why the script action was
   * executed.
   * @property {array} [executionSummary] The summary of script action
   * execution result.
   * @property {string} [debugInformation] The script action execution debug
   * information.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of RuntimeScriptActionDetail
   *
   * @returns {object} metadata of RuntimeScriptActionDetail
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'RuntimeScriptActionDetail',
      type: {
        name: 'Composite',
        className: 'RuntimeScriptActionDetail',
        modelProperties: {
          name: {
            required: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          uri: {
            required: true,
            serializedName: 'uri',
            type: {
              name: 'String'
            }
          },
          parameters: {
            required: false,
            serializedName: 'parameters',
            type: {
              name: 'String'
            }
          },
          roles: {
            required: true,
            serializedName: 'roles',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          applicationName: {
            required: false,
            readOnly: true,
            serializedName: 'applicationName',
            type: {
              name: 'String'
            }
          },
          scriptExecutionId: {
            required: false,
            readOnly: true,
            serializedName: 'scriptExecutionId',
            type: {
              name: 'Number'
            }
          },
          startTime: {
            required: false,
            readOnly: true,
            serializedName: 'startTime',
            type: {
              name: 'String'
            }
          },
          endTime: {
            required: false,
            readOnly: true,
            serializedName: 'endTime',
            type: {
              name: 'String'
            }
          },
          status: {
            required: false,
            readOnly: true,
            serializedName: 'status',
            type: {
              name: 'String'
            }
          },
          operation: {
            required: false,
            readOnly: true,
            serializedName: 'operation',
            type: {
              name: 'String'
            }
          },
          executionSummary: {
            required: false,
            readOnly: true,
            serializedName: 'executionSummary',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ScriptActionExecutionSummaryElementType',
                  type: {
                    name: 'Composite',
                    className: 'ScriptActionExecutionSummary'
                  }
              }
            }
          },
          debugInformation: {
            required: false,
            readOnly: true,
            serializedName: 'debugInformation',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = RuntimeScriptActionDetail;
