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

/**
 * Linked service for Teradata data source.
 *
 * @extends models['LinkedService']
 */
class TeradataLinkedService extends models['LinkedService'] {
  /**
   * Create a TeradataLinkedService.
   * @member {object} server Server name for connection. Type: string (or
   * Expression with resultType string).
   * @member {string} [authenticationType] AuthenticationType to be used for
   * connection. Possible values include: 'Basic', 'Windows'
   * @member {object} [username] Username for authentication. Type: string (or
   * Expression with resultType string).
   * @member {object} [password] Password for authentication.
   * @member {string} [password.type] Polymorphic Discriminator
   * @member {object} [encryptedCredential] The encrypted credential used for
   * authentication. Credentials are encrypted using the integration runtime
   * credential manager. Type: string (or Expression with resultType string).
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of TeradataLinkedService
   *
   * @returns {object} metadata of TeradataLinkedService
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Teradata',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'type',
          clientName: 'type'
        },
        uberParent: 'LinkedService',
        className: 'TeradataLinkedService',
        modelProperties: {
          connectVia: {
            required: false,
            serializedName: 'connectVia',
            type: {
              name: 'Composite',
              className: 'IntegrationRuntimeReference'
            }
          },
          description: {
            required: false,
            serializedName: 'description',
            type: {
              name: 'String'
            }
          },
          parameters: {
            required: false,
            serializedName: 'parameters',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'ParameterSpecificationElementType',
                  type: {
                    name: 'Composite',
                    className: 'ParameterSpecification'
                  }
              }
            }
          },
          annotations: {
            required: false,
            serializedName: 'annotations',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ObjectElementType',
                  type: {
                    name: 'Object'
                  }
              }
            }
          },
          type: {
            required: true,
            serializedName: 'type',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          },
          server: {
            required: true,
            serializedName: 'typeProperties.server',
            type: {
              name: 'Object'
            }
          },
          authenticationType: {
            required: false,
            serializedName: 'typeProperties.authenticationType',
            type: {
              name: 'String'
            }
          },
          username: {
            required: false,
            serializedName: 'typeProperties.username',
            type: {
              name: 'Object'
            }
          },
          password: {
            required: false,
            serializedName: 'typeProperties.password',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: 'type',
                clientName: 'type'
              },
              uberParent: 'SecretBase',
              className: 'SecretBase'
            }
          },
          encryptedCredential: {
            required: false,
            serializedName: 'typeProperties.encryptedCredential',
            type: {
              name: 'Object'
            }
          }
        }
      }
    };
  }
}

module.exports = TeradataLinkedService;
