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

/**
 * Information about a pipeline run.
 *
 */
class PipelineRun {
  /**
   * Create a PipelineRun.
   * @member {string} [runId] Identifier of a run.
   * @member {string} [pipelineName] The pipeline name.
   * @member {object} [parameters] The full or partial list of parameter name,
   * value pair used in the pipeline run.
   * @member {object} [invokedBy] Entity that started the pipeline run.
   * @member {string} [invokedBy.name] Name of the entity that started the
   * pipeline run.
   * @member {string} [invokedBy.id] The ID of the entity that started the run.
   * @member {string} [invokedBy.invokedByType] The type of the entity that
   * started the run.
   * @member {date} [lastUpdated] The last updated timestamp for the pipeline
   * run event in ISO8601 format.
   * @member {date} [runStart] The start time of a pipeline run in ISO8601
   * format.
   * @member {date} [runEnd] The end time of a pipeline run in ISO8601 format.
   * @member {number} [durationInMs] The duration of a pipeline run.
   * @member {string} [status] The status of a pipeline run.
   * @member {string} [message] The message from a pipeline run.
   */
  constructor() {
  }

  /**
   * Defines the metadata of PipelineRun
   *
   * @returns {object} metadata of PipelineRun
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'PipelineRun',
      type: {
        name: 'Composite',
        additionalProperties: {
          type: {
            name: 'Dictionary',
            value: {
                required: false,
                serializedName: 'ObjectElementType',
                type: {
                  name: 'Object'
                }
            }
          }
        },
        className: 'PipelineRun',
        modelProperties: {
          runId: {
            required: false,
            readOnly: true,
            serializedName: 'runId',
            type: {
              name: 'String'
            }
          },
          pipelineName: {
            required: false,
            readOnly: true,
            serializedName: 'pipelineName',
            type: {
              name: 'String'
            }
          },
          parameters: {
            required: false,
            readOnly: true,
            serializedName: 'parameters',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          invokedBy: {
            required: false,
            readOnly: true,
            serializedName: 'invokedBy',
            type: {
              name: 'Composite',
              className: 'PipelineRunInvokedBy'
            }
          },
          lastUpdated: {
            required: false,
            readOnly: true,
            serializedName: 'lastUpdated',
            type: {
              name: 'DateTime'
            }
          },
          runStart: {
            required: false,
            readOnly: true,
            serializedName: 'runStart',
            type: {
              name: 'DateTime'
            }
          },
          runEnd: {
            required: false,
            readOnly: true,
            serializedName: 'runEnd',
            type: {
              name: 'DateTime'
            }
          },
          durationInMs: {
            required: false,
            readOnly: true,
            serializedName: 'durationInMs',
            type: {
              name: 'Number'
            }
          },
          status: {
            required: false,
            readOnly: true,
            serializedName: 'status',
            type: {
              name: 'String'
            }
          },
          message: {
            required: false,
            readOnly: true,
            serializedName: 'message',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = PipelineRun;
