|  |  | 1 |  | // Copyright (c) Microsoft Corporation. All rights reserved. | 
|  |  | 2 |  | // Licensed under the MIT License. See License.txt in the project root for | 
|  |  | 3 |  | // license information. | 
|  |  | 4 |  |  | 
|  |  | 5 |  | namespace Microsoft.Azure.HDInsight.Job.Models | 
|  |  | 6 |  | { | 
|  |  | 7 |  |     using System.Collections.Generic; | 
|  |  | 8 |  |  | 
|  |  | 9 |  |     /// <summary> | 
|  |  | 10 |  |     /// Parameters specifying the HDInsight Hive job definition. | 
|  |  | 11 |  |     /// </summary> | 
|  |  | 12 |  |     public partial class SqoopJobSubmissionParameters | 
|  |  | 13 |  |     { | 
|  |  | 14 |  |         /// <summary> | 
|  |  | 15 |  |         /// Optional. Gets or sets the command to use for a Sqoop job. | 
|  |  | 16 |  |         /// </summary> | 
|  | 12 | 17 |  |         public string Command { get; set; } | 
|  |  | 18 |  |  | 
|  |  | 19 |  |         /// <summary> | 
|  |  | 20 |  |         /// Optional. Gets or sets the command file to use for a Sqoop job. | 
|  |  | 21 |  |         /// </summary> | 
|  | 0 | 22 |  |         public string File { get; set; } | 
|  |  | 23 |  |  | 
|  |  | 24 |  |         /// <summary> | 
|  |  | 25 |  |         /// Optional. Gets or sets the files to be copied to the cluster. | 
|  |  | 26 |  |         /// </summary> | 
|  | 0 | 27 |  |         public IList<string> Files { get; set; } | 
|  |  | 28 |  |  | 
|  |  | 29 |  |         /// <summary> | 
|  |  | 30 |  |         /// Optional. Directory where libjar can be found to use by Sqoop. | 
|  |  | 31 |  |         /// </summary> | 
|  | 0 | 32 |  |         public string LibDir { get; set; } | 
|  |  | 33 |  |  | 
|  |  | 34 |  |         /// <summary> | 
|  |  | 35 |  |         /// Optional. Status directory in the default storage account to store job files stderr, stdout and exit. | 
|  |  | 36 |  |         /// </summary> | 
|  | 8 | 37 |  |         public string StatusDir { get; set; } | 
|  |  | 38 |  |  | 
|  |  | 39 |  |         /// <summary> | 
|  |  | 40 |  |         /// Initializes a new instance of the SqoopJobSubmissionParameters | 
|  |  | 41 |  |         /// class. | 
|  |  | 42 |  |         /// </summary> | 
|  | 4 | 43 |  |         public SqoopJobSubmissionParameters() | 
|  |  | 44 |  |         { | 
|  | 4 | 45 |  |         } | 
|  |  | 46 |  |  | 
|  |  | 47 |  |         internal string GetJobPostRequestContent() | 
|  |  | 48 |  |         { | 
|  |  | 49 |  |             // Check input parameters and transform them to required format before sending request to templeton. | 
|  | 4 | 50 |  |             var values = new List<KeyValuePair<string, string>>(); | 
|  |  | 51 |  |  | 
|  | 4 | 52 |  |             if (!string.IsNullOrEmpty(this.Command)) | 
|  |  | 53 |  |             { | 
|  | 4 | 54 |  |                 values.Add(new KeyValuePair<string, string>("command", this.Command)); | 
|  |  | 55 |  |             } | 
|  |  | 56 |  |  | 
|  | 4 | 57 |  |             if (!string.IsNullOrEmpty(this.File)) | 
|  |  | 58 |  |             { | 
|  | 0 | 59 |  |                 values.Add(new KeyValuePair<string, string>("file", this.File)); | 
|  |  | 60 |  |             } | 
|  |  | 61 |  |  | 
|  | 4 | 62 |  |             if (!string.IsNullOrEmpty(this.LibDir)) | 
|  |  | 63 |  |             { | 
|  | 0 | 64 |  |                 values.Add(new KeyValuePair<string, string>("libdir", this.LibDir)); | 
|  |  | 65 |  |             } | 
|  |  | 66 |  |  | 
|  | 4 | 67 |  |             if (this.Files != null && this.Files.Count > 0) | 
|  |  | 68 |  |             { | 
|  | 0 | 69 |  |                 values.Add(new KeyValuePair<string, string>("files", ModelHelper.BuildListToCommaSeparatedString(this.Fi | 
|  |  | 70 |  |             } | 
|  |  | 71 |  |  | 
|  | 4 | 72 |  |             values.Add(new KeyValuePair<string, string>("statusdir", ModelHelper.GetStatusDirectory(this.StatusDir))); | 
|  |  | 73 |  |  | 
|  | 4 | 74 |  |             return ModelHelper.ConvertItemsToString(values); | 
|  |  | 75 |  |         } | 
|  |  | 76 |  |     } | 
|  |  | 77 |  | } |