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

/**
 * The properties that are associated with a scalar function.
 *
 * @extends models['FunctionProperties']
 */
class ScalarFunctionProperties extends models['FunctionProperties'] {
  /**
   * Create a ScalarFunctionProperties.
   * @member {array} [inputs] A list of inputs describing the parameters of the
   * function.
   * @member {object} [output] The output of the function.
   * @member {string} [output.dataType] The (Azure Stream Analytics supported)
   * data type of the function output. A list of valid Azure Stream Analytics
   * data types are described at
   * https://msdn.microsoft.com/en-us/library/azure/dn835065.aspx
   * @member {object} [binding] The physical binding of the function. For
   * example, in the Azure Machine Learning web service’s case, this describes
   * the endpoint.
   * @member {string} [binding.type] Polymorphic Discriminator
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of ScalarFunctionProperties
   *
   * @returns {object} metadata of ScalarFunctionProperties
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Scalar',
      type: {
        name: 'Composite',
        className: 'ScalarFunctionProperties',
        modelProperties: {
          etag: {
            required: false,
            readOnly: true,
            serializedName: 'etag',
            type: {
              name: 'String'
            }
          },
          type: {
            required: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          inputs: {
            required: false,
            serializedName: 'properties.inputs',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'FunctionInputElementType',
                  type: {
                    name: 'Composite',
                    className: 'FunctionInput'
                  }
              }
            }
          },
          output: {
            required: false,
            serializedName: 'properties.output',
            type: {
              name: 'Composite',
              className: 'FunctionOutput'
            }
          },
          binding: {
            required: false,
            serializedName: 'properties.binding',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: 'type',
                clientName: 'type'
              },
              uberParent: 'FunctionBinding',
              className: 'FunctionBinding'
            }
          }
        }
      }
    };
  }
}

module.exports = ScalarFunctionProperties;
