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

/**
 * Node setup settings.
 *
 */
class NodeSetup {
  /**
   * Create a NodeSetup.
   * @member {object} [setupTask] Setup task. Setup task to run on cluster
   * nodes when nodes got created or rebooted. The setup task code needs to be
   * idempotent. Generally the setup task is used to download static data that
   * is required for all jobs that run on the cluster VMs and/or to
   * download/install software.
   * @member {string} [setupTask.commandLine] The command line to be executed
   * on each cluster's node after it being allocated or rebooted. The command
   * is executed in a bash subshell as a root.
   * @member {array} [setupTask.environmentVariables] A collection of user
   * defined environment variables to be set for setup task.
   * @member {array} [setupTask.secrets] A collection of user defined
   * environment variables with secret values to be set for the setup task.
   * Server will never report values of these variables back.
   * @member {string} [setupTask.stdOutErrPathPrefix] The prefix of a path
   * where the Batch AI service will upload the stdout, stderr and execution
   * log of the setup task.
   * @member {string} [setupTask.stdOutErrPathSuffix] A path segment appended
   * by Batch AI to stdOutErrPathPrefix to form a path where stdout, stderr and
   * execution log of the setup task will be uploaded. Batch AI creates the
   * setup task output directories under an unique path to avoid conflicts
   * between different clusters. The full path can be obtained by concatenation
   * of stdOutErrPathPrefix and stdOutErrPathSuffix.
   * @member {object} [mountVolumes] Mount volumes. Mount volumes to be
   * available to setup task and all jobs executing on the cluster. The volumes
   * will be mounted at location specified by $AZ_BATCHAI_MOUNT_ROOT
   * environment variable.
   * @member {array} [mountVolumes.azureFileShares] A collection of Azure File
   * Shares that are to be mounted to the cluster nodes.
   * @member {array} [mountVolumes.azureBlobFileSystems] A collection of Azure
   * Blob Containers that are to be mounted to the cluster nodes.
   * @member {array} [mountVolumes.fileServers] A collection of Batch AI File
   * Servers that are to be mounted to the cluster nodes.
   * @member {array} [mountVolumes.unmanagedFileSystems] A collection of
   * unmanaged file systems that are to be mounted to the cluster nodes.
   * @member {object} [performanceCountersSettings] Performance counters
   * settings. Settings for performance counters collecting and uploading.
   * @member {object} [performanceCountersSettings.appInsightsReference] Azure
   * Application Insights information for performance counters reporting. If
   * provided, Batch AI will upload node performance counters to the
   * corresponding Azure Application Insights account.
   * @member {object}
   * [performanceCountersSettings.appInsightsReference.component] Azure
   * Application Insights component resource ID.
   * @member {string}
   * [performanceCountersSettings.appInsightsReference.component.id] The ID of
   * the resource
   * @member {string}
   * [performanceCountersSettings.appInsightsReference.instrumentationKey]
   * Value of the Azure Application Insights instrumentation key.
   * @member {object}
   * [performanceCountersSettings.appInsightsReference.instrumentationKeySecretReference]
   * KeyVault Store and Secret which contains Azure Application Insights
   * instrumentation key. One of instrumentationKey or
   * instrumentationKeySecretReference must be specified.
   * @member {object}
   * [performanceCountersSettings.appInsightsReference.instrumentationKeySecretReference.sourceVault]
   * Fully qualified resource indentifier of the Key Vault.
   * @member {string}
   * [performanceCountersSettings.appInsightsReference.instrumentationKeySecretReference.sourceVault.id]
   * The ID of the resource
   * @member {string}
   * [performanceCountersSettings.appInsightsReference.instrumentationKeySecretReference.secretUrl]
   * The URL referencing a secret in the Key Vault.
   */
  constructor() {
  }

  /**
   * Defines the metadata of NodeSetup
   *
   * @returns {object} metadata of NodeSetup
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'NodeSetup',
      type: {
        name: 'Composite',
        className: 'NodeSetup',
        modelProperties: {
          setupTask: {
            required: false,
            serializedName: 'setupTask',
            type: {
              name: 'Composite',
              className: 'SetupTask'
            }
          },
          mountVolumes: {
            required: false,
            serializedName: 'mountVolumes',
            type: {
              name: 'Composite',
              className: 'MountVolumes'
            }
          },
          performanceCountersSettings: {
            required: false,
            serializedName: 'performanceCountersSettings',
            type: {
              name: 'Composite',
              className: 'PerformanceCountersSettings'
            }
          }
        }
      }
    };
  }
}

module.exports = NodeSetup;
