/*
 * 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 linked service for an SSH File Transfer Protocol (SFTP) server.
 *
 * @extends models['LinkedService']
 */
class SftpServerLinkedService extends models['LinkedService'] {
  /**
   * Create a SftpServerLinkedService.
   * @member {object} host The SFTP server host name. Type: string (or
   * Expression with resultType string).
   * @member {object} [port] The TCP port number that the SFTP server uses to
   * listen for client connections. Default value is 22. Type: integer (or
   * Expression with resultType integer), minimum: 0.
   * @member {string} [authenticationType] The authentication type to be used
   * to connect to the FTP server. Possible values include: 'Basic',
   * 'SshPublicKey'
   * @member {object} [userName] The username used to log on to the SFTP
   * server. Type: string (or Expression with resultType string).
   * @member {object} [password] Password to logon the SFTP server for Basic
   * 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).
   * @member {object} [privateKeyPath] The SSH private key file path for
   * SshPublicKey authentication. Only valid for on-premises copy. For
   * on-premises copy with SshPublicKey authentication, either PrivateKeyPath
   * or PrivateKeyContent should be specified. SSH private key should be
   * OpenSSH format. Type: string (or Expression with resultType string).
   * @member {object} [privateKeyContent] Base64 encoded SSH private key
   * content for SshPublicKey authentication. For on-premises copy with
   * SshPublicKey authentication, either PrivateKeyPath or PrivateKeyContent
   * should be specified. SSH private key should be OpenSSH format.
   * @member {string} [privateKeyContent.type] Polymorphic Discriminator
   * @member {object} [passPhrase] The password to decrypt the SSH private key
   * if the SSH private key is encrypted.
   * @member {string} [passPhrase.type] Polymorphic Discriminator
   * @member {object} [skipHostKeyValidation] If true, skip the SSH host key
   * validation. Default value is false. Type: boolean (or Expression with
   * resultType boolean).
   * @member {object} [hostKeyFingerprint] The host key finger-print of the
   * SFTP server. When SkipHostKeyValidation is false, HostKeyFingerprint
   * should be specified. Type: string (or Expression with resultType string).
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of SftpServerLinkedService
   *
   * @returns {object} metadata of SftpServerLinkedService
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Sftp',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'type',
          clientName: 'type'
        },
        uberParent: 'LinkedService',
        className: 'SftpServerLinkedService',
        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'
            }
          },
          host: {
            required: true,
            serializedName: 'typeProperties.host',
            type: {
              name: 'Object'
            }
          },
          port: {
            required: false,
            serializedName: 'typeProperties.port',
            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'
            }
          },
          privateKeyPath: {
            required: false,
            serializedName: 'typeProperties.privateKeyPath',
            type: {
              name: 'Object'
            }
          },
          privateKeyContent: {
            required: false,
            serializedName: 'typeProperties.privateKeyContent',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: 'type',
                clientName: 'type'
              },
              uberParent: 'SecretBase',
              className: 'SecretBase'
            }
          },
          passPhrase: {
            required: false,
            serializedName: 'typeProperties.passPhrase',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: 'type',
                clientName: 'type'
              },
              uberParent: 'SecretBase',
              className: 'SecretBase'
            }
          },
          skipHostKeyValidation: {
            required: false,
            serializedName: 'typeProperties.skipHostKeyValidation',
            type: {
              name: 'Object'
            }
          },
          hostKeyFingerprint: {
            required: false,
            serializedName: 'typeProperties.hostKeyFingerprint',
            type: {
              name: 'Object'
            }
          }
        }
      }
    };
  }
}

module.exports = SftpServerLinkedService;
