/*
 * 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 workflow trigger history.
 *
 * @extends models['SubResource']
 */
class WorkflowTriggerHistory extends models['SubResource'] {
  /**
   * Create a WorkflowTriggerHistory.
   * @property {date} [startTime] Gets the start time.
   * @property {date} [endTime] Gets the end time.
   * @property {string} [status] Gets the status. Possible values include:
   * 'NotSpecified', 'Paused', 'Running', 'Waiting', 'Succeeded', 'Skipped',
   * 'Suspended', 'Cancelled', 'Failed', 'Faulted', 'TimedOut', 'Aborted',
   * 'Ignored'
   * @property {string} [code] Gets the code.
   * @property {object} [error] Gets the error.
   * @property {string} [trackingId] Gets the tracking id.
   * @property {object} [correlation] The run correlation.
   * @property {string} [correlation.clientTrackingId] The client tracking id.
   * @property {object} [inputsLink] Gets the link to input parameters.
   * @property {string} [inputsLink.uri] The content link URI.
   * @property {string} [inputsLink.contentVersion] The content version.
   * @property {number} [inputsLink.contentSize] The content size.
   * @property {object} [inputsLink.contentHash] The content hash.
   * @property {string} [inputsLink.contentHash.algorithm] The algorithm of the
   * content hash.
   * @property {string} [inputsLink.contentHash.value] The value of the content
   * hash.
   * @property {object} [inputsLink.metadata] The metadata.
   * @property {object} [outputsLink] Gets the link to output parameters.
   * @property {string} [outputsLink.uri] The content link URI.
   * @property {string} [outputsLink.contentVersion] The content version.
   * @property {number} [outputsLink.contentSize] The content size.
   * @property {object} [outputsLink.contentHash] The content hash.
   * @property {string} [outputsLink.contentHash.algorithm] The algorithm of
   * the content hash.
   * @property {string} [outputsLink.contentHash.value] The value of the
   * content hash.
   * @property {object} [outputsLink.metadata] The metadata.
   * @property {boolean} [fired] Gets a value indicating whether trigger was
   * fired.
   * @property {object} [run] Gets the reference to workflow run.
   * @property {string} [run.id] The resource id.
   * @property {string} [run.name] Gets the resource name.
   * @property {string} [run.type] Gets the resource type.
   * @property {string} [name] Gets the workflow trigger history name.
   * @property {string} [type] Gets the workflow trigger history type.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of WorkflowTriggerHistory
   *
   * @returns {object} metadata of WorkflowTriggerHistory
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'WorkflowTriggerHistory',
      type: {
        name: 'Composite',
        className: 'WorkflowTriggerHistory',
        modelProperties: {
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          startTime: {
            required: false,
            readOnly: true,
            serializedName: 'properties.startTime',
            type: {
              name: 'DateTime'
            }
          },
          endTime: {
            required: false,
            readOnly: true,
            serializedName: 'properties.endTime',
            type: {
              name: 'DateTime'
            }
          },
          status: {
            required: false,
            readOnly: true,
            serializedName: 'properties.status',
            type: {
              name: 'String'
            }
          },
          code: {
            required: false,
            readOnly: true,
            serializedName: 'properties.code',
            type: {
              name: 'String'
            }
          },
          error: {
            required: false,
            readOnly: true,
            serializedName: 'properties.error',
            type: {
              name: 'Object'
            }
          },
          trackingId: {
            required: false,
            readOnly: true,
            serializedName: 'properties.trackingId',
            type: {
              name: 'String'
            }
          },
          correlation: {
            required: false,
            serializedName: 'properties.correlation',
            type: {
              name: 'Composite',
              className: 'Correlation'
            }
          },
          inputsLink: {
            required: false,
            readOnly: true,
            serializedName: 'properties.inputsLink',
            type: {
              name: 'Composite',
              className: 'ContentLink'
            }
          },
          outputsLink: {
            required: false,
            readOnly: true,
            serializedName: 'properties.outputsLink',
            type: {
              name: 'Composite',
              className: 'ContentLink'
            }
          },
          fired: {
            required: false,
            readOnly: true,
            serializedName: 'properties.fired',
            type: {
              name: 'Boolean'
            }
          },
          run: {
            required: false,
            readOnly: true,
            serializedName: 'properties.run',
            type: {
              name: 'Composite',
              className: 'ResourceReference'
            }
          },
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = WorkflowTriggerHistory;
