| | 1 | | // <auto-generated> |
| | 2 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 3 | | // Licensed under the MIT License. See License.txt in the project root for |
| | 4 | | // license information. |
| | 5 | | // |
| | 6 | | // Code generated by Microsoft (R) AutoRest Code Generator. |
| | 7 | | // Changes may cause incorrect behavior and will be lost if the code is |
| | 8 | | // regenerated. |
| | 9 | | // </auto-generated> |
| | 10 | |
|
| | 11 | | namespace Microsoft.Azure.HDInsight.Job |
| | 12 | | { |
| | 13 | | using Microsoft.Rest; |
| | 14 | | using Microsoft.Rest.Azure; |
| | 15 | | using Microsoft.Rest.Serialization; |
| | 16 | | using Models; |
| | 17 | | using Newtonsoft.Json; |
| | 18 | | using System.Collections; |
| | 19 | | using System.Collections.Generic; |
| | 20 | | using System.Linq; |
| | 21 | | using System.Net; |
| | 22 | | using System.Net.Http; |
| | 23 | |
|
| | 24 | | /// <summary> |
| | 25 | | /// The HDInsight Job Client. |
| | 26 | | /// </summary> |
| | 27 | | public partial class HDInsightJobClient : ServiceClient<HDInsightJobClient>, IHDInsightJobClient, IAzureClient |
| | 28 | | { |
| | 29 | | /// <summary> |
| | 30 | | /// The base URI of the service. |
| | 31 | | /// </summary> |
| 614 | 32 | | internal string BaseUri {get; set;} |
| | 33 | |
|
| | 34 | | /// <summary> |
| | 35 | | /// Gets or sets json serialization settings. |
| | 36 | | /// </summary> |
| 124 | 37 | | public JsonSerializerSettings SerializationSettings { get; private set; } |
| | 38 | |
|
| | 39 | | /// <summary> |
| | 40 | | /// Gets or sets json deserialization settings. |
| | 41 | | /// </summary> |
| 672 | 42 | | public JsonSerializerSettings DeserializationSettings { get; private set; } |
| | 43 | |
|
| | 44 | | /// <summary> |
| | 45 | | /// Credentials needed for the client to connect to Azure. |
| | 46 | | /// </summary> |
| 1284 | 47 | | public ServiceClientCredentials Credentials { get; private set; } |
| | 48 | |
|
| | 49 | | /// <summary> |
| | 50 | | /// The cluster endpoint, for example https://clustername.azurehdinsight.net. |
| | 51 | | /// </summary> |
| 1172 | 52 | | public string Endpoint { get; set; } |
| | 53 | |
|
| | 54 | | /// <summary> |
| | 55 | | /// The user name used for running job. |
| | 56 | | /// </summary> |
| 346 | 57 | | public string Username { get; set; } |
| | 58 | |
|
| | 59 | | /// <summary> |
| | 60 | | /// The preferred language for the response. |
| | 61 | | /// </summary> |
| 1170 | 62 | | public string AcceptLanguage { get; set; } |
| | 63 | |
|
| | 64 | | /// <summary> |
| | 65 | | /// The retry timeout in seconds for Long Running Operations. Default value is |
| | 66 | | /// 30. |
| | 67 | | /// </summary> |
| 0 | 68 | | public int? LongRunningOperationRetryTimeout { get; set; } |
| | 69 | |
|
| | 70 | | /// <summary> |
| | 71 | | /// Whether a unique x-ms-client-request-id should be generated. When set to |
| | 72 | | /// true a unique x-ms-client-request-id value is generated and included in |
| | 73 | | /// each request. Default is true. |
| | 74 | | /// </summary> |
| 1170 | 75 | | public bool? GenerateClientRequestId { get; set; } |
| | 76 | |
|
| | 77 | | /// <summary> |
| | 78 | | /// Gets the IJobOperations. |
| | 79 | | /// </summary> |
| 210 | 80 | | public virtual IJobOperations Job { get; private set; } |
| | 81 | |
|
| | 82 | | /// <summary> |
| | 83 | | /// Initializes a new instance of the HDInsightJobClient class. |
| | 84 | | /// </summary> |
| | 85 | | /// <param name='httpClient'> |
| | 86 | | /// HttpClient to be used |
| | 87 | | /// </param> |
| | 88 | | /// <param name='disposeHttpClient'> |
| | 89 | | /// True: will dispose the provided httpClient on calling HDInsightJobClient.Dispose(). False: will not dispose |
| 2 | 90 | | protected HDInsightJobClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient |
| | 91 | | { |
| 2 | 92 | | Initialize(); |
| 2 | 93 | | } |
| | 94 | |
|
| | 95 | | /// <summary> |
| | 96 | | /// Initializes a new instance of the HDInsightJobClient class. |
| | 97 | | /// </summary> |
| | 98 | | /// <param name='handlers'> |
| | 99 | | /// Optional. The delegating handlers to add to the http client pipeline. |
| | 100 | | /// </param> |
| 56 | 101 | | protected HDInsightJobClient(params DelegatingHandler[] handlers) : base(handlers) |
| | 102 | | { |
| 56 | 103 | | Initialize(); |
| 56 | 104 | | } |
| | 105 | |
|
| | 106 | | /// <summary> |
| | 107 | | /// Initializes a new instance of the HDInsightJobClient class. |
| | 108 | | /// </summary> |
| | 109 | | /// <param name='rootHandler'> |
| | 110 | | /// Optional. The http client handler used to handle http transport. |
| | 111 | | /// </param> |
| | 112 | | /// <param name='handlers'> |
| | 113 | | /// Optional. The delegating handlers to add to the http client pipeline. |
| | 114 | | /// </param> |
| 0 | 115 | | protected HDInsightJobClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHand |
| | 116 | | { |
| 0 | 117 | | Initialize(); |
| 0 | 118 | | } |
| | 119 | |
|
| | 120 | | /// <summary> |
| | 121 | | /// Initializes a new instance of the HDInsightJobClient class. |
| | 122 | | /// </summary> |
| | 123 | | /// <param name='credentials'> |
| | 124 | | /// Required. Credentials needed for the client to connect to Azure. |
| | 125 | | /// </param> |
| | 126 | | /// <param name='handlers'> |
| | 127 | | /// Optional. The delegating handlers to add to the http client pipeline. |
| | 128 | | /// </param> |
| | 129 | | /// <exception cref="System.ArgumentNullException"> |
| | 130 | | /// Thrown when a required parameter is null |
| | 131 | | /// </exception> |
| 56 | 132 | | internal HDInsightJobClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(ha |
| | 133 | | { |
| 56 | 134 | | if (credentials == null) |
| | 135 | | { |
| 0 | 136 | | throw new System.ArgumentNullException("credentials"); |
| | 137 | | } |
| 56 | 138 | | Credentials = credentials; |
| 56 | 139 | | if (Credentials != null) |
| | 140 | | { |
| 56 | 141 | | Credentials.InitializeServiceClient(this); |
| | 142 | | } |
| 56 | 143 | | } |
| | 144 | |
|
| | 145 | | /// <summary> |
| | 146 | | /// Initializes a new instance of the HDInsightJobClient class. |
| | 147 | | /// </summary> |
| | 148 | | /// <param name='credentials'> |
| | 149 | | /// Required. Credentials needed for the client to connect to Azure. |
| | 150 | | /// </param> |
| | 151 | | /// <param name='httpClient'> |
| | 152 | | /// HttpClient to be used |
| | 153 | | /// </param> |
| | 154 | | /// <param name='disposeHttpClient'> |
| | 155 | | /// True: will dispose the provided httpClient on calling HDInsightJobClient.Dispose(). False: will not dispose |
| | 156 | | /// <exception cref="System.ArgumentNullException"> |
| | 157 | | /// Thrown when a required parameter is null |
| | 158 | | /// </exception> |
| 0 | 159 | | internal HDInsightJobClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) |
| | 160 | | { |
| 0 | 161 | | if (credentials == null) |
| | 162 | | { |
| 0 | 163 | | throw new System.ArgumentNullException("credentials"); |
| | 164 | | } |
| 0 | 165 | | Credentials = credentials; |
| 0 | 166 | | if (Credentials != null) |
| | 167 | | { |
| 0 | 168 | | Credentials.InitializeServiceClient(this); |
| | 169 | | } |
| 0 | 170 | | } |
| | 171 | |
|
| | 172 | | /// <summary> |
| | 173 | | /// Initializes a new instance of the HDInsightJobClient class. |
| | 174 | | /// </summary> |
| | 175 | | /// <param name='credentials'> |
| | 176 | | /// Required. Credentials needed for the client to connect to Azure. |
| | 177 | | /// </param> |
| | 178 | | /// <param name='rootHandler'> |
| | 179 | | /// Optional. The http client handler used to handle http transport. |
| | 180 | | /// </param> |
| | 181 | | /// <param name='handlers'> |
| | 182 | | /// Optional. The delegating handlers to add to the http client pipeline. |
| | 183 | | /// </param> |
| | 184 | | /// <exception cref="System.ArgumentNullException"> |
| | 185 | | /// Thrown when a required parameter is null |
| | 186 | | /// </exception> |
| 0 | 187 | | internal HDInsightJobClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params Delegati |
| | 188 | | { |
| 0 | 189 | | if (credentials == null) |
| | 190 | | { |
| 0 | 191 | | throw new System.ArgumentNullException("credentials"); |
| | 192 | | } |
| 0 | 193 | | Credentials = credentials; |
| 0 | 194 | | if (Credentials != null) |
| | 195 | | { |
| 0 | 196 | | Credentials.InitializeServiceClient(this); |
| | 197 | | } |
| 0 | 198 | | } |
| | 199 | |
|
| | 200 | | /// <summary> |
| | 201 | | /// An optional partial-method to perform custom initialization. |
| | 202 | | /// </summary> |
| | 203 | | partial void CustomInitialize(); |
| | 204 | | /// <summary> |
| | 205 | | /// Initializes client properties. |
| | 206 | | /// </summary> |
| | 207 | | private void Initialize() |
| | 208 | | { |
| 58 | 209 | | Job = new JobOperations(this); |
| 58 | 210 | | BaseUri = "https://{endpoint}"; |
| 58 | 211 | | AcceptLanguage = "en-US"; |
| 58 | 212 | | LongRunningOperationRetryTimeout = 30; |
| 58 | 213 | | GenerateClientRequestId = true; |
| 58 | 214 | | SerializationSettings = new JsonSerializerSettings |
| 58 | 215 | | { |
| 58 | 216 | | Formatting = Newtonsoft.Json.Formatting.Indented, |
| 58 | 217 | | DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, |
| 58 | 218 | | DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, |
| 58 | 219 | | NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, |
| 58 | 220 | | ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, |
| 58 | 221 | | ContractResolver = new ReadOnlyJsonContractResolver(), |
| 58 | 222 | | Converters = new List<JsonConverter> |
| 58 | 223 | | { |
| 58 | 224 | | new Iso8601TimeSpanConverter() |
| 58 | 225 | | } |
| 58 | 226 | | }; |
| 58 | 227 | | DeserializationSettings = new JsonSerializerSettings |
| 58 | 228 | | { |
| 58 | 229 | | DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, |
| 58 | 230 | | DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, |
| 58 | 231 | | NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, |
| 58 | 232 | | ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, |
| 58 | 233 | | ContractResolver = new ReadOnlyJsonContractResolver(), |
| 58 | 234 | | Converters = new List<JsonConverter> |
| 58 | 235 | | { |
| 58 | 236 | | new Iso8601TimeSpanConverter() |
| 58 | 237 | | } |
| 58 | 238 | | }; |
| 58 | 239 | | CustomInitialize(); |
| 58 | 240 | | DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); |
| 58 | 241 | | } |
| | 242 | | } |
| | 243 | | } |