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

/**
 * Job creation parameters.
 *
 */
class JobCreateParameters {
  /**
   * Create a JobCreateParameters.
   * @member {string} [schedulingPriority] Scheduling priority. Scheduling
   * priority associated with the job. Possible values: low, normal, high.
   * Possible values include: 'low', 'normal', 'high'. Default value: 'normal'
   * .
   * @member {object} cluster Cluster. Resource ID of the cluster on which this
   * job will run.
   * @member {string} [cluster.id] The ID of the resource
   * @member {object} [mountVolumes] Mount volumes. Information on mount
   * volumes to be used by the job. These volumes will be mounted before the
   * job execution and will be unmouted after the job completion. The volumes
   * will be mounted at location specified by $AZ_BATCHAI_JOB_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 {number} nodeCount Node count. Number of compute nodes to run the
   * job on. The job will be gang scheduled on that many compute nodes.
   * @member {object} [containerSettings] Container settings. Docker container
   * settings for the job. If not provided, the job will run directly on the
   * node.
   * @member {object} [containerSettings.imageSourceRegistry] Information about
   * docker image and docker registry to download the container from.
   * @member {string} [containerSettings.imageSourceRegistry.serverUrl] URL for
   * image repository.
   * @member {string} [containerSettings.imageSourceRegistry.image] The name of
   * the image in the image repository.
   * @member {object} [containerSettings.imageSourceRegistry.credentials]
   * Credentials to access the private docker repository.
   * @member {string}
   * [containerSettings.imageSourceRegistry.credentials.username] User name to
   * login to the repository.
   * @member {string}
   * [containerSettings.imageSourceRegistry.credentials.password] User password
   * to login to the docker repository. One of password or
   * passwordSecretReference must be specified.
   * @member {object}
   * [containerSettings.imageSourceRegistry.credentials.passwordSecretReference]
   * KeyVault Secret storing the password. Users can store their secrets in
   * Azure KeyVault and pass it to the Batch AI service to integrate with
   * KeyVault. One of password or passwordSecretReference must be specified.
   * @member {object}
   * [containerSettings.imageSourceRegistry.credentials.passwordSecretReference.sourceVault]
   * Fully qualified resource indentifier of the Key Vault.
   * @member {string}
   * [containerSettings.imageSourceRegistry.credentials.passwordSecretReference.sourceVault.id]
   * The ID of the resource
   * @member {string}
   * [containerSettings.imageSourceRegistry.credentials.passwordSecretReference.secretUrl]
   * The URL referencing a secret in the Key Vault.
   * @member {string} [containerSettings.shmSize] Size of /dev/shm. Please
   * refer to docker documentation for supported argument formats.
   * @member {object} [cntkSettings] CNTK settings. Settings for CNTK (aka
   * Microsoft Cognitive Toolkit) job.
   * @member {string} [cntkSettings.languageType] The language to use for
   * launching CNTK (aka Microsoft Cognitive Toolkit) job. Valid values are
   * 'BrainScript' or 'Python'.
   * @member {string} [cntkSettings.configFilePath] Specifies the path of the
   * BrainScript config file. This property can be specified only if the
   * languageType is 'BrainScript'.
   * @member {string} [cntkSettings.pythonScriptFilePath] Python script to
   * execute. This property can be specified only if the languageType is
   * 'Python'.
   * @member {string} [cntkSettings.pythonInterpreterPath] The path to the
   * Python interpreter. This property can be specified only if the
   * languageType is 'Python'.
   * @member {string} [cntkSettings.commandLineArgs] Command line arguments
   * that need to be passed to the python script or cntk executable.
   * @member {number} [cntkSettings.processCount] Number of processes to launch
   * for the job execution. The default value for this property is equal to
   * nodeCount property
   * @member {object} [pyTorchSettings] pyTorch settings. Settings for pyTorch
   * job.
   * @member {string} [pyTorchSettings.pythonScriptFilePath] The python script
   * to execute.
   * @member {string} [pyTorchSettings.pythonInterpreterPath] The path to the
   * Python interpreter.
   * @member {string} [pyTorchSettings.commandLineArgs] Command line arguments
   * that need to be passed to the python script.
   * @member {number} [pyTorchSettings.processCount] Number of processes to
   * launch for the job execution. The default value for this property is equal
   * to nodeCount property
   * @member {string} [pyTorchSettings.communicationBackend] Type of the
   * communication backend for distributed jobs. Valid values are 'TCP', 'Gloo'
   * or 'MPI'. Not required for non-distributed jobs.
   * @member {object} [tensorFlowSettings] TensorFlow settings. Settings for
   * Tensor Flow job.
   * @member {string} [tensorFlowSettings.pythonScriptFilePath] The python
   * script to execute.
   * @member {string} [tensorFlowSettings.pythonInterpreterPath] The path to
   * the Python interpreter.
   * @member {string} [tensorFlowSettings.masterCommandLineArgs] Command line
   * arguments that need to be passed to the python script for the master task.
   * @member {string} [tensorFlowSettings.workerCommandLineArgs] Command line
   * arguments that need to be passed to the python script for the worker task.
   * Optional for single process jobs.
   * @member {string} [tensorFlowSettings.parameterServerCommandLineArgs]
   * Command line arguments that need to be passed to the python script for the
   * parameter server. Optional for single process jobs.
   * @member {number} [tensorFlowSettings.workerCount] The number of worker
   * tasks. If specified, the value must be less than or equal to (nodeCount *
   * numberOfGPUs per VM). If not specified, the default value is equal to
   * nodeCount. This property can be specified only for distributed TensorFlow
   * training.
   * @member {number} [tensorFlowSettings.parameterServerCount] The number of
   * parameter server tasks. If specified, the value must be less than or equal
   * to nodeCount. If not specified, the default value is equal to 1 for
   * distributed TensorFlow training. This property can be specified only for
   * distributed TensorFlow training.
   * @member {object} [caffeSettings] Caffe settings. Settings for Caffe job.
   * @member {string} [caffeSettings.configFilePath] Path of the config file
   * for the job. This property cannot be specified if pythonScriptFilePath is
   * specified.
   * @member {string} [caffeSettings.pythonScriptFilePath] Python script to
   * execute. This property cannot be specified if configFilePath is specified.
   * @member {string} [caffeSettings.pythonInterpreterPath] The path to the
   * Python interpreter. The property can be specified only if the
   * pythonScriptFilePath is specified.
   * @member {string} [caffeSettings.commandLineArgs] Command line arguments
   * that need to be passed to the Caffe job.
   * @member {number} [caffeSettings.processCount] Number of processes to
   * launch for the job execution. The default value for this property is equal
   * to nodeCount property
   * @member {object} [caffe2Settings] Caffe2 settings. Settings for Caffe2
   * job.
   * @member {string} [caffe2Settings.pythonScriptFilePath] The python script
   * to execute.
   * @member {string} [caffe2Settings.pythonInterpreterPath] The path to the
   * Python interpreter.
   * @member {string} [caffe2Settings.commandLineArgs] Command line arguments
   * that need to be passed to the python script.
   * @member {object} [chainerSettings] Chainer settings. Settings for Chainer
   * job.
   * @member {string} [chainerSettings.pythonScriptFilePath] The python script
   * to execute.
   * @member {string} [chainerSettings.pythonInterpreterPath] The path to the
   * Python interpreter.
   * @member {string} [chainerSettings.commandLineArgs] Command line arguments
   * that need to be passed to the python script.
   * @member {number} [chainerSettings.processCount] Number of processes to
   * launch for the job execution. The default value for this property is equal
   * to nodeCount property
   * @member {object} [customToolkitSettings] Custom tool kit job. Settings for
   * custom tool kit job.
   * @member {string} [customToolkitSettings.commandLine] The command line to
   * execute on the master node.
   * @member {object} [customMpiSettings] Custom MPI settings. Settings for
   * custom MPI job.
   * @member {string} [customMpiSettings.commandLine] The command line to be
   * executed by mpi runtime on each compute node.
   * @member {number} [customMpiSettings.processCount] Number of processes to
   * launch for the job execution. The default value for this property is equal
   * to nodeCount property
   * @member {object} [horovodSettings] Horovod settings. Settings for Horovod
   * job.
   * @member {string} [horovodSettings.pythonScriptFilePath] The python script
   * to execute.
   * @member {string} [horovodSettings.pythonInterpreterPath] The path to the
   * Python interpreter.
   * @member {string} [horovodSettings.commandLineArgs] Command line arguments
   * that need to be passed to the python script.
   * @member {number} [horovodSettings.processCount] Number of processes to
   * launch for the job execution. The default value for this property is equal
   * to nodeCount property
   * @member {object} [jobPreparation] Job preparation. A command line to be
   * executed on each node allocated for the job before tool kit is launched.
   * @member {string} [jobPreparation.commandLine] The command line to execute.
   * If containerSettings is specified on the job, this commandLine will be
   * executed in the same container as job. Otherwise it will be executed on
   * the node.
   * @member {string} stdOutErrPathPrefix Standard output path prefix. The path
   * where the Batch AI service will store stdout, stderror and execution log
   * of the job.
   * @member {array} [inputDirectories] Input directories. A list of input
   * directories for the job.
   * @member {array} [outputDirectories] Output directories. A list of output
   * directories for the job.
   * @member {array} [environmentVariables] Environment variables. A list of
   * user defined environment variables which will be setup for the job.
   * @member {array} [secrets] Secrets. A list of user defined environment
   * variables with secret values which will be setup for the job. Server will
   * never report values of these variables back.
   * @member {object} [constraints] Constraints associated with the Job.
   * @member {moment.duration} [constraints.maxWallClockTime] Max time the job
   * can run. Default value: 1 week.
   */
  constructor() {
  }

