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

/**
 * A streamng job object, containing all information associated with the named
 * streaming job.
 *
 * @extends models['Resource']
 */
class StreamingJob extends models['Resource'] {
  /**
   * Create a StreamingJob.
   * @member {object} [sku] Describes the SKU of the streaming job. Required on
   * PUT (CreateOrReplace) requests.
   * @member {string} [sku.name] The name of the SKU. Required on PUT
   * (CreateOrReplace) requests. Possible values include: 'Standard'
   * @member {string} [jobId] A GUID uniquely identifying the streaming job.
   * This GUID is generated upon creation of the streaming job.
   * @member {string} [provisioningState] Describes the provisioning status of
   * the streaming job.
   * @member {string} [jobState] Describes the state of the streaming job.
   * @member {string} [outputStartMode] This property should only be utilized
   * when it is desired that the job be started immediately upon creation.
   * Value may be JobStartTime, CustomTime, or LastOutputEventTime to indicate
   * whether the starting point of the output event stream should start
   * whenever the job is started, start at a custom user time stamp specified
   * via the outputStartTime property, or start from the last event output
   * time. Possible values include: 'JobStartTime', 'CustomTime',
   * 'LastOutputEventTime'
   * @member {date} [outputStartTime] Value is either an ISO-8601 formatted
   * time stamp that indicates the starting point of the output event stream,
   * or null to indicate that the output event stream will start whenever the
   * streaming job is started. This property must have a value if
   * outputStartMode is set to CustomTime.
   * @member {date} [lastOutputEventTime] Value is either an ISO-8601 formatted
   * timestamp indicating the last output event time of the streaming job or
   * null indicating that output has not yet been produced. In case of multiple
   * outputs or multiple streams, this shows the latest value in that set.
   * @member {string} [eventsOutOfOrderPolicy] Indicates the policy to apply to
   * events that arrive out of order in the input event stream. Possible values
   * include: 'Adjust', 'Drop'
   * @member {string} [outputErrorPolicy] Indicates the policy to apply to
   * events that arrive at the output and cannot be written to the external
   * storage due to being malformed (missing column values, column values of
   * wrong type or size). Possible values include: 'Stop', 'Drop'
   * @member {number} [eventsOutOfOrderMaxDelayInSeconds] The maximum tolerable
   * delay in seconds where out-of-order events can be adjusted to be back in
   * order.
   * @member {number} [eventsLateArrivalMaxDelayInSeconds] The maximum
   * tolerable delay in seconds where events arriving late could be included.
   * Supported range is -1 to 1814399 (20.23:59:59 days) and -1 is used to
   * specify wait indefinitely. If the property is absent, it is interpreted to
   * have a value of -1.
   * @member {string} [dataLocale] The data locale of the stream analytics job.
   * Value should be the name of a supported .NET Culture from the set
   * https://msdn.microsoft.com/en-us/library/system.globalization.culturetypes(v=vs.110).aspx.
   * Defaults to 'en-US' if none specified.
   * @member {string} [compatibilityLevel] Controls certain runtime behaviors
   * of the streaming job. Possible values include: '1.0'
   * @member {date} [createdDate] Value is an ISO-8601 formatted UTC timestamp
   * indicating when the streaming job was created.
   * @member {array} [inputs] A list of one or more inputs to the streaming
   * job. The name property for each input is required when specifying this
   * property in a PUT request. This property cannot be modify via a PATCH
   * operation. You must use the PATCH API available for the individual input.
   * @member {object} [transformation] Indicates the query and the number of
   * streaming units to use for the streaming job. The name property of the
   * transformation is required when specifying this property in a PUT request.
   * This property cannot be modify via a PATCH operation. You must use the
   * PATCH API available for the individual tranformation.
   * @member {number} [transformation.streamingUnits] Specifies the number of
   * streaming units that the streaming job uses.
   * @member {string} [transformation.query] Specifies the query that will be
   * run in the streaming job. You can learn more about the Stream Analytics
   * Query Language (SAQL) here:
   * https://msdn.microsoft.com/library/azure/dn834998 . Required on PUT
   * (CreateOrReplace) requests.
   * @member {string} [transformation.etag] The current entity tag for the
   * transformation. This is an opaque string. You can use it to detect whether
   * the resource has changed between requests. You can also use it in the
   * If-Match or If-None-Match headers for write operations for optimistic
   * concurrency.
   * @member {array} [outputs] A list of one or more outputs for the streaming
   * job. The name property for each output is required when specifying this
   * property in a PUT request. This property cannot be modify via a PATCH
   * operation. You must use the PATCH API available for the individual output.
   * @member {array} [functions] A list of one or more functions for the
   * streaming job. The name property for each function is required when
   * specifying this property in a PUT request. This property cannot be modify
   * via a PATCH operation. You must use the PATCH API available for the
   * individual transformation.
   * @member {string} [etag] The current entity tag for the streaming job. This
   * is an opaque string. You can use it to detect whether the resource has
   * changed between requests. You can also use it in the If-Match or
   * If-None-Match headers for write operations for optimistic concurrency.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of StreamingJob
   *
   * @returns {object} metadata of StreamingJob
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'StreamingJob',
      type: {
        name: 'Composite',
        className: 'StreamingJob',
        modelProperties: {
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          location: {
            required: false,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          tags: {
            required: false,
            serializedName: 'tags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          sku: {
            required: false,
            serializedName: 'properties.sku',
            type: {
              name: 'Composite',
              className: 'Sku'
            }
          },
          jobId: {
            required: false,
            readOnly: true,
            serializedName: 'properties.jobId',
            type: {
              name: 'String'
            }
          },
          provisioningState: {
            required: false,
            readOnly: true,
            serializedName: 'properties.provisioningState',
            type: {
              name: 'String'
            }
          },
          jobState: {
            required: false,
            readOnly: true,
            serializedName: 'properties.jobState',
            type: {
              name: 'String'
            }
          },
          outputStartMode: {
            required: false,
            serializedName: 'properties.outputStartMode',
            type: {
              name: 'String'
            }
          },
          outputStartTime: {
            required: false,
            serializedName: 'properties.outputStartTime',
            type: {
              name: 'DateTime'
            }
          },
          lastOutputEventTime: {
            required: false,
            readOnly: true,
            serializedName: 'properties.lastOutputEventTime',
            type: {
              name: 'DateTime'
            }
          },
          eventsOutOfOrderPolicy: {
            required: false,
            serializedName: 'properties.eventsOutOfOrderPolicy',
            type: {
              name: 'String'
            }
          },
          outputErrorPolicy: {
            required: false,
            serializedName: 'properties.outputErrorPolicy',
            type: {
              name: 'String'
            }
          },
          eventsOutOfOrderMaxDelayInSeconds: {
            required: false,
            serializedName: 'properties.eventsOutOfOrderMaxDelayInSeconds',
            type: {
              name: 'Number'
            }
          },
          eventsLateArrivalMaxDelayInSeconds: {
            required: false,
            serializedName: 'properties.eventsLateArrivalMaxDelayInSeconds',
            type: {
              name: 'Number'
            }
          },
          dataLocale: {
            required: false,
            serializedName: 'properties.dataLocale',
            type: {
              name: 'String'
            }
          },
          compatibilityLevel: {
            required: false,
            serializedName: 'properties.compatibilityLevel',
            type: {
              name: 'String'
            }
          },
          createdDate: {
            required: false,
            readOnly: true,
            serializedName: 'properties.createdDate',
            type: {
              name: 'DateTime'
            }
          },
          inputs: {
            required: false,
            serializedName: 'properties.inputs',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'InputElementType',
                  type: {
                    name: 'Composite',
                    className: 'Input'
                  }
              }
            }
          },
          transformation: {
            required: false,
            serializedName: 'properties.transformation',
            type: {
              name: 'Composite',
              className: 'Transformation'
            }
          },
          outputs: {
            required: false,
            serializedName: 'properties.outputs',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'OutputElementType',
                  type: {
                    name: 'Composite',
                    className: 'Output'
                  }
              }
            }
          },
          functions: {
            required: false,
            serializedName: 'properties.functions',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'FunctionModelElementType',
                  type: {
                    name: 'Composite',
                    className: 'FunctionModel'
                  }
              }
            }
          },
          etag: {
            required: false,
            readOnly: true,
            serializedName: 'properties.etag',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = StreamingJob;
