/*
 * 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 transformation object, containing all information associated with the
 * named transformation. All transformations are contained under a streaming
 * job.
 *
 * @extends models['SubResource']
 */
class Transformation extends models['SubResource'] {
  /**
   * Create a Transformation.
   * @member {number} [streamingUnits] Specifies the number of streaming units
   * that the streaming job uses.
   * @member {string} [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} [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.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of Transformation
   *
   * @returns {object} metadata of Transformation
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Transformation',
      type: {
        name: 'Composite',
        className: 'Transformation',
        modelProperties: {
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          streamingUnits: {
            required: false,
            serializedName: 'properties.streamingUnits',
            type: {
              name: 'Number'
            }
          },
          query: {
            required: false,
            serializedName: 'properties.query',
            type: {
              name: 'String'
            }
          },
          etag: {
            required: false,
            readOnly: true,
            serializedName: 'properties.etag',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = Transformation;
