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

/**
 * Azure Databricks linked service.
 *
 * @extends models['LinkedService']
 */
class AzureDatabricksLinkedService extends models['LinkedService'] {
  /**
   * Create a AzureDatabricksLinkedService.
   * @member {object} domain <REGION>.azuredatabricks.net, domain name of your
   * Databricks deployment. Type: string (or Expression with resultType
   * string).
   * @member {object} accessToken Access token for databricks REST API. Refer
   * to https://docs.azuredatabricks.net/api/latest/authentication.html. Type:
   * string (or Expression with resultType string).
   * @member {string} [accessToken.type] Polymorphic Discriminator
   * @member {object} [existingClusterId] The id of an existing cluster that
   * will be used for all runs of this job. Type: string (or Expression with
   * resultType string).
   * @member {object} [newClusterVersion] The Spark version of new cluster.
   * Type: string (or Expression with resultType string).
   * @member {object} [newClusterNumOfWorker] Number of worker nodes that new
   * cluster should have. A string formatted Int32, like '1' means numOfWorker
   * is 1 or '1:10' means auto-scale from 1 as min and 10 as max. Type: string
   * (or Expression with resultType string).
   * @member {object} [newClusterNodeType] The node types of new cluster. Type:
   * string (or Expression with resultType string).
   * @member {object} [newClusterSparkConf] A set of optional, user-specified
   * Spark configuration key-value pairs.
   * @member {object} [newClusterSparkEnvVars] A set of optional,
   * user-specified Spark environment variables key-value pairs.
   * @member {object} [newClusterCustomTags] Additional tags for cluster
   * resources.
   * @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 AzureDatabricksLinkedService
   *
   * @returns {object} metadata of AzureDatabricksLinkedService
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'AzureDatabricks',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'type',
          clientName: 'type'
        },
        uberParent: 'LinkedService',
        className: 'AzureDatabricksLinkedService',
        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'
            }
          },
          domain: {
            required: true,
            serializedName: 'typeProperties.domain',
            type: {
              name: 'Object'
            }
          },
          accessToken: {
            required: true,
            serializedName: 'typeProperties.accessToken',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: 'type',
                clientName: 'type'
              },
              uberParent: 'SecretBase',
              className: 'SecretBase'
            }
          },
          existingClusterId: {
            required: false,
            serializedName: 'typeProperties.existingClusterId',
            type: {
              name: 'Object'
            }
          },
          newClusterVersion: {
            required: false,
            serializedName: 'typeProperties.newClusterVersion',
            type: {
              name: 'Object'
            }
          },
          newClusterNumOfWorker: {
            required: false,
            serializedName: 'typeProperties.newClusterNumOfWorker',
            type: {
              name: 'Object'
            }
          },
          newClusterNodeType: {
            required: false,
            serializedName: 'typeProperties.newClusterNodeType',
            type: {
              name: 'Object'
            }
          },
          newClusterSparkConf: {
            required: false,
            serializedName: 'typeProperties.newClusterSparkConf',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'ObjectElementType',
                  type: {
                    name: 'Object'
                  }
              }
            }
          },
          newClusterSparkEnvVars: {
            required: false,
            serializedName: 'typeProperties.newClusterSparkEnvVars',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'ObjectElementType',
                  type: {
                    name: 'Object'
                  }
              }
            }
          },
          newClusterCustomTags: {
            required: false,
            serializedName: 'typeProperties.newClusterCustomTags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'ObjectElementType',
                  type: {
                    name: 'Object'
                  }
              }
            }
          },
          encryptedCredential: {
            required: false,
            serializedName: 'typeProperties.encryptedCredential',
            type: {
              name: 'Object'
            }
          }
        }
      }
    };
  }
}

module.exports = AzureDatabricksLinkedService;
