/*
 * 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 binding to an Azure Machine Learning web service.
 *
 * @extends models['FunctionBinding']
 */
class AzureMachineLearningWebServiceFunctionBinding extends models['FunctionBinding'] {
  /**
   * Create a AzureMachineLearningWebServiceFunctionBinding.
   * @member {string} [endpoint] The Request-Response execute endpoint of the
   * Azure Machine Learning web service. Find out more here:
   * https://docs.microsoft.com/en-us/azure/machine-learning/machine-learning-consume-web-services#request-response-service-rrs
   * @member {string} [apiKey] The API key used to authenticate with
   * Request-Response endpoint.
   * @member {object} [inputs] The inputs for the Azure Machine Learning web
   * service endpoint.
   * @member {string} [inputs.name] The name of the input. This is the name
   * provided while authoring the endpoint.
   * @member {array} [inputs.columnNames] A list of input columns for the Azure
   * Machine Learning web service endpoint.
   * @member {array} [outputs] A list of outputs from the Azure Machine
   * Learning web service endpoint execution.
   * @member {number} [batchSize] Number between 1 and 10000 describing maximum
   * number of rows for every Azure ML RRS execute request. Default is 1000.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of AzureMachineLearningWebServiceFunctionBinding
   *
   * @returns {object} metadata of AzureMachineLearningWebServiceFunctionBinding
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Microsoft.MachineLearning/WebService',
      type: {
        name: 'Composite',
        className: 'AzureMachineLearningWebServiceFunctionBinding',
        modelProperties: {
          type: {
            required: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          endpoint: {
            required: false,
            serializedName: 'properties.endpoint',
            type: {
              name: 'String'
            }
          },
          apiKey: {
            required: false,
            serializedName: 'properties.apiKey',
            type: {
              name: 'String'
            }
          },
          inputs: {
            required: false,
            serializedName: 'properties.inputs',
            type: {
              name: 'Composite',
              className: 'AzureMachineLearningWebServiceInputs'
            }
          },
          outputs: {
            required: false,
            serializedName: 'properties.outputs',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'AzureMachineLearningWebServiceOutputColumnElementType',
                  type: {
                    name: 'Composite',
                    className: 'AzureMachineLearningWebServiceOutputColumn'
                  }
              }
            }
          },
          batchSize: {
            required: false,
            serializedName: 'properties.batchSize',
            type: {
              name: 'Number'
            }
          }
        }
      }
    };
  }
}

module.exports = AzureMachineLearningWebServiceFunctionBinding;
