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

/**
 * Triggered Web Job Run Information.
 *
 * @extends models['ProxyOnlyResource']
 */
class TriggeredJobRun extends models['ProxyOnlyResource'] {
  /**
   * Create a TriggeredJobRun.
   * @member {string} [webJobId] Job ID.
   * @member {string} [webJobName] Job name.
   * @member {string} [status] Job status. Possible values include: 'Success',
   * 'Failed', 'Error'
   * @member {date} [startTime] Start time.
   * @member {date} [endTime] End time.
   * @member {string} [duration] Job duration.
   * @member {string} [outputUrl] Output URL.
   * @member {string} [errorUrl] Error URL.
   * @member {string} [url] Job URL.
   * @member {string} [jobName] Job name.
   * @member {string} [trigger] Job trigger.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of TriggeredJobRun
   *
   * @returns {object} metadata of TriggeredJobRun
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'TriggeredJobRun',
      type: {
        name: 'Composite',
        className: 'TriggeredJobRun',
        modelProperties: {
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          kind: {
            required: false,
            serializedName: 'kind',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          webJobId: {
            required: false,
            serializedName: 'properties.web_job_id',
            type: {
              name: 'String'
            }
          },
          webJobName: {
            required: false,
            serializedName: 'properties.web_job_name',
            type: {
              name: 'String'
            }
          },
          status: {
            required: false,
            serializedName: 'properties.status',
            type: {
              name: 'Enum',
              allowedValues: [ 'Success', 'Failed', 'Error' ]
            }
          },
          startTime: {
            required: false,
            serializedName: 'properties.start_time',
            type: {
              name: 'DateTime'
            }
          },
          endTime: {
            required: false,
            serializedName: 'properties.end_time',
            type: {
              name: 'DateTime'
            }
          },
          duration: {
            required: false,
            serializedName: 'properties.duration',
            type: {
              name: 'String'
            }
          },
          outputUrl: {
            required: false,
            serializedName: 'properties.output_url',
            type: {
              name: 'String'
            }
          },
          errorUrl: {
            required: false,
            serializedName: 'properties.error_url',
            type: {
              name: 'String'
            }
          },
          url: {
            required: false,
            serializedName: 'properties.url',
            type: {
              name: 'String'
            }
          },
          jobName: {
            required: false,
            serializedName: 'properties.job_name',
            type: {
              name: 'String'
            }
          },
          trigger: {
            required: false,
            serializedName: 'properties.trigger',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = TriggeredJobRun;