  /**
   * Defines the metadata of JobCreateParameters
   *
   * @returns {object} metadata of JobCreateParameters
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'JobCreateParameters',
      type: {
        name: 'Composite',
        className: 'JobCreateParameters',
        modelProperties: {
          schedulingPriority: {
            required: false,
            serializedName: 'properties.schedulingPriority',
            defaultValue: 'normal',
            type: {
              name: 'String'
            }
          },
          cluster: {
            required: true,
            serializedName: 'properties.cluster',
            type: {
              name: 'Composite',
              className: 'ResourceId'
            }
          },
          mountVolumes: {
            required: false,
            serializedName: 'properties.mountVolumes',
            type: {
              name: 'Composite',
              className: 'MountVolumes'
            }
          },
          nodeCount: {
            required: true,
            serializedName: 'properties.nodeCount',
            type: {
              name: 'Number'
            }
          },
          containerSettings: {
            required: false,
            serializedName: 'properties.containerSettings',
            type: {
              name: 'Composite',
              className: 'ContainerSettings'
            }
          },
          cntkSettings: {
            required: false,
            serializedName: 'properties.cntkSettings',
            type: {
              name: 'Composite',
              className: 'CNTKsettings'
            }
          },
          pyTorchSettings: {
            required: false,
            serializedName: 'properties.pyTorchSettings',
            type: {
              name: 'Composite',
              className: 'PyTorchSettings'
            }
          },
          tensorFlowSettings: {
            required: false,
            serializedName: 'properties.tensorFlowSettings',
            type: {
              name: 'Composite',
              className: 'TensorFlowSettings'
            }
          },
          caffeSettings: {
            required: false,
            serializedName: 'properties.caffeSettings',
            type: {
              name: 'Composite',
              className: 'CaffeSettings'
            }
          },
          caffe2Settings: {
            required: false,
            serializedName: 'properties.caffe2Settings',
            type: {
              name: 'Composite',
              className: 'Caffe2Settings'
            }
          },
          chainerSettings: {
            required: false,
            serializedName: 'properties.chainerSettings',
            type: {
              name: 'Composite',
              className: 'ChainerSettings'
            }
          },
          customToolkitSettings: {
            required: false,
            serializedName: 'properties.customToolkitSettings',
            type: {
              name: 'Composite',
              className: 'CustomToolkitSettings'
            }
          },
          customMpiSettings: {
            required: false,
            serializedName: 'properties.customMpiSettings',
            type: {
              name: 'Composite',
              className: 'CustomMpiSettings'
            }
          },
          horovodSettings: {
            required: false,
            serializedName: 'properties.horovodSettings',
            type: {
              name: 'Composite',
              className: 'HorovodSettings'
            }
          },
          jobPreparation: {
            required: false,
            serializedName: 'properties.jobPreparation',
            type: {
              name: 'Composite',
              className: 'JobPreparation'
            }
          },
          stdOutErrPathPrefix: {
            required: true,
            serializedName: 'properties.stdOutErrPathPrefix',
            type: {
              name: 'String'
            }
          },
          inputDirectories: {
            required: false,
            serializedName: 'properties.inputDirectories',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'InputDirectoryElementType',
                  type: {
                    name: 'Composite',
                    className: 'InputDirectory'
                  }
              }
            }
          },
          outputDirectories: {
            required: false,
            serializedName: 'properties.outputDirectories',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'OutputDirectoryElementType',
                  type: {
                    name: 'Composite',
                    className: 'OutputDirectory'
                  }
              }
            }
          },
          environmentVariables: {
            required: false,
            serializedName: 'properties.environmentVariables',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'EnvironmentVariableElementType',
                  type: {
                    name: 'Composite',
                    className: 'EnvironmentVariable'
                  }
              }
            }
          },
          secrets: {
            required: false,
            serializedName: 'properties.secrets',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'EnvironmentVariableWithSecretValueElementType',
                  type: {
                    name: 'Composite',
                    className: 'EnvironmentVariableWithSecretValue'
                  }
              }
            }
          },
          constraints: {
            required: false,
            serializedName: 'properties.constraints',
            type: {
              name: 'Composite',
              className: 'JobBasePropertiesConstraints'
            }
          }
        }
      }
    };
  }
}

module.exports = JobCreateParameters;
