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

/**
 * Specifies a setup task which can be used to customize the compute nodes of
 * the cluster.
 *
 */
class SetupTask {
  /**
   * Create a SetupTask.
   * @member {string} commandLine Command line. 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} [environmentVariables] Environment variables. A collection
   * of user defined environment variables to be set for setup task.
   * @member {array} [secrets] 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} stdOutErrPathPrefix Output path prefix. The prefix of a
   * path where the Batch AI service will upload the stdout, stderr and
   * execution log of the setup task.
   * @member {string} [stdOutErrPathSuffix] Output path suffix. 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.
   */
  constructor() {
  }

  /**
   * Defines the metadata of SetupTask
   *
   * @returns {object} metadata of SetupTask
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'SetupTask',
      type: {
        name: 'Composite',
        className: 'SetupTask',
        modelProperties: {
          commandLine: {
            required: true,
            serializedName: 'commandLine',
            type: {
              name: 'String'
            }
          },
          environmentVariables: {
            required: false,
            serializedName: 'environmentVariables',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'EnvironmentVariableElementType',
                  type: {
                    name: 'Composite',
                    className: 'EnvironmentVariable'
                  }
              }
            }
          },
          secrets: {
            required: false,
            serializedName: 'secrets',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'EnvironmentVariableWithSecretValueElementType',
                  type: {
                    name: 'Composite',
                    className: 'EnvironmentVariableWithSecretValue'
                  }
              }
            }
          },
          stdOutErrPathPrefix: {
            required: true,
            serializedName: 'stdOutErrPathPrefix',
            type: {
              name: 'String'
            }
          },
          stdOutErrPathSuffix: {
            required: false,
            readOnly: true,
            serializedName: 'stdOutErrPathSuffix',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = SetupTask;
