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

/**
 * HDInsight ondemand linked service.
 *
 * @extends models['LinkedService']
 */
class HDInsightOnDemandLinkedService extends models['LinkedService'] {
  /**
   * Create a HDInsightOnDemandLinkedService.
   * @member {object} clusterSize Number of worker/data nodes in the cluster.
   * Suggestion value: 4. Type: string (or Expression with resultType string).
   * @member {object} timeToLive The allowed idle time for the on-demand
   * HDInsight cluster. Specifies how long the on-demand HDInsight cluster
   * stays alive after completion of an activity run if there are no other
   * active jobs in the cluster. The minimum value is 5 mins. Type: string (or
   * Expression with resultType string).
   * @member {object} version Version of the HDInsight cluster.  Type: string
   * (or Expression with resultType string).
   * @member {object} linkedServiceName Azure Storage linked service to be used
   * by the on-demand cluster for storing and processing data.
   * @member {string} [linkedServiceName.referenceName] Reference LinkedService
   * name.
   * @member {object} [linkedServiceName.parameters] Arguments for
   * LinkedService.
   * @member {object} hostSubscriptionId The customer’s subscription to host
   * the cluster. Type: string (or Expression with resultType string).
   * @member {object} [servicePrincipalId] The service principal id for the
   * hostSubscriptionId. Type: string (or Expression with resultType string).
   * @member {object} [servicePrincipalKey] The key for the service principal
   * id.
   * @member {string} [servicePrincipalKey.type] Polymorphic Discriminator
   * @member {object} tenant The Tenant id/name to which the service principal
   * belongs. Type: string (or Expression with resultType string).
   * @member {object} clusterResourceGroup The resource group where the cluster
   * belongs. Type: string (or Expression with resultType string).
   * @member {object} [clusterNamePrefix] The prefix of cluster name, postfix
   * will be distinct with timestamp. Type: string (or Expression with
   * resultType string).
   * @member {object} [clusterUserName] The username to access the cluster.
   * Type: string (or Expression with resultType string).
   * @member {object} [clusterPassword] The password to access the cluster.
   * @member {string} [clusterPassword.type] Polymorphic Discriminator
   * @member {object} [clusterSshUserName] The username to SSH remotely connect
   * to cluster’s node (for Linux). Type: string (or Expression with resultType
   * string).
   * @member {object} [clusterSshPassword] The password to SSH remotely connect
   * cluster’s node (for Linux).
   * @member {string} [clusterSshPassword.type] Polymorphic Discriminator
   * @member {array} [additionalLinkedServiceNames] Specifies additional
   * storage accounts for the HDInsight linked service so that the Data Factory
   * service can register them on your behalf.
   * @member {object} [hcatalogLinkedServiceName] The name of Azure SQL linked
   * service that point to the HCatalog database. The on-demand HDInsight
   * cluster is created by using the Azure SQL database as the metastore.
   * @member {string} [hcatalogLinkedServiceName.referenceName] Reference
   * LinkedService name.
   * @member {object} [hcatalogLinkedServiceName.parameters] Arguments for
   * LinkedService.
   * @member {object} [clusterType] The cluster type. Type: string (or
   * Expression with resultType string).
   * @member {object} [sparkVersion] The version of spark if the cluster type
   * is 'spark'. Type: string (or Expression with resultType string).
   * @member {object} [coreConfiguration] Specifies the core configuration
   * parameters (as in core-site.xml) for the HDInsight cluster to be created.
   * @member {object} [hBaseConfiguration] Specifies the HBase configuration
   * parameters (hbase-site.xml) for the HDInsight cluster.
   * @member {object} [hdfsConfiguration] Specifies the HDFS configuration
   * parameters (hdfs-site.xml) for the HDInsight cluster.
   * @member {object} [hiveConfiguration] Specifies the hive configuration
   * parameters (hive-site.xml) for the HDInsight cluster.
   * @member {object} [mapReduceConfiguration] Specifies the MapReduce
   * configuration parameters (mapred-site.xml) for the HDInsight cluster.
   * @member {object} [oozieConfiguration] Specifies the Oozie configuration
   * parameters (oozie-site.xml) for the HDInsight cluster.
   * @member {object} [stormConfiguration] Specifies the Storm configuration
   * parameters (storm-site.xml) for the HDInsight cluster.
   * @member {object} [yarnConfiguration] Specifies the Yarn configuration
   * parameters (yarn-site.xml) for the HDInsight cluster.
   * @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} [headNodeSize] Specifies the size of the head node for
   * the HDInsight cluster.
   * @member {object} [dataNodeSize] Specifies the size of the data node for
   * the HDInsight cluster.
   * @member {object} [zookeeperNodeSize] Specifies the size of the Zoo Keeper
   * node for the HDInsight cluster.
   * @member {array} [scriptActions] Custom script actions to run on HDI
   * ondemand cluster once it's up. Please refer to
   * https://docs.microsoft.com/en-us/azure/hdinsight/hdinsight-hadoop-customize-cluster-linux?toc=%2Fen-us%2Fazure%2Fhdinsight%2Fr-server%2FTOC.json&bc=%2Fen-us%2Fazure%2Fbread%2Ftoc.json#understanding-script-actions.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of HDInsightOnDemandLinkedService
   *
   * @returns {object} metadata of HDInsightOnDemandLinkedService
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'HDInsightOnDemand',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'type',
          clientName: 'type'
        },
        uberParent: 'LinkedService',
        className: 'HDInsightOnDemandLinkedService',
        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'
            }
          },
          clusterSize: {
            required: true,
            serializedName: 'typeProperties.clusterSize',
            type: {
              name: 'Object'
            }
          },
          timeToLive: {
            required: true,
            serializedName: 'typeProperties.timeToLive',
            type: {
              name: 'Object'
            }
          },
          version: {
            required: true,
            serializedName: 'typeProperties.version',
            type: {
              name: 'Object'
            }
          },
          linkedServiceName: {
            required: true,
            serializedName: 'typeProperties.linkedServiceName',
            defaultValue: {},
            type: {
              name: 'Composite',
              className: 'LinkedServiceReference'
            }
          },
          hostSubscriptionId: {
            required: true,
            serializedName: 'typeProperties.hostSubscriptionId',
            type: {
              name: 'Object'
            }
          },
          servicePrincipalId: {
            required: false,
            serializedName: 'typeProperties.servicePrincipalId',
            type: {
              name: 'Object'
            }
          },
          servicePrincipalKey: {
            required: false,
            serializedName: 'typeProperties.servicePrincipalKey',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: 'type',
                clientName: 'type'
              },
              uberParent: 'SecretBase',
              className: 'SecretBase'
            }
          },
          tenant: {
            required: true,
            serializedName: 'typeProperties.tenant',
            type: {
              name: 'Object'
            }
          },
          clusterResourceGroup: {
            required: true,
            serializedName: 'typeProperties.clusterResourceGroup',
            type: {
              name: 'Object'
            }
          },
          clusterNamePrefix: {
            required: false,
            serializedName: 'typeProperties.clusterNamePrefix',
            type: {
              name: 'Object'
            }
          },
          clusterUserName: {
            required: false,
            serializedName: 'typeProperties.clusterUserName',
            type: {
              name: 'Object'
            }
          },
          clusterPassword: {
            required: false,
            serializedName: 'typeProperties.clusterPassword',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: 'type',
                clientName: 'type'
              },
              uberParent: 'SecretBase',
              className: 'SecretBase'
            }
          },
          clusterSshUserName: {
            required: false,
            serializedName: 'typeProperties.clusterSshUserName',
            type: {
              name: 'Object'
            }
          },
          clusterSshPassword: {
            required: false,
            serializedName: 'typeProperties.clusterSshPassword',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: 'type',
                clientName: 'type'
              },
              uberParent: 'SecretBase',
              className: 'SecretBase'
            }
          },
          additionalLinkedServiceNames: {
            required: false,
            serializedName: 'typeProperties.additionalLinkedServiceNames',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'LinkedServiceReferenceElementType',
                  type: {
                    name: 'Composite',
                    className: 'LinkedServiceReference'
                  }
              }
            }
          },
          hcatalogLinkedServiceName: {
            required: false,
            serializedName: 'typeProperties.hcatalogLinkedServiceName',
            type: {
              name: 'Composite',
              className: 'LinkedServiceReference'
            }
          },
          clusterType: {
            required: false,
            serializedName: 'typeProperties.clusterType',
            type: {
              name: 'Object'
            }
          },
          sparkVersion: {
            required: false,
            serializedName: 'typeProperties.sparkVersion',
            type: {
              name: 'Object'
            }
          },
          coreConfiguration: {
            required: false,
            serializedName: 'typeProperties.coreConfiguration',
            type: {
              name: 'Object'
            }
          },
          hBaseConfiguration: {
            required: false,
            serializedName: 'typeProperties.hBaseConfiguration',
            type: {
              name: 'Object'
            }
          },
          hdfsConfiguration: {
            required: false,
            serializedName: 'typeProperties.hdfsConfiguration',
            type: {
              name: 'Object'
            }
          },
          hiveConfiguration: {
            required: false,
            serializedName: 'typeProperties.hiveConfiguration',
            type: {
              name: 'Object'
            }
          },
          mapReduceConfiguration: {
            required: false,
            serializedName: 'typeProperties.mapReduceConfiguration',
            type: {
              name: 'Object'
            }
          },
          oozieConfiguration: {
            required: false,
            serializedName: 'typeProperties.oozieConfiguration',
            type: {
              name: 'Object'
            }
          },
          stormConfiguration: {
            required: false,
            serializedName: 'typeProperties.stormConfiguration',
            type: {
              name: 'Object'
            }
          },
          yarnConfiguration: {
            required: false,
            serializedName: 'typeProperties.yarnConfiguration',
            type: {
              name: 'Object'
            }
          },
          encryptedCredential: {
            required: false,
            serializedName: 'typeProperties.encryptedCredential',
            type: {
              name: 'Object'
            }
          },
          headNodeSize: {
            required: false,
            serializedName: 'typeProperties.headNodeSize',
            type: {
              name: 'Object'
            }
          },
          dataNodeSize: {
            required: false,
            serializedName: 'typeProperties.dataNodeSize',
            type: {
              name: 'Object'
            }
          },
          zookeeperNodeSize: {
            required: false,
            serializedName: 'typeProperties.zookeeperNodeSize',
            type: {
              name: 'Object'
            }
          },
          scriptActions: {
            required: false,
            serializedName: 'typeProperties.scriptActions',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ScriptActionElementType',
                  type: {
                    name: 'Composite',
                    className: 'ScriptAction'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = HDInsightOnDemandLinkedService;
