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

/**
 * Job Pipeline Information, showing the relationship of jobs and recurrences
 * of those jobs in a pipeline.
 *
 */
class JobPipelineInformation {
  /**
   * Create a JobPipelineInformation.
   * @member {uuid} [pipelineId] the job relationship pipeline identifier (a
   * GUID).
   * @member {string} [pipelineName] the friendly name of the job relationship
   * pipeline, which does not need to be unique.
   * @member {string} [pipelineUri] the pipeline uri, unique, links to the
   * originating service for this pipeline.
   * @member {number} [numJobsFailed] the number of jobs in this pipeline that
   * have failed.
   * @member {number} [numJobsCanceled] the number of jobs in this pipeline
   * that have been canceled.
   * @member {number} [numJobsSucceeded] the number of jobs in this pipeline
   * that have succeeded.
   * @member {number} [auHoursFailed] the number of job execution hours that
   * resulted in failed jobs.
   * @member {number} [auHoursCanceled] the number of job execution hours that
   * resulted in canceled jobs.
   * @member {number} [auHoursSucceeded] the number of job execution hours that
   * resulted in successful jobs.
   * @member {date} [lastSubmitTime] the last time a job in this pipeline was
   * submitted.
   * @member {array} [runs] the list of recurrence identifiers representing
   * each run of this pipeline.
   * @member {array} [recurrences] the list of recurrence identifiers
   * representing each run of this pipeline.
   */
  constructor() {
  }

  /**
   * Defines the metadata of JobPipelineInformation
   *
   * @returns {object} metadata of JobPipelineInformation
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'JobPipelineInformation',
      type: {
        name: 'Composite',
        className: 'JobPipelineInformation',
        modelProperties: {
          pipelineId: {
            required: false,
            readOnly: true,
            serializedName: 'pipelineId',
            type: {
              name: 'String'
            }
          },
          pipelineName: {
            required: false,
            readOnly: true,
            serializedName: 'pipelineName',
            constraints: {
              MaxLength: 260
            },
            type: {
              name: 'String'
            }
          },
          pipelineUri: {
            required: false,
            readOnly: true,
            serializedName: 'pipelineUri',
            type: {
              name: 'String'
            }
          },
          numJobsFailed: {
            required: false,
            readOnly: true,
            serializedName: 'numJobsFailed',
            type: {
              name: 'Number'
            }
          },
          numJobsCanceled: {
            required: false,
            readOnly: true,
            serializedName: 'numJobsCanceled',
            type: {
              name: 'Number'
            }
          },
          numJobsSucceeded: {
            required: false,
            readOnly: true,
            serializedName: 'numJobsSucceeded',
            type: {
              name: 'Number'
            }
          },
          auHoursFailed: {
            required: false,
            readOnly: true,
            serializedName: 'auHoursFailed',
            type: {
              name: 'Number'
            }
          },
          auHoursCanceled: {
            required: false,
            readOnly: true,
            serializedName: 'auHoursCanceled',
            type: {
              name: 'Number'
            }
          },
          auHoursSucceeded: {
            required: false,
            readOnly: true,
            serializedName: 'auHoursSucceeded',
            type: {
              name: 'Number'
            }
          },
          lastSubmitTime: {
            required: false,
            readOnly: true,
            serializedName: 'lastSubmitTime',
            type: {
              name: 'DateTime'
            }
          },
          runs: {
            required: false,
            readOnly: true,
            serializedName: 'runs',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'JobPipelineRunInformationElementType',
                  type: {
                    name: 'Composite',
                    className: 'JobPipelineRunInformation'
                  }
              }
            }
          },
          recurrences: {
            required: false,
            readOnly: true,
            serializedName: 'recurrences',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'UuidElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = JobPipelineInformation;
