/*
 * 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 Information.
 *
 * @extends models['ProxyOnlyResource']
 */
class TriggeredWebJob extends models['ProxyOnlyResource'] {
  /**
   * Create a TriggeredWebJob.
   * @member {object} [latestRun] Latest job run information.
   * @member {string} [latestRun.triggeredJobRunId] Job ID.
   * @member {string} [latestRun.triggeredJobRunName] Job name.
   * @member {string} [latestRun.status] Job status. Possible values include:
   * 'Success', 'Failed', 'Error'
   * @member {date} [latestRun.startTime] Start time.
   * @member {date} [latestRun.endTime] End time.
   * @member {string} [latestRun.duration] Job duration.
   * @member {string} [latestRun.outputUrl] Output URL.
   * @member {string} [latestRun.errorUrl] Error URL.
   * @member {string} [latestRun.url] Job URL.
   * @member {string} [latestRun.jobName] Job name.
   * @member {string} [latestRun.trigger] Job trigger.
   * @member {string} [historyUrl] History URL.
   * @member {string} [schedulerLogsUrl] Scheduler Logs URL.
   * @member {string} [triggeredWebJobName] Job name. Used as job identifier in
   * ARM resource URI.
   * @member {string} [runCommand] Run command.
   * @member {string} [url] Job URL.
   * @member {string} [extraInfoUrl] Extra Info URL.
   * @member {string} [jobType] Job type. Possible values include:
   * 'Continuous', 'Triggered'
   * @member {string} [error] Error information.
   * @member {boolean} [usingSdk] Using SDK?
   * @member {object} [settings] Job settings.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of TriggeredWebJob
   *
   * @returns {object} metadata of TriggeredWebJob
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'TriggeredWebJob',
      type: {
        name: 'Composite',
        className: 'TriggeredWebJob',
        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'
            }
          },
          latestRun: {
            required: false,
            serializedName: 'properties.latestRun',
            type: {
              name: 'Composite',
              className: 'TriggeredJobRun'
            }
          },
          historyUrl: {
            required: false,
            serializedName: 'properties.historyUrl',
            type: {
              name: 'String'
            }
          },
          schedulerLogsUrl: {
            required: false,
            serializedName: 'properties.schedulerLogsUrl',
            type: {
              name: 'String'
            }
          },
          triggeredWebJobName: {
            required: false,
            readOnly: true,
            serializedName: 'properties.name',
            type: {
              name: 'String'
            }
          },
          runCommand: {
            required: false,
            serializedName: 'properties.runCommand',
            type: {
              name: 'String'
            }
          },
          url: {
            required: false,
            serializedName: 'properties.url',
            type: {
              name: 'String'
            }
          },
          extraInfoUrl: {
            required: false,
            serializedName: 'properties.extraInfoUrl',
            type: {
              name: 'String'
            }
          },
          jobType: {
            required: false,
            serializedName: 'properties.jobType',
            type: {
              name: 'Enum',
              allowedValues: [ 'Continuous', 'Triggered' ]
            }
          },
          error: {
            required: false,
            serializedName: 'properties.error',
            type: {
              name: 'String'
            }
          },
          usingSdk: {
            required: false,
            serializedName: 'properties.usingSdk',
            type: {
              name: 'Boolean'
            }
          },
          settings: {
            required: false,
            serializedName: 'properties.settings',
            type: {
              name: 'Object'
            }
          }
        }
      }
    };
  }
}

module.exports = TriggeredWebJob;
