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

/**
 * Trigger runs.
 *
 */
class TriggerRun {
  /**
   * Create a TriggerRun.
   * @member {string} [triggerRunId] Trigger run id.
   * @member {string} [triggerName] Trigger name.
   * @member {string} [triggerType] Trigger type.
   * @member {date} [triggerRunTimestamp] Trigger run start time.
   * @member {string} [status] Trigger run status. Possible values include:
   * 'Succeeded', 'Failed', 'Inprogress'
   * @member {string} [message] Trigger error message.
   * @member {object} [properties] List of property name and value related to
   * trigger run. Name, value pair depends on type of trigger.
   * @member {object} [triggeredPipelines] List of pipeline name and run Id
   * triggered by the trigger run.
   */
  constructor() {
  }

  /**
   * Defines the metadata of TriggerRun
   *
   * @returns {object} metadata of TriggerRun
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'TriggerRun',
      type: {
        name: 'Composite',
        additionalProperties: {
          type: {
            name: 'Dictionary',
            value: {
                required: false,
                serializedName: 'ObjectElementType',
                type: {
                  name: 'Object'
                }
            }
          }
        },
        className: 'TriggerRun',
        modelProperties: {
          triggerRunId: {
            required: false,
            readOnly: true,
            serializedName: 'triggerRunId',
            type: {
              name: 'String'
            }
          },
          triggerName: {
            required: false,
            readOnly: true,
            serializedName: 'triggerName',
            type: {
              name: 'String'
            }
          },
          triggerType: {
            required: false,
            readOnly: true,
            serializedName: 'triggerType',
            type: {
              name: 'String'
            }
          },
          triggerRunTimestamp: {
            required: false,
            readOnly: true,
            serializedName: 'triggerRunTimestamp',
            type: {
              name: 'DateTime'
            }
          },
          status: {
            required: false,
            readOnly: true,
            serializedName: 'status',
            type: {
              name: 'String'
            }
          },
          message: {
            required: false,
            readOnly: true,
            serializedName: 'message',
            type: {
              name: 'String'
            }
          },
          properties: {
            required: false,
            readOnly: true,
            serializedName: 'properties',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          triggeredPipelines: {
            required: false,
            readOnly: true,
            serializedName: 'triggeredPipelines',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = TriggerRun;
