| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | // This file was automatically generated. Do not edit. |
| | 5 | |
|
| | 6 | | #pragma warning disable IDE0016 // Null check can be simplified |
| | 7 | | #pragma warning disable IDE0017 // Variable declaration can be inlined |
| | 8 | | #pragma warning disable IDE0018 // Object initialization can be simplified |
| | 9 | | #pragma warning disable SA1402 // File may only contain a single type |
| | 10 | |
|
| | 11 | | #region Service |
| | 12 | | namespace Azure.Storage.Files.DataLake |
| | 13 | | { |
| | 14 | | /// <summary> |
| | 15 | | /// Azure Data Lake Storage REST API |
| | 16 | | /// Azure Data Lake Storage provides storage for Hadoop and other big data workloads. |
| | 17 | | /// </summary> |
| | 18 | | internal static partial class DataLakeRestClient |
| | 19 | | { |
| | 20 | | #region Service operations |
| | 21 | | /// <summary> |
| | 22 | | /// Service operations for Azure Data Lake Storage REST API |
| | 23 | | /// </summary> |
| | 24 | | public static partial class Service |
| | 25 | | { |
| | 26 | | #region Service.ListFileSystemsAsync |
| | 27 | | /// <summary> |
| | 28 | | /// List filesystems and their properties in given account. |
| | 29 | | /// </summary> |
| | 30 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param> |
| | 31 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 32 | | /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de |
| | 33 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 34 | | /// <param name="prefix">Filters results to filesystems within the specified prefix.</param> |
| | 35 | | /// <param name="continuation">Optional. When deleting a directory, the number of paths that are deleted wi |
| | 36 | | /// <param name="maxResults">An optional value that specifies the maximum number of items to return. If omit |
| | 37 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 38 | | /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href=" |
| | 39 | | /// <param name="async">Whether to invoke the operation asynchronously. The default value is true.</param> |
| | 40 | | /// <param name="operationName">Operation name.</param> |
| | 41 | | /// <param name="cancellationToken">Cancellation token.</param> |
| | 42 | | /// <returns>Azure.Response{Azure.Storage.Files.DataLake.Models.ServiceListFileSystemsResult}</returns> |
| | 43 | | public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.DataLake.Models.Serv |
| | 44 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 45 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 46 | | System.Uri resourceUri, |
| | 47 | | string version, |
| | 48 | | string prefix = default, |
| | 49 | | string continuation = default, |
| | 50 | | int? maxResults = default, |
| | 51 | | string requestId = default, |
| | 52 | | int? timeout = default, |
| | 53 | | bool async = true, |
| | 54 | | string operationName = "ServiceClient.ListFileSystems", |
| | 55 | | System.Threading.CancellationToken cancellationToken = default) |
| | 56 | | { |
| | 57 | | Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName); |
| | 58 | | try |
| | 59 | | { |
| | 60 | | _scope.AddAttribute("url", resourceUri); |
| | 61 | | _scope.Start(); |
| | 62 | | using (Azure.Core.HttpMessage _message = ListFileSystemsAsync_CreateMessage( |
| | 63 | | pipeline, |
| | 64 | | resourceUri, |
| | 65 | | version, |
| | 66 | | prefix, |
| | 67 | | continuation, |
| | 68 | | maxResults, |
| | 69 | | requestId, |
| | 70 | | timeout)) |
| | 71 | | { |
| | 72 | | if (async) |
| | 73 | | { |
| | 74 | | // Send the request asynchronously if we're being called via an async path |
| | 75 | | await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false); |
| | 76 | | } |
| | 77 | | else |
| | 78 | | { |
| | 79 | | // Send the request synchronously through the API that blocks if we're being called via a sy |
| | 80 | | // (this is safe because the Task will complete before the user can call Wait) |
| | 81 | | pipeline.Send(_message, cancellationToken); |
| | 82 | | } |
| | 83 | | Azure.Response _response = _message.Response; |
| | 84 | | cancellationToken.ThrowIfCancellationRequested(); |
| | 85 | | return ListFileSystemsAsync_CreateResponse(clientDiagnostics, _response); |
| | 86 | | } |
| | 87 | | } |
| | 88 | | catch (System.Exception ex) |
| | 89 | | { |
| | 90 | | _scope.Failed(ex); |
| | 91 | | throw; |
| | 92 | | } |
| | 93 | | finally |
| | 94 | | { |
| | 95 | | _scope.Dispose(); |
| | 96 | | } |
| | 97 | | } |
| | 98 | |
|
| | 99 | | /// <summary> |
| | 100 | | /// Create the Service.ListFileSystemsAsync request. |
| | 101 | | /// </summary> |
| | 102 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 103 | | /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de |
| | 104 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 105 | | /// <param name="prefix">Filters results to filesystems within the specified prefix.</param> |
| | 106 | | /// <param name="continuation">Optional. When deleting a directory, the number of paths that are deleted wi |
| | 107 | | /// <param name="maxResults">An optional value that specifies the maximum number of items to return. If omit |
| | 108 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 109 | | /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href=" |
| | 110 | | /// <returns>The Service.ListFileSystemsAsync Message.</returns> |
| | 111 | | internal static Azure.Core.HttpMessage ListFileSystemsAsync_CreateMessage( |
| | 112 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 113 | | System.Uri resourceUri, |
| | 114 | | string version, |
| | 115 | | string prefix = default, |
| | 116 | | string continuation = default, |
| | 117 | | int? maxResults = default, |
| | 118 | | string requestId = default, |
| | 119 | | int? timeout = default) |
| | 120 | | { |
| | 121 | | // Validation |
| | 122 | | if (resourceUri == null) |
| | 123 | | { |
| | 124 | | throw new System.ArgumentNullException(nameof(resourceUri)); |
| | 125 | | } |
| | 126 | | if (version == null) |
| | 127 | | { |
| | 128 | | throw new System.ArgumentNullException(nameof(version)); |
| | 129 | | } |
| | 130 | |
|
| | 131 | | // Create the request |
| | 132 | | Azure.Core.HttpMessage _message = pipeline.CreateMessage(); |
| | 133 | | Azure.Core.Request _request = _message.Request; |
| | 134 | |
|
| | 135 | | // Set the endpoint |
| | 136 | | _request.Method = Azure.Core.RequestMethod.Get; |
| | 137 | | _request.Uri.Reset(resourceUri); |
| | 138 | | _request.Uri.AppendQuery("resource", "account", escapeValue: false); |
| | 139 | | if (prefix != null) { _request.Uri.AppendQuery("prefix", prefix); } |
| | 140 | | if (continuation != null) { _request.Uri.AppendQuery("continuation", continuation); } |
| | 141 | | if (maxResults != null) { _request.Uri.AppendQuery("maxResults", maxResults.Value.ToString(System.Global |
| | 142 | | if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C |
| | 143 | |
|
| | 144 | | // Add request headers |
| | 145 | | _request.Headers.SetValue("x-ms-version", version); |
| | 146 | | if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } |
| | 147 | |
|
| | 148 | | return _message; |
| | 149 | | } |
| | 150 | |
|
| | 151 | | /// <summary> |
| | 152 | | /// Create the Service.ListFileSystemsAsync response or throw a failure exception. |
| | 153 | | /// </summary> |
| | 154 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param> |
| | 155 | | /// <param name="response">The raw Response.</param> |
| | 156 | | /// <returns>The Service.ListFileSystemsAsync Azure.Response{Azure.Storage.Files.DataLake.Models.ServiceList |
| | 157 | | internal static Azure.Response<Azure.Storage.Files.DataLake.Models.ServiceListFileSystemsResult> ListFileSys |
| | 158 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 159 | | Azure.Response response) |
| | 160 | | { |
| | 161 | | // Process the response |
| | 162 | | switch (response.Status) |
| | 163 | | { |
| | 164 | | case 200: |
| | 165 | | { |
| | 166 | | // Create the result |
| | 167 | | System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X |
| | 168 | | Azure.Storage.Files.DataLake.Models.ServiceListFileSystemsResult _value = new Azure.Storage.File |
| | 169 | | _value.Body = Azure.Storage.Files.DataLake.Models.FileSystemList.FromXml(_xml.Root); |
| | 170 | |
|
| | 171 | | // Get response headers |
| | 172 | | string _header; |
| | 173 | | if (response.Headers.TryGetValue("x-ms-continuation", out _header)) |
| | 174 | | { |
| | 175 | | _value.Continuation = _header; |
| | 176 | | } |
| | 177 | | if (response.Headers.TryGetValue("Content-Type", out _header)) |
| | 178 | | { |
| | 179 | | _value.ContentType = _header; |
| | 180 | | } |
| | 181 | |
|
| | 182 | | // Create the response |
| | 183 | | return Response.FromValue(_value, response); |
| | 184 | | } |
| | 185 | | case 304: |
| | 186 | | { |
| | 187 | | return new Azure.NoBodyResponse<Azure.Storage.Files.DataLake.Models.ServiceListFileSystemsResult |
| | 188 | | } |
| | 189 | | default: |
| | 190 | | { |
| | 191 | | // Create the result |
| | 192 | | string _value; |
| | 193 | | using (System.IO.StreamReader _streamReader = new System.IO.StreamReader(response.ContentStream) |
| | 194 | | { |
| | 195 | | _value = _streamReader.ReadToEnd(); |
| | 196 | | } |
| | 197 | |
|
| | 198 | | throw _value.CreateException(clientDiagnostics, response); |
| | 199 | | } |
| | 200 | | } |
| | 201 | | } |
| | 202 | | #endregion Service.ListFileSystemsAsync |
| | 203 | | } |
| | 204 | | #endregion Service operations |
| | 205 | |
|
| | 206 | | #region FileSystem operations |
| | 207 | | /// <summary> |
| | 208 | | /// FileSystem operations for Azure Data Lake Storage REST API |
| | 209 | | /// </summary> |
| | 210 | | public static partial class FileSystem |
| | 211 | | { |
| | 212 | | #region FileSystem.CreateAsync |
| | 213 | | /// <summary> |
| | 214 | | /// Create a FileSystem rooted at the specified location. If the FileSystem already exists, the operation fa |
| | 215 | | /// </summary> |
| | 216 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param> |
| | 217 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 218 | | /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de |
| | 219 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 220 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 221 | | /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href=" |
| | 222 | | /// <param name="properties">Optional. User-defined properties to be stored with the filesystem, in the form |
| | 223 | | /// <param name="async">Whether to invoke the operation asynchronously. The default value is true.</param> |
| | 224 | | /// <param name="operationName">Operation name.</param> |
| | 225 | | /// <param name="cancellationToken">Cancellation token.</param> |
| | 226 | | /// <returns>Azure.Response{Azure.Storage.Files.DataLake.Models.FileSystemCreateResult}</returns> |
| | 227 | | public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.DataLake.Models.File |
| | 228 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 229 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 230 | | System.Uri resourceUri, |
| | 231 | | string version, |
| | 232 | | string requestId = default, |
| | 233 | | int? timeout = default, |
| | 234 | | string properties = default, |
| | 235 | | bool async = true, |
| | 236 | | string operationName = "FileSystemClient.Create", |
| | 237 | | System.Threading.CancellationToken cancellationToken = default) |
| | 238 | | { |
| | 239 | | Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName); |
| | 240 | | try |
| | 241 | | { |
| | 242 | | _scope.AddAttribute("url", resourceUri); |
| | 243 | | _scope.Start(); |
| | 244 | | using (Azure.Core.HttpMessage _message = CreateAsync_CreateMessage( |
| | 245 | | pipeline, |
| | 246 | | resourceUri, |
| | 247 | | version, |
| | 248 | | requestId, |
| | 249 | | timeout, |
| | 250 | | properties)) |
| | 251 | | { |
| | 252 | | if (async) |
| | 253 | | { |
| | 254 | | // Send the request asynchronously if we're being called via an async path |
| | 255 | | await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false); |
| | 256 | | } |
| | 257 | | else |
| | 258 | | { |
| | 259 | | // Send the request synchronously through the API that blocks if we're being called via a sy |
| | 260 | | // (this is safe because the Task will complete before the user can call Wait) |
| | 261 | | pipeline.Send(_message, cancellationToken); |
| | 262 | | } |
| | 263 | | Azure.Response _response = _message.Response; |
| | 264 | | cancellationToken.ThrowIfCancellationRequested(); |
| | 265 | | return CreateAsync_CreateResponse(clientDiagnostics, _response); |
| | 266 | | } |
| | 267 | | } |
| | 268 | | catch (System.Exception ex) |
| | 269 | | { |
| | 270 | | _scope.Failed(ex); |
| | 271 | | throw; |
| | 272 | | } |
| | 273 | | finally |
| | 274 | | { |
| | 275 | | _scope.Dispose(); |
| | 276 | | } |
| | 277 | | } |
| | 278 | |
|
| | 279 | | /// <summary> |
| | 280 | | /// Create the FileSystem.CreateAsync request. |
| | 281 | | /// </summary> |
| | 282 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 283 | | /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de |
| | 284 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 285 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 286 | | /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href=" |
| | 287 | | /// <param name="properties">Optional. User-defined properties to be stored with the filesystem, in the form |
| | 288 | | /// <returns>The FileSystem.CreateAsync Message.</returns> |
| | 289 | | internal static Azure.Core.HttpMessage CreateAsync_CreateMessage( |
| | 290 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 291 | | System.Uri resourceUri, |
| | 292 | | string version, |
| | 293 | | string requestId = default, |
| | 294 | | int? timeout = default, |
| | 295 | | string properties = default) |
| | 296 | | { |
| | 297 | | // Validation |
| | 298 | | if (resourceUri == null) |
| | 299 | | { |
| | 300 | | throw new System.ArgumentNullException(nameof(resourceUri)); |
| | 301 | | } |
| | 302 | | if (version == null) |
| | 303 | | { |
| | 304 | | throw new System.ArgumentNullException(nameof(version)); |
| | 305 | | } |
| | 306 | |
|
| | 307 | | // Create the request |
| | 308 | | Azure.Core.HttpMessage _message = pipeline.CreateMessage(); |
| | 309 | | Azure.Core.Request _request = _message.Request; |
| | 310 | |
|
| | 311 | | // Set the endpoint |
| | 312 | | _request.Method = Azure.Core.RequestMethod.Put; |
| | 313 | | _request.Uri.Reset(resourceUri); |
| | 314 | | _request.Uri.AppendQuery("resource", "filesystem", escapeValue: false); |
| | 315 | | if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C |
| | 316 | |
|
| | 317 | | // Add request headers |
| | 318 | | _request.Headers.SetValue("x-ms-version", version); |
| | 319 | | if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } |
| | 320 | | if (properties != null) { _request.Headers.SetValue("x-ms-properties", properties); } |
| | 321 | |
|
| | 322 | | return _message; |
| | 323 | | } |
| | 324 | |
|
| | 325 | | /// <summary> |
| | 326 | | /// Create the FileSystem.CreateAsync response or throw a failure exception. |
| | 327 | | /// </summary> |
| | 328 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param> |
| | 329 | | /// <param name="response">The raw Response.</param> |
| | 330 | | /// <returns>The FileSystem.CreateAsync Azure.Response{Azure.Storage.Files.DataLake.Models.FileSystemCreateR |
| | 331 | | internal static Azure.Response<Azure.Storage.Files.DataLake.Models.FileSystemCreateResult> CreateAsync_Creat |
| | 332 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 333 | | Azure.Response response) |
| | 334 | | { |
| | 335 | | // Process the response |
| | 336 | | switch (response.Status) |
| | 337 | | { |
| | 338 | | case 201: |
| | 339 | | { |
| | 340 | | // Create the result |
| | 341 | | Azure.Storage.Files.DataLake.Models.FileSystemCreateResult _value = new Azure.Storage.Files.Data |
| | 342 | |
|
| | 343 | | // Get response headers |
| | 344 | | string _header; |
| | 345 | | if (response.Headers.TryGetValue("ETag", out _header)) |
| | 346 | | { |
| | 347 | | _value.ETag = new Azure.ETag(_header); |
| | 348 | | } |
| | 349 | | if (response.Headers.TryGetValue("Last-Modified", out _header)) |
| | 350 | | { |
| | 351 | | _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo. |
| | 352 | | } |
| | 353 | | if (response.Headers.TryGetValue("x-ms-namespace-enabled", out _header)) |
| | 354 | | { |
| | 355 | | _value.NamespaceEnabled = _header; |
| | 356 | | } |
| | 357 | |
|
| | 358 | | // Create the response |
| | 359 | | return Response.FromValue(_value, response); |
| | 360 | | } |
| | 361 | | default: |
| | 362 | | { |
| | 363 | | // Create the result |
| | 364 | | string _value; |
| | 365 | | using (System.IO.StreamReader _streamReader = new System.IO.StreamReader(response.ContentStream) |
| | 366 | | { |
| | 367 | | _value = _streamReader.ReadToEnd(); |
| | 368 | | } |
| | 369 | |
|
| | 370 | | throw _value.CreateException(clientDiagnostics, response); |
| | 371 | | } |
| | 372 | | } |
| | 373 | | } |
| | 374 | | #endregion FileSystem.CreateAsync |
| | 375 | |
|
| | 376 | | #region FileSystem.SetPropertiesAsync |
| | 377 | | /// <summary> |
| | 378 | | /// Set properties for the FileSystem. This operation supports conditional HTTP requests. For more informa |
| | 379 | | /// </summary> |
| | 380 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param> |
| | 381 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 382 | | /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de |
| | 383 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 384 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 385 | | /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href=" |
| | 386 | | /// <param name="properties">Optional. User-defined properties to be stored with the filesystem, in the form |
| | 387 | | /// <param name="ifModifiedSince">Specify this header value to operate only on a blob if it has been modifie |
| | 388 | | /// <param name="ifUnmodifiedSince">Specify this header value to operate only on a blob if it has not been m |
| | 389 | | /// <param name="async">Whether to invoke the operation asynchronously. The default value is true.</param> |
| | 390 | | /// <param name="operationName">Operation name.</param> |
| | 391 | | /// <param name="cancellationToken">Cancellation token.</param> |
| | 392 | | /// <returns>Azure.Response{Azure.Storage.Files.DataLake.Models.FileSystemSetPropertiesResult}</returns> |
| | 393 | | public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.DataLake.Models.File |
| | 394 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 395 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 396 | | System.Uri resourceUri, |
| | 397 | | string version, |
| | 398 | | string requestId = default, |
| | 399 | | int? timeout = default, |
| | 400 | | string properties = default, |
| | 401 | | System.DateTimeOffset? ifModifiedSince = default, |
| | 402 | | System.DateTimeOffset? ifUnmodifiedSince = default, |
| | 403 | | bool async = true, |
| | 404 | | string operationName = "FileSystemClient.SetProperties", |
| | 405 | | System.Threading.CancellationToken cancellationToken = default) |
| | 406 | | { |
| | 407 | | Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName); |
| | 408 | | try |
| | 409 | | { |
| | 410 | | _scope.AddAttribute("url", resourceUri); |
| | 411 | | _scope.Start(); |
| | 412 | | using (Azure.Core.HttpMessage _message = SetPropertiesAsync_CreateMessage( |
| | 413 | | pipeline, |
| | 414 | | resourceUri, |
| | 415 | | version, |
| | 416 | | requestId, |
| | 417 | | timeout, |
| | 418 | | properties, |
| | 419 | | ifModifiedSince, |
| | 420 | | ifUnmodifiedSince)) |
| | 421 | | { |
| | 422 | | if (async) |
| | 423 | | { |
| | 424 | | // Send the request asynchronously if we're being called via an async path |
| | 425 | | await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false); |
| | 426 | | } |
| | 427 | | else |
| | 428 | | { |
| | 429 | | // Send the request synchronously through the API that blocks if we're being called via a sy |
| | 430 | | // (this is safe because the Task will complete before the user can call Wait) |
| | 431 | | pipeline.Send(_message, cancellationToken); |
| | 432 | | } |
| | 433 | | Azure.Response _response = _message.Response; |
| | 434 | | cancellationToken.ThrowIfCancellationRequested(); |
| | 435 | | return SetPropertiesAsync_CreateResponse(clientDiagnostics, _response); |
| | 436 | | } |
| | 437 | | } |
| | 438 | | catch (System.Exception ex) |
| | 439 | | { |
| | 440 | | _scope.Failed(ex); |
| | 441 | | throw; |
| | 442 | | } |
| | 443 | | finally |
| | 444 | | { |
| | 445 | | _scope.Dispose(); |
| | 446 | | } |
| | 447 | | } |
| | 448 | |
|
| | 449 | | /// <summary> |
| | 450 | | /// Create the FileSystem.SetPropertiesAsync request. |
| | 451 | | /// </summary> |
| | 452 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 453 | | /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de |
| | 454 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 455 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 456 | | /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href=" |
| | 457 | | /// <param name="properties">Optional. User-defined properties to be stored with the filesystem, in the form |
| | 458 | | /// <param name="ifModifiedSince">Specify this header value to operate only on a blob if it has been modifie |
| | 459 | | /// <param name="ifUnmodifiedSince">Specify this header value to operate only on a blob if it has not been m |
| | 460 | | /// <returns>The FileSystem.SetPropertiesAsync Message.</returns> |
| | 461 | | internal static Azure.Core.HttpMessage SetPropertiesAsync_CreateMessage( |
| | 462 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 463 | | System.Uri resourceUri, |
| | 464 | | string version, |
| | 465 | | string requestId = default, |
| | 466 | | int? timeout = default, |
| | 467 | | string properties = default, |
| | 468 | | System.DateTimeOffset? ifModifiedSince = default, |
| | 469 | | System.DateTimeOffset? ifUnmodifiedSince = default) |
| | 470 | | { |
| | 471 | | // Validation |
| | 472 | | if (resourceUri == null) |
| | 473 | | { |
| | 474 | | throw new System.ArgumentNullException(nameof(resourceUri)); |
| | 475 | | } |
| | 476 | | if (version == null) |
| | 477 | | { |
| | 478 | | throw new System.ArgumentNullException(nameof(version)); |
| | 479 | | } |
| | 480 | |
|
| | 481 | | // Create the request |
| | 482 | | Azure.Core.HttpMessage _message = pipeline.CreateMessage(); |
| | 483 | | Azure.Core.Request _request = _message.Request; |
| | 484 | |
|
| | 485 | | // Set the endpoint |
| | 486 | | _request.Method = Azure.Core.RequestMethod.Patch; |
| | 487 | | _request.Uri.Reset(resourceUri); |
| | 488 | | _request.Uri.AppendQuery("resource", "filesystem", escapeValue: false); |
| | 489 | | if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C |
| | 490 | |
|
| | 491 | | // Add request headers |
| | 492 | | _request.Headers.SetValue("x-ms-version", version); |
| | 493 | | if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } |
| | 494 | | if (properties != null) { _request.Headers.SetValue("x-ms-properties", properties); } |
| | 495 | | if (ifModifiedSince != null) { _request.Headers.SetValue("If-Modified-Since", ifModifiedSince.Value.ToSt |
| | 496 | | if (ifUnmodifiedSince != null) { _request.Headers.SetValue("If-Unmodified-Since", ifUnmodifiedSince.Valu |
| | 497 | |
|
| | 498 | | return _message; |
| | 499 | | } |
| | 500 | |
|
| | 501 | | /// <summary> |
| | 502 | | /// Create the FileSystem.SetPropertiesAsync response or throw a failure exception. |
| | 503 | | /// </summary> |
| | 504 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param> |
| | 505 | | /// <param name="response">The raw Response.</param> |
| | 506 | | /// <returns>The FileSystem.SetPropertiesAsync Azure.Response{Azure.Storage.Files.DataLake.Models.FileSystem |
| | 507 | | internal static Azure.Response<Azure.Storage.Files.DataLake.Models.FileSystemSetPropertiesResult> SetPropert |
| | 508 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 509 | | Azure.Response response) |
| | 510 | | { |
| | 511 | | // Process the response |
| | 512 | | switch (response.Status) |
| | 513 | | { |
| | 514 | | case 200: |
| | 515 | | { |
| | 516 | | // Create the result |
| | 517 | | Azure.Storage.Files.DataLake.Models.FileSystemSetPropertiesResult _value = new Azure.Storage.Fil |
| | 518 | |
|
| | 519 | | // Get response headers |
| | 520 | | string _header; |
| | 521 | | if (response.Headers.TryGetValue("ETag", out _header)) |
| | 522 | | { |
| | 523 | | _value.ETag = new Azure.ETag(_header); |
| | 524 | | } |
| | 525 | | if (response.Headers.TryGetValue("Last-Modified", out _header)) |
| | 526 | | { |
| | 527 | | _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo. |
| | 528 | | } |
| | 529 | |
|
| | 530 | | // Create the response |
| | 531 | | return Response.FromValue(_value, response); |
| | 532 | | } |
| | 533 | | default: |
| | 534 | | { |
| | 535 | | // Create the result |
| | 536 | | string _value; |
| | 537 | | using (System.IO.StreamReader _streamReader = new System.IO.StreamReader(response.ContentStream) |
| | 538 | | { |
| | 539 | | _value = _streamReader.ReadToEnd(); |
| | 540 | | } |
| | 541 | |
|
| | 542 | | throw _value.CreateException(clientDiagnostics, response); |
| | 543 | | } |
| | 544 | | } |
| | 545 | | } |
| | 546 | | #endregion FileSystem.SetPropertiesAsync |
| | 547 | |
|
| | 548 | | #region FileSystem.GetPropertiesAsync |
| | 549 | | /// <summary> |
| | 550 | | /// All system and user-defined filesystem properties are specified in the response headers. |
| | 551 | | /// </summary> |
| | 552 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param> |
| | 553 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 554 | | /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de |
| | 555 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 556 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 557 | | /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href=" |
| | 558 | | /// <param name="async">Whether to invoke the operation asynchronously. The default value is true.</param> |
| | 559 | | /// <param name="operationName">Operation name.</param> |
| | 560 | | /// <param name="cancellationToken">Cancellation token.</param> |
| | 561 | | /// <returns>Azure.Response{Azure.Storage.Files.DataLake.Models.FileSystemGetPropertiesResult}</returns> |
| | 562 | | public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.DataLake.Models.File |
| | 563 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 564 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 565 | | System.Uri resourceUri, |
| | 566 | | string version, |
| | 567 | | string requestId = default, |
| | 568 | | int? timeout = default, |
| | 569 | | bool async = true, |
| | 570 | | string operationName = "FileSystemClient.GetProperties", |
| | 571 | | System.Threading.CancellationToken cancellationToken = default) |
| | 572 | | { |
| | 573 | | Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName); |
| | 574 | | try |
| | 575 | | { |
| | 576 | | _scope.AddAttribute("url", resourceUri); |
| | 577 | | _scope.Start(); |
| | 578 | | using (Azure.Core.HttpMessage _message = GetPropertiesAsync_CreateMessage( |
| | 579 | | pipeline, |
| | 580 | | resourceUri, |
| | 581 | | version, |
| | 582 | | requestId, |
| | 583 | | timeout)) |
| | 584 | | { |
| | 585 | | if (async) |
| | 586 | | { |
| | 587 | | // Send the request asynchronously if we're being called via an async path |
| | 588 | | await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false); |
| | 589 | | } |
| | 590 | | else |
| | 591 | | { |
| | 592 | | // Send the request synchronously through the API that blocks if we're being called via a sy |
| | 593 | | // (this is safe because the Task will complete before the user can call Wait) |
| | 594 | | pipeline.Send(_message, cancellationToken); |
| | 595 | | } |
| | 596 | | Azure.Response _response = _message.Response; |
| | 597 | | cancellationToken.ThrowIfCancellationRequested(); |
| | 598 | | return GetPropertiesAsync_CreateResponse(clientDiagnostics, _response); |
| | 599 | | } |
| | 600 | | } |
| | 601 | | catch (System.Exception ex) |
| | 602 | | { |
| | 603 | | _scope.Failed(ex); |
| | 604 | | throw; |
| | 605 | | } |
| | 606 | | finally |
| | 607 | | { |
| | 608 | | _scope.Dispose(); |
| | 609 | | } |
| | 610 | | } |
| | 611 | |
|
| | 612 | | /// <summary> |
| | 613 | | /// Create the FileSystem.GetPropertiesAsync request. |
| | 614 | | /// </summary> |
| | 615 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 616 | | /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de |
| | 617 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 618 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 619 | | /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href=" |
| | 620 | | /// <returns>The FileSystem.GetPropertiesAsync Message.</returns> |
| | 621 | | internal static Azure.Core.HttpMessage GetPropertiesAsync_CreateMessage( |
| | 622 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 623 | | System.Uri resourceUri, |
| | 624 | | string version, |
| | 625 | | string requestId = default, |
| | 626 | | int? timeout = default) |
| | 627 | | { |
| | 628 | | // Validation |
| | 629 | | if (resourceUri == null) |
| | 630 | | { |
| | 631 | | throw new System.ArgumentNullException(nameof(resourceUri)); |
| | 632 | | } |
| | 633 | | if (version == null) |
| | 634 | | { |
| | 635 | | throw new System.ArgumentNullException(nameof(version)); |
| | 636 | | } |
| | 637 | |
|
| | 638 | | // Create the request |
| | 639 | | Azure.Core.HttpMessage _message = pipeline.CreateMessage(); |
| | 640 | | Azure.Core.Request _request = _message.Request; |
| | 641 | |
|
| | 642 | | // Set the endpoint |
| | 643 | | _request.Method = Azure.Core.RequestMethod.Head; |
| | 644 | | _request.Uri.Reset(resourceUri); |
| | 645 | | _request.Uri.AppendQuery("resource", "filesystem", escapeValue: false); |
| | 646 | | if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C |
| | 647 | |
|
| | 648 | | // Add request headers |
| | 649 | | _request.Headers.SetValue("x-ms-version", version); |
| | 650 | | if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } |
| | 651 | |
|
| | 652 | | return _message; |
| | 653 | | } |
| | 654 | |
|
| | 655 | | /// <summary> |
| | 656 | | /// Create the FileSystem.GetPropertiesAsync response or throw a failure exception. |
| | 657 | | /// </summary> |
| | 658 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param> |
| | 659 | | /// <param name="response">The raw Response.</param> |
| | 660 | | /// <returns>The FileSystem.GetPropertiesAsync Azure.Response{Azure.Storage.Files.DataLake.Models.FileSystem |
| | 661 | | internal static Azure.Response<Azure.Storage.Files.DataLake.Models.FileSystemGetPropertiesResult> GetPropert |
| | 662 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 663 | | Azure.Response response) |
| | 664 | | { |
| | 665 | | // Process the response |
| | 666 | | switch (response.Status) |
| | 667 | | { |
| | 668 | | case 200: |
| | 669 | | { |
| | 670 | | // Create the result |
| | 671 | | Azure.Storage.Files.DataLake.Models.FileSystemGetPropertiesResult _value = new Azure.Storage.Fil |
| | 672 | |
|
| | 673 | | // Get response headers |
| | 674 | | string _header; |
| | 675 | | if (response.Headers.TryGetValue("ETag", out _header)) |
| | 676 | | { |
| | 677 | | _value.ETag = new Azure.ETag(_header); |
| | 678 | | } |
| | 679 | | if (response.Headers.TryGetValue("Last-Modified", out _header)) |
| | 680 | | { |
| | 681 | | _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo. |
| | 682 | | } |
| | 683 | | if (response.Headers.TryGetValue("x-ms-properties", out _header)) |
| | 684 | | { |
| | 685 | | _value.Properties = _header; |
| | 686 | | } |
| | 687 | | if (response.Headers.TryGetValue("x-ms-namespace-enabled", out _header)) |
| | 688 | | { |
| | 689 | | _value.NamespaceEnabled = _header; |
| | 690 | | } |
| | 691 | |
|
| | 692 | | // Create the response |
| | 693 | | return Response.FromValue(_value, response); |
| | 694 | | } |
| | 695 | | case 304: |
| | 696 | | { |
| | 697 | | return new Azure.NoBodyResponse<Azure.Storage.Files.DataLake.Models.FileSystemGetPropertiesResul |
| | 698 | | } |
| | 699 | | default: |
| | 700 | | { |
| | 701 | | // Create the result |
| | 702 | | string _value; |
| | 703 | | using (System.IO.StreamReader _streamReader = new System.IO.StreamReader(response.ContentStream) |
| | 704 | | { |
| | 705 | | _value = _streamReader.ReadToEnd(); |
| | 706 | | } |
| | 707 | |
|
| | 708 | | throw _value.CreateException(clientDiagnostics, response); |
| | 709 | | } |
| | 710 | | } |
| | 711 | | } |
| | 712 | | #endregion FileSystem.GetPropertiesAsync |
| | 713 | |
|
| | 714 | | #region FileSystem.DeleteAsync |
| | 715 | | /// <summary> |
| | 716 | | /// Marks the FileSystem for deletion. When a FileSystem is deleted, a FileSystem with the same identifier |
| | 717 | | /// </summary> |
| | 718 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param> |
| | 719 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 720 | | /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de |
| | 721 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 722 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 723 | | /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href=" |
| | 724 | | /// <param name="ifModifiedSince">Specify this header value to operate only on a blob if it has been modifie |
| | 725 | | /// <param name="ifUnmodifiedSince">Specify this header value to operate only on a blob if it has not been m |
| | 726 | | /// <param name="async">Whether to invoke the operation asynchronously. The default value is true.</param> |
| | 727 | | /// <param name="operationName">Operation name.</param> |
| | 728 | | /// <param name="cancellationToken">Cancellation token.</param> |
| | 729 | | /// <returns>Azure.Response</returns> |
| | 730 | | public static async System.Threading.Tasks.ValueTask<Azure.Response> DeleteAsync( |
| | 731 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 732 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 733 | | System.Uri resourceUri, |
| | 734 | | string version, |
| | 735 | | string requestId = default, |
| | 736 | | int? timeout = default, |
| | 737 | | System.DateTimeOffset? ifModifiedSince = default, |
| | 738 | | System.DateTimeOffset? ifUnmodifiedSince = default, |
| | 739 | | bool async = true, |
| | 740 | | string operationName = "FileSystemClient.Delete", |
| | 741 | | System.Threading.CancellationToken cancellationToken = default) |
| | 742 | | { |
| | 743 | | Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName); |
| | 744 | | try |
| | 745 | | { |
| | 746 | | _scope.AddAttribute("url", resourceUri); |
| | 747 | | _scope.Start(); |
| | 748 | | using (Azure.Core.HttpMessage _message = DeleteAsync_CreateMessage( |
| | 749 | | pipeline, |
| | 750 | | resourceUri, |
| | 751 | | version, |
| | 752 | | requestId, |
| | 753 | | timeout, |
| | 754 | | ifModifiedSince, |
| | 755 | | ifUnmodifiedSince)) |
| | 756 | | { |
| | 757 | | if (async) |
| | 758 | | { |
| | 759 | | // Send the request asynchronously if we're being called via an async path |
| | 760 | | await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false); |
| | 761 | | } |
| | 762 | | else |
| | 763 | | { |
| | 764 | | // Send the request synchronously through the API that blocks if we're being called via a sy |
| | 765 | | // (this is safe because the Task will complete before the user can call Wait) |
| | 766 | | pipeline.Send(_message, cancellationToken); |
| | 767 | | } |
| | 768 | | Azure.Response _response = _message.Response; |
| | 769 | | cancellationToken.ThrowIfCancellationRequested(); |
| | 770 | | return DeleteAsync_CreateResponse(clientDiagnostics, _response); |
| | 771 | | } |
| | 772 | | } |
| | 773 | | catch (System.Exception ex) |
| | 774 | | { |
| | 775 | | _scope.Failed(ex); |
| | 776 | | throw; |
| | 777 | | } |
| | 778 | | finally |
| | 779 | | { |
| | 780 | | _scope.Dispose(); |
| | 781 | | } |
| | 782 | | } |
| | 783 | |
|
| | 784 | | /// <summary> |
| | 785 | | /// Create the FileSystem.DeleteAsync request. |
| | 786 | | /// </summary> |
| | 787 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 788 | | /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de |
| | 789 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 790 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 791 | | /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href=" |
| | 792 | | /// <param name="ifModifiedSince">Specify this header value to operate only on a blob if it has been modifie |
| | 793 | | /// <param name="ifUnmodifiedSince">Specify this header value to operate only on a blob if it has not been m |
| | 794 | | /// <returns>The FileSystem.DeleteAsync Message.</returns> |
| | 795 | | internal static Azure.Core.HttpMessage DeleteAsync_CreateMessage( |
| | 796 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 797 | | System.Uri resourceUri, |
| | 798 | | string version, |
| | 799 | | string requestId = default, |
| | 800 | | int? timeout = default, |
| | 801 | | System.DateTimeOffset? ifModifiedSince = default, |
| | 802 | | System.DateTimeOffset? ifUnmodifiedSince = default) |
| | 803 | | { |
| | 804 | | // Validation |
| | 805 | | if (resourceUri == null) |
| | 806 | | { |
| | 807 | | throw new System.ArgumentNullException(nameof(resourceUri)); |
| | 808 | | } |
| | 809 | | if (version == null) |
| | 810 | | { |
| | 811 | | throw new System.ArgumentNullException(nameof(version)); |
| | 812 | | } |
| | 813 | |
|
| | 814 | | // Create the request |
| | 815 | | Azure.Core.HttpMessage _message = pipeline.CreateMessage(); |
| | 816 | | Azure.Core.Request _request = _message.Request; |
| | 817 | |
|
| | 818 | | // Set the endpoint |
| | 819 | | _request.Method = Azure.Core.RequestMethod.Delete; |
| | 820 | | _request.Uri.Reset(resourceUri); |
| | 821 | | _request.Uri.AppendQuery("resource", "filesystem", escapeValue: false); |
| | 822 | | if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C |
| | 823 | |
|
| | 824 | | // Add request headers |
| | 825 | | _request.Headers.SetValue("x-ms-version", version); |
| | 826 | | if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } |
| | 827 | | if (ifModifiedSince != null) { _request.Headers.SetValue("If-Modified-Since", ifModifiedSince.Value.ToSt |
| | 828 | | if (ifUnmodifiedSince != null) { _request.Headers.SetValue("If-Unmodified-Since", ifUnmodifiedSince.Valu |
| | 829 | |
|
| | 830 | | return _message; |
| | 831 | | } |
| | 832 | |
|
| | 833 | | /// <summary> |
| | 834 | | /// Create the FileSystem.DeleteAsync response or throw a failure exception. |
| | 835 | | /// </summary> |
| | 836 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param> |
| | 837 | | /// <param name="response">The raw Response.</param> |
| | 838 | | /// <returns>The FileSystem.DeleteAsync Azure.Response.</returns> |
| | 839 | | internal static Azure.Response DeleteAsync_CreateResponse( |
| | 840 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 841 | | Azure.Response response) |
| | 842 | | { |
| | 843 | | // Process the response |
| | 844 | | switch (response.Status) |
| | 845 | | { |
| | 846 | | case 202: |
| | 847 | | { |
| | 848 | | return response; |
| | 849 | | } |
| | 850 | | default: |
| | 851 | | { |
| | 852 | | // Create the result |
| | 853 | | string _value; |
| | 854 | | using (System.IO.StreamReader _streamReader = new System.IO.StreamReader(response.ContentStream) |
| | 855 | | { |
| | 856 | | _value = _streamReader.ReadToEnd(); |
| | 857 | | } |
| | 858 | |
|
| | 859 | | throw _value.CreateException(clientDiagnostics, response); |
| | 860 | | } |
| | 861 | | } |
| | 862 | | } |
| | 863 | | #endregion FileSystem.DeleteAsync |
| | 864 | |
|
| | 865 | | #region FileSystem.ListPathsAsync |
| | 866 | | /// <summary> |
| | 867 | | /// List FileSystem paths and their properties. |
| | 868 | | /// </summary> |
| | 869 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param> |
| | 870 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 871 | | /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de |
| | 872 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 873 | | /// <param name="recursive">Required</param> |
| | 874 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 875 | | /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href=" |
| | 876 | | /// <param name="continuation">Optional. When deleting a directory, the number of paths that are deleted wi |
| | 877 | | /// <param name="path">Optional. Filters results to paths within the specified directory. An error occurs i |
| | 878 | | /// <param name="maxResults">An optional value that specifies the maximum number of items to return. If omit |
| | 879 | | /// <param name="upn">Optional. Valid only when Hierarchical Namespace is enabled for the account. If "true" |
| | 880 | | /// <param name="async">Whether to invoke the operation asynchronously. The default value is true.</param> |
| | 881 | | /// <param name="operationName">Operation name.</param> |
| | 882 | | /// <param name="cancellationToken">Cancellation token.</param> |
| | 883 | | /// <returns>Azure.Response{Azure.Storage.Files.DataLake.Models.FileSystemListPathsResult}</returns> |
| | 884 | | public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.DataLake.Models.File |
| | 885 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 886 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 887 | | System.Uri resourceUri, |
| | 888 | | string version, |
| | 889 | | bool recursive, |
| | 890 | | string requestId = default, |
| | 891 | | int? timeout = default, |
| | 892 | | string continuation = default, |
| | 893 | | string path = default, |
| | 894 | | int? maxResults = default, |
| | 895 | | bool? upn = default, |
| | 896 | | bool async = true, |
| | 897 | | string operationName = "FileSystemClient.ListPaths", |
| | 898 | | System.Threading.CancellationToken cancellationToken = default) |
| | 899 | | { |
| | 900 | | Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName); |
| | 901 | | try |
| | 902 | | { |
| | 903 | | _scope.AddAttribute("url", resourceUri); |
| | 904 | | _scope.Start(); |
| | 905 | | using (Azure.Core.HttpMessage _message = ListPathsAsync_CreateMessage( |
| | 906 | | pipeline, |
| | 907 | | resourceUri, |
| | 908 | | version, |
| | 909 | | recursive, |
| | 910 | | requestId, |
| | 911 | | timeout, |
| | 912 | | continuation, |
| | 913 | | path, |
| | 914 | | maxResults, |
| | 915 | | upn)) |
| | 916 | | { |
| | 917 | | if (async) |
| | 918 | | { |
| | 919 | | // Send the request asynchronously if we're being called via an async path |
| | 920 | | await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false); |
| | 921 | | } |
| | 922 | | else |
| | 923 | | { |
| | 924 | | // Send the request synchronously through the API that blocks if we're being called via a sy |
| | 925 | | // (this is safe because the Task will complete before the user can call Wait) |
| | 926 | | pipeline.Send(_message, cancellationToken); |
| | 927 | | } |
| | 928 | | Azure.Response _response = _message.Response; |
| | 929 | | cancellationToken.ThrowIfCancellationRequested(); |
| | 930 | | return ListPathsAsync_CreateResponse(clientDiagnostics, _response); |
| | 931 | | } |
| | 932 | | } |
| | 933 | | catch (System.Exception ex) |
| | 934 | | { |
| | 935 | | _scope.Failed(ex); |
| | 936 | | throw; |
| | 937 | | } |
| | 938 | | finally |
| | 939 | | { |
| | 940 | | _scope.Dispose(); |
| | 941 | | } |
| | 942 | | } |
| | 943 | |
|
| | 944 | | /// <summary> |
| | 945 | | /// Create the FileSystem.ListPathsAsync request. |
| | 946 | | /// </summary> |
| | 947 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 948 | | /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de |
| | 949 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 950 | | /// <param name="recursive">Required</param> |
| | 951 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 952 | | /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href=" |
| | 953 | | /// <param name="continuation">Optional. When deleting a directory, the number of paths that are deleted wi |
| | 954 | | /// <param name="path">Optional. Filters results to paths within the specified directory. An error occurs i |
| | 955 | | /// <param name="maxResults">An optional value that specifies the maximum number of items to return. If omit |
| | 956 | | /// <param name="upn">Optional. Valid only when Hierarchical Namespace is enabled for the account. If "true" |
| | 957 | | /// <returns>The FileSystem.ListPathsAsync Message.</returns> |
| | 958 | | internal static Azure.Core.HttpMessage ListPathsAsync_CreateMessage( |
| | 959 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 960 | | System.Uri resourceUri, |
| | 961 | | string version, |
| | 962 | | bool recursive, |
| | 963 | | string requestId = default, |
| | 964 | | int? timeout = default, |
| | 965 | | string continuation = default, |
| | 966 | | string path = default, |
| | 967 | | int? maxResults = default, |
| | 968 | | bool? upn = default) |
| | 969 | | { |
| | 970 | | // Validation |
| | 971 | | if (resourceUri == null) |
| | 972 | | { |
| | 973 | | throw new System.ArgumentNullException(nameof(resourceUri)); |
| | 974 | | } |
| | 975 | | if (version == null) |
| | 976 | | { |
| | 977 | | throw new System.ArgumentNullException(nameof(version)); |
| | 978 | | } |
| | 979 | |
|
| | 980 | | // Create the request |
| | 981 | | Azure.Core.HttpMessage _message = pipeline.CreateMessage(); |
| | 982 | | Azure.Core.Request _request = _message.Request; |
| | 983 | |
|
| | 984 | | // Set the endpoint |
| | 985 | | _request.Method = Azure.Core.RequestMethod.Get; |
| | 986 | | _request.Uri.Reset(resourceUri); |
| | 987 | | _request.Uri.AppendQuery("resource", "filesystem", escapeValue: false); |
| | 988 | |
|
| | 989 | | #pragma warning disable CA1308 // Normalize strings to uppercase |
| | 990 | | _request.Uri.AppendQuery("recursive", recursive.ToString(System.Globalization.CultureInfo.InvariantCultu |
| | 991 | | #pragma warning restore CA1308 // Normalize strings to uppercase |
| | 992 | |
|
| | 993 | | if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C |
| | 994 | | if (continuation != null) { _request.Uri.AppendQuery("continuation", continuation); } |
| | 995 | | if (path != null) { _request.Uri.AppendQuery("directory", path); } |
| | 996 | | if (maxResults != null) { _request.Uri.AppendQuery("maxResults", maxResults.Value.ToString(System.Global |
| | 997 | | if (upn != null) { |
| | 998 | | #pragma warning disable CA1308 // Normalize strings to uppercase |
| | 999 | | _request.Uri.AppendQuery("upn", upn.Value.ToString(System.Globalization.CultureInfo.InvariantCulture).To |
| | 1000 | | #pragma warning restore CA1308 // Normalize strings to uppercase |
| | 1001 | | } |
| | 1002 | |
|
| | 1003 | | // Add request headers |
| | 1004 | | _request.Headers.SetValue("x-ms-version", version); |
| | 1005 | | if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } |
| | 1006 | |
|
| | 1007 | | return _message; |
| | 1008 | | } |
| | 1009 | |
|
| | 1010 | | /// <summary> |
| | 1011 | | /// Create the FileSystem.ListPathsAsync response or throw a failure exception. |
| | 1012 | | /// </summary> |
| | 1013 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param> |
| | 1014 | | /// <param name="response">The raw Response.</param> |
| | 1015 | | /// <returns>The FileSystem.ListPathsAsync Azure.Response{Azure.Storage.Files.DataLake.Models.FileSystemList |
| | 1016 | | internal static Azure.Response<Azure.Storage.Files.DataLake.Models.FileSystemListPathsResult> ListPathsAsync |
| | 1017 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 1018 | | Azure.Response response) |
| | 1019 | | { |
| | 1020 | | // Process the response |
| | 1021 | | switch (response.Status) |
| | 1022 | | { |
| | 1023 | | case 200: |
| | 1024 | | { |
| | 1025 | | // Create the result |
| | 1026 | | Azure.Storage.Files.DataLake.Models.FileSystemListPathsResult _value = new Azure.Storage.Files.D |
| | 1027 | | _value.Body = response.ContentStream; // You should manually wrap with RetriableStream! |
| | 1028 | |
|
| | 1029 | | // Get response headers |
| | 1030 | | string _header; |
| | 1031 | | if (response.Headers.TryGetValue("ETag", out _header)) |
| | 1032 | | { |
| | 1033 | | _value.ETag = new Azure.ETag(_header); |
| | 1034 | | } |
| | 1035 | | if (response.Headers.TryGetValue("Last-Modified", out _header)) |
| | 1036 | | { |
| | 1037 | | _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo. |
| | 1038 | | } |
| | 1039 | | if (response.Headers.TryGetValue("x-ms-continuation", out _header)) |
| | 1040 | | { |
| | 1041 | | _value.Continuation = _header; |
| | 1042 | | } |
| | 1043 | |
|
| | 1044 | | // Create the response |
| | 1045 | | return Response.FromValue(_value, response); |
| | 1046 | | } |
| | 1047 | | case 304: |
| | 1048 | | { |
| | 1049 | | return new Azure.NoBodyResponse<Azure.Storage.Files.DataLake.Models.FileSystemListPathsResult>(r |
| | 1050 | | } |
| | 1051 | | default: |
| | 1052 | | { |
| | 1053 | | // Create the result |
| | 1054 | | string _value; |
| | 1055 | | using (System.IO.StreamReader _streamReader = new System.IO.StreamReader(response.ContentStream) |
| | 1056 | | { |
| | 1057 | | _value = _streamReader.ReadToEnd(); |
| | 1058 | | } |
| | 1059 | |
|
| | 1060 | | throw _value.CreateException(clientDiagnostics, response); |
| | 1061 | | } |
| | 1062 | | } |
| | 1063 | | } |
| | 1064 | | #endregion FileSystem.ListPathsAsync |
| | 1065 | | } |
| | 1066 | | #endregion FileSystem operations |
| | 1067 | |
|
| | 1068 | | #region Path operations |
| | 1069 | | /// <summary> |
| | 1070 | | /// Path operations for Azure Data Lake Storage REST API |
| | 1071 | | /// </summary> |
| | 1072 | | public static partial class Path |
| | 1073 | | { |
| | 1074 | | #region Path.CreateAsync |
| | 1075 | | /// <summary> |
| | 1076 | | /// Create or rename a file or directory. By default, the destination is overwritten and if the destinati |
| | 1077 | | /// </summary> |
| | 1078 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param> |
| | 1079 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 1080 | | /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de |
| | 1081 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 1082 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 1083 | | /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href=" |
| | 1084 | | /// <param name="resource">Required only for Create File and Create Directory. The value must be "file" or " |
| | 1085 | | /// <param name="continuation">Optional. When deleting a directory, the number of paths that are deleted wi |
| | 1086 | | /// <param name="mode">Optional. Valid only when namespace is enabled. This parameter determines the behavio |
| | 1087 | | /// <param name="cacheControl">Optional. Sets the blob's cache control. If specified, this property is store |
| | 1088 | | /// <param name="contentEncoding">Optional. Sets the blob's content encoding. If specified, this property is |
| | 1089 | | /// <param name="contentLanguage">Optional. Set the blob's content language. If specified, this property is |
| | 1090 | | /// <param name="contentDisposition">Optional. Sets the blob's Content-Disposition header.</param> |
| | 1091 | | /// <param name="contentType">Optional. Sets the blob's content type. If specified, this property is stored |
| | 1092 | | /// <param name="renameSource">An optional file or directory to be renamed. The value must have the followi |
| | 1093 | | /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma |
| | 1094 | | /// <param name="sourceLeaseId">A lease ID for the source path. If specified, the source path must have an a |
| | 1095 | | /// <param name="properties">Optional. User-defined properties to be stored with the filesystem, in the form |
| | 1096 | | /// <param name="permissions">Optional and only valid if Hierarchical Namespace is enabled for the account. |
| | 1097 | | /// <param name="umask">Optional and only valid if Hierarchical Namespace is enabled for the account. When c |
| | 1098 | | /// <param name="ifMatch">Specify an ETag value to operate only on blobs with a matching value.</param> |
| | 1099 | | /// <param name="ifNoneMatch">Specify an ETag value to operate only on blobs without a matching value.</para |
| | 1100 | | /// <param name="ifModifiedSince">Specify this header value to operate only on a blob if it has been modifie |
| | 1101 | | /// <param name="ifUnmodifiedSince">Specify this header value to operate only on a blob if it has not been m |
| | 1102 | | /// <param name="sourceIfMatch">Specify an ETag value to operate only on blobs with a matching value.</param |
| | 1103 | | /// <param name="sourceIfNoneMatch">Specify an ETag value to operate only on blobs without a matching value. |
| | 1104 | | /// <param name="sourceIfModifiedSince">Specify this header value to operate only on a blob if it has been m |
| | 1105 | | /// <param name="sourceIfUnmodifiedSince">Specify this header value to operate only on a blob if it has not |
| | 1106 | | /// <param name="async">Whether to invoke the operation asynchronously. The default value is true.</param> |
| | 1107 | | /// <param name="operationName">Operation name.</param> |
| | 1108 | | /// <param name="cancellationToken">Cancellation token.</param> |
| | 1109 | | /// <returns>Azure.Response{Azure.Storage.Files.DataLake.Models.PathCreateResult}</returns> |
| | 1110 | | public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.DataLake.Models.Path |
| | 1111 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 1112 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 1113 | | System.Uri resourceUri, |
| | 1114 | | string version, |
| | 1115 | | string requestId = default, |
| | 1116 | | int? timeout = default, |
| | 1117 | | Azure.Storage.Files.DataLake.Models.PathResourceType? resource = default, |
| | 1118 | | string continuation = default, |
| | 1119 | | Azure.Storage.Files.DataLake.Models.PathRenameMode? mode = default, |
| | 1120 | | string cacheControl = default, |
| | 1121 | | string contentEncoding = default, |
| | 1122 | | string contentLanguage = default, |
| | 1123 | | string contentDisposition = default, |
| | 1124 | | string contentType = default, |
| | 1125 | | string renameSource = default, |
| | 1126 | | string leaseId = default, |
| | 1127 | | string sourceLeaseId = default, |
| | 1128 | | string properties = default, |
| | 1129 | | string permissions = default, |
| | 1130 | | string umask = default, |
| | 1131 | | Azure.ETag? ifMatch = default, |
| | 1132 | | Azure.ETag? ifNoneMatch = default, |
| | 1133 | | System.DateTimeOffset? ifModifiedSince = default, |
| | 1134 | | System.DateTimeOffset? ifUnmodifiedSince = default, |
| | 1135 | | Azure.ETag? sourceIfMatch = default, |
| | 1136 | | Azure.ETag? sourceIfNoneMatch = default, |
| | 1137 | | System.DateTimeOffset? sourceIfModifiedSince = default, |
| | 1138 | | System.DateTimeOffset? sourceIfUnmodifiedSince = default, |
| | 1139 | | bool async = true, |
| | 1140 | | string operationName = "PathClient.Create", |
| | 1141 | | System.Threading.CancellationToken cancellationToken = default) |
| | 1142 | | { |
| | 1143 | | Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName); |
| | 1144 | | try |
| | 1145 | | { |
| | 1146 | | _scope.AddAttribute("url", resourceUri); |
| | 1147 | | _scope.Start(); |
| | 1148 | | using (Azure.Core.HttpMessage _message = CreateAsync_CreateMessage( |
| | 1149 | | pipeline, |
| | 1150 | | resourceUri, |
| | 1151 | | version, |
| | 1152 | | requestId, |
| | 1153 | | timeout, |
| | 1154 | | resource, |
| | 1155 | | continuation, |
| | 1156 | | mode, |
| | 1157 | | cacheControl, |
| | 1158 | | contentEncoding, |
| | 1159 | | contentLanguage, |
| | 1160 | | contentDisposition, |
| | 1161 | | contentType, |
| | 1162 | | renameSource, |
| | 1163 | | leaseId, |
| | 1164 | | sourceLeaseId, |
| | 1165 | | properties, |
| | 1166 | | permissions, |
| | 1167 | | umask, |
| | 1168 | | ifMatch, |
| | 1169 | | ifNoneMatch, |
| | 1170 | | ifModifiedSince, |
| | 1171 | | ifUnmodifiedSince, |
| | 1172 | | sourceIfMatch, |
| | 1173 | | sourceIfNoneMatch, |
| | 1174 | | sourceIfModifiedSince, |
| | 1175 | | sourceIfUnmodifiedSince)) |
| | 1176 | | { |
| | 1177 | | if (async) |
| | 1178 | | { |
| | 1179 | | // Send the request asynchronously if we're being called via an async path |
| | 1180 | | await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false); |
| | 1181 | | } |
| | 1182 | | else |
| | 1183 | | { |
| | 1184 | | // Send the request synchronously through the API that blocks if we're being called via a sy |
| | 1185 | | // (this is safe because the Task will complete before the user can call Wait) |
| | 1186 | | pipeline.Send(_message, cancellationToken); |
| | 1187 | | } |
| | 1188 | | Azure.Response _response = _message.Response; |
| | 1189 | | cancellationToken.ThrowIfCancellationRequested(); |
| | 1190 | | return CreateAsync_CreateResponse(clientDiagnostics, _response); |
| | 1191 | | } |
| | 1192 | | } |
| | 1193 | | catch (System.Exception ex) |
| | 1194 | | { |
| | 1195 | | _scope.Failed(ex); |
| | 1196 | | throw; |
| | 1197 | | } |
| | 1198 | | finally |
| | 1199 | | { |
| | 1200 | | _scope.Dispose(); |
| | 1201 | | } |
| | 1202 | | } |
| | 1203 | |
|
| | 1204 | | /// <summary> |
| | 1205 | | /// Create the Path.CreateAsync request. |
| | 1206 | | /// </summary> |
| | 1207 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 1208 | | /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de |
| | 1209 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 1210 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 1211 | | /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href=" |
| | 1212 | | /// <param name="resource">Required only for Create File and Create Directory. The value must be "file" or " |
| | 1213 | | /// <param name="continuation">Optional. When deleting a directory, the number of paths that are deleted wi |
| | 1214 | | /// <param name="mode">Optional. Valid only when namespace is enabled. This parameter determines the behavio |
| | 1215 | | /// <param name="cacheControl">Optional. Sets the blob's cache control. If specified, this property is store |
| | 1216 | | /// <param name="contentEncoding">Optional. Sets the blob's content encoding. If specified, this property is |
| | 1217 | | /// <param name="contentLanguage">Optional. Set the blob's content language. If specified, this property is |
| | 1218 | | /// <param name="contentDisposition">Optional. Sets the blob's Content-Disposition header.</param> |
| | 1219 | | /// <param name="contentType">Optional. Sets the blob's content type. If specified, this property is stored |
| | 1220 | | /// <param name="renameSource">An optional file or directory to be renamed. The value must have the followi |
| | 1221 | | /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma |
| | 1222 | | /// <param name="sourceLeaseId">A lease ID for the source path. If specified, the source path must have an a |
| | 1223 | | /// <param name="properties">Optional. User-defined properties to be stored with the filesystem, in the form |
| | 1224 | | /// <param name="permissions">Optional and only valid if Hierarchical Namespace is enabled for the account. |
| | 1225 | | /// <param name="umask">Optional and only valid if Hierarchical Namespace is enabled for the account. When c |
| | 1226 | | /// <param name="ifMatch">Specify an ETag value to operate only on blobs with a matching value.</param> |
| | 1227 | | /// <param name="ifNoneMatch">Specify an ETag value to operate only on blobs without a matching value.</para |
| | 1228 | | /// <param name="ifModifiedSince">Specify this header value to operate only on a blob if it has been modifie |
| | 1229 | | /// <param name="ifUnmodifiedSince">Specify this header value to operate only on a blob if it has not been m |
| | 1230 | | /// <param name="sourceIfMatch">Specify an ETag value to operate only on blobs with a matching value.</param |
| | 1231 | | /// <param name="sourceIfNoneMatch">Specify an ETag value to operate only on blobs without a matching value. |
| | 1232 | | /// <param name="sourceIfModifiedSince">Specify this header value to operate only on a blob if it has been m |
| | 1233 | | /// <param name="sourceIfUnmodifiedSince">Specify this header value to operate only on a blob if it has not |
| | 1234 | | /// <returns>The Path.CreateAsync Message.</returns> |
| | 1235 | | internal static Azure.Core.HttpMessage CreateAsync_CreateMessage( |
| | 1236 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 1237 | | System.Uri resourceUri, |
| | 1238 | | string version, |
| | 1239 | | string requestId = default, |
| | 1240 | | int? timeout = default, |
| | 1241 | | Azure.Storage.Files.DataLake.Models.PathResourceType? resource = default, |
| | 1242 | | string continuation = default, |
| | 1243 | | Azure.Storage.Files.DataLake.Models.PathRenameMode? mode = default, |
| | 1244 | | string cacheControl = default, |
| | 1245 | | string contentEncoding = default, |
| | 1246 | | string contentLanguage = default, |
| | 1247 | | string contentDisposition = default, |
| | 1248 | | string contentType = default, |
| | 1249 | | string renameSource = default, |
| | 1250 | | string leaseId = default, |
| | 1251 | | string sourceLeaseId = default, |
| | 1252 | | string properties = default, |
| | 1253 | | string permissions = default, |
| | 1254 | | string umask = default, |
| | 1255 | | Azure.ETag? ifMatch = default, |
| | 1256 | | Azure.ETag? ifNoneMatch = default, |
| | 1257 | | System.DateTimeOffset? ifModifiedSince = default, |
| | 1258 | | System.DateTimeOffset? ifUnmodifiedSince = default, |
| | 1259 | | Azure.ETag? sourceIfMatch = default, |
| | 1260 | | Azure.ETag? sourceIfNoneMatch = default, |
| | 1261 | | System.DateTimeOffset? sourceIfModifiedSince = default, |
| | 1262 | | System.DateTimeOffset? sourceIfUnmodifiedSince = default) |
| | 1263 | | { |
| | 1264 | | // Validation |
| | 1265 | | if (resourceUri == null) |
| | 1266 | | { |
| | 1267 | | throw new System.ArgumentNullException(nameof(resourceUri)); |
| | 1268 | | } |
| | 1269 | | if (version == null) |
| | 1270 | | { |
| | 1271 | | throw new System.ArgumentNullException(nameof(version)); |
| | 1272 | | } |
| | 1273 | |
|
| | 1274 | | // Create the request |
| | 1275 | | Azure.Core.HttpMessage _message = pipeline.CreateMessage(); |
| | 1276 | | Azure.Core.Request _request = _message.Request; |
| | 1277 | |
|
| | 1278 | | // Set the endpoint |
| | 1279 | | _request.Method = Azure.Core.RequestMethod.Put; |
| | 1280 | | _request.Uri.Reset(resourceUri); |
| | 1281 | | if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C |
| | 1282 | | if (resource != null) { _request.Uri.AppendQuery("resource", Azure.Storage.Files.DataLake.DataLakeRestCl |
| | 1283 | | if (continuation != null) { _request.Uri.AppendQuery("continuation", continuation); } |
| | 1284 | | if (mode != null) { _request.Uri.AppendQuery("mode", Azure.Storage.Files.DataLake.DataLakeRestClient.Ser |
| | 1285 | |
|
| | 1286 | | // Add request headers |
| | 1287 | | _request.Headers.SetValue("x-ms-version", version); |
| | 1288 | | if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } |
| | 1289 | | if (cacheControl != null) { _request.Headers.SetValue("x-ms-cache-control", cacheControl); } |
| | 1290 | | if (contentEncoding != null) { _request.Headers.SetValue("x-ms-content-encoding", contentEncoding); } |
| | 1291 | | if (contentLanguage != null) { _request.Headers.SetValue("x-ms-content-language", contentLanguage); } |
| | 1292 | | if (contentDisposition != null) { _request.Headers.SetValue("x-ms-content-disposition", contentDispositi |
| | 1293 | | if (contentType != null) { _request.Headers.SetValue("x-ms-content-type", contentType); } |
| | 1294 | | if (renameSource != null) { _request.Headers.SetValue("x-ms-rename-source", renameSource); } |
| | 1295 | | if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } |
| | 1296 | | if (sourceLeaseId != null) { _request.Headers.SetValue("x-ms-source-lease-id", sourceLeaseId); } |
| | 1297 | | if (properties != null) { _request.Headers.SetValue("x-ms-properties", properties); } |
| | 1298 | | if (permissions != null) { _request.Headers.SetValue("x-ms-permissions", permissions); } |
| | 1299 | | if (umask != null) { _request.Headers.SetValue("x-ms-umask", umask); } |
| | 1300 | | if (ifMatch != null) { _request.Headers.SetValue("If-Match", ifMatch.Value.ToString()); } |
| | 1301 | | if (ifNoneMatch != null) { _request.Headers.SetValue("If-None-Match", ifNoneMatch.Value.ToString()); } |
| | 1302 | | if (ifModifiedSince != null) { _request.Headers.SetValue("If-Modified-Since", ifModifiedSince.Value.ToSt |
| | 1303 | | if (ifUnmodifiedSince != null) { _request.Headers.SetValue("If-Unmodified-Since", ifUnmodifiedSince.Valu |
| | 1304 | | if (sourceIfMatch != null) { _request.Headers.SetValue("x-ms-source-if-match", sourceIfMatch.Value.ToStr |
| | 1305 | | if (sourceIfNoneMatch != null) { _request.Headers.SetValue("x-ms-source-if-none-match", sourceIfNoneMatc |
| | 1306 | | if (sourceIfModifiedSince != null) { _request.Headers.SetValue("x-ms-source-if-modified-since", sourceIf |
| | 1307 | | if (sourceIfUnmodifiedSince != null) { _request.Headers.SetValue("x-ms-source-if-unmodified-since", sour |
| | 1308 | |
|
| | 1309 | | return _message; |
| | 1310 | | } |
| | 1311 | |
|
| | 1312 | | /// <summary> |
| | 1313 | | /// Create the Path.CreateAsync response or throw a failure exception. |
| | 1314 | | /// </summary> |
| | 1315 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param> |
| | 1316 | | /// <param name="response">The raw Response.</param> |
| | 1317 | | /// <returns>The Path.CreateAsync Azure.Response{Azure.Storage.Files.DataLake.Models.PathCreateResult}.</ret |
| | 1318 | | internal static Azure.Response<Azure.Storage.Files.DataLake.Models.PathCreateResult> CreateAsync_CreateRespo |
| | 1319 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 1320 | | Azure.Response response) |
| | 1321 | | { |
| | 1322 | | // Process the response |
| | 1323 | | switch (response.Status) |
| | 1324 | | { |
| | 1325 | | case 201: |
| | 1326 | | { |
| | 1327 | | // Create the result |
| | 1328 | | Azure.Storage.Files.DataLake.Models.PathCreateResult _value = new Azure.Storage.Files.DataLake.M |
| | 1329 | |
|
| | 1330 | | // Get response headers |
| | 1331 | | string _header; |
| | 1332 | | if (response.Headers.TryGetValue("ETag", out _header)) |
| | 1333 | | { |
| | 1334 | | _value.ETag = new Azure.ETag(_header); |
| | 1335 | | } |
| | 1336 | | if (response.Headers.TryGetValue("Last-Modified", out _header)) |
| | 1337 | | { |
| | 1338 | | _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo. |
| | 1339 | | } |
| | 1340 | | if (response.Headers.TryGetValue("x-ms-continuation", out _header)) |
| | 1341 | | { |
| | 1342 | | _value.Continuation = _header; |
| | 1343 | | } |
| | 1344 | | if (response.Headers.TryGetValue("Content-Length", out _header)) |
| | 1345 | | { |
| | 1346 | | _value.ContentLength = long.Parse(_header, System.Globalization.CultureInfo.InvariantCulture |
| | 1347 | | } |
| | 1348 | |
|
| | 1349 | | // Create the response |
| | 1350 | | return Response.FromValue(_value, response); |
| | 1351 | | } |
| | 1352 | | default: |
| | 1353 | | { |
| | 1354 | | // Create the result |
| | 1355 | | string _value; |
| | 1356 | | using (System.IO.StreamReader _streamReader = new System.IO.StreamReader(response.ContentStream) |
| | 1357 | | { |
| | 1358 | | _value = _streamReader.ReadToEnd(); |
| | 1359 | | } |
| | 1360 | |
|
| | 1361 | | throw _value.CreateException(clientDiagnostics, response); |
| | 1362 | | } |
| | 1363 | | } |
| | 1364 | | } |
| | 1365 | | #endregion Path.CreateAsync |
| | 1366 | |
|
| | 1367 | | #region Path.UpdateAsync |
| | 1368 | | /// <summary> |
| | 1369 | | /// Uploads data to be appended to a file, flushes (writes) previously uploaded data to a file, sets propert |
| | 1370 | | /// </summary> |
| | 1371 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param> |
| | 1372 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 1373 | | /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de |
| | 1374 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 1375 | | /// <param name="action">The action must be "append" to upload data to be appended to a file, "flush" to flu |
| | 1376 | | /// <param name="mode">Mode "set" sets POSIX access control rights on files and directories, "modify" modifi |
| | 1377 | | /// <param name="body">Initial data</param> |
| | 1378 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 1379 | | /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href=" |
| | 1380 | | /// <param name="maxRecords">Optional. Valid for "SetAccessControlRecursive" operation. It specifies the max |
| | 1381 | | /// <param name="continuation">Optional. The number of paths processed with each invocation is limited. If t |
| | 1382 | | /// <param name="position">This parameter allows the caller to upload data in parallel and control the order |
| | 1383 | | /// <param name="retainUncommittedData">Valid only for flush operations. If "true", uncommitted data is ret |
| | 1384 | | /// <param name="close">Azure Storage Events allow applications to receive notifications when files change. |
| | 1385 | | /// <param name="contentLength">Required for "Append Data" and "Flush Data". Must be 0 for "Flush Data". M |
| | 1386 | | /// <param name="contentHash">Specify the transactional md5 for the body, to be validated by the service.</p |
| | 1387 | | /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma |
| | 1388 | | /// <param name="cacheControl">Optional. Sets the blob's cache control. If specified, this property is store |
| | 1389 | | /// <param name="contentType">Optional. Sets the blob's content type. If specified, this property is stored |
| | 1390 | | /// <param name="contentDisposition">Optional. Sets the blob's Content-Disposition header.</param> |
| | 1391 | | /// <param name="contentEncoding">Optional. Sets the blob's content encoding. If specified, this property is |
| | 1392 | | /// <param name="contentLanguage">Optional. Set the blob's content language. If specified, this property is |
| | 1393 | | /// <param name="properties">Optional. User-defined properties to be stored with the filesystem, in the form |
| | 1394 | | /// <param name="owner">Optional. The owner of the blob or directory.</param> |
| | 1395 | | /// <param name="group">Optional. The owning group of the blob or directory.</param> |
| | 1396 | | /// <param name="permissions">Optional and only valid if Hierarchical Namespace is enabled for the account. |
| | 1397 | | /// <param name="acl">Sets POSIX access control rights on files and directories. The value is a comma-separa |
| | 1398 | | /// <param name="ifMatch">Specify an ETag value to operate only on blobs with a matching value.</param> |
| | 1399 | | /// <param name="ifNoneMatch">Specify an ETag value to operate only on blobs without a matching value.</para |
| | 1400 | | /// <param name="ifModifiedSince">Specify this header value to operate only on a blob if it has been modifie |
| | 1401 | | /// <param name="ifUnmodifiedSince">Specify this header value to operate only on a blob if it has not been m |
| | 1402 | | /// <param name="async">Whether to invoke the operation asynchronously. The default value is true.</param> |
| | 1403 | | /// <param name="operationName">Operation name.</param> |
| | 1404 | | /// <param name="cancellationToken">Cancellation token.</param> |
| | 1405 | | /// <returns>Azure.Response{Azure.Storage.Files.DataLake.Models.PathUpdateResult}</returns> |
| | 1406 | | public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.DataLake.Models.Path |
| | 1407 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 1408 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 1409 | | System.Uri resourceUri, |
| | 1410 | | string version, |
| | 1411 | | Azure.Storage.Files.DataLake.Models.PathUpdateAction action, |
| | 1412 | | Azure.Storage.Files.DataLake.Models.PathSetAccessControlRecursiveMode mode, |
| | 1413 | | System.IO.Stream body, |
| | 1414 | | string requestId = default, |
| | 1415 | | int? timeout = default, |
| | 1416 | | int? maxRecords = default, |
| | 1417 | | string continuation = default, |
| | 1418 | | long? position = default, |
| | 1419 | | bool? retainUncommittedData = default, |
| | 1420 | | bool? close = default, |
| | 1421 | | long? contentLength = default, |
| | 1422 | | byte[] contentHash = default, |
| | 1423 | | string leaseId = default, |
| | 1424 | | string cacheControl = default, |
| | 1425 | | string contentType = default, |
| | 1426 | | string contentDisposition = default, |
| | 1427 | | string contentEncoding = default, |
| | 1428 | | string contentLanguage = default, |
| | 1429 | | string properties = default, |
| | 1430 | | string owner = default, |
| | 1431 | | string group = default, |
| | 1432 | | string permissions = default, |
| | 1433 | | string acl = default, |
| | 1434 | | Azure.ETag? ifMatch = default, |
| | 1435 | | Azure.ETag? ifNoneMatch = default, |
| | 1436 | | System.DateTimeOffset? ifModifiedSince = default, |
| | 1437 | | System.DateTimeOffset? ifUnmodifiedSince = default, |
| | 1438 | | bool async = true, |
| | 1439 | | string operationName = "PathClient.Update", |
| | 1440 | | System.Threading.CancellationToken cancellationToken = default) |
| | 1441 | | { |
| | 1442 | | Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName); |
| | 1443 | | try |
| | 1444 | | { |
| | 1445 | | _scope.AddAttribute("url", resourceUri); |
| | 1446 | | _scope.Start(); |
| | 1447 | | using (Azure.Core.HttpMessage _message = UpdateAsync_CreateMessage( |
| | 1448 | | pipeline, |
| | 1449 | | resourceUri, |
| | 1450 | | version, |
| | 1451 | | action, |
| | 1452 | | mode, |
| | 1453 | | body, |
| | 1454 | | requestId, |
| | 1455 | | timeout, |
| | 1456 | | maxRecords, |
| | 1457 | | continuation, |
| | 1458 | | position, |
| | 1459 | | retainUncommittedData, |
| | 1460 | | close, |
| | 1461 | | contentLength, |
| | 1462 | | contentHash, |
| | 1463 | | leaseId, |
| | 1464 | | cacheControl, |
| | 1465 | | contentType, |
| | 1466 | | contentDisposition, |
| | 1467 | | contentEncoding, |
| | 1468 | | contentLanguage, |
| | 1469 | | properties, |
| | 1470 | | owner, |
| | 1471 | | group, |
| | 1472 | | permissions, |
| | 1473 | | acl, |
| | 1474 | | ifMatch, |
| | 1475 | | ifNoneMatch, |
| | 1476 | | ifModifiedSince, |
| | 1477 | | ifUnmodifiedSince)) |
| | 1478 | | { |
| | 1479 | | if (async) |
| | 1480 | | { |
| | 1481 | | // Send the request asynchronously if we're being called via an async path |
| | 1482 | | await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false); |
| | 1483 | | } |
| | 1484 | | else |
| | 1485 | | { |
| | 1486 | | // Send the request synchronously through the API that blocks if we're being called via a sy |
| | 1487 | | // (this is safe because the Task will complete before the user can call Wait) |
| | 1488 | | pipeline.Send(_message, cancellationToken); |
| | 1489 | | } |
| | 1490 | | Azure.Response _response = _message.Response; |
| | 1491 | | cancellationToken.ThrowIfCancellationRequested(); |
| | 1492 | | return UpdateAsync_CreateResponse(clientDiagnostics, _response); |
| | 1493 | | } |
| | 1494 | | } |
| | 1495 | | catch (System.Exception ex) |
| | 1496 | | { |
| | 1497 | | _scope.Failed(ex); |
| | 1498 | | throw; |
| | 1499 | | } |
| | 1500 | | finally |
| | 1501 | | { |
| | 1502 | | _scope.Dispose(); |
| | 1503 | | } |
| | 1504 | | } |
| | 1505 | |
|
| | 1506 | | /// <summary> |
| | 1507 | | /// Create the Path.UpdateAsync request. |
| | 1508 | | /// </summary> |
| | 1509 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 1510 | | /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de |
| | 1511 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 1512 | | /// <param name="action">The action must be "append" to upload data to be appended to a file, "flush" to flu |
| | 1513 | | /// <param name="mode">Mode "set" sets POSIX access control rights on files and directories, "modify" modifi |
| | 1514 | | /// <param name="body">Initial data</param> |
| | 1515 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 1516 | | /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href=" |
| | 1517 | | /// <param name="maxRecords">Optional. Valid for "SetAccessControlRecursive" operation. It specifies the max |
| | 1518 | | /// <param name="continuation">Optional. The number of paths processed with each invocation is limited. If t |
| | 1519 | | /// <param name="position">This parameter allows the caller to upload data in parallel and control the order |
| | 1520 | | /// <param name="retainUncommittedData">Valid only for flush operations. If "true", uncommitted data is ret |
| | 1521 | | /// <param name="close">Azure Storage Events allow applications to receive notifications when files change. |
| | 1522 | | /// <param name="contentLength">Required for "Append Data" and "Flush Data". Must be 0 for "Flush Data". M |
| | 1523 | | /// <param name="contentHash">Specify the transactional md5 for the body, to be validated by the service.</p |
| | 1524 | | /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma |
| | 1525 | | /// <param name="cacheControl">Optional. Sets the blob's cache control. If specified, this property is store |
| | 1526 | | /// <param name="contentType">Optional. Sets the blob's content type. If specified, this property is stored |
| | 1527 | | /// <param name="contentDisposition">Optional. Sets the blob's Content-Disposition header.</param> |
| | 1528 | | /// <param name="contentEncoding">Optional. Sets the blob's content encoding. If specified, this property is |
| | 1529 | | /// <param name="contentLanguage">Optional. Set the blob's content language. If specified, this property is |
| | 1530 | | /// <param name="properties">Optional. User-defined properties to be stored with the filesystem, in the form |
| | 1531 | | /// <param name="owner">Optional. The owner of the blob or directory.</param> |
| | 1532 | | /// <param name="group">Optional. The owning group of the blob or directory.</param> |
| | 1533 | | /// <param name="permissions">Optional and only valid if Hierarchical Namespace is enabled for the account. |
| | 1534 | | /// <param name="acl">Sets POSIX access control rights on files and directories. The value is a comma-separa |
| | 1535 | | /// <param name="ifMatch">Specify an ETag value to operate only on blobs with a matching value.</param> |
| | 1536 | | /// <param name="ifNoneMatch">Specify an ETag value to operate only on blobs without a matching value.</para |
| | 1537 | | /// <param name="ifModifiedSince">Specify this header value to operate only on a blob if it has been modifie |
| | 1538 | | /// <param name="ifUnmodifiedSince">Specify this header value to operate only on a blob if it has not been m |
| | 1539 | | /// <returns>The Path.UpdateAsync Message.</returns> |
| | 1540 | | internal static Azure.Core.HttpMessage UpdateAsync_CreateMessage( |
| | 1541 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 1542 | | System.Uri resourceUri, |
| | 1543 | | string version, |
| | 1544 | | Azure.Storage.Files.DataLake.Models.PathUpdateAction action, |
| | 1545 | | Azure.Storage.Files.DataLake.Models.PathSetAccessControlRecursiveMode mode, |
| | 1546 | | System.IO.Stream body, |
| | 1547 | | string requestId = default, |
| | 1548 | | int? timeout = default, |
| | 1549 | | int? maxRecords = default, |
| | 1550 | | string continuation = default, |
| | 1551 | | long? position = default, |
| | 1552 | | bool? retainUncommittedData = default, |
| | 1553 | | bool? close = default, |
| | 1554 | | long? contentLength = default, |
| | 1555 | | byte[] contentHash = default, |
| | 1556 | | string leaseId = default, |
| | 1557 | | string cacheControl = default, |
| | 1558 | | string contentType = default, |
| | 1559 | | string contentDisposition = default, |
| | 1560 | | string contentEncoding = default, |
| | 1561 | | string contentLanguage = default, |
| | 1562 | | string properties = default, |
| | 1563 | | string owner = default, |
| | 1564 | | string group = default, |
| | 1565 | | string permissions = default, |
| | 1566 | | string acl = default, |
| | 1567 | | Azure.ETag? ifMatch = default, |
| | 1568 | | Azure.ETag? ifNoneMatch = default, |
| | 1569 | | System.DateTimeOffset? ifModifiedSince = default, |
| | 1570 | | System.DateTimeOffset? ifUnmodifiedSince = default) |
| | 1571 | | { |
| | 1572 | | // Validation |
| | 1573 | | if (resourceUri == null) |
| | 1574 | | { |
| | 1575 | | throw new System.ArgumentNullException(nameof(resourceUri)); |
| | 1576 | | } |
| | 1577 | | if (version == null) |
| | 1578 | | { |
| | 1579 | | throw new System.ArgumentNullException(nameof(version)); |
| | 1580 | | } |
| | 1581 | | if (body == null) |
| | 1582 | | { |
| | 1583 | | throw new System.ArgumentNullException(nameof(body)); |
| | 1584 | | } |
| | 1585 | |
|
| | 1586 | | // Create the request |
| | 1587 | | Azure.Core.HttpMessage _message = pipeline.CreateMessage(); |
| | 1588 | | Azure.Core.Request _request = _message.Request; |
| | 1589 | |
|
| | 1590 | | // Set the endpoint |
| | 1591 | | _request.Method = Azure.Core.RequestMethod.Patch; |
| | 1592 | | _request.Uri.Reset(resourceUri); |
| | 1593 | | _request.Uri.AppendQuery("action", Azure.Storage.Files.DataLake.DataLakeRestClient.Serialization.ToStrin |
| | 1594 | | _request.Uri.AppendQuery("mode", Azure.Storage.Files.DataLake.DataLakeRestClient.Serialization.ToString( |
| | 1595 | | if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C |
| | 1596 | | if (maxRecords != null) { _request.Uri.AppendQuery("maxRecords", maxRecords.Value.ToString(System.Global |
| | 1597 | | if (continuation != null) { _request.Uri.AppendQuery("continuation", continuation); } |
| | 1598 | | if (position != null) { _request.Uri.AppendQuery("position", position.Value.ToString(System.Globalizatio |
| | 1599 | | if (retainUncommittedData != null) { |
| | 1600 | | #pragma warning disable CA1308 // Normalize strings to uppercase |
| | 1601 | | _request.Uri.AppendQuery("retainUncommittedData", retainUncommittedData.Value.ToString(System.Globalizat |
| | 1602 | | #pragma warning restore CA1308 // Normalize strings to uppercase |
| | 1603 | | } |
| | 1604 | | if (close != null) { |
| | 1605 | | #pragma warning disable CA1308 // Normalize strings to uppercase |
| | 1606 | | _request.Uri.AppendQuery("close", close.Value.ToString(System.Globalization.CultureInfo.InvariantCulture |
| | 1607 | | #pragma warning restore CA1308 // Normalize strings to uppercase |
| | 1608 | | } |
| | 1609 | |
|
| | 1610 | | // Add request headers |
| | 1611 | | _request.Headers.SetValue("x-ms-version", version); |
| | 1612 | | if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } |
| | 1613 | | if (contentLength != null) { _request.Headers.SetValue("Content-Length", contentLength.Value.ToString(Sy |
| | 1614 | | if (contentHash != null) { _request.Headers.SetValue("x-ms-content-md5", System.Convert.ToBase64String(c |
| | 1615 | | if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } |
| | 1616 | | if (cacheControl != null) { _request.Headers.SetValue("x-ms-cache-control", cacheControl); } |
| | 1617 | | if (contentType != null) { _request.Headers.SetValue("x-ms-content-type", contentType); } |
| | 1618 | | if (contentDisposition != null) { _request.Headers.SetValue("x-ms-content-disposition", contentDispositi |
| | 1619 | | if (contentEncoding != null) { _request.Headers.SetValue("x-ms-content-encoding", contentEncoding); } |
| | 1620 | | if (contentLanguage != null) { _request.Headers.SetValue("x-ms-content-language", contentLanguage); } |
| | 1621 | | if (properties != null) { _request.Headers.SetValue("x-ms-properties", properties); } |
| | 1622 | | if (owner != null) { _request.Headers.SetValue("x-ms-owner", owner); } |
| | 1623 | | if (group != null) { _request.Headers.SetValue("x-ms-group", group); } |
| | 1624 | | if (permissions != null) { _request.Headers.SetValue("x-ms-permissions", permissions); } |
| | 1625 | | if (acl != null) { _request.Headers.SetValue("x-ms-acl", acl); } |
| | 1626 | | if (ifMatch != null) { _request.Headers.SetValue("If-Match", ifMatch.Value.ToString()); } |
| | 1627 | | if (ifNoneMatch != null) { _request.Headers.SetValue("If-None-Match", ifNoneMatch.Value.ToString()); } |
| | 1628 | | if (ifModifiedSince != null) { _request.Headers.SetValue("If-Modified-Since", ifModifiedSince.Value.ToSt |
| | 1629 | | if (ifUnmodifiedSince != null) { _request.Headers.SetValue("If-Unmodified-Since", ifUnmodifiedSince.Valu |
| | 1630 | |
|
| | 1631 | | // Create the body |
| | 1632 | | _request.Content = Azure.Core.RequestContent.Create(body); |
| | 1633 | |
|
| | 1634 | | return _message; |
| | 1635 | | } |
| | 1636 | |
|
| | 1637 | | /// <summary> |
| | 1638 | | /// Create the Path.UpdateAsync response or throw a failure exception. |
| | 1639 | | /// </summary> |
| | 1640 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param> |
| | 1641 | | /// <param name="response">The raw Response.</param> |
| | 1642 | | /// <returns>The Path.UpdateAsync Azure.Response{Azure.Storage.Files.DataLake.Models.PathUpdateResult}.</ret |
| | 1643 | | internal static Azure.Response<Azure.Storage.Files.DataLake.Models.PathUpdateResult> UpdateAsync_CreateRespo |
| | 1644 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 1645 | | Azure.Response response) |
| | 1646 | | { |
| | 1647 | | // Process the response |
| | 1648 | | switch (response.Status) |
| | 1649 | | { |
| | 1650 | | case 200: |
| | 1651 | | { |
| | 1652 | | // Create the result |
| | 1653 | | System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X |
| | 1654 | | Azure.Storage.Files.DataLake.Models.PathUpdateResult _value = new Azure.Storage.Files.DataLake.M |
| | 1655 | | _value.Body = Azure.Storage.Files.DataLake.Models.SetAccessControlRecursiveResponse.FromXml(_xml |
| | 1656 | |
|
| | 1657 | | // Get response headers |
| | 1658 | | string _header; |
| | 1659 | | if (response.Headers.TryGetValue("ETag", out _header)) |
| | 1660 | | { |
| | 1661 | | _value.ETag = new Azure.ETag(_header); |
| | 1662 | | } |
| | 1663 | | if (response.Headers.TryGetValue("Last-Modified", out _header)) |
| | 1664 | | { |
| | 1665 | | _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo. |
| | 1666 | | } |
| | 1667 | | if (response.Headers.TryGetValue("Accept-Ranges", out _header)) |
| | 1668 | | { |
| | 1669 | | _value.AcceptRanges = _header; |
| | 1670 | | } |
| | 1671 | | if (response.Headers.TryGetValue("Cache-Control", out _header)) |
| | 1672 | | { |
| | 1673 | | _value.CacheControl = _header; |
| | 1674 | | } |
| | 1675 | | if (response.Headers.TryGetValue("Content-Disposition", out _header)) |
| | 1676 | | { |
| | 1677 | | _value.ContentDisposition = _header; |
| | 1678 | | } |
| | 1679 | | if (response.Headers.TryGetValue("Content-Encoding", out _header)) |
| | 1680 | | { |
| | 1681 | | _value.ContentEncoding = _header; |
| | 1682 | | } |
| | 1683 | | if (response.Headers.TryGetValue("Content-Language", out _header)) |
| | 1684 | | { |
| | 1685 | | _value.ContentLanguage = _header; |
| | 1686 | | } |
| | 1687 | | if (response.Headers.TryGetValue("Content-Length", out _header)) |
| | 1688 | | { |
| | 1689 | | _value.ContentLength = long.Parse(_header, System.Globalization.CultureInfo.InvariantCulture |
| | 1690 | | } |
| | 1691 | | if (response.Headers.TryGetValue("Content-Range", out _header)) |
| | 1692 | | { |
| | 1693 | | _value.ContentRange = _header; |
| | 1694 | | } |
| | 1695 | | if (response.Headers.TryGetValue("Content-Type", out _header)) |
| | 1696 | | { |
| | 1697 | | _value.ContentType = _header; |
| | 1698 | | } |
| | 1699 | | if (response.Headers.TryGetValue("Content-MD5", out _header)) |
| | 1700 | | { |
| | 1701 | | _value.ContentMD5 = _header; |
| | 1702 | | } |
| | 1703 | | if (response.Headers.TryGetValue("x-ms-properties", out _header)) |
| | 1704 | | { |
| | 1705 | | _value.Properties = _header; |
| | 1706 | | } |
| | 1707 | | if (response.Headers.TryGetValue("x-ms-continuation", out _header)) |
| | 1708 | | { |
| | 1709 | | _value.XMSContinuation = _header; |
| | 1710 | | } |
| | 1711 | |
|
| | 1712 | | // Create the response |
| | 1713 | | return Response.FromValue(_value, response); |
| | 1714 | | } |
| | 1715 | | case 202: |
| | 1716 | | { |
| | 1717 | | // Create the result |
| | 1718 | | Azure.Storage.Files.DataLake.Models.PathUpdateResult _value = new Azure.Storage.Files.DataLake.M |
| | 1719 | |
|
| | 1720 | | // Get response headers |
| | 1721 | | string _header; |
| | 1722 | | if (response.Headers.TryGetValue("Content-MD5", out _header)) |
| | 1723 | | { |
| | 1724 | | _value.ContentMD5 = _header; |
| | 1725 | | } |
| | 1726 | |
|
| | 1727 | | // Create the response |
| | 1728 | | return Response.FromValue(_value, response); |
| | 1729 | | } |
| | 1730 | | default: |
| | 1731 | | { |
| | 1732 | | // Create the result |
| | 1733 | | string _value; |
| | 1734 | | using (System.IO.StreamReader _streamReader = new System.IO.StreamReader(response.ContentStream) |
| | 1735 | | { |
| | 1736 | | _value = _streamReader.ReadToEnd(); |
| | 1737 | | } |
| | 1738 | |
|
| | 1739 | | throw _value.CreateException(clientDiagnostics, response); |
| | 1740 | | } |
| | 1741 | | } |
| | 1742 | | } |
| | 1743 | | #endregion Path.UpdateAsync |
| | 1744 | |
|
| | 1745 | | #region Path.LeaseAsync |
| | 1746 | | /// <summary> |
| | 1747 | | /// Create and manage a lease to restrict write and delete access to the path. This operation supports condi |
| | 1748 | | /// </summary> |
| | 1749 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param> |
| | 1750 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 1751 | | /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de |
| | 1752 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 1753 | | /// <param name="xMSLeaseAction">There are five lease actions: "acquire", "break", "change", "renew", and "r |
| | 1754 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 1755 | | /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href=" |
| | 1756 | | /// <param name="xMSLeaseDuration">The lease duration is required to acquire a lease, and specifies the dura |
| | 1757 | | /// <param name="xMSLeaseBreakPeriod">The lease break period duration is optional to break a lease, and spe |
| | 1758 | | /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma |
| | 1759 | | /// <param name="proposedLeaseId">Proposed lease ID, in a GUID string format. The Blob service returns 400 ( |
| | 1760 | | /// <param name="ifMatch">Specify an ETag value to operate only on blobs with a matching value.</param> |
| | 1761 | | /// <param name="ifNoneMatch">Specify an ETag value to operate only on blobs without a matching value.</para |
| | 1762 | | /// <param name="ifModifiedSince">Specify this header value to operate only on a blob if it has been modifie |
| | 1763 | | /// <param name="ifUnmodifiedSince">Specify this header value to operate only on a blob if it has not been m |
| | 1764 | | /// <param name="async">Whether to invoke the operation asynchronously. The default value is true.</param> |
| | 1765 | | /// <param name="operationName">Operation name.</param> |
| | 1766 | | /// <param name="cancellationToken">Cancellation token.</param> |
| | 1767 | | /// <returns>Azure.Response{Azure.Storage.Files.DataLake.Models.PathLeaseResult}</returns> |
| | 1768 | | public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.DataLake.Models.Path |
| | 1769 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 1770 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 1771 | | System.Uri resourceUri, |
| | 1772 | | string version, |
| | 1773 | | Azure.Storage.Files.DataLake.Models.PathLeaseAction xMSLeaseAction, |
| | 1774 | | string requestId = default, |
| | 1775 | | int? timeout = default, |
| | 1776 | | int? xMSLeaseDuration = default, |
| | 1777 | | int? xMSLeaseBreakPeriod = default, |
| | 1778 | | string leaseId = default, |
| | 1779 | | string proposedLeaseId = default, |
| | 1780 | | Azure.ETag? ifMatch = default, |
| | 1781 | | Azure.ETag? ifNoneMatch = default, |
| | 1782 | | System.DateTimeOffset? ifModifiedSince = default, |
| | 1783 | | System.DateTimeOffset? ifUnmodifiedSince = default, |
| | 1784 | | bool async = true, |
| | 1785 | | string operationName = "PathClient.Lease", |
| | 1786 | | System.Threading.CancellationToken cancellationToken = default) |
| | 1787 | | { |
| | 1788 | | Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName); |
| | 1789 | | try |
| | 1790 | | { |
| | 1791 | | _scope.AddAttribute("url", resourceUri); |
| | 1792 | | _scope.Start(); |
| | 1793 | | using (Azure.Core.HttpMessage _message = LeaseAsync_CreateMessage( |
| | 1794 | | pipeline, |
| | 1795 | | resourceUri, |
| | 1796 | | version, |
| | 1797 | | xMSLeaseAction, |
| | 1798 | | requestId, |
| | 1799 | | timeout, |
| | 1800 | | xMSLeaseDuration, |
| | 1801 | | xMSLeaseBreakPeriod, |
| | 1802 | | leaseId, |
| | 1803 | | proposedLeaseId, |
| | 1804 | | ifMatch, |
| | 1805 | | ifNoneMatch, |
| | 1806 | | ifModifiedSince, |
| | 1807 | | ifUnmodifiedSince)) |
| | 1808 | | { |
| | 1809 | | if (async) |
| | 1810 | | { |
| | 1811 | | // Send the request asynchronously if we're being called via an async path |
| | 1812 | | await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false); |
| | 1813 | | } |
| | 1814 | | else |
| | 1815 | | { |
| | 1816 | | // Send the request synchronously through the API that blocks if we're being called via a sy |
| | 1817 | | // (this is safe because the Task will complete before the user can call Wait) |
| | 1818 | | pipeline.Send(_message, cancellationToken); |
| | 1819 | | } |
| | 1820 | | Azure.Response _response = _message.Response; |
| | 1821 | | cancellationToken.ThrowIfCancellationRequested(); |
| | 1822 | | return LeaseAsync_CreateResponse(clientDiagnostics, _response); |
| | 1823 | | } |
| | 1824 | | } |
| | 1825 | | catch (System.Exception ex) |
| | 1826 | | { |
| | 1827 | | _scope.Failed(ex); |
| | 1828 | | throw; |
| | 1829 | | } |
| | 1830 | | finally |
| | 1831 | | { |
| | 1832 | | _scope.Dispose(); |
| | 1833 | | } |
| | 1834 | | } |
| | 1835 | |
|
| | 1836 | | /// <summary> |
| | 1837 | | /// Create the Path.LeaseAsync request. |
| | 1838 | | /// </summary> |
| | 1839 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 1840 | | /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de |
| | 1841 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 1842 | | /// <param name="xMSLeaseAction">There are five lease actions: "acquire", "break", "change", "renew", and "r |
| | 1843 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 1844 | | /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href=" |
| | 1845 | | /// <param name="xMSLeaseDuration">The lease duration is required to acquire a lease, and specifies the dura |
| | 1846 | | /// <param name="xMSLeaseBreakPeriod">The lease break period duration is optional to break a lease, and spe |
| | 1847 | | /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma |
| | 1848 | | /// <param name="proposedLeaseId">Proposed lease ID, in a GUID string format. The Blob service returns 400 ( |
| | 1849 | | /// <param name="ifMatch">Specify an ETag value to operate only on blobs with a matching value.</param> |
| | 1850 | | /// <param name="ifNoneMatch">Specify an ETag value to operate only on blobs without a matching value.</para |
| | 1851 | | /// <param name="ifModifiedSince">Specify this header value to operate only on a blob if it has been modifie |
| | 1852 | | /// <param name="ifUnmodifiedSince">Specify this header value to operate only on a blob if it has not been m |
| | 1853 | | /// <returns>The Path.LeaseAsync Message.</returns> |
| | 1854 | | internal static Azure.Core.HttpMessage LeaseAsync_CreateMessage( |
| | 1855 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 1856 | | System.Uri resourceUri, |
| | 1857 | | string version, |
| | 1858 | | Azure.Storage.Files.DataLake.Models.PathLeaseAction xMSLeaseAction, |
| | 1859 | | string requestId = default, |
| | 1860 | | int? timeout = default, |
| | 1861 | | int? xMSLeaseDuration = default, |
| | 1862 | | int? xMSLeaseBreakPeriod = default, |
| | 1863 | | string leaseId = default, |
| | 1864 | | string proposedLeaseId = default, |
| | 1865 | | Azure.ETag? ifMatch = default, |
| | 1866 | | Azure.ETag? ifNoneMatch = default, |
| | 1867 | | System.DateTimeOffset? ifModifiedSince = default, |
| | 1868 | | System.DateTimeOffset? ifUnmodifiedSince = default) |
| | 1869 | | { |
| | 1870 | | // Validation |
| | 1871 | | if (resourceUri == null) |
| | 1872 | | { |
| | 1873 | | throw new System.ArgumentNullException(nameof(resourceUri)); |
| | 1874 | | } |
| | 1875 | | if (version == null) |
| | 1876 | | { |
| | 1877 | | throw new System.ArgumentNullException(nameof(version)); |
| | 1878 | | } |
| | 1879 | |
|
| | 1880 | | // Create the request |
| | 1881 | | Azure.Core.HttpMessage _message = pipeline.CreateMessage(); |
| | 1882 | | Azure.Core.Request _request = _message.Request; |
| | 1883 | |
|
| | 1884 | | // Set the endpoint |
| | 1885 | | _request.Method = Azure.Core.RequestMethod.Post; |
| | 1886 | | _request.Uri.Reset(resourceUri); |
| | 1887 | | if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C |
| | 1888 | |
|
| | 1889 | | // Add request headers |
| | 1890 | | _request.Headers.SetValue("x-ms-version", version); |
| | 1891 | | _request.Headers.SetValue("x-ms-lease-action", Azure.Storage.Files.DataLake.DataLakeRestClient.Serializa |
| | 1892 | | if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } |
| | 1893 | | if (xMSLeaseDuration != null) { _request.Headers.SetValue("x-ms-lease-duration", xMSLeaseDuration.Value. |
| | 1894 | | if (xMSLeaseBreakPeriod != null) { _request.Headers.SetValue("x-ms-lease-break-period", xMSLeaseBreakPer |
| | 1895 | | if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } |
| | 1896 | | if (proposedLeaseId != null) { _request.Headers.SetValue("x-ms-proposed-lease-id", proposedLeaseId); } |
| | 1897 | | if (ifMatch != null) { _request.Headers.SetValue("If-Match", ifMatch.Value.ToString()); } |
| | 1898 | | if (ifNoneMatch != null) { _request.Headers.SetValue("If-None-Match", ifNoneMatch.Value.ToString()); } |
| | 1899 | | if (ifModifiedSince != null) { _request.Headers.SetValue("If-Modified-Since", ifModifiedSince.Value.ToSt |
| | 1900 | | if (ifUnmodifiedSince != null) { _request.Headers.SetValue("If-Unmodified-Since", ifUnmodifiedSince.Valu |
| | 1901 | |
|
| | 1902 | | return _message; |
| | 1903 | | } |
| | 1904 | |
|
| | 1905 | | /// <summary> |
| | 1906 | | /// Create the Path.LeaseAsync response or throw a failure exception. |
| | 1907 | | /// </summary> |
| | 1908 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param> |
| | 1909 | | /// <param name="response">The raw Response.</param> |
| | 1910 | | /// <returns>The Path.LeaseAsync Azure.Response{Azure.Storage.Files.DataLake.Models.PathLeaseResult}.</retur |
| | 1911 | | internal static Azure.Response<Azure.Storage.Files.DataLake.Models.PathLeaseResult> LeaseAsync_CreateRespons |
| | 1912 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 1913 | | Azure.Response response) |
| | 1914 | | { |
| | 1915 | | // Process the response |
| | 1916 | | switch (response.Status) |
| | 1917 | | { |
| | 1918 | | case 200: |
| | 1919 | | { |
| | 1920 | | // Create the result |
| | 1921 | | Azure.Storage.Files.DataLake.Models.PathLeaseResult _value = new Azure.Storage.Files.DataLake.Mo |
| | 1922 | |
|
| | 1923 | | // Get response headers |
| | 1924 | | string _header; |
| | 1925 | | if (response.Headers.TryGetValue("ETag", out _header)) |
| | 1926 | | { |
| | 1927 | | _value.ETag = new Azure.ETag(_header); |
| | 1928 | | } |
| | 1929 | | if (response.Headers.TryGetValue("Last-Modified", out _header)) |
| | 1930 | | { |
| | 1931 | | _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo. |
| | 1932 | | } |
| | 1933 | | if (response.Headers.TryGetValue("x-ms-lease-id", out _header)) |
| | 1934 | | { |
| | 1935 | | _value.LeaseId = _header; |
| | 1936 | | } |
| | 1937 | |
|
| | 1938 | | // Create the response |
| | 1939 | | return Response.FromValue(_value, response); |
| | 1940 | | } |
| | 1941 | | case 201: |
| | 1942 | | { |
| | 1943 | | // Create the result |
| | 1944 | | Azure.Storage.Files.DataLake.Models.PathLeaseResult _value = new Azure.Storage.Files.DataLake.Mo |
| | 1945 | |
|
| | 1946 | | // Get response headers |
| | 1947 | | string _header; |
| | 1948 | | if (response.Headers.TryGetValue("ETag", out _header)) |
| | 1949 | | { |
| | 1950 | | _value.ETag = new Azure.ETag(_header); |
| | 1951 | | } |
| | 1952 | | if (response.Headers.TryGetValue("Last-Modified", out _header)) |
| | 1953 | | { |
| | 1954 | | _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo. |
| | 1955 | | } |
| | 1956 | | if (response.Headers.TryGetValue("x-ms-lease-id", out _header)) |
| | 1957 | | { |
| | 1958 | | _value.LeaseId = _header; |
| | 1959 | | } |
| | 1960 | |
|
| | 1961 | | // Create the response |
| | 1962 | | return Response.FromValue(_value, response); |
| | 1963 | | } |
| | 1964 | | case 202: |
| | 1965 | | { |
| | 1966 | | // Create the result |
| | 1967 | | Azure.Storage.Files.DataLake.Models.PathLeaseResult _value = new Azure.Storage.Files.DataLake.Mo |
| | 1968 | |
|
| | 1969 | | // Get response headers |
| | 1970 | | string _header; |
| | 1971 | | if (response.Headers.TryGetValue("ETag", out _header)) |
| | 1972 | | { |
| | 1973 | | _value.ETag = new Azure.ETag(_header); |
| | 1974 | | } |
| | 1975 | | if (response.Headers.TryGetValue("Last-Modified", out _header)) |
| | 1976 | | { |
| | 1977 | | _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo. |
| | 1978 | | } |
| | 1979 | | if (response.Headers.TryGetValue("x-ms-lease-time", out _header)) |
| | 1980 | | { |
| | 1981 | | _value.LeaseTime = _header; |
| | 1982 | | } |
| | 1983 | |
|
| | 1984 | | // Create the response |
| | 1985 | | return Response.FromValue(_value, response); |
| | 1986 | | } |
| | 1987 | | default: |
| | 1988 | | { |
| | 1989 | | // Create the result |
| | 1990 | | string _value; |
| | 1991 | | using (System.IO.StreamReader _streamReader = new System.IO.StreamReader(response.ContentStream) |
| | 1992 | | { |
| | 1993 | | _value = _streamReader.ReadToEnd(); |
| | 1994 | | } |
| | 1995 | |
|
| | 1996 | | throw _value.CreateException(clientDiagnostics, response); |
| | 1997 | | } |
| | 1998 | | } |
| | 1999 | | } |
| | 2000 | | #endregion Path.LeaseAsync |
| | 2001 | |
|
| | 2002 | | #region Path.ReadAsync |
| | 2003 | | /// <summary> |
| | 2004 | | /// Read the contents of a file. For read operations, range requests are supported. This operation supports |
| | 2005 | | /// </summary> |
| | 2006 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param> |
| | 2007 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 2008 | | /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de |
| | 2009 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 2010 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 2011 | | /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href=" |
| | 2012 | | /// <param name="range">The HTTP Range request header specifies one or more byte ranges of the resource to b |
| | 2013 | | /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma |
| | 2014 | | /// <param name="xMSRangeGetContentMd5">Optional. When this header is set to "true" and specified together w |
| | 2015 | | /// <param name="ifMatch">Specify an ETag value to operate only on blobs with a matching value.</param> |
| | 2016 | | /// <param name="ifNoneMatch">Specify an ETag value to operate only on blobs without a matching value.</para |
| | 2017 | | /// <param name="ifModifiedSince">Specify this header value to operate only on a blob if it has been modifie |
| | 2018 | | /// <param name="ifUnmodifiedSince">Specify this header value to operate only on a blob if it has not been m |
| | 2019 | | /// <param name="async">Whether to invoke the operation asynchronously. The default value is true.</param> |
| | 2020 | | /// <param name="operationName">Operation name.</param> |
| | 2021 | | /// <param name="cancellationToken">Cancellation token.</param> |
| | 2022 | | /// <returns>Azure.Response{Azure.Storage.Files.DataLake.Models.PathReadResult}</returns> |
| | 2023 | | public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.DataLake.Models.Path |
| | 2024 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 2025 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 2026 | | System.Uri resourceUri, |
| | 2027 | | string version, |
| | 2028 | | string requestId = default, |
| | 2029 | | int? timeout = default, |
| | 2030 | | string range = default, |
| | 2031 | | string leaseId = default, |
| | 2032 | | bool? xMSRangeGetContentMd5 = default, |
| | 2033 | | Azure.ETag? ifMatch = default, |
| | 2034 | | Azure.ETag? ifNoneMatch = default, |
| | 2035 | | System.DateTimeOffset? ifModifiedSince = default, |
| | 2036 | | System.DateTimeOffset? ifUnmodifiedSince = default, |
| | 2037 | | bool async = true, |
| | 2038 | | string operationName = "PathClient.Read", |
| | 2039 | | System.Threading.CancellationToken cancellationToken = default) |
| | 2040 | | { |
| | 2041 | | Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName); |
| | 2042 | | try |
| | 2043 | | { |
| | 2044 | | _scope.AddAttribute("url", resourceUri); |
| | 2045 | | _scope.Start(); |
| | 2046 | | using (Azure.Core.HttpMessage _message = ReadAsync_CreateMessage( |
| | 2047 | | pipeline, |
| | 2048 | | resourceUri, |
| | 2049 | | version, |
| | 2050 | | requestId, |
| | 2051 | | timeout, |
| | 2052 | | range, |
| | 2053 | | leaseId, |
| | 2054 | | xMSRangeGetContentMd5, |
| | 2055 | | ifMatch, |
| | 2056 | | ifNoneMatch, |
| | 2057 | | ifModifiedSince, |
| | 2058 | | ifUnmodifiedSince)) |
| | 2059 | | { |
| | 2060 | | if (async) |
| | 2061 | | { |
| | 2062 | | // Send the request asynchronously if we're being called via an async path |
| | 2063 | | await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false); |
| | 2064 | | } |
| | 2065 | | else |
| | 2066 | | { |
| | 2067 | | // Send the request synchronously through the API that blocks if we're being called via a sy |
| | 2068 | | // (this is safe because the Task will complete before the user can call Wait) |
| | 2069 | | pipeline.Send(_message, cancellationToken); |
| | 2070 | | } |
| | 2071 | | Azure.Response _response = _message.Response; |
| | 2072 | | cancellationToken.ThrowIfCancellationRequested(); |
| | 2073 | | return ReadAsync_CreateResponse(clientDiagnostics, _response); |
| | 2074 | | } |
| | 2075 | | } |
| | 2076 | | catch (System.Exception ex) |
| | 2077 | | { |
| | 2078 | | _scope.Failed(ex); |
| | 2079 | | throw; |
| | 2080 | | } |
| | 2081 | | finally |
| | 2082 | | { |
| | 2083 | | _scope.Dispose(); |
| | 2084 | | } |
| | 2085 | | } |
| | 2086 | |
|
| | 2087 | | /// <summary> |
| | 2088 | | /// Create the Path.ReadAsync request. |
| | 2089 | | /// </summary> |
| | 2090 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 2091 | | /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de |
| | 2092 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 2093 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 2094 | | /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href=" |
| | 2095 | | /// <param name="range">The HTTP Range request header specifies one or more byte ranges of the resource to b |
| | 2096 | | /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma |
| | 2097 | | /// <param name="xMSRangeGetContentMd5">Optional. When this header is set to "true" and specified together w |
| | 2098 | | /// <param name="ifMatch">Specify an ETag value to operate only on blobs with a matching value.</param> |
| | 2099 | | /// <param name="ifNoneMatch">Specify an ETag value to operate only on blobs without a matching value.</para |
| | 2100 | | /// <param name="ifModifiedSince">Specify this header value to operate only on a blob if it has been modifie |
| | 2101 | | /// <param name="ifUnmodifiedSince">Specify this header value to operate only on a blob if it has not been m |
| | 2102 | | /// <returns>The Path.ReadAsync Message.</returns> |
| | 2103 | | internal static Azure.Core.HttpMessage ReadAsync_CreateMessage( |
| | 2104 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 2105 | | System.Uri resourceUri, |
| | 2106 | | string version, |
| | 2107 | | string requestId = default, |
| | 2108 | | int? timeout = default, |
| | 2109 | | string range = default, |
| | 2110 | | string leaseId = default, |
| | 2111 | | bool? xMSRangeGetContentMd5 = default, |
| | 2112 | | Azure.ETag? ifMatch = default, |
| | 2113 | | Azure.ETag? ifNoneMatch = default, |
| | 2114 | | System.DateTimeOffset? ifModifiedSince = default, |
| | 2115 | | System.DateTimeOffset? ifUnmodifiedSince = default) |
| | 2116 | | { |
| | 2117 | | // Validation |
| | 2118 | | if (resourceUri == null) |
| | 2119 | | { |
| | 2120 | | throw new System.ArgumentNullException(nameof(resourceUri)); |
| | 2121 | | } |
| | 2122 | | if (version == null) |
| | 2123 | | { |
| | 2124 | | throw new System.ArgumentNullException(nameof(version)); |
| | 2125 | | } |
| | 2126 | |
|
| | 2127 | | // Create the request |
| | 2128 | | Azure.Core.HttpMessage _message = pipeline.CreateMessage(); |
| | 2129 | | Azure.Core.Request _request = _message.Request; |
| | 2130 | |
|
| | 2131 | | // Set the endpoint |
| | 2132 | | _request.Method = Azure.Core.RequestMethod.Get; |
| | 2133 | | _request.Uri.Reset(resourceUri); |
| | 2134 | | if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C |
| | 2135 | |
|
| | 2136 | | // Add request headers |
| | 2137 | | _request.Headers.SetValue("x-ms-version", version); |
| | 2138 | | if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } |
| | 2139 | | if (range != null) { _request.Headers.SetValue("Range", range); } |
| | 2140 | | if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } |
| | 2141 | | if (xMSRangeGetContentMd5 != null) { |
| | 2142 | | #pragma warning disable CA1308 // Normalize strings to uppercase |
| | 2143 | | _request.Headers.SetValue("x-ms-range-get-content-md5", xMSRangeGetContentMd5.Value.ToString(System.Glob |
| | 2144 | | #pragma warning restore CA1308 // Normalize strings to uppercase |
| | 2145 | | } |
| | 2146 | | if (ifMatch != null) { _request.Headers.SetValue("If-Match", ifMatch.Value.ToString()); } |
| | 2147 | | if (ifNoneMatch != null) { _request.Headers.SetValue("If-None-Match", ifNoneMatch.Value.ToString()); } |
| | 2148 | | if (ifModifiedSince != null) { _request.Headers.SetValue("If-Modified-Since", ifModifiedSince.Value.ToSt |
| | 2149 | | if (ifUnmodifiedSince != null) { _request.Headers.SetValue("If-Unmodified-Since", ifUnmodifiedSince.Valu |
| | 2150 | |
|
| | 2151 | | return _message; |
| | 2152 | | } |
| | 2153 | |
|
| | 2154 | | /// <summary> |
| | 2155 | | /// Create the Path.ReadAsync response or throw a failure exception. |
| | 2156 | | /// </summary> |
| | 2157 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param> |
| | 2158 | | /// <param name="response">The raw Response.</param> |
| | 2159 | | /// <returns>The Path.ReadAsync Azure.Response{Azure.Storage.Files.DataLake.Models.PathReadResult}.</returns |
| | 2160 | | internal static Azure.Response<Azure.Storage.Files.DataLake.Models.PathReadResult> ReadAsync_CreateResponse( |
| | 2161 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 2162 | | Azure.Response response) |
| | 2163 | | { |
| | 2164 | | // Process the response |
| | 2165 | | switch (response.Status) |
| | 2166 | | { |
| | 2167 | | case 200: |
| | 2168 | | { |
| | 2169 | | // Create the result |
| | 2170 | | Azure.Storage.Files.DataLake.Models.PathReadResult _value = new Azure.Storage.Files.DataLake.Mod |
| | 2171 | | _value.Body = response.ContentStream; // You should manually wrap with RetriableStream! |
| | 2172 | |
|
| | 2173 | | // Get response headers |
| | 2174 | | string _header; |
| | 2175 | | if (response.Headers.TryGetValue("Accept-Ranges", out _header)) |
| | 2176 | | { |
| | 2177 | | _value.AcceptRanges = _header; |
| | 2178 | | } |
| | 2179 | | if (response.Headers.TryGetValue("Cache-Control", out _header)) |
| | 2180 | | { |
| | 2181 | | _value.CacheControl = _header; |
| | 2182 | | } |
| | 2183 | | if (response.Headers.TryGetValue("Content-Disposition", out _header)) |
| | 2184 | | { |
| | 2185 | | _value.ContentDisposition = _header; |
| | 2186 | | } |
| | 2187 | | if (response.Headers.TryGetValue("Content-Encoding", out _header)) |
| | 2188 | | { |
| | 2189 | | _value.ContentEncoding = _header; |
| | 2190 | | } |
| | 2191 | | if (response.Headers.TryGetValue("Content-Language", out _header)) |
| | 2192 | | { |
| | 2193 | | _value.ContentLanguage = _header; |
| | 2194 | | } |
| | 2195 | | if (response.Headers.TryGetValue("Content-Length", out _header)) |
| | 2196 | | { |
| | 2197 | | _value.ContentLength = long.Parse(_header, System.Globalization.CultureInfo.InvariantCulture |
| | 2198 | | } |
| | 2199 | | if (response.Headers.TryGetValue("Content-Range", out _header)) |
| | 2200 | | { |
| | 2201 | | _value.ContentRange = _header; |
| | 2202 | | } |
| | 2203 | | if (response.Headers.TryGetValue("Content-Type", out _header)) |
| | 2204 | | { |
| | 2205 | | _value.ContentType = _header; |
| | 2206 | | } |
| | 2207 | | if (response.Headers.TryGetValue("Content-MD5", out _header)) |
| | 2208 | | { |
| | 2209 | | _value.ContentMD5 = _header; |
| | 2210 | | } |
| | 2211 | | if (response.Headers.TryGetValue("ETag", out _header)) |
| | 2212 | | { |
| | 2213 | | _value.ETag = new Azure.ETag(_header); |
| | 2214 | | } |
| | 2215 | | if (response.Headers.TryGetValue("Last-Modified", out _header)) |
| | 2216 | | { |
| | 2217 | | _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo. |
| | 2218 | | } |
| | 2219 | | if (response.Headers.TryGetValue("x-ms-resource-type", out _header)) |
| | 2220 | | { |
| | 2221 | | _value.ResourceType = _header; |
| | 2222 | | } |
| | 2223 | | if (response.Headers.TryGetValue("x-ms-properties", out _header)) |
| | 2224 | | { |
| | 2225 | | _value.Properties = _header; |
| | 2226 | | } |
| | 2227 | | if (response.Headers.TryGetValue("x-ms-lease-duration", out _header)) |
| | 2228 | | { |
| | 2229 | | _value.LeaseDuration = _header; |
| | 2230 | | } |
| | 2231 | | if (response.Headers.TryGetValue("x-ms-lease-state", out _header)) |
| | 2232 | | { |
| | 2233 | | _value.LeaseState = _header; |
| | 2234 | | } |
| | 2235 | | if (response.Headers.TryGetValue("x-ms-lease-status", out _header)) |
| | 2236 | | { |
| | 2237 | | _value.LeaseStatus = _header; |
| | 2238 | | } |
| | 2239 | |
|
| | 2240 | | // Create the response |
| | 2241 | | return Response.FromValue(_value, response); |
| | 2242 | | } |
| | 2243 | | case 206: |
| | 2244 | | { |
| | 2245 | | // Create the result |
| | 2246 | | Azure.Storage.Files.DataLake.Models.PathReadResult _value = new Azure.Storage.Files.DataLake.Mod |
| | 2247 | | _value.Body = response.ContentStream; // You should manually wrap with RetriableStream! |
| | 2248 | |
|
| | 2249 | | // Get response headers |
| | 2250 | | string _header; |
| | 2251 | | if (response.Headers.TryGetValue("Accept-Ranges", out _header)) |
| | 2252 | | { |
| | 2253 | | _value.AcceptRanges = _header; |
| | 2254 | | } |
| | 2255 | | if (response.Headers.TryGetValue("Cache-Control", out _header)) |
| | 2256 | | { |
| | 2257 | | _value.CacheControl = _header; |
| | 2258 | | } |
| | 2259 | | if (response.Headers.TryGetValue("Content-Disposition", out _header)) |
| | 2260 | | { |
| | 2261 | | _value.ContentDisposition = _header; |
| | 2262 | | } |
| | 2263 | | if (response.Headers.TryGetValue("Content-Encoding", out _header)) |
| | 2264 | | { |
| | 2265 | | _value.ContentEncoding = _header; |
| | 2266 | | } |
| | 2267 | | if (response.Headers.TryGetValue("Content-Language", out _header)) |
| | 2268 | | { |
| | 2269 | | _value.ContentLanguage = _header; |
| | 2270 | | } |
| | 2271 | | if (response.Headers.TryGetValue("Content-Length", out _header)) |
| | 2272 | | { |
| | 2273 | | _value.ContentLength = long.Parse(_header, System.Globalization.CultureInfo.InvariantCulture |
| | 2274 | | } |
| | 2275 | | if (response.Headers.TryGetValue("Content-Range", out _header)) |
| | 2276 | | { |
| | 2277 | | _value.ContentRange = _header; |
| | 2278 | | } |
| | 2279 | | if (response.Headers.TryGetValue("Content-Type", out _header)) |
| | 2280 | | { |
| | 2281 | | _value.ContentType = _header; |
| | 2282 | | } |
| | 2283 | | if (response.Headers.TryGetValue("Content-MD5", out _header)) |
| | 2284 | | { |
| | 2285 | | _value.ContentMD5 = _header; |
| | 2286 | | } |
| | 2287 | | if (response.Headers.TryGetValue("x-ms-content-md5", out _header)) |
| | 2288 | | { |
| | 2289 | | _value.XMSContentMd5 = _header; |
| | 2290 | | } |
| | 2291 | | if (response.Headers.TryGetValue("ETag", out _header)) |
| | 2292 | | { |
| | 2293 | | _value.ETag = new Azure.ETag(_header); |
| | 2294 | | } |
| | 2295 | | if (response.Headers.TryGetValue("Last-Modified", out _header)) |
| | 2296 | | { |
| | 2297 | | _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo. |
| | 2298 | | } |
| | 2299 | | if (response.Headers.TryGetValue("x-ms-resource-type", out _header)) |
| | 2300 | | { |
| | 2301 | | _value.ResourceType = _header; |
| | 2302 | | } |
| | 2303 | | if (response.Headers.TryGetValue("x-ms-properties", out _header)) |
| | 2304 | | { |
| | 2305 | | _value.Properties = _header; |
| | 2306 | | } |
| | 2307 | | if (response.Headers.TryGetValue("x-ms-lease-duration", out _header)) |
| | 2308 | | { |
| | 2309 | | _value.LeaseDuration = _header; |
| | 2310 | | } |
| | 2311 | | if (response.Headers.TryGetValue("x-ms-lease-state", out _header)) |
| | 2312 | | { |
| | 2313 | | _value.LeaseState = _header; |
| | 2314 | | } |
| | 2315 | | if (response.Headers.TryGetValue("x-ms-lease-status", out _header)) |
| | 2316 | | { |
| | 2317 | | _value.LeaseStatus = _header; |
| | 2318 | | } |
| | 2319 | |
|
| | 2320 | | // Create the response |
| | 2321 | | return Response.FromValue(_value, response); |
| | 2322 | | } |
| | 2323 | | case 304: |
| | 2324 | | { |
| | 2325 | | return new Azure.NoBodyResponse<Azure.Storage.Files.DataLake.Models.PathReadResult>(response); |
| | 2326 | | } |
| | 2327 | | default: |
| | 2328 | | { |
| | 2329 | | // Create the result |
| | 2330 | | string _value; |
| | 2331 | | using (System.IO.StreamReader _streamReader = new System.IO.StreamReader(response.ContentStream) |
| | 2332 | | { |
| | 2333 | | _value = _streamReader.ReadToEnd(); |
| | 2334 | | } |
| | 2335 | |
|
| | 2336 | | throw _value.CreateException(clientDiagnostics, response); |
| | 2337 | | } |
| | 2338 | | } |
| | 2339 | | } |
| | 2340 | | #endregion Path.ReadAsync |
| | 2341 | |
|
| | 2342 | | #region Path.GetPropertiesAsync |
| | 2343 | | /// <summary> |
| | 2344 | | /// Get Properties returns all system and user defined properties for a path. Get Status returns all system |
| | 2345 | | /// </summary> |
| | 2346 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param> |
| | 2347 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 2348 | | /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de |
| | 2349 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 2350 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 2351 | | /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href=" |
| | 2352 | | /// <param name="action">Optional. If the value is "getStatus" only the system defined properties for the pa |
| | 2353 | | /// <param name="upn">Optional. Valid only when Hierarchical Namespace is enabled for the account. If "true" |
| | 2354 | | /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma |
| | 2355 | | /// <param name="ifMatch">Specify an ETag value to operate only on blobs with a matching value.</param> |
| | 2356 | | /// <param name="ifNoneMatch">Specify an ETag value to operate only on blobs without a matching value.</para |
| | 2357 | | /// <param name="ifModifiedSince">Specify this header value to operate only on a blob if it has been modifie |
| | 2358 | | /// <param name="ifUnmodifiedSince">Specify this header value to operate only on a blob if it has not been m |
| | 2359 | | /// <param name="async">Whether to invoke the operation asynchronously. The default value is true.</param> |
| | 2360 | | /// <param name="operationName">Operation name.</param> |
| | 2361 | | /// <param name="cancellationToken">Cancellation token.</param> |
| | 2362 | | /// <returns>Azure.Response{Azure.Storage.Files.DataLake.Models.PathGetPropertiesResult}</returns> |
| | 2363 | | public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.DataLake.Models.Path |
| | 2364 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 2365 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 2366 | | System.Uri resourceUri, |
| | 2367 | | string version, |
| | 2368 | | string requestId = default, |
| | 2369 | | int? timeout = default, |
| | 2370 | | Azure.Storage.Files.DataLake.Models.PathGetPropertiesAction? action = default, |
| | 2371 | | bool? upn = default, |
| | 2372 | | string leaseId = default, |
| | 2373 | | Azure.ETag? ifMatch = default, |
| | 2374 | | Azure.ETag? ifNoneMatch = default, |
| | 2375 | | System.DateTimeOffset? ifModifiedSince = default, |
| | 2376 | | System.DateTimeOffset? ifUnmodifiedSince = default, |
| | 2377 | | bool async = true, |
| | 2378 | | string operationName = "PathClient.GetProperties", |
| | 2379 | | System.Threading.CancellationToken cancellationToken = default) |
| | 2380 | | { |
| | 2381 | | Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName); |
| | 2382 | | try |
| | 2383 | | { |
| | 2384 | | _scope.AddAttribute("url", resourceUri); |
| | 2385 | | _scope.Start(); |
| | 2386 | | using (Azure.Core.HttpMessage _message = GetPropertiesAsync_CreateMessage( |
| | 2387 | | pipeline, |
| | 2388 | | resourceUri, |
| | 2389 | | version, |
| | 2390 | | requestId, |
| | 2391 | | timeout, |
| | 2392 | | action, |
| | 2393 | | upn, |
| | 2394 | | leaseId, |
| | 2395 | | ifMatch, |
| | 2396 | | ifNoneMatch, |
| | 2397 | | ifModifiedSince, |
| | 2398 | | ifUnmodifiedSince)) |
| | 2399 | | { |
| | 2400 | | if (async) |
| | 2401 | | { |
| | 2402 | | // Send the request asynchronously if we're being called via an async path |
| | 2403 | | await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false); |
| | 2404 | | } |
| | 2405 | | else |
| | 2406 | | { |
| | 2407 | | // Send the request synchronously through the API that blocks if we're being called via a sy |
| | 2408 | | // (this is safe because the Task will complete before the user can call Wait) |
| | 2409 | | pipeline.Send(_message, cancellationToken); |
| | 2410 | | } |
| | 2411 | | Azure.Response _response = _message.Response; |
| | 2412 | | cancellationToken.ThrowIfCancellationRequested(); |
| | 2413 | | return GetPropertiesAsync_CreateResponse(clientDiagnostics, _response); |
| | 2414 | | } |
| | 2415 | | } |
| | 2416 | | catch (System.Exception ex) |
| | 2417 | | { |
| | 2418 | | _scope.Failed(ex); |
| | 2419 | | throw; |
| | 2420 | | } |
| | 2421 | | finally |
| | 2422 | | { |
| | 2423 | | _scope.Dispose(); |
| | 2424 | | } |
| | 2425 | | } |
| | 2426 | |
|
| | 2427 | | /// <summary> |
| | 2428 | | /// Create the Path.GetPropertiesAsync request. |
| | 2429 | | /// </summary> |
| | 2430 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 2431 | | /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de |
| | 2432 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 2433 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 2434 | | /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href=" |
| | 2435 | | /// <param name="action">Optional. If the value is "getStatus" only the system defined properties for the pa |
| | 2436 | | /// <param name="upn">Optional. Valid only when Hierarchical Namespace is enabled for the account. If "true" |
| | 2437 | | /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma |
| | 2438 | | /// <param name="ifMatch">Specify an ETag value to operate only on blobs with a matching value.</param> |
| | 2439 | | /// <param name="ifNoneMatch">Specify an ETag value to operate only on blobs without a matching value.</para |
| | 2440 | | /// <param name="ifModifiedSince">Specify this header value to operate only on a blob if it has been modifie |
| | 2441 | | /// <param name="ifUnmodifiedSince">Specify this header value to operate only on a blob if it has not been m |
| | 2442 | | /// <returns>The Path.GetPropertiesAsync Message.</returns> |
| | 2443 | | internal static Azure.Core.HttpMessage GetPropertiesAsync_CreateMessage( |
| | 2444 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 2445 | | System.Uri resourceUri, |
| | 2446 | | string version, |
| | 2447 | | string requestId = default, |
| | 2448 | | int? timeout = default, |
| | 2449 | | Azure.Storage.Files.DataLake.Models.PathGetPropertiesAction? action = default, |
| | 2450 | | bool? upn = default, |
| | 2451 | | string leaseId = default, |
| | 2452 | | Azure.ETag? ifMatch = default, |
| | 2453 | | Azure.ETag? ifNoneMatch = default, |
| | 2454 | | System.DateTimeOffset? ifModifiedSince = default, |
| | 2455 | | System.DateTimeOffset? ifUnmodifiedSince = default) |
| | 2456 | | { |
| | 2457 | | // Validation |
| | 2458 | | if (resourceUri == null) |
| | 2459 | | { |
| | 2460 | | throw new System.ArgumentNullException(nameof(resourceUri)); |
| | 2461 | | } |
| | 2462 | | if (version == null) |
| | 2463 | | { |
| | 2464 | | throw new System.ArgumentNullException(nameof(version)); |
| | 2465 | | } |
| | 2466 | |
|
| | 2467 | | // Create the request |
| | 2468 | | Azure.Core.HttpMessage _message = pipeline.CreateMessage(); |
| | 2469 | | Azure.Core.Request _request = _message.Request; |
| | 2470 | |
|
| | 2471 | | // Set the endpoint |
| | 2472 | | _request.Method = Azure.Core.RequestMethod.Head; |
| | 2473 | | _request.Uri.Reset(resourceUri); |
| | 2474 | | if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C |
| | 2475 | | if (action != null) { _request.Uri.AppendQuery("action", Azure.Storage.Files.DataLake.DataLakeRestClient |
| | 2476 | | if (upn != null) { |
| | 2477 | | #pragma warning disable CA1308 // Normalize strings to uppercase |
| | 2478 | | _request.Uri.AppendQuery("upn", upn.Value.ToString(System.Globalization.CultureInfo.InvariantCulture).To |
| | 2479 | | #pragma warning restore CA1308 // Normalize strings to uppercase |
| | 2480 | | } |
| | 2481 | |
|
| | 2482 | | // Add request headers |
| | 2483 | | _request.Headers.SetValue("x-ms-version", version); |
| | 2484 | | if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } |
| | 2485 | | if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } |
| | 2486 | | if (ifMatch != null) { _request.Headers.SetValue("If-Match", ifMatch.Value.ToString()); } |
| | 2487 | | if (ifNoneMatch != null) { _request.Headers.SetValue("If-None-Match", ifNoneMatch.Value.ToString()); } |
| | 2488 | | if (ifModifiedSince != null) { _request.Headers.SetValue("If-Modified-Since", ifModifiedSince.Value.ToSt |
| | 2489 | | if (ifUnmodifiedSince != null) { _request.Headers.SetValue("If-Unmodified-Since", ifUnmodifiedSince.Valu |
| | 2490 | |
|
| | 2491 | | return _message; |
| | 2492 | | } |
| | 2493 | |
|
| | 2494 | | /// <summary> |
| | 2495 | | /// Create the Path.GetPropertiesAsync response or throw a failure exception. |
| | 2496 | | /// </summary> |
| | 2497 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param> |
| | 2498 | | /// <param name="response">The raw Response.</param> |
| | 2499 | | /// <returns>The Path.GetPropertiesAsync Azure.Response{Azure.Storage.Files.DataLake.Models.PathGetPropertie |
| | 2500 | | internal static Azure.Response<Azure.Storage.Files.DataLake.Models.PathGetPropertiesResult> GetPropertiesAsy |
| | 2501 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 2502 | | Azure.Response response) |
| | 2503 | | { |
| | 2504 | | // Process the response |
| | 2505 | | switch (response.Status) |
| | 2506 | | { |
| | 2507 | | case 200: |
| | 2508 | | { |
| | 2509 | | // Create the result |
| | 2510 | | Azure.Storage.Files.DataLake.Models.PathGetPropertiesResult _value = new Azure.Storage.Files.Dat |
| | 2511 | |
|
| | 2512 | | // Get response headers |
| | 2513 | | string _header; |
| | 2514 | | if (response.Headers.TryGetValue("Accept-Ranges", out _header)) |
| | 2515 | | { |
| | 2516 | | _value.AcceptRanges = _header; |
| | 2517 | | } |
| | 2518 | | if (response.Headers.TryGetValue("Cache-Control", out _header)) |
| | 2519 | | { |
| | 2520 | | _value.CacheControl = _header; |
| | 2521 | | } |
| | 2522 | | if (response.Headers.TryGetValue("Content-Disposition", out _header)) |
| | 2523 | | { |
| | 2524 | | _value.ContentDisposition = _header; |
| | 2525 | | } |
| | 2526 | | if (response.Headers.TryGetValue("Content-Encoding", out _header)) |
| | 2527 | | { |
| | 2528 | | _value.ContentEncoding = _header; |
| | 2529 | | } |
| | 2530 | | if (response.Headers.TryGetValue("Content-Language", out _header)) |
| | 2531 | | { |
| | 2532 | | _value.ContentLanguage = _header; |
| | 2533 | | } |
| | 2534 | | if (response.Headers.TryGetValue("Content-Length", out _header)) |
| | 2535 | | { |
| | 2536 | | _value.ContentLength = long.Parse(_header, System.Globalization.CultureInfo.InvariantCulture |
| | 2537 | | } |
| | 2538 | | if (response.Headers.TryGetValue("Content-Range", out _header)) |
| | 2539 | | { |
| | 2540 | | _value.ContentRange = _header; |
| | 2541 | | } |
| | 2542 | | if (response.Headers.TryGetValue("Content-Type", out _header)) |
| | 2543 | | { |
| | 2544 | | _value.ContentType = _header; |
| | 2545 | | } |
| | 2546 | | if (response.Headers.TryGetValue("Content-MD5", out _header)) |
| | 2547 | | { |
| | 2548 | | _value.ContentMD5 = _header; |
| | 2549 | | } |
| | 2550 | | if (response.Headers.TryGetValue("ETag", out _header)) |
| | 2551 | | { |
| | 2552 | | _value.ETag = new Azure.ETag(_header); |
| | 2553 | | } |
| | 2554 | | if (response.Headers.TryGetValue("Last-Modified", out _header)) |
| | 2555 | | { |
| | 2556 | | _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo. |
| | 2557 | | } |
| | 2558 | | if (response.Headers.TryGetValue("x-ms-resource-type", out _header)) |
| | 2559 | | { |
| | 2560 | | _value.ResourceType = _header; |
| | 2561 | | } |
| | 2562 | | if (response.Headers.TryGetValue("x-ms-properties", out _header)) |
| | 2563 | | { |
| | 2564 | | _value.Properties = _header; |
| | 2565 | | } |
| | 2566 | | if (response.Headers.TryGetValue("x-ms-owner", out _header)) |
| | 2567 | | { |
| | 2568 | | _value.Owner = _header; |
| | 2569 | | } |
| | 2570 | | if (response.Headers.TryGetValue("x-ms-group", out _header)) |
| | 2571 | | { |
| | 2572 | | _value.Group = _header; |
| | 2573 | | } |
| | 2574 | | if (response.Headers.TryGetValue("x-ms-permissions", out _header)) |
| | 2575 | | { |
| | 2576 | | _value.Permissions = _header; |
| | 2577 | | } |
| | 2578 | | if (response.Headers.TryGetValue("x-ms-acl", out _header)) |
| | 2579 | | { |
| | 2580 | | _value.ACL = _header; |
| | 2581 | | } |
| | 2582 | | if (response.Headers.TryGetValue("x-ms-lease-duration", out _header)) |
| | 2583 | | { |
| | 2584 | | _value.LeaseDuration = _header; |
| | 2585 | | } |
| | 2586 | | if (response.Headers.TryGetValue("x-ms-lease-state", out _header)) |
| | 2587 | | { |
| | 2588 | | _value.LeaseState = _header; |
| | 2589 | | } |
| | 2590 | | if (response.Headers.TryGetValue("x-ms-lease-status", out _header)) |
| | 2591 | | { |
| | 2592 | | _value.LeaseStatus = _header; |
| | 2593 | | } |
| | 2594 | |
|
| | 2595 | | // Create the response |
| | 2596 | | return Response.FromValue(_value, response); |
| | 2597 | | } |
| | 2598 | | case 304: |
| | 2599 | | { |
| | 2600 | | return new Azure.NoBodyResponse<Azure.Storage.Files.DataLake.Models.PathGetPropertiesResult>(res |
| | 2601 | | } |
| | 2602 | | default: |
| | 2603 | | { |
| | 2604 | | // Create the result |
| | 2605 | | string _value; |
| | 2606 | | using (System.IO.StreamReader _streamReader = new System.IO.StreamReader(response.ContentStream) |
| | 2607 | | { |
| | 2608 | | _value = _streamReader.ReadToEnd(); |
| | 2609 | | } |
| | 2610 | |
|
| | 2611 | | throw _value.CreateException(clientDiagnostics, response); |
| | 2612 | | } |
| | 2613 | | } |
| | 2614 | | } |
| | 2615 | | #endregion Path.GetPropertiesAsync |
| | 2616 | |
|
| | 2617 | | #region Path.DeleteAsync |
| | 2618 | | /// <summary> |
| | 2619 | | /// Delete the file or directory. This operation supports conditional HTTP requests. For more information, |
| | 2620 | | /// </summary> |
| | 2621 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param> |
| | 2622 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 2623 | | /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de |
| | 2624 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 2625 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 2626 | | /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href=" |
| | 2627 | | /// <param name="recursive">Required</param> |
| | 2628 | | /// <param name="continuation">Optional. When deleting a directory, the number of paths that are deleted wi |
| | 2629 | | /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma |
| | 2630 | | /// <param name="ifMatch">Specify an ETag value to operate only on blobs with a matching value.</param> |
| | 2631 | | /// <param name="ifNoneMatch">Specify an ETag value to operate only on blobs without a matching value.</para |
| | 2632 | | /// <param name="ifModifiedSince">Specify this header value to operate only on a blob if it has been modifie |
| | 2633 | | /// <param name="ifUnmodifiedSince">Specify this header value to operate only on a blob if it has not been m |
| | 2634 | | /// <param name="async">Whether to invoke the operation asynchronously. The default value is true.</param> |
| | 2635 | | /// <param name="operationName">Operation name.</param> |
| | 2636 | | /// <param name="cancellationToken">Cancellation token.</param> |
| | 2637 | | /// <returns>Azure.Response{Azure.Storage.Files.DataLake.Models.PathDeleteResult}</returns> |
| | 2638 | | public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.DataLake.Models.Path |
| | 2639 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 2640 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 2641 | | System.Uri resourceUri, |
| | 2642 | | string version, |
| | 2643 | | string requestId = default, |
| | 2644 | | int? timeout = default, |
| | 2645 | | bool? recursive = default, |
| | 2646 | | string continuation = default, |
| | 2647 | | string leaseId = default, |
| | 2648 | | Azure.ETag? ifMatch = default, |
| | 2649 | | Azure.ETag? ifNoneMatch = default, |
| | 2650 | | System.DateTimeOffset? ifModifiedSince = default, |
| | 2651 | | System.DateTimeOffset? ifUnmodifiedSince = default, |
| | 2652 | | bool async = true, |
| | 2653 | | string operationName = "PathClient.Delete", |
| | 2654 | | System.Threading.CancellationToken cancellationToken = default) |
| | 2655 | | { |
| | 2656 | | Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName); |
| | 2657 | | try |
| | 2658 | | { |
| | 2659 | | _scope.AddAttribute("url", resourceUri); |
| | 2660 | | _scope.Start(); |
| | 2661 | | using (Azure.Core.HttpMessage _message = DeleteAsync_CreateMessage( |
| | 2662 | | pipeline, |
| | 2663 | | resourceUri, |
| | 2664 | | version, |
| | 2665 | | requestId, |
| | 2666 | | timeout, |
| | 2667 | | recursive, |
| | 2668 | | continuation, |
| | 2669 | | leaseId, |
| | 2670 | | ifMatch, |
| | 2671 | | ifNoneMatch, |
| | 2672 | | ifModifiedSince, |
| | 2673 | | ifUnmodifiedSince)) |
| | 2674 | | { |
| | 2675 | | if (async) |
| | 2676 | | { |
| | 2677 | | // Send the request asynchronously if we're being called via an async path |
| | 2678 | | await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false); |
| | 2679 | | } |
| | 2680 | | else |
| | 2681 | | { |
| | 2682 | | // Send the request synchronously through the API that blocks if we're being called via a sy |
| | 2683 | | // (this is safe because the Task will complete before the user can call Wait) |
| | 2684 | | pipeline.Send(_message, cancellationToken); |
| | 2685 | | } |
| | 2686 | | Azure.Response _response = _message.Response; |
| | 2687 | | cancellationToken.ThrowIfCancellationRequested(); |
| | 2688 | | return DeleteAsync_CreateResponse(clientDiagnostics, _response); |
| | 2689 | | } |
| | 2690 | | } |
| | 2691 | | catch (System.Exception ex) |
| | 2692 | | { |
| | 2693 | | _scope.Failed(ex); |
| | 2694 | | throw; |
| | 2695 | | } |
| | 2696 | | finally |
| | 2697 | | { |
| | 2698 | | _scope.Dispose(); |
| | 2699 | | } |
| | 2700 | | } |
| | 2701 | |
|
| | 2702 | | /// <summary> |
| | 2703 | | /// Create the Path.DeleteAsync request. |
| | 2704 | | /// </summary> |
| | 2705 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 2706 | | /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de |
| | 2707 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 2708 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 2709 | | /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href=" |
| | 2710 | | /// <param name="recursive">Required</param> |
| | 2711 | | /// <param name="continuation">Optional. When deleting a directory, the number of paths that are deleted wi |
| | 2712 | | /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma |
| | 2713 | | /// <param name="ifMatch">Specify an ETag value to operate only on blobs with a matching value.</param> |
| | 2714 | | /// <param name="ifNoneMatch">Specify an ETag value to operate only on blobs without a matching value.</para |
| | 2715 | | /// <param name="ifModifiedSince">Specify this header value to operate only on a blob if it has been modifie |
| | 2716 | | /// <param name="ifUnmodifiedSince">Specify this header value to operate only on a blob if it has not been m |
| | 2717 | | /// <returns>The Path.DeleteAsync Message.</returns> |
| | 2718 | | internal static Azure.Core.HttpMessage DeleteAsync_CreateMessage( |
| | 2719 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 2720 | | System.Uri resourceUri, |
| | 2721 | | string version, |
| | 2722 | | string requestId = default, |
| | 2723 | | int? timeout = default, |
| | 2724 | | bool? recursive = default, |
| | 2725 | | string continuation = default, |
| | 2726 | | string leaseId = default, |
| | 2727 | | Azure.ETag? ifMatch = default, |
| | 2728 | | Azure.ETag? ifNoneMatch = default, |
| | 2729 | | System.DateTimeOffset? ifModifiedSince = default, |
| | 2730 | | System.DateTimeOffset? ifUnmodifiedSince = default) |
| | 2731 | | { |
| | 2732 | | // Validation |
| | 2733 | | if (resourceUri == null) |
| | 2734 | | { |
| | 2735 | | throw new System.ArgumentNullException(nameof(resourceUri)); |
| | 2736 | | } |
| | 2737 | | if (version == null) |
| | 2738 | | { |
| | 2739 | | throw new System.ArgumentNullException(nameof(version)); |
| | 2740 | | } |
| | 2741 | |
|
| | 2742 | | // Create the request |
| | 2743 | | Azure.Core.HttpMessage _message = pipeline.CreateMessage(); |
| | 2744 | | Azure.Core.Request _request = _message.Request; |
| | 2745 | |
|
| | 2746 | | // Set the endpoint |
| | 2747 | | _request.Method = Azure.Core.RequestMethod.Delete; |
| | 2748 | | _request.Uri.Reset(resourceUri); |
| | 2749 | | if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C |
| | 2750 | | if (recursive != null) { |
| | 2751 | | #pragma warning disable CA1308 // Normalize strings to uppercase |
| | 2752 | | _request.Uri.AppendQuery("recursive", recursive.Value.ToString(System.Globalization.CultureInfo.Invarian |
| | 2753 | | #pragma warning restore CA1308 // Normalize strings to uppercase |
| | 2754 | | } |
| | 2755 | | if (continuation != null) { _request.Uri.AppendQuery("continuation", continuation); } |
| | 2756 | |
|
| | 2757 | | // Add request headers |
| | 2758 | | _request.Headers.SetValue("x-ms-version", version); |
| | 2759 | | if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } |
| | 2760 | | if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } |
| | 2761 | | if (ifMatch != null) { _request.Headers.SetValue("If-Match", ifMatch.Value.ToString()); } |
| | 2762 | | if (ifNoneMatch != null) { _request.Headers.SetValue("If-None-Match", ifNoneMatch.Value.ToString()); } |
| | 2763 | | if (ifModifiedSince != null) { _request.Headers.SetValue("If-Modified-Since", ifModifiedSince.Value.ToSt |
| | 2764 | | if (ifUnmodifiedSince != null) { _request.Headers.SetValue("If-Unmodified-Since", ifUnmodifiedSince.Valu |
| | 2765 | |
|
| | 2766 | | return _message; |
| | 2767 | | } |
| | 2768 | |
|
| | 2769 | | /// <summary> |
| | 2770 | | /// Create the Path.DeleteAsync response or throw a failure exception. |
| | 2771 | | /// </summary> |
| | 2772 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param> |
| | 2773 | | /// <param name="response">The raw Response.</param> |
| | 2774 | | /// <returns>The Path.DeleteAsync Azure.Response{Azure.Storage.Files.DataLake.Models.PathDeleteResult}.</ret |
| | 2775 | | internal static Azure.Response<Azure.Storage.Files.DataLake.Models.PathDeleteResult> DeleteAsync_CreateRespo |
| | 2776 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 2777 | | Azure.Response response) |
| | 2778 | | { |
| | 2779 | | // Process the response |
| | 2780 | | switch (response.Status) |
| | 2781 | | { |
| | 2782 | | case 200: |
| | 2783 | | { |
| | 2784 | | // Create the result |
| | 2785 | | Azure.Storage.Files.DataLake.Models.PathDeleteResult _value = new Azure.Storage.Files.DataLake.M |
| | 2786 | |
|
| | 2787 | | // Get response headers |
| | 2788 | | string _header; |
| | 2789 | | if (response.Headers.TryGetValue("x-ms-continuation", out _header)) |
| | 2790 | | { |
| | 2791 | | _value.Continuation = _header; |
| | 2792 | | } |
| | 2793 | |
|
| | 2794 | | // Create the response |
| | 2795 | | return Response.FromValue(_value, response); |
| | 2796 | | } |
| | 2797 | | default: |
| | 2798 | | { |
| | 2799 | | // Create the result |
| | 2800 | | string _value; |
| | 2801 | | using (System.IO.StreamReader _streamReader = new System.IO.StreamReader(response.ContentStream) |
| | 2802 | | { |
| | 2803 | | _value = _streamReader.ReadToEnd(); |
| | 2804 | | } |
| | 2805 | |
|
| | 2806 | | throw _value.CreateException(clientDiagnostics, response); |
| | 2807 | | } |
| | 2808 | | } |
| | 2809 | | } |
| | 2810 | | #endregion Path.DeleteAsync |
| | 2811 | |
|
| | 2812 | | #region Path.SetAccessControlAsync |
| | 2813 | | /// <summary> |
| | 2814 | | /// Set the owner, group, permissions, or access control list for a path. |
| | 2815 | | /// </summary> |
| | 2816 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param> |
| | 2817 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 2818 | | /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de |
| | 2819 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 2820 | | /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href=" |
| | 2821 | | /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma |
| | 2822 | | /// <param name="owner">Optional. The owner of the blob or directory.</param> |
| | 2823 | | /// <param name="group">Optional. The owning group of the blob or directory.</param> |
| | 2824 | | /// <param name="permissions">Optional and only valid if Hierarchical Namespace is enabled for the account. |
| | 2825 | | /// <param name="acl">Sets POSIX access control rights on files and directories. The value is a comma-separa |
| | 2826 | | /// <param name="ifMatch">Specify an ETag value to operate only on blobs with a matching value.</param> |
| | 2827 | | /// <param name="ifNoneMatch">Specify an ETag value to operate only on blobs without a matching value.</para |
| | 2828 | | /// <param name="ifModifiedSince">Specify this header value to operate only on a blob if it has been modifie |
| | 2829 | | /// <param name="ifUnmodifiedSince">Specify this header value to operate only on a blob if it has not been m |
| | 2830 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 2831 | | /// <param name="async">Whether to invoke the operation asynchronously. The default value is true.</param> |
| | 2832 | | /// <param name="operationName">Operation name.</param> |
| | 2833 | | /// <param name="cancellationToken">Cancellation token.</param> |
| | 2834 | | /// <returns>Azure.Response{Azure.Storage.Files.DataLake.Models.PathSetAccessControlResult}</returns> |
| | 2835 | | public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.DataLake.Models.Path |
| | 2836 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 2837 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 2838 | | System.Uri resourceUri, |
| | 2839 | | string version, |
| | 2840 | | int? timeout = default, |
| | 2841 | | string leaseId = default, |
| | 2842 | | string owner = default, |
| | 2843 | | string group = default, |
| | 2844 | | string permissions = default, |
| | 2845 | | string acl = default, |
| | 2846 | | Azure.ETag? ifMatch = default, |
| | 2847 | | Azure.ETag? ifNoneMatch = default, |
| | 2848 | | System.DateTimeOffset? ifModifiedSince = default, |
| | 2849 | | System.DateTimeOffset? ifUnmodifiedSince = default, |
| | 2850 | | string requestId = default, |
| | 2851 | | bool async = true, |
| | 2852 | | string operationName = "PathClient.SetAccessControl", |
| | 2853 | | System.Threading.CancellationToken cancellationToken = default) |
| | 2854 | | { |
| | 2855 | | Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName); |
| | 2856 | | try |
| | 2857 | | { |
| | 2858 | | _scope.AddAttribute("url", resourceUri); |
| | 2859 | | _scope.Start(); |
| | 2860 | | using (Azure.Core.HttpMessage _message = SetAccessControlAsync_CreateMessage( |
| | 2861 | | pipeline, |
| | 2862 | | resourceUri, |
| | 2863 | | version, |
| | 2864 | | timeout, |
| | 2865 | | leaseId, |
| | 2866 | | owner, |
| | 2867 | | group, |
| | 2868 | | permissions, |
| | 2869 | | acl, |
| | 2870 | | ifMatch, |
| | 2871 | | ifNoneMatch, |
| | 2872 | | ifModifiedSince, |
| | 2873 | | ifUnmodifiedSince, |
| | 2874 | | requestId)) |
| | 2875 | | { |
| | 2876 | | if (async) |
| | 2877 | | { |
| | 2878 | | // Send the request asynchronously if we're being called via an async path |
| | 2879 | | await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false); |
| | 2880 | | } |
| | 2881 | | else |
| | 2882 | | { |
| | 2883 | | // Send the request synchronously through the API that blocks if we're being called via a sy |
| | 2884 | | // (this is safe because the Task will complete before the user can call Wait) |
| | 2885 | | pipeline.Send(_message, cancellationToken); |
| | 2886 | | } |
| | 2887 | | Azure.Response _response = _message.Response; |
| | 2888 | | cancellationToken.ThrowIfCancellationRequested(); |
| | 2889 | | return SetAccessControlAsync_CreateResponse(clientDiagnostics, _response); |
| | 2890 | | } |
| | 2891 | | } |
| | 2892 | | catch (System.Exception ex) |
| | 2893 | | { |
| | 2894 | | _scope.Failed(ex); |
| | 2895 | | throw; |
| | 2896 | | } |
| | 2897 | | finally |
| | 2898 | | { |
| | 2899 | | _scope.Dispose(); |
| | 2900 | | } |
| | 2901 | | } |
| | 2902 | |
|
| | 2903 | | /// <summary> |
| | 2904 | | /// Create the Path.SetAccessControlAsync request. |
| | 2905 | | /// </summary> |
| | 2906 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 2907 | | /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de |
| | 2908 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 2909 | | /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href=" |
| | 2910 | | /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma |
| | 2911 | | /// <param name="owner">Optional. The owner of the blob or directory.</param> |
| | 2912 | | /// <param name="group">Optional. The owning group of the blob or directory.</param> |
| | 2913 | | /// <param name="permissions">Optional and only valid if Hierarchical Namespace is enabled for the account. |
| | 2914 | | /// <param name="acl">Sets POSIX access control rights on files and directories. The value is a comma-separa |
| | 2915 | | /// <param name="ifMatch">Specify an ETag value to operate only on blobs with a matching value.</param> |
| | 2916 | | /// <param name="ifNoneMatch">Specify an ETag value to operate only on blobs without a matching value.</para |
| | 2917 | | /// <param name="ifModifiedSince">Specify this header value to operate only on a blob if it has been modifie |
| | 2918 | | /// <param name="ifUnmodifiedSince">Specify this header value to operate only on a blob if it has not been m |
| | 2919 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 2920 | | /// <returns>The Path.SetAccessControlAsync Message.</returns> |
| | 2921 | | internal static Azure.Core.HttpMessage SetAccessControlAsync_CreateMessage( |
| | 2922 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 2923 | | System.Uri resourceUri, |
| | 2924 | | string version, |
| | 2925 | | int? timeout = default, |
| | 2926 | | string leaseId = default, |
| | 2927 | | string owner = default, |
| | 2928 | | string group = default, |
| | 2929 | | string permissions = default, |
| | 2930 | | string acl = default, |
| | 2931 | | Azure.ETag? ifMatch = default, |
| | 2932 | | Azure.ETag? ifNoneMatch = default, |
| | 2933 | | System.DateTimeOffset? ifModifiedSince = default, |
| | 2934 | | System.DateTimeOffset? ifUnmodifiedSince = default, |
| | 2935 | | string requestId = default) |
| | 2936 | | { |
| | 2937 | | // Validation |
| | 2938 | | if (resourceUri == null) |
| | 2939 | | { |
| | 2940 | | throw new System.ArgumentNullException(nameof(resourceUri)); |
| | 2941 | | } |
| | 2942 | | if (version == null) |
| | 2943 | | { |
| | 2944 | | throw new System.ArgumentNullException(nameof(version)); |
| | 2945 | | } |
| | 2946 | |
|
| | 2947 | | // Create the request |
| | 2948 | | Azure.Core.HttpMessage _message = pipeline.CreateMessage(); |
| | 2949 | | Azure.Core.Request _request = _message.Request; |
| | 2950 | |
|
| | 2951 | | // Set the endpoint |
| | 2952 | | _request.Method = Azure.Core.RequestMethod.Patch; |
| | 2953 | | _request.Uri.Reset(resourceUri); |
| | 2954 | | _request.Uri.AppendQuery("action", "setAccessControl", escapeValue: false); |
| | 2955 | | if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C |
| | 2956 | |
|
| | 2957 | | // Add request headers |
| | 2958 | | _request.Headers.SetValue("x-ms-version", version); |
| | 2959 | | if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } |
| | 2960 | | if (owner != null) { _request.Headers.SetValue("x-ms-owner", owner); } |
| | 2961 | | if (group != null) { _request.Headers.SetValue("x-ms-group", group); } |
| | 2962 | | if (permissions != null) { _request.Headers.SetValue("x-ms-permissions", permissions); } |
| | 2963 | | if (acl != null) { _request.Headers.SetValue("x-ms-acl", acl); } |
| | 2964 | | if (ifMatch != null) { _request.Headers.SetValue("If-Match", ifMatch.Value.ToString()); } |
| | 2965 | | if (ifNoneMatch != null) { _request.Headers.SetValue("If-None-Match", ifNoneMatch.Value.ToString()); } |
| | 2966 | | if (ifModifiedSince != null) { _request.Headers.SetValue("If-Modified-Since", ifModifiedSince.Value.ToSt |
| | 2967 | | if (ifUnmodifiedSince != null) { _request.Headers.SetValue("If-Unmodified-Since", ifUnmodifiedSince.Valu |
| | 2968 | | if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } |
| | 2969 | |
|
| | 2970 | | return _message; |
| | 2971 | | } |
| | 2972 | |
|
| | 2973 | | /// <summary> |
| | 2974 | | /// Create the Path.SetAccessControlAsync response or throw a failure exception. |
| | 2975 | | /// </summary> |
| | 2976 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param> |
| | 2977 | | /// <param name="response">The raw Response.</param> |
| | 2978 | | /// <returns>The Path.SetAccessControlAsync Azure.Response{Azure.Storage.Files.DataLake.Models.PathSetAccess |
| | 2979 | | internal static Azure.Response<Azure.Storage.Files.DataLake.Models.PathSetAccessControlResult> SetAccessCont |
| | 2980 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 2981 | | Azure.Response response) |
| | 2982 | | { |
| | 2983 | | // Process the response |
| | 2984 | | switch (response.Status) |
| | 2985 | | { |
| | 2986 | | case 200: |
| | 2987 | | { |
| | 2988 | | // Create the result |
| | 2989 | | Azure.Storage.Files.DataLake.Models.PathSetAccessControlResult _value = new Azure.Storage.Files. |
| | 2990 | |
|
| | 2991 | | // Get response headers |
| | 2992 | | string _header; |
| | 2993 | | if (response.Headers.TryGetValue("ETag", out _header)) |
| | 2994 | | { |
| | 2995 | | _value.ETag = new Azure.ETag(_header); |
| | 2996 | | } |
| | 2997 | | if (response.Headers.TryGetValue("Last-Modified", out _header)) |
| | 2998 | | { |
| | 2999 | | _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo. |
| | 3000 | | } |
| | 3001 | | if (response.Headers.TryGetValue("x-ms-client-request-id", out _header)) |
| | 3002 | | { |
| | 3003 | | _value.ClientRequestId = _header; |
| | 3004 | | } |
| | 3005 | |
|
| | 3006 | | // Create the response |
| | 3007 | | return Response.FromValue(_value, response); |
| | 3008 | | } |
| | 3009 | | default: |
| | 3010 | | { |
| | 3011 | | // Create the result |
| | 3012 | | string _value; |
| | 3013 | | using (System.IO.StreamReader _streamReader = new System.IO.StreamReader(response.ContentStream) |
| | 3014 | | { |
| | 3015 | | _value = _streamReader.ReadToEnd(); |
| | 3016 | | } |
| | 3017 | |
|
| | 3018 | | throw _value.CreateException(clientDiagnostics, response); |
| | 3019 | | } |
| | 3020 | | } |
| | 3021 | | } |
| | 3022 | | #endregion Path.SetAccessControlAsync |
| | 3023 | |
|
| | 3024 | | #region Path.SetAccessControlRecursiveAsync |
| | 3025 | | /// <summary> |
| | 3026 | | /// Set the access control list for a path and subpaths. |
| | 3027 | | /// </summary> |
| | 3028 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param> |
| | 3029 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 3030 | | /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de |
| | 3031 | | /// <param name="mode">Mode "set" sets POSIX access control rights on files and directories, "modify" modifi |
| | 3032 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 3033 | | /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href=" |
| | 3034 | | /// <param name="continuation">Optional. When deleting a directory, the number of paths that are deleted wi |
| | 3035 | | /// <param name="maxRecords">Optional. It specifies the maximum number of files or directories on which the |
| | 3036 | | /// <param name="acl">Sets POSIX access control rights on files and directories. The value is a comma-separa |
| | 3037 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 3038 | | /// <param name="async">Whether to invoke the operation asynchronously. The default value is true.</param> |
| | 3039 | | /// <param name="operationName">Operation name.</param> |
| | 3040 | | /// <param name="cancellationToken">Cancellation token.</param> |
| | 3041 | | /// <returns>Azure.Response{Azure.Storage.Files.DataLake.Models.PathSetAccessControlRecursiveResult}</return |
| | 3042 | | public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.DataLake.Models.Path |
| | 3043 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 3044 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 3045 | | System.Uri resourceUri, |
| | 3046 | | Azure.Storage.Files.DataLake.Models.PathSetAccessControlRecursiveMode mode, |
| | 3047 | | string version, |
| | 3048 | | int? timeout = default, |
| | 3049 | | string continuation = default, |
| | 3050 | | int? maxRecords = default, |
| | 3051 | | string acl = default, |
| | 3052 | | string requestId = default, |
| | 3053 | | bool async = true, |
| | 3054 | | string operationName = "PathClient.SetAccessControlRecursive", |
| | 3055 | | System.Threading.CancellationToken cancellationToken = default) |
| | 3056 | | { |
| | 3057 | | Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName); |
| | 3058 | | try |
| | 3059 | | { |
| | 3060 | | _scope.AddAttribute("url", resourceUri); |
| | 3061 | | _scope.Start(); |
| | 3062 | | using (Azure.Core.HttpMessage _message = SetAccessControlRecursiveAsync_CreateMessage( |
| | 3063 | | pipeline, |
| | 3064 | | resourceUri, |
| | 3065 | | mode, |
| | 3066 | | version, |
| | 3067 | | timeout, |
| | 3068 | | continuation, |
| | 3069 | | maxRecords, |
| | 3070 | | acl, |
| | 3071 | | requestId)) |
| | 3072 | | { |
| | 3073 | | if (async) |
| | 3074 | | { |
| | 3075 | | // Send the request asynchronously if we're being called via an async path |
| | 3076 | | await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false); |
| | 3077 | | } |
| | 3078 | | else |
| | 3079 | | { |
| | 3080 | | // Send the request synchronously through the API that blocks if we're being called via a sy |
| | 3081 | | // (this is safe because the Task will complete before the user can call Wait) |
| | 3082 | | pipeline.Send(_message, cancellationToken); |
| | 3083 | | } |
| | 3084 | | Azure.Response _response = _message.Response; |
| | 3085 | | cancellationToken.ThrowIfCancellationRequested(); |
| | 3086 | | return SetAccessControlRecursiveAsync_CreateResponse(clientDiagnostics, _response); |
| | 3087 | | } |
| | 3088 | | } |
| | 3089 | | catch (System.Exception ex) |
| | 3090 | | { |
| | 3091 | | _scope.Failed(ex); |
| | 3092 | | throw; |
| | 3093 | | } |
| | 3094 | | finally |
| | 3095 | | { |
| | 3096 | | _scope.Dispose(); |
| | 3097 | | } |
| | 3098 | | } |
| | 3099 | |
|
| | 3100 | | /// <summary> |
| | 3101 | | /// Create the Path.SetAccessControlRecursiveAsync request. |
| | 3102 | | /// </summary> |
| | 3103 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 3104 | | /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de |
| | 3105 | | /// <param name="mode">Mode "set" sets POSIX access control rights on files and directories, "modify" modifi |
| | 3106 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 3107 | | /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href=" |
| | 3108 | | /// <param name="continuation">Optional. When deleting a directory, the number of paths that are deleted wi |
| | 3109 | | /// <param name="maxRecords">Optional. It specifies the maximum number of files or directories on which the |
| | 3110 | | /// <param name="acl">Sets POSIX access control rights on files and directories. The value is a comma-separa |
| | 3111 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 3112 | | /// <returns>The Path.SetAccessControlRecursiveAsync Message.</returns> |
| | 3113 | | internal static Azure.Core.HttpMessage SetAccessControlRecursiveAsync_CreateMessage( |
| | 3114 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 3115 | | System.Uri resourceUri, |
| | 3116 | | Azure.Storage.Files.DataLake.Models.PathSetAccessControlRecursiveMode mode, |
| | 3117 | | string version, |
| | 3118 | | int? timeout = default, |
| | 3119 | | string continuation = default, |
| | 3120 | | int? maxRecords = default, |
| | 3121 | | string acl = default, |
| | 3122 | | string requestId = default) |
| | 3123 | | { |
| | 3124 | | // Validation |
| | 3125 | | if (resourceUri == null) |
| | 3126 | | { |
| | 3127 | | throw new System.ArgumentNullException(nameof(resourceUri)); |
| | 3128 | | } |
| | 3129 | | if (version == null) |
| | 3130 | | { |
| | 3131 | | throw new System.ArgumentNullException(nameof(version)); |
| | 3132 | | } |
| | 3133 | |
|
| | 3134 | | // Create the request |
| | 3135 | | Azure.Core.HttpMessage _message = pipeline.CreateMessage(); |
| | 3136 | | Azure.Core.Request _request = _message.Request; |
| | 3137 | |
|
| | 3138 | | // Set the endpoint |
| | 3139 | | _request.Method = Azure.Core.RequestMethod.Patch; |
| | 3140 | | _request.Uri.Reset(resourceUri); |
| | 3141 | | _request.Uri.AppendQuery("action", "setAccessControlRecursive", escapeValue: false); |
| | 3142 | | _request.Uri.AppendQuery("mode", Azure.Storage.Files.DataLake.DataLakeRestClient.Serialization.ToString( |
| | 3143 | | if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C |
| | 3144 | | if (continuation != null) { _request.Uri.AppendQuery("continuation", continuation); } |
| | 3145 | | if (maxRecords != null) { _request.Uri.AppendQuery("maxRecords", maxRecords.Value.ToString(System.Global |
| | 3146 | |
|
| | 3147 | | // Add request headers |
| | 3148 | | _request.Headers.SetValue("x-ms-version", version); |
| | 3149 | | if (acl != null) { _request.Headers.SetValue("x-ms-acl", acl); } |
| | 3150 | | if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } |
| | 3151 | |
|
| | 3152 | | return _message; |
| | 3153 | | } |
| | 3154 | |
|
| | 3155 | | /// <summary> |
| | 3156 | | /// Create the Path.SetAccessControlRecursiveAsync response or throw a failure exception. |
| | 3157 | | /// </summary> |
| | 3158 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param> |
| | 3159 | | /// <param name="response">The raw Response.</param> |
| | 3160 | | /// <returns>The Path.SetAccessControlRecursiveAsync Azure.Response{Azure.Storage.Files.DataLake.Models.Path |
| | 3161 | | internal static Azure.Response<Azure.Storage.Files.DataLake.Models.PathSetAccessControlRecursiveResult> SetA |
| | 3162 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 3163 | | Azure.Response response) |
| | 3164 | | { |
| | 3165 | | // Process the response |
| | 3166 | | switch (response.Status) |
| | 3167 | | { |
| | 3168 | | case 200: |
| | 3169 | | { |
| | 3170 | | // Create the result |
| | 3171 | | Azure.Storage.Files.DataLake.Models.PathSetAccessControlRecursiveResult _value = new Azure.Stora |
| | 3172 | | _value.Body = response.ContentStream; // You should manually wrap with RetriableStream! |
| | 3173 | |
|
| | 3174 | | // Get response headers |
| | 3175 | | string _header; |
| | 3176 | | if (response.Headers.TryGetValue("x-ms-client-request-id", out _header)) |
| | 3177 | | { |
| | 3178 | | _value.ClientRequestId = _header; |
| | 3179 | | } |
| | 3180 | | if (response.Headers.TryGetValue("x-ms-continuation", out _header)) |
| | 3181 | | { |
| | 3182 | | _value.Continuation = _header; |
| | 3183 | | } |
| | 3184 | |
|
| | 3185 | | // Create the response |
| | 3186 | | return Response.FromValue(_value, response); |
| | 3187 | | } |
| | 3188 | | default: |
| | 3189 | | { |
| | 3190 | | // Create the result |
| | 3191 | | string _value; |
| | 3192 | | using (System.IO.StreamReader _streamReader = new System.IO.StreamReader(response.ContentStream) |
| | 3193 | | { |
| | 3194 | | _value = _streamReader.ReadToEnd(); |
| | 3195 | | } |
| | 3196 | |
|
| | 3197 | | throw _value.CreateException(clientDiagnostics, response); |
| | 3198 | | } |
| | 3199 | | } |
| | 3200 | | } |
| | 3201 | | #endregion Path.SetAccessControlRecursiveAsync |
| | 3202 | |
|
| | 3203 | | #region Path.FlushDataAsync |
| | 3204 | | /// <summary> |
| | 3205 | | /// Set the owner, group, permissions, or access control list for a path. |
| | 3206 | | /// </summary> |
| | 3207 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param> |
| | 3208 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 3209 | | /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de |
| | 3210 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 3211 | | /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href=" |
| | 3212 | | /// <param name="position">This parameter allows the caller to upload data in parallel and control the order |
| | 3213 | | /// <param name="retainUncommittedData">Valid only for flush operations. If "true", uncommitted data is ret |
| | 3214 | | /// <param name="close">Azure Storage Events allow applications to receive notifications when files change. |
| | 3215 | | /// <param name="contentLength">Required for "Append Data" and "Flush Data". Must be 0 for "Flush Data". M |
| | 3216 | | /// <param name="contentHash">Specify the transactional md5 for the body, to be validated by the service.</p |
| | 3217 | | /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma |
| | 3218 | | /// <param name="cacheControl">Optional. Sets the blob's cache control. If specified, this property is store |
| | 3219 | | /// <param name="contentType">Optional. Sets the blob's content type. If specified, this property is stored |
| | 3220 | | /// <param name="contentDisposition">Optional. Sets the blob's Content-Disposition header.</param> |
| | 3221 | | /// <param name="contentEncoding">Optional. Sets the blob's content encoding. If specified, this property is |
| | 3222 | | /// <param name="contentLanguage">Optional. Set the blob's content language. If specified, this property is |
| | 3223 | | /// <param name="ifMatch">Specify an ETag value to operate only on blobs with a matching value.</param> |
| | 3224 | | /// <param name="ifNoneMatch">Specify an ETag value to operate only on blobs without a matching value.</para |
| | 3225 | | /// <param name="ifModifiedSince">Specify this header value to operate only on a blob if it has been modifie |
| | 3226 | | /// <param name="ifUnmodifiedSince">Specify this header value to operate only on a blob if it has not been m |
| | 3227 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 3228 | | /// <param name="async">Whether to invoke the operation asynchronously. The default value is true.</param> |
| | 3229 | | /// <param name="operationName">Operation name.</param> |
| | 3230 | | /// <param name="cancellationToken">Cancellation token.</param> |
| | 3231 | | /// <returns>Azure.Response{Azure.Storage.Files.DataLake.Models.PathFlushDataResult}</returns> |
| | 3232 | | public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.DataLake.Models.Path |
| | 3233 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 3234 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 3235 | | System.Uri resourceUri, |
| | 3236 | | string version, |
| | 3237 | | int? timeout = default, |
| | 3238 | | long? position = default, |
| | 3239 | | bool? retainUncommittedData = default, |
| | 3240 | | bool? close = default, |
| | 3241 | | long? contentLength = default, |
| | 3242 | | byte[] contentHash = default, |
| | 3243 | | string leaseId = default, |
| | 3244 | | string cacheControl = default, |
| | 3245 | | string contentType = default, |
| | 3246 | | string contentDisposition = default, |
| | 3247 | | string contentEncoding = default, |
| | 3248 | | string contentLanguage = default, |
| | 3249 | | Azure.ETag? ifMatch = default, |
| | 3250 | | Azure.ETag? ifNoneMatch = default, |
| | 3251 | | System.DateTimeOffset? ifModifiedSince = default, |
| | 3252 | | System.DateTimeOffset? ifUnmodifiedSince = default, |
| | 3253 | | string requestId = default, |
| | 3254 | | bool async = true, |
| | 3255 | | string operationName = "PathClient.FlushData", |
| | 3256 | | System.Threading.CancellationToken cancellationToken = default) |
| | 3257 | | { |
| | 3258 | | Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName); |
| | 3259 | | try |
| | 3260 | | { |
| | 3261 | | _scope.AddAttribute("url", resourceUri); |
| | 3262 | | _scope.Start(); |
| | 3263 | | using (Azure.Core.HttpMessage _message = FlushDataAsync_CreateMessage( |
| | 3264 | | pipeline, |
| | 3265 | | resourceUri, |
| | 3266 | | version, |
| | 3267 | | timeout, |
| | 3268 | | position, |
| | 3269 | | retainUncommittedData, |
| | 3270 | | close, |
| | 3271 | | contentLength, |
| | 3272 | | contentHash, |
| | 3273 | | leaseId, |
| | 3274 | | cacheControl, |
| | 3275 | | contentType, |
| | 3276 | | contentDisposition, |
| | 3277 | | contentEncoding, |
| | 3278 | | contentLanguage, |
| | 3279 | | ifMatch, |
| | 3280 | | ifNoneMatch, |
| | 3281 | | ifModifiedSince, |
| | 3282 | | ifUnmodifiedSince, |
| | 3283 | | requestId)) |
| | 3284 | | { |
| | 3285 | | if (async) |
| | 3286 | | { |
| | 3287 | | // Send the request asynchronously if we're being called via an async path |
| | 3288 | | await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false); |
| | 3289 | | } |
| | 3290 | | else |
| | 3291 | | { |
| | 3292 | | // Send the request synchronously through the API that blocks if we're being called via a sy |
| | 3293 | | // (this is safe because the Task will complete before the user can call Wait) |
| | 3294 | | pipeline.Send(_message, cancellationToken); |
| | 3295 | | } |
| | 3296 | | Azure.Response _response = _message.Response; |
| | 3297 | | cancellationToken.ThrowIfCancellationRequested(); |
| | 3298 | | return FlushDataAsync_CreateResponse(clientDiagnostics, _response); |
| | 3299 | | } |
| | 3300 | | } |
| | 3301 | | catch (System.Exception ex) |
| | 3302 | | { |
| | 3303 | | _scope.Failed(ex); |
| | 3304 | | throw; |
| | 3305 | | } |
| | 3306 | | finally |
| | 3307 | | { |
| | 3308 | | _scope.Dispose(); |
| | 3309 | | } |
| | 3310 | | } |
| | 3311 | |
|
| | 3312 | | /// <summary> |
| | 3313 | | /// Create the Path.FlushDataAsync request. |
| | 3314 | | /// </summary> |
| | 3315 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 3316 | | /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de |
| | 3317 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 3318 | | /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href=" |
| | 3319 | | /// <param name="position">This parameter allows the caller to upload data in parallel and control the order |
| | 3320 | | /// <param name="retainUncommittedData">Valid only for flush operations. If "true", uncommitted data is ret |
| | 3321 | | /// <param name="close">Azure Storage Events allow applications to receive notifications when files change. |
| | 3322 | | /// <param name="contentLength">Required for "Append Data" and "Flush Data". Must be 0 for "Flush Data". M |
| | 3323 | | /// <param name="contentHash">Specify the transactional md5 for the body, to be validated by the service.</p |
| | 3324 | | /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma |
| | 3325 | | /// <param name="cacheControl">Optional. Sets the blob's cache control. If specified, this property is store |
| | 3326 | | /// <param name="contentType">Optional. Sets the blob's content type. If specified, this property is stored |
| | 3327 | | /// <param name="contentDisposition">Optional. Sets the blob's Content-Disposition header.</param> |
| | 3328 | | /// <param name="contentEncoding">Optional. Sets the blob's content encoding. If specified, this property is |
| | 3329 | | /// <param name="contentLanguage">Optional. Set the blob's content language. If specified, this property is |
| | 3330 | | /// <param name="ifMatch">Specify an ETag value to operate only on blobs with a matching value.</param> |
| | 3331 | | /// <param name="ifNoneMatch">Specify an ETag value to operate only on blobs without a matching value.</para |
| | 3332 | | /// <param name="ifModifiedSince">Specify this header value to operate only on a blob if it has been modifie |
| | 3333 | | /// <param name="ifUnmodifiedSince">Specify this header value to operate only on a blob if it has not been m |
| | 3334 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 3335 | | /// <returns>The Path.FlushDataAsync Message.</returns> |
| | 3336 | | internal static Azure.Core.HttpMessage FlushDataAsync_CreateMessage( |
| | 3337 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 3338 | | System.Uri resourceUri, |
| | 3339 | | string version, |
| | 3340 | | int? timeout = default, |
| | 3341 | | long? position = default, |
| | 3342 | | bool? retainUncommittedData = default, |
| | 3343 | | bool? close = default, |
| | 3344 | | long? contentLength = default, |
| | 3345 | | byte[] contentHash = default, |
| | 3346 | | string leaseId = default, |
| | 3347 | | string cacheControl = default, |
| | 3348 | | string contentType = default, |
| | 3349 | | string contentDisposition = default, |
| | 3350 | | string contentEncoding = default, |
| | 3351 | | string contentLanguage = default, |
| | 3352 | | Azure.ETag? ifMatch = default, |
| | 3353 | | Azure.ETag? ifNoneMatch = default, |
| | 3354 | | System.DateTimeOffset? ifModifiedSince = default, |
| | 3355 | | System.DateTimeOffset? ifUnmodifiedSince = default, |
| | 3356 | | string requestId = default) |
| | 3357 | | { |
| | 3358 | | // Validation |
| | 3359 | | if (resourceUri == null) |
| | 3360 | | { |
| | 3361 | | throw new System.ArgumentNullException(nameof(resourceUri)); |
| | 3362 | | } |
| | 3363 | | if (version == null) |
| | 3364 | | { |
| | 3365 | | throw new System.ArgumentNullException(nameof(version)); |
| | 3366 | | } |
| | 3367 | |
|
| | 3368 | | // Create the request |
| | 3369 | | Azure.Core.HttpMessage _message = pipeline.CreateMessage(); |
| | 3370 | | Azure.Core.Request _request = _message.Request; |
| | 3371 | |
|
| | 3372 | | // Set the endpoint |
| | 3373 | | _request.Method = Azure.Core.RequestMethod.Patch; |
| | 3374 | | _request.Uri.Reset(resourceUri); |
| | 3375 | | _request.Uri.AppendQuery("action", "flush", escapeValue: false); |
| | 3376 | | if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C |
| | 3377 | | if (position != null) { _request.Uri.AppendQuery("position", position.Value.ToString(System.Globalizatio |
| | 3378 | | if (retainUncommittedData != null) { |
| | 3379 | | #pragma warning disable CA1308 // Normalize strings to uppercase |
| | 3380 | | _request.Uri.AppendQuery("retainUncommittedData", retainUncommittedData.Value.ToString(System.Globalizat |
| | 3381 | | #pragma warning restore CA1308 // Normalize strings to uppercase |
| | 3382 | | } |
| | 3383 | | if (close != null) { |
| | 3384 | | #pragma warning disable CA1308 // Normalize strings to uppercase |
| | 3385 | | _request.Uri.AppendQuery("close", close.Value.ToString(System.Globalization.CultureInfo.InvariantCulture |
| | 3386 | | #pragma warning restore CA1308 // Normalize strings to uppercase |
| | 3387 | | } |
| | 3388 | |
|
| | 3389 | | // Add request headers |
| | 3390 | | _request.Headers.SetValue("x-ms-version", version); |
| | 3391 | | if (contentLength != null) { _request.Headers.SetValue("Content-Length", contentLength.Value.ToString(Sy |
| | 3392 | | if (contentHash != null) { _request.Headers.SetValue("x-ms-content-md5", System.Convert.ToBase64String(c |
| | 3393 | | if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } |
| | 3394 | | if (cacheControl != null) { _request.Headers.SetValue("x-ms-cache-control", cacheControl); } |
| | 3395 | | if (contentType != null) { _request.Headers.SetValue("x-ms-content-type", contentType); } |
| | 3396 | | if (contentDisposition != null) { _request.Headers.SetValue("x-ms-content-disposition", contentDispositi |
| | 3397 | | if (contentEncoding != null) { _request.Headers.SetValue("x-ms-content-encoding", contentEncoding); } |
| | 3398 | | if (contentLanguage != null) { _request.Headers.SetValue("x-ms-content-language", contentLanguage); } |
| | 3399 | | if (ifMatch != null) { _request.Headers.SetValue("If-Match", ifMatch.Value.ToString()); } |
| | 3400 | | if (ifNoneMatch != null) { _request.Headers.SetValue("If-None-Match", ifNoneMatch.Value.ToString()); } |
| | 3401 | | if (ifModifiedSince != null) { _request.Headers.SetValue("If-Modified-Since", ifModifiedSince.Value.ToSt |
| | 3402 | | if (ifUnmodifiedSince != null) { _request.Headers.SetValue("If-Unmodified-Since", ifUnmodifiedSince.Valu |
| | 3403 | | if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } |
| | 3404 | |
|
| | 3405 | | return _message; |
| | 3406 | | } |
| | 3407 | |
|
| | 3408 | | /// <summary> |
| | 3409 | | /// Create the Path.FlushDataAsync response or throw a failure exception. |
| | 3410 | | /// </summary> |
| | 3411 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param> |
| | 3412 | | /// <param name="response">The raw Response.</param> |
| | 3413 | | /// <returns>The Path.FlushDataAsync Azure.Response{Azure.Storage.Files.DataLake.Models.PathFlushDataResult} |
| | 3414 | | internal static Azure.Response<Azure.Storage.Files.DataLake.Models.PathFlushDataResult> FlushDataAsync_Creat |
| | 3415 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 3416 | | Azure.Response response) |
| | 3417 | | { |
| | 3418 | | // Process the response |
| | 3419 | | switch (response.Status) |
| | 3420 | | { |
| | 3421 | | case 200: |
| | 3422 | | { |
| | 3423 | | // Create the result |
| | 3424 | | Azure.Storage.Files.DataLake.Models.PathFlushDataResult _value = new Azure.Storage.Files.DataLak |
| | 3425 | |
|
| | 3426 | | // Get response headers |
| | 3427 | | string _header; |
| | 3428 | | if (response.Headers.TryGetValue("ETag", out _header)) |
| | 3429 | | { |
| | 3430 | | _value.ETag = new Azure.ETag(_header); |
| | 3431 | | } |
| | 3432 | | if (response.Headers.TryGetValue("Last-Modified", out _header)) |
| | 3433 | | { |
| | 3434 | | _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo. |
| | 3435 | | } |
| | 3436 | | if (response.Headers.TryGetValue("Content-Length", out _header)) |
| | 3437 | | { |
| | 3438 | | _value.ContentLength = long.Parse(_header, System.Globalization.CultureInfo.InvariantCulture |
| | 3439 | | } |
| | 3440 | | if (response.Headers.TryGetValue("x-ms-client-request-id", out _header)) |
| | 3441 | | { |
| | 3442 | | _value.ClientRequestId = _header; |
| | 3443 | | } |
| | 3444 | |
|
| | 3445 | | // Create the response |
| | 3446 | | return Response.FromValue(_value, response); |
| | 3447 | | } |
| | 3448 | | default: |
| | 3449 | | { |
| | 3450 | | // Create the result |
| | 3451 | | string _value; |
| | 3452 | | using (System.IO.StreamReader _streamReader = new System.IO.StreamReader(response.ContentStream) |
| | 3453 | | { |
| | 3454 | | _value = _streamReader.ReadToEnd(); |
| | 3455 | | } |
| | 3456 | |
|
| | 3457 | | throw _value.CreateException(clientDiagnostics, response); |
| | 3458 | | } |
| | 3459 | | } |
| | 3460 | | } |
| | 3461 | | #endregion Path.FlushDataAsync |
| | 3462 | |
|
| | 3463 | | #region Path.AppendDataAsync |
| | 3464 | | /// <summary> |
| | 3465 | | /// Append data to the file. |
| | 3466 | | /// </summary> |
| | 3467 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param> |
| | 3468 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 3469 | | /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de |
| | 3470 | | /// <param name="body">Initial data</param> |
| | 3471 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 3472 | | /// <param name="position">This parameter allows the caller to upload data in parallel and control the order |
| | 3473 | | /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href=" |
| | 3474 | | /// <param name="contentLength">Required for "Append Data" and "Flush Data". Must be 0 for "Flush Data". M |
| | 3475 | | /// <param name="transactionalContentHash">Specify the transactional md5 for the body, to be validated by th |
| | 3476 | | /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma |
| | 3477 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 3478 | | /// <param name="async">Whether to invoke the operation asynchronously. The default value is true.</param> |
| | 3479 | | /// <param name="operationName">Operation name.</param> |
| | 3480 | | /// <param name="cancellationToken">Cancellation token.</param> |
| | 3481 | | /// <returns>Azure.Response{Azure.Storage.Files.DataLake.Models.PathAppendDataResult}</returns> |
| | 3482 | | public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.DataLake.Models.Path |
| | 3483 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 3484 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 3485 | | System.Uri resourceUri, |
| | 3486 | | System.IO.Stream body, |
| | 3487 | | string version, |
| | 3488 | | long? position = default, |
| | 3489 | | int? timeout = default, |
| | 3490 | | long? contentLength = default, |
| | 3491 | | byte[] transactionalContentHash = default, |
| | 3492 | | string leaseId = default, |
| | 3493 | | string requestId = default, |
| | 3494 | | bool async = true, |
| | 3495 | | string operationName = "PathClient.AppendData", |
| | 3496 | | System.Threading.CancellationToken cancellationToken = default) |
| | 3497 | | { |
| | 3498 | | Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName); |
| | 3499 | | try |
| | 3500 | | { |
| | 3501 | | _scope.AddAttribute("url", resourceUri); |
| | 3502 | | _scope.Start(); |
| | 3503 | | using (Azure.Core.HttpMessage _message = AppendDataAsync_CreateMessage( |
| | 3504 | | pipeline, |
| | 3505 | | resourceUri, |
| | 3506 | | body, |
| | 3507 | | version, |
| | 3508 | | position, |
| | 3509 | | timeout, |
| | 3510 | | contentLength, |
| | 3511 | | transactionalContentHash, |
| | 3512 | | leaseId, |
| | 3513 | | requestId)) |
| | 3514 | | { |
| | 3515 | | if (async) |
| | 3516 | | { |
| | 3517 | | // Send the request asynchronously if we're being called via an async path |
| | 3518 | | await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false); |
| | 3519 | | } |
| | 3520 | | else |
| | 3521 | | { |
| | 3522 | | // Send the request synchronously through the API that blocks if we're being called via a sy |
| | 3523 | | // (this is safe because the Task will complete before the user can call Wait) |
| | 3524 | | pipeline.Send(_message, cancellationToken); |
| | 3525 | | } |
| | 3526 | | Azure.Response _response = _message.Response; |
| | 3527 | | cancellationToken.ThrowIfCancellationRequested(); |
| | 3528 | | return AppendDataAsync_CreateResponse(clientDiagnostics, _response); |
| | 3529 | | } |
| | 3530 | | } |
| | 3531 | | catch (System.Exception ex) |
| | 3532 | | { |
| | 3533 | | _scope.Failed(ex); |
| | 3534 | | throw; |
| | 3535 | | } |
| | 3536 | | finally |
| | 3537 | | { |
| | 3538 | | _scope.Dispose(); |
| | 3539 | | } |
| | 3540 | | } |
| | 3541 | |
|
| | 3542 | | /// <summary> |
| | 3543 | | /// Create the Path.AppendDataAsync request. |
| | 3544 | | /// </summary> |
| | 3545 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 3546 | | /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de |
| | 3547 | | /// <param name="body">Initial data</param> |
| | 3548 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 3549 | | /// <param name="position">This parameter allows the caller to upload data in parallel and control the order |
| | 3550 | | /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href=" |
| | 3551 | | /// <param name="contentLength">Required for "Append Data" and "Flush Data". Must be 0 for "Flush Data". M |
| | 3552 | | /// <param name="transactionalContentHash">Specify the transactional md5 for the body, to be validated by th |
| | 3553 | | /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma |
| | 3554 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 3555 | | /// <returns>The Path.AppendDataAsync Message.</returns> |
| | 3556 | | internal static Azure.Core.HttpMessage AppendDataAsync_CreateMessage( |
| | 3557 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 3558 | | System.Uri resourceUri, |
| | 3559 | | System.IO.Stream body, |
| | 3560 | | string version, |
| | 3561 | | long? position = default, |
| | 3562 | | int? timeout = default, |
| | 3563 | | long? contentLength = default, |
| | 3564 | | byte[] transactionalContentHash = default, |
| | 3565 | | string leaseId = default, |
| | 3566 | | string requestId = default) |
| | 3567 | | { |
| | 3568 | | // Validation |
| | 3569 | | if (resourceUri == null) |
| | 3570 | | { |
| | 3571 | | throw new System.ArgumentNullException(nameof(resourceUri)); |
| | 3572 | | } |
| | 3573 | | if (body == null) |
| | 3574 | | { |
| | 3575 | | throw new System.ArgumentNullException(nameof(body)); |
| | 3576 | | } |
| | 3577 | | if (version == null) |
| | 3578 | | { |
| | 3579 | | throw new System.ArgumentNullException(nameof(version)); |
| | 3580 | | } |
| | 3581 | |
|
| | 3582 | | // Create the request |
| | 3583 | | Azure.Core.HttpMessage _message = pipeline.CreateMessage(); |
| | 3584 | | Azure.Core.Request _request = _message.Request; |
| | 3585 | |
|
| | 3586 | | // Set the endpoint |
| | 3587 | | _request.Method = Azure.Core.RequestMethod.Patch; |
| | 3588 | | _request.Uri.Reset(resourceUri); |
| | 3589 | | _request.Uri.AppendQuery("action", "append", escapeValue: false); |
| | 3590 | | if (position != null) { _request.Uri.AppendQuery("position", position.Value.ToString(System.Globalizatio |
| | 3591 | | if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C |
| | 3592 | |
|
| | 3593 | | // Add request headers |
| | 3594 | | _request.Headers.SetValue("x-ms-version", version); |
| | 3595 | | if (contentLength != null) { _request.Headers.SetValue("Content-Length", contentLength.Value.ToString(Sy |
| | 3596 | | if (transactionalContentHash != null) { _request.Headers.SetValue("Content-MD5", System.Convert.ToBase64 |
| | 3597 | | if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } |
| | 3598 | | if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } |
| | 3599 | |
|
| | 3600 | | // Create the body |
| | 3601 | | _request.Content = Azure.Core.RequestContent.Create(body); |
| | 3602 | |
|
| | 3603 | | return _message; |
| | 3604 | | } |
| | 3605 | |
|
| | 3606 | | /// <summary> |
| | 3607 | | /// Create the Path.AppendDataAsync response or throw a failure exception. |
| | 3608 | | /// </summary> |
| | 3609 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param> |
| | 3610 | | /// <param name="response">The raw Response.</param> |
| | 3611 | | /// <returns>The Path.AppendDataAsync Azure.Response{Azure.Storage.Files.DataLake.Models.PathAppendDataResul |
| | 3612 | | internal static Azure.Response<Azure.Storage.Files.DataLake.Models.PathAppendDataResult> AppendDataAsync_Cre |
| | 3613 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 3614 | | Azure.Response response) |
| | 3615 | | { |
| | 3616 | | // Process the response |
| | 3617 | | switch (response.Status) |
| | 3618 | | { |
| | 3619 | | case 202: |
| | 3620 | | { |
| | 3621 | | // Create the result |
| | 3622 | | Azure.Storage.Files.DataLake.Models.PathAppendDataResult _value = new Azure.Storage.Files.DataLa |
| | 3623 | |
|
| | 3624 | | // Get response headers |
| | 3625 | | string _header; |
| | 3626 | | if (response.Headers.TryGetValue("x-ms-client-request-id", out _header)) |
| | 3627 | | { |
| | 3628 | | _value.ClientRequestId = _header; |
| | 3629 | | } |
| | 3630 | |
|
| | 3631 | | // Create the response |
| | 3632 | | return Response.FromValue(_value, response); |
| | 3633 | | } |
| | 3634 | | default: |
| | 3635 | | { |
| | 3636 | | // Create the result |
| | 3637 | | string _value; |
| | 3638 | | using (System.IO.StreamReader _streamReader = new System.IO.StreamReader(response.ContentStream) |
| | 3639 | | { |
| | 3640 | | _value = _streamReader.ReadToEnd(); |
| | 3641 | | } |
| | 3642 | |
|
| | 3643 | | throw _value.CreateException(clientDiagnostics, response); |
| | 3644 | | } |
| | 3645 | | } |
| | 3646 | | } |
| | 3647 | | #endregion Path.AppendDataAsync |
| | 3648 | |
|
| | 3649 | | #region Path.SetExpiryAsync |
| | 3650 | | /// <summary> |
| | 3651 | | /// Sets the time a blob will expire and be deleted. |
| | 3652 | | /// </summary> |
| | 3653 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param> |
| | 3654 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 3655 | | /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de |
| | 3656 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 3657 | | /// <param name="expiryOptions">Required. Indicates mode of the expiry time</param> |
| | 3658 | | /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href=" |
| | 3659 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 3660 | | /// <param name="expiresOn">The time to set the blob to expiry</param> |
| | 3661 | | /// <param name="async">Whether to invoke the operation asynchronously. The default value is true.</param> |
| | 3662 | | /// <param name="operationName">Operation name.</param> |
| | 3663 | | /// <param name="cancellationToken">Cancellation token.</param> |
| | 3664 | | /// <returns>Azure.Response{Azure.Storage.Files.DataLake.Models.PathSetExpiryInternal}</returns> |
| | 3665 | | public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.DataLake.Models.Path |
| | 3666 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 3667 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 3668 | | System.Uri resourceUri, |
| | 3669 | | string version, |
| | 3670 | | Azure.Storage.Files.DataLake.Models.PathExpiryOptions expiryOptions, |
| | 3671 | | int? timeout = default, |
| | 3672 | | string requestId = default, |
| | 3673 | | string expiresOn = default, |
| | 3674 | | bool async = true, |
| | 3675 | | string operationName = "PathClient.SetExpiry", |
| | 3676 | | System.Threading.CancellationToken cancellationToken = default) |
| | 3677 | | { |
| | 3678 | | Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName); |
| | 3679 | | try |
| | 3680 | | { |
| | 3681 | | _scope.AddAttribute("url", resourceUri); |
| | 3682 | | _scope.Start(); |
| | 3683 | | using (Azure.Core.HttpMessage _message = SetExpiryAsync_CreateMessage( |
| | 3684 | | pipeline, |
| | 3685 | | resourceUri, |
| | 3686 | | version, |
| | 3687 | | expiryOptions, |
| | 3688 | | timeout, |
| | 3689 | | requestId, |
| | 3690 | | expiresOn)) |
| | 3691 | | { |
| | 3692 | | if (async) |
| | 3693 | | { |
| | 3694 | | // Send the request asynchronously if we're being called via an async path |
| | 3695 | | await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false); |
| | 3696 | | } |
| | 3697 | | else |
| | 3698 | | { |
| | 3699 | | // Send the request synchronously through the API that blocks if we're being called via a sy |
| | 3700 | | // (this is safe because the Task will complete before the user can call Wait) |
| | 3701 | | pipeline.Send(_message, cancellationToken); |
| | 3702 | | } |
| | 3703 | | Azure.Response _response = _message.Response; |
| | 3704 | | cancellationToken.ThrowIfCancellationRequested(); |
| | 3705 | | return SetExpiryAsync_CreateResponse(clientDiagnostics, _response); |
| | 3706 | | } |
| | 3707 | | } |
| | 3708 | | catch (System.Exception ex) |
| | 3709 | | { |
| | 3710 | | _scope.Failed(ex); |
| | 3711 | | throw; |
| | 3712 | | } |
| | 3713 | | finally |
| | 3714 | | { |
| | 3715 | | _scope.Dispose(); |
| | 3716 | | } |
| | 3717 | | } |
| | 3718 | |
|
| | 3719 | | /// <summary> |
| | 3720 | | /// Create the Path.SetExpiryAsync request. |
| | 3721 | | /// </summary> |
| | 3722 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 3723 | | /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de |
| | 3724 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 3725 | | /// <param name="expiryOptions">Required. Indicates mode of the expiry time</param> |
| | 3726 | | /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href=" |
| | 3727 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 3728 | | /// <param name="expiresOn">The time to set the blob to expiry</param> |
| | 3729 | | /// <returns>The Path.SetExpiryAsync Message.</returns> |
| | 3730 | | internal static Azure.Core.HttpMessage SetExpiryAsync_CreateMessage( |
| | 3731 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 3732 | | System.Uri resourceUri, |
| | 3733 | | string version, |
| | 3734 | | Azure.Storage.Files.DataLake.Models.PathExpiryOptions expiryOptions, |
| | 3735 | | int? timeout = default, |
| | 3736 | | string requestId = default, |
| | 3737 | | string expiresOn = default) |
| | 3738 | | { |
| | 3739 | | // Validation |
| | 3740 | | if (resourceUri == null) |
| | 3741 | | { |
| | 3742 | | throw new System.ArgumentNullException(nameof(resourceUri)); |
| | 3743 | | } |
| | 3744 | | if (version == null) |
| | 3745 | | { |
| | 3746 | | throw new System.ArgumentNullException(nameof(version)); |
| | 3747 | | } |
| | 3748 | |
|
| | 3749 | | // Create the request |
| | 3750 | | Azure.Core.HttpMessage _message = pipeline.CreateMessage(); |
| | 3751 | | Azure.Core.Request _request = _message.Request; |
| | 3752 | |
|
| | 3753 | | // Set the endpoint |
| | 3754 | | _request.Method = Azure.Core.RequestMethod.Put; |
| | 3755 | | _request.Uri.Reset(resourceUri); |
| | 3756 | | _request.Uri.AppendQuery("comp", "expiry", escapeValue: false); |
| | 3757 | | if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C |
| | 3758 | |
|
| | 3759 | | // Add request headers |
| | 3760 | | _request.Headers.SetValue("x-ms-version", version); |
| | 3761 | | _request.Headers.SetValue("x-ms-expiry-option", expiryOptions.ToString()); |
| | 3762 | | if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } |
| | 3763 | | if (expiresOn != null) { _request.Headers.SetValue("x-ms-expiry-time", expiresOn); } |
| | 3764 | |
|
| | 3765 | | return _message; |
| | 3766 | | } |
| | 3767 | |
|
| | 3768 | | /// <summary> |
| | 3769 | | /// Create the Path.SetExpiryAsync response or throw a failure exception. |
| | 3770 | | /// </summary> |
| | 3771 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param> |
| | 3772 | | /// <param name="response">The raw Response.</param> |
| | 3773 | | /// <returns>The Path.SetExpiryAsync Azure.Response{Azure.Storage.Files.DataLake.Models.PathSetExpiryInterna |
| | 3774 | | internal static Azure.Response<Azure.Storage.Files.DataLake.Models.PathSetExpiryInternal> SetExpiryAsync_Cre |
| | 3775 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 3776 | | Azure.Response response) |
| | 3777 | | { |
| | 3778 | | // Process the response |
| | 3779 | | switch (response.Status) |
| | 3780 | | { |
| | 3781 | | case 200: |
| | 3782 | | { |
| | 3783 | | // Create the result |
| | 3784 | | Azure.Storage.Files.DataLake.Models.PathSetExpiryInternal _value = new Azure.Storage.Files.DataL |
| | 3785 | |
|
| | 3786 | | // Get response headers |
| | 3787 | | string _header; |
| | 3788 | | if (response.Headers.TryGetValue("ETag", out _header)) |
| | 3789 | | { |
| | 3790 | | _value.ETag = new Azure.ETag(_header); |
| | 3791 | | } |
| | 3792 | | if (response.Headers.TryGetValue("Last-Modified", out _header)) |
| | 3793 | | { |
| | 3794 | | _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo. |
| | 3795 | | } |
| | 3796 | | if (response.Headers.TryGetValue("x-ms-client-request-id", out _header)) |
| | 3797 | | { |
| | 3798 | | _value.ClientRequestId = _header; |
| | 3799 | | } |
| | 3800 | |
|
| | 3801 | | // Create the response |
| | 3802 | | return Response.FromValue(_value, response); |
| | 3803 | | } |
| | 3804 | | default: |
| | 3805 | | { |
| | 3806 | | // Create the result |
| | 3807 | | string _value; |
| | 3808 | | using (System.IO.StreamReader _streamReader = new System.IO.StreamReader(response.ContentStream) |
| | 3809 | | { |
| | 3810 | | _value = _streamReader.ReadToEnd(); |
| | 3811 | | } |
| | 3812 | |
|
| | 3813 | | throw _value.CreateException(clientDiagnostics, response); |
| | 3814 | | } |
| | 3815 | | } |
| | 3816 | | } |
| | 3817 | | #endregion Path.SetExpiryAsync |
| | 3818 | | } |
| | 3819 | | #endregion Path operations |
| | 3820 | | } |
| | 3821 | | } |
| | 3822 | | #endregion Service |
| | 3823 | |
|
| | 3824 | | #region Models |
| | 3825 | | #region class AclFailedEntry |
| | 3826 | | namespace Azure.Storage.Files.DataLake.Models |
| | 3827 | | { |
| | 3828 | | /// <summary> |
| | 3829 | | /// AclFailedEntry |
| | 3830 | | /// </summary> |
| | 3831 | | internal partial class AclFailedEntry |
| | 3832 | | { |
| | 3833 | | /// <summary> |
| | 3834 | | /// name |
| | 3835 | | /// </summary> |
| | 3836 | | public string Name { get; internal set; } |
| | 3837 | |
|
| | 3838 | | /// <summary> |
| | 3839 | | /// type |
| | 3840 | | /// </summary> |
| | 3841 | | public string Type { get; internal set; } |
| | 3842 | |
|
| | 3843 | | /// <summary> |
| | 3844 | | /// errorMessage |
| | 3845 | | /// </summary> |
| | 3846 | | public string ErrorMessage { get; internal set; } |
| | 3847 | |
|
| | 3848 | | /// <summary> |
| | 3849 | | /// Prevent direct instantiation of AclFailedEntry instances. |
| | 3850 | | /// You can use DataLakeModelFactory.AclFailedEntry instead. |
| | 3851 | | /// </summary> |
| | 3852 | | internal AclFailedEntry() { } |
| | 3853 | |
|
| | 3854 | | /// <summary> |
| | 3855 | | /// Deserializes XML into a new AclFailedEntry instance. |
| | 3856 | | /// </summary> |
| | 3857 | | /// <param name="element">The XML element to deserialize.</param> |
| | 3858 | | /// <returns>A deserialized AclFailedEntry instance.</returns> |
| | 3859 | | internal static Azure.Storage.Files.DataLake.Models.AclFailedEntry FromXml(System.Xml.Linq.XElement element) |
| | 3860 | | { |
| | 3861 | | System.Diagnostics.Debug.Assert(element != null); |
| | 3862 | | System.Xml.Linq.XElement _child; |
| | 3863 | | Azure.Storage.Files.DataLake.Models.AclFailedEntry _value = new Azure.Storage.Files.DataLake.Models.AclFaile |
| | 3864 | | _child = element.Element(System.Xml.Linq.XName.Get("name", "")); |
| | 3865 | | if (_child != null) |
| | 3866 | | { |
| | 3867 | | _value.Name = _child.Value; |
| | 3868 | | } |
| | 3869 | | _child = element.Element(System.Xml.Linq.XName.Get("type", "")); |
| | 3870 | | if (_child != null) |
| | 3871 | | { |
| | 3872 | | _value.Type = _child.Value; |
| | 3873 | | } |
| | 3874 | | _child = element.Element(System.Xml.Linq.XName.Get("errorMessage", "")); |
| | 3875 | | if (_child != null) |
| | 3876 | | { |
| | 3877 | | _value.ErrorMessage = _child.Value; |
| | 3878 | | } |
| | 3879 | | CustomizeFromXml(element, _value); |
| | 3880 | | return _value; |
| | 3881 | | } |
| | 3882 | |
|
| | 3883 | | static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Files.DataLake.Models.AclFa |
| | 3884 | | } |
| | 3885 | | } |
| | 3886 | | #endregion class AclFailedEntry |
| | 3887 | |
|
| | 3888 | | #region class FileSystem |
| | 3889 | | namespace Azure.Storage.Files.DataLake.Models |
| | 3890 | | { |
| | 3891 | | /// <summary> |
| | 3892 | | /// FileSystem |
| | 3893 | | /// </summary> |
| | 3894 | | internal partial class FileSystem |
| | 3895 | | { |
| | 3896 | | /// <summary> |
| | 3897 | | /// name |
| | 3898 | | /// </summary> |
| | 3899 | | public string Name { get; internal set; } |
| | 3900 | |
|
| | 3901 | | /// <summary> |
| | 3902 | | /// lastModified |
| | 3903 | | /// </summary> |
| | 3904 | | public string LastModified { get; internal set; } |
| | 3905 | |
|
| | 3906 | | /// <summary> |
| | 3907 | | /// eTag |
| | 3908 | | /// </summary> |
| | 3909 | | public string ETag { get; internal set; } |
| | 3910 | |
|
| | 3911 | | /// <summary> |
| | 3912 | | /// Prevent direct instantiation of FileSystem instances. |
| | 3913 | | /// You can use DataLakeModelFactory.FileSystem instead. |
| | 3914 | | /// </summary> |
| | 3915 | | internal FileSystem() { } |
| | 3916 | |
|
| | 3917 | | /// <summary> |
| | 3918 | | /// Deserializes XML into a new FileSystem instance. |
| | 3919 | | /// </summary> |
| | 3920 | | /// <param name="element">The XML element to deserialize.</param> |
| | 3921 | | /// <returns>A deserialized FileSystem instance.</returns> |
| | 3922 | | internal static Azure.Storage.Files.DataLake.Models.FileSystem FromXml(System.Xml.Linq.XElement element) |
| | 3923 | | { |
| | 3924 | | System.Diagnostics.Debug.Assert(element != null); |
| | 3925 | | System.Xml.Linq.XElement _child; |
| | 3926 | | Azure.Storage.Files.DataLake.Models.FileSystem _value = new Azure.Storage.Files.DataLake.Models.FileSystem() |
| | 3927 | | _child = element.Element(System.Xml.Linq.XName.Get("name", "")); |
| | 3928 | | if (_child != null) |
| | 3929 | | { |
| | 3930 | | _value.Name = _child.Value; |
| | 3931 | | } |
| | 3932 | | _child = element.Element(System.Xml.Linq.XName.Get("lastModified", "")); |
| | 3933 | | if (_child != null) |
| | 3934 | | { |
| | 3935 | | _value.LastModified = _child.Value; |
| | 3936 | | } |
| | 3937 | | _child = element.Element(System.Xml.Linq.XName.Get("eTag", "")); |
| | 3938 | | if (_child != null) |
| | 3939 | | { |
| | 3940 | | _value.ETag = _child.Value; |
| | 3941 | | } |
| | 3942 | | CustomizeFromXml(element, _value); |
| | 3943 | | return _value; |
| | 3944 | | } |
| | 3945 | |
|
| | 3946 | | static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Files.DataLake.Models.FileS |
| | 3947 | | } |
| | 3948 | | } |
| | 3949 | | #endregion class FileSystem |
| | 3950 | |
|
| | 3951 | | #region class FileSystemCreateResult |
| | 3952 | | namespace Azure.Storage.Files.DataLake.Models |
| | 3953 | | { |
| | 3954 | | /// <summary> |
| | 3955 | | /// FileSystem CreateResult |
| | 3956 | | /// </summary> |
| | 3957 | | internal partial class FileSystemCreateResult |
| | 3958 | | { |
| | 3959 | | /// <summary> |
| | 3960 | | /// An HTTP entity tag associated with the FileSystem. |
| | 3961 | | /// </summary> |
| | 3962 | | public Azure.ETag ETag { get; internal set; } |
| | 3963 | |
|
| | 3964 | | /// <summary> |
| | 3965 | | /// The data and time the filesystem was last modified. Operations on files and directories do not affect the l |
| | 3966 | | /// </summary> |
| | 3967 | | public System.DateTimeOffset LastModified { get; internal set; } |
| | 3968 | |
|
| | 3969 | | /// <summary> |
| | 3970 | | /// A bool string indicates whether the namespace feature is enabled. If "true", the namespace is enabled for th |
| | 3971 | | /// </summary> |
| | 3972 | | public string NamespaceEnabled { get; internal set; } |
| | 3973 | |
|
| | 3974 | | /// <summary> |
| | 3975 | | /// Prevent direct instantiation of FileSystemCreateResult instances. |
| | 3976 | | /// You can use DataLakeModelFactory.FileSystemCreateResult instead. |
| | 3977 | | /// </summary> |
| | 3978 | | internal FileSystemCreateResult() { } |
| | 3979 | | } |
| | 3980 | | } |
| | 3981 | | #endregion class FileSystemCreateResult |
| | 3982 | |
|
| | 3983 | | #region class FileSystemGetPropertiesResult |
| | 3984 | | namespace Azure.Storage.Files.DataLake.Models |
| | 3985 | | { |
| | 3986 | | /// <summary> |
| | 3987 | | /// FileSystem GetPropertiesResult |
| | 3988 | | /// </summary> |
| | 3989 | | internal partial class FileSystemGetPropertiesResult |
| | 3990 | | { |
| | 3991 | | /// <summary> |
| | 3992 | | /// An HTTP entity tag associated with the filesystem. Changes to filesystem properties affect the entity tag, |
| | 3993 | | /// </summary> |
| | 3994 | | public Azure.ETag ETag { get; internal set; } |
| | 3995 | |
|
| | 3996 | | /// <summary> |
| | 3997 | | /// The data and time the filesystem was last modified. Changes to filesystem properties update the last modifi |
| | 3998 | | /// </summary> |
| | 3999 | | public System.DateTimeOffset LastModified { get; internal set; } |
| | 4000 | |
|
| | 4001 | | /// <summary> |
| | 4002 | | /// The user-defined properties associated with the filesystem. A comma-separated list of name and value pairs |
| | 4003 | | /// </summary> |
| | 4004 | | public string Properties { get; internal set; } |
| | 4005 | |
|
| | 4006 | | /// <summary> |
| | 4007 | | /// A bool string indicates whether the namespace feature is enabled. If "true", the namespace is enabled for th |
| | 4008 | | /// </summary> |
| | 4009 | | public string NamespaceEnabled { get; internal set; } |
| | 4010 | |
|
| | 4011 | | /// <summary> |
| | 4012 | | /// Prevent direct instantiation of FileSystemGetPropertiesResult instances. |
| | 4013 | | /// You can use DataLakeModelFactory.FileSystemGetPropertiesResult instead. |
| | 4014 | | /// </summary> |
| | 4015 | | internal FileSystemGetPropertiesResult() { } |
| | 4016 | | } |
| | 4017 | | } |
| | 4018 | | #endregion class FileSystemGetPropertiesResult |
| | 4019 | |
|
| | 4020 | | #region class FileSystemListPathsResult |
| | 4021 | | namespace Azure.Storage.Files.DataLake.Models |
| | 4022 | | { |
| | 4023 | | /// <summary> |
| | 4024 | | /// FileSystem ListPathsResult |
| | 4025 | | /// </summary> |
| | 4026 | | internal partial class FileSystemListPathsResult |
| | 4027 | | { |
| | 4028 | | /// <summary> |
| | 4029 | | /// An HTTP entity tag associated with the filesystem. Changes to filesystem properties affect the entity tag, |
| | 4030 | | /// </summary> |
| | 4031 | | public Azure.ETag ETag { get; internal set; } |
| | 4032 | |
|
| | 4033 | | /// <summary> |
| | 4034 | | /// The data and time the filesystem was last modified. Changes to filesystem properties update the last modifi |
| | 4035 | | /// </summary> |
| | 4036 | | public System.DateTimeOffset LastModified { get; internal set; } |
| | 4037 | |
|
| | 4038 | | /// <summary> |
| | 4039 | | /// If the number of paths to be listed exceeds the maxResults limit, a continuation token is returned in this r |
| | 4040 | | /// </summary> |
| | 4041 | | public string Continuation { get; internal set; } |
| | 4042 | |
|
| | 4043 | | /// <summary> |
| | 4044 | | /// Body |
| | 4045 | | /// </summary> |
| | 4046 | | public System.IO.Stream Body { get; internal set; } |
| | 4047 | |
|
| | 4048 | | /// <summary> |
| | 4049 | | /// Prevent direct instantiation of FileSystemListPathsResult instances. |
| | 4050 | | /// You can use DataLakeModelFactory.FileSystemListPathsResult instead. |
| | 4051 | | /// </summary> |
| | 4052 | | internal FileSystemListPathsResult() { } |
| | 4053 | | } |
| | 4054 | | } |
| | 4055 | | #endregion class FileSystemListPathsResult |
| | 4056 | |
|
| | 4057 | | #region class FileSystemSetPropertiesResult |
| | 4058 | | namespace Azure.Storage.Files.DataLake.Models |
| | 4059 | | { |
| | 4060 | | /// <summary> |
| | 4061 | | /// FileSystem SetPropertiesResult |
| | 4062 | | /// </summary> |
| | 4063 | | internal partial class FileSystemSetPropertiesResult |
| | 4064 | | { |
| | 4065 | | /// <summary> |
| | 4066 | | /// An HTTP entity tag associated with the filesystem. Changes to filesystem properties affect the entity tag, |
| | 4067 | | /// </summary> |
| | 4068 | | public Azure.ETag ETag { get; internal set; } |
| | 4069 | |
|
| | 4070 | | /// <summary> |
| | 4071 | | /// The data and time the filesystem was last modified. Changes to filesystem properties update the last modifi |
| | 4072 | | /// </summary> |
| | 4073 | | public System.DateTimeOffset LastModified { get; internal set; } |
| | 4074 | |
|
| | 4075 | | /// <summary> |
| | 4076 | | /// Prevent direct instantiation of FileSystemSetPropertiesResult instances. |
| | 4077 | | /// You can use DataLakeModelFactory.FileSystemSetPropertiesResult instead. |
| | 4078 | | /// </summary> |
| | 4079 | | internal FileSystemSetPropertiesResult() { } |
| | 4080 | | } |
| | 4081 | | } |
| | 4082 | | #endregion class FileSystemSetPropertiesResult |
| | 4083 | |
|
| | 4084 | | #region class FileSystemList |
| | 4085 | | namespace Azure.Storage.Files.DataLake.Models |
| | 4086 | | { |
| | 4087 | | /// <summary> |
| | 4088 | | /// FileSystemList |
| | 4089 | | /// </summary> |
| | 4090 | | internal partial class FileSystemList |
| | 4091 | | { |
| | 4092 | | /// <summary> |
| | 4093 | | /// filesystems |
| | 4094 | | /// </summary> |
| | 4095 | | public System.Collections.Generic.IEnumerable<Azure.Storage.Files.DataLake.Models.FileSystem> Filesystems { get; |
| | 4096 | |
|
| | 4097 | | /// <summary> |
| | 4098 | | /// Creates a new FileSystemList instance |
| | 4099 | | /// </summary> |
| | 4100 | | public FileSystemList() |
| | 4101 | | : this(false) |
| | 4102 | | { |
| | 4103 | | } |
| | 4104 | |
|
| | 4105 | | /// <summary> |
| | 4106 | | /// Creates a new FileSystemList instance |
| | 4107 | | /// </summary> |
| | 4108 | | /// <param name="skipInitialization">Whether to skip initializing nested objects.</param> |
| | 4109 | | internal FileSystemList(bool skipInitialization) |
| | 4110 | | { |
| | 4111 | | if (!skipInitialization) |
| | 4112 | | { |
| | 4113 | | Filesystems = new System.Collections.Generic.List<Azure.Storage.Files.DataLake.Models.FileSystem>(); |
| | 4114 | | } |
| | 4115 | | } |
| | 4116 | |
|
| | 4117 | | /// <summary> |
| | 4118 | | /// Deserializes XML into a new FileSystemList instance. |
| | 4119 | | /// </summary> |
| | 4120 | | /// <param name="element">The XML element to deserialize.</param> |
| | 4121 | | /// <returns>A deserialized FileSystemList instance.</returns> |
| | 4122 | | internal static Azure.Storage.Files.DataLake.Models.FileSystemList FromXml(System.Xml.Linq.XElement element) |
| | 4123 | | { |
| | 4124 | | System.Diagnostics.Debug.Assert(element != null); |
| | 4125 | | Azure.Storage.Files.DataLake.Models.FileSystemList _value = new Azure.Storage.Files.DataLake.Models.FileSyst |
| | 4126 | | _value.Filesystems = System.Linq.Enumerable.ToList( |
| | 4127 | | System.Linq.Enumerable.Select( |
| | 4128 | | element.Elements(System.Xml.Linq.XName.Get("FileSystem", "")), |
| | 4129 | | e => Azure.Storage.Files.DataLake.Models.FileSystem.FromXml(e))); |
| | 4130 | | CustomizeFromXml(element, _value); |
| | 4131 | | return _value; |
| | 4132 | | } |
| | 4133 | |
|
| | 4134 | | static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Files.DataLake.Models.FileS |
| | 4135 | | } |
| | 4136 | | } |
| | 4137 | | #endregion class FileSystemList |
| | 4138 | |
|
| | 4139 | | #region class Path |
| | 4140 | | namespace Azure.Storage.Files.DataLake.Models |
| | 4141 | | { |
| | 4142 | | /// <summary> |
| | 4143 | | /// Path |
| | 4144 | | /// </summary> |
| | 4145 | | internal partial class Path |
| | 4146 | | { |
| | 4147 | | /// <summary> |
| | 4148 | | /// name |
| | 4149 | | /// </summary> |
| | 4150 | | public string Name { get; internal set; } |
| | 4151 | |
|
| | 4152 | | /// <summary> |
| | 4153 | | /// isDirectory |
| | 4154 | | /// </summary> |
| | 4155 | | public bool? IsDirectory { get; internal set; } |
| | 4156 | |
|
| | 4157 | | /// <summary> |
| | 4158 | | /// lastModified |
| | 4159 | | /// </summary> |
| | 4160 | | public string LastModified { get; internal set; } |
| | 4161 | |
|
| | 4162 | | /// <summary> |
| | 4163 | | /// eTag |
| | 4164 | | /// </summary> |
| | 4165 | | public string ETag { get; internal set; } |
| | 4166 | |
|
| | 4167 | | /// <summary> |
| | 4168 | | /// contentLength |
| | 4169 | | /// </summary> |
| | 4170 | | public long? ContentLength { get; internal set; } |
| | 4171 | |
|
| | 4172 | | /// <summary> |
| | 4173 | | /// owner |
| | 4174 | | /// </summary> |
| | 4175 | | public string Owner { get; internal set; } |
| | 4176 | |
|
| | 4177 | | /// <summary> |
| | 4178 | | /// group |
| | 4179 | | /// </summary> |
| | 4180 | | public string Group { get; internal set; } |
| | 4181 | |
|
| | 4182 | | /// <summary> |
| | 4183 | | /// permissions |
| | 4184 | | /// </summary> |
| | 4185 | | public string Permissions { get; internal set; } |
| | 4186 | |
|
| | 4187 | | /// <summary> |
| | 4188 | | /// Prevent direct instantiation of Path instances. |
| | 4189 | | /// You can use DataLakeModelFactory.Path instead. |
| | 4190 | | /// </summary> |
| | 4191 | | internal Path() { } |
| | 4192 | | } |
| | 4193 | | } |
| | 4194 | | #endregion class Path |
| | 4195 | |
|
| | 4196 | | #region class PathAppendDataResult |
| | 4197 | | namespace Azure.Storage.Files.DataLake.Models |
| | 4198 | | { |
| | 4199 | | /// <summary> |
| | 4200 | | /// Path AppendDataResult |
| | 4201 | | /// </summary> |
| | 4202 | | internal partial class PathAppendDataResult |
| | 4203 | | { |
| | 4204 | | /// <summary> |
| | 4205 | | /// If a client request id header is sent in the request, this header will be present in the response with the s |
| | 4206 | | /// </summary> |
| | 4207 | | public string ClientRequestId { get; internal set; } |
| | 4208 | |
|
| | 4209 | | /// <summary> |
| | 4210 | | /// Prevent direct instantiation of PathAppendDataResult instances. |
| | 4211 | | /// You can use DataLakeModelFactory.PathAppendDataResult instead. |
| | 4212 | | /// </summary> |
| | 4213 | | internal PathAppendDataResult() { } |
| | 4214 | | } |
| | 4215 | | } |
| | 4216 | | #endregion class PathAppendDataResult |
| | 4217 | |
|
| | 4218 | | #region class PathCreateResult |
| | 4219 | | namespace Azure.Storage.Files.DataLake.Models |
| | 4220 | | { |
| | 4221 | | /// <summary> |
| | 4222 | | /// Path CreateResult |
| | 4223 | | /// </summary> |
| | 4224 | | internal partial class PathCreateResult |
| | 4225 | | { |
| | 4226 | | /// <summary> |
| | 4227 | | /// An HTTP entity tag associated with the file or directory. |
| | 4228 | | /// </summary> |
| | 4229 | | public Azure.ETag ETag { get; internal set; } |
| | 4230 | |
|
| | 4231 | | /// <summary> |
| | 4232 | | /// The data and time the file or directory was last modified. Write operations on the file or directory update |
| | 4233 | | /// </summary> |
| | 4234 | | public System.DateTimeOffset LastModified { get; internal set; } |
| | 4235 | |
|
| | 4236 | | /// <summary> |
| | 4237 | | /// When renaming a directory, the number of paths that are renamed with each invocation is limited. If the num |
| | 4238 | | /// </summary> |
| | 4239 | | public string Continuation { get; internal set; } |
| | 4240 | |
|
| | 4241 | | /// <summary> |
| | 4242 | | /// The size of the resource in bytes. |
| | 4243 | | /// </summary> |
| | 4244 | | public long ContentLength { get; internal set; } |
| | 4245 | |
|
| | 4246 | | /// <summary> |
| | 4247 | | /// Prevent direct instantiation of PathCreateResult instances. |
| | 4248 | | /// You can use DataLakeModelFactory.PathCreateResult instead. |
| | 4249 | | /// </summary> |
| | 4250 | | internal PathCreateResult() { } |
| | 4251 | | } |
| | 4252 | | } |
| | 4253 | | #endregion class PathCreateResult |
| | 4254 | |
|
| | 4255 | | #region class PathDeleteResult |
| | 4256 | | namespace Azure.Storage.Files.DataLake.Models |
| | 4257 | | { |
| | 4258 | | /// <summary> |
| | 4259 | | /// Path DeleteResult |
| | 4260 | | /// </summary> |
| | 4261 | | internal partial class PathDeleteResult |
| | 4262 | | { |
| | 4263 | | /// <summary> |
| | 4264 | | /// When deleting a directory, the number of paths that are deleted with each invocation is limited. If the num |
| | 4265 | | /// </summary> |
| | 4266 | | public string Continuation { get; internal set; } |
| | 4267 | |
|
| | 4268 | | /// <summary> |
| | 4269 | | /// Prevent direct instantiation of PathDeleteResult instances. |
| | 4270 | | /// You can use DataLakeModelFactory.PathDeleteResult instead. |
| | 4271 | | /// </summary> |
| | 4272 | | internal PathDeleteResult() { } |
| | 4273 | | } |
| | 4274 | | } |
| | 4275 | | #endregion class PathDeleteResult |
| | 4276 | |
|
| | 4277 | | #region class PathFlushDataResult |
| | 4278 | | namespace Azure.Storage.Files.DataLake.Models |
| | 4279 | | { |
| | 4280 | | /// <summary> |
| | 4281 | | /// Path FlushDataResult |
| | 4282 | | /// </summary> |
| | 4283 | | internal partial class PathFlushDataResult |
| | 4284 | | { |
| | 4285 | | /// <summary> |
| | 4286 | | /// An HTTP entity tag associated with the file or directory. |
| | 4287 | | /// </summary> |
| | 4288 | | public Azure.ETag ETag { get; internal set; } |
| | 4289 | |
|
| | 4290 | | /// <summary> |
| | 4291 | | /// The data and time the file or directory was last modified. Write operations on the file or directory update |
| | 4292 | | /// </summary> |
| | 4293 | | public System.DateTimeOffset LastModified { get; internal set; } |
| | 4294 | |
|
| | 4295 | | /// <summary> |
| | 4296 | | /// The size of the resource in bytes. |
| | 4297 | | /// </summary> |
| | 4298 | | public long ContentLength { get; internal set; } |
| | 4299 | |
|
| | 4300 | | /// <summary> |
| | 4301 | | /// If a client request id header is sent in the request, this header will be present in the response with the s |
| | 4302 | | /// </summary> |
| | 4303 | | public string ClientRequestId { get; internal set; } |
| | 4304 | |
|
| | 4305 | | /// <summary> |
| | 4306 | | /// Prevent direct instantiation of PathFlushDataResult instances. |
| | 4307 | | /// You can use DataLakeModelFactory.PathFlushDataResult instead. |
| | 4308 | | /// </summary> |
| | 4309 | | internal PathFlushDataResult() { } |
| | 4310 | | } |
| | 4311 | | } |
| | 4312 | | #endregion class PathFlushDataResult |
| | 4313 | |
|
| | 4314 | | #region class PathGetPropertiesResult |
| | 4315 | | namespace Azure.Storage.Files.DataLake.Models |
| | 4316 | | { |
| | 4317 | | /// <summary> |
| | 4318 | | /// Path GetPropertiesResult |
| | 4319 | | /// </summary> |
| | 4320 | | internal partial class PathGetPropertiesResult |
| | 4321 | | { |
| | 4322 | | /// <summary> |
| | 4323 | | /// Indicates that the service supports requests for partial file content. |
| | 4324 | | /// </summary> |
| | 4325 | | public string AcceptRanges { get; internal set; } |
| | 4326 | |
|
| | 4327 | | /// <summary> |
| | 4328 | | /// If the Cache-Control request header has previously been set for the resource, that value is returned in this |
| | 4329 | | /// </summary> |
| | 4330 | | public string CacheControl { get; internal set; } |
| | 4331 | |
|
| | 4332 | | /// <summary> |
| | 4333 | | /// If the Content-Disposition request header has previously been set for the resource, that value is returned i |
| | 4334 | | /// </summary> |
| | 4335 | | public string ContentDisposition { get; internal set; } |
| | 4336 | |
|
| | 4337 | | /// <summary> |
| | 4338 | | /// If the Content-Encoding request header has previously been set for the resource, that value is returned in t |
| | 4339 | | /// </summary> |
| | 4340 | | public string ContentEncoding { get; internal set; } |
| | 4341 | |
|
| | 4342 | | /// <summary> |
| | 4343 | | /// If the Content-Language request header has previously been set for the resource, that value is returned in t |
| | 4344 | | /// </summary> |
| | 4345 | | public string ContentLanguage { get; internal set; } |
| | 4346 | |
|
| | 4347 | | /// <summary> |
| | 4348 | | /// The size of the resource in bytes. |
| | 4349 | | /// </summary> |
| | 4350 | | public long ContentLength { get; internal set; } |
| | 4351 | |
|
| | 4352 | | /// <summary> |
| | 4353 | | /// Indicates the range of bytes returned in the event that the client requested a subset of the file by setting |
| | 4354 | | /// </summary> |
| | 4355 | | public string ContentRange { get; internal set; } |
| | 4356 | |
|
| | 4357 | | /// <summary> |
| | 4358 | | /// The content type specified for the resource. If no content type was specified, the default content type is a |
| | 4359 | | /// </summary> |
| | 4360 | | public string ContentType { get; internal set; } |
| | 4361 | |
|
| | 4362 | | /// <summary> |
| | 4363 | | /// The MD5 hash of complete file stored in storage. This header is returned only for "GetProperties" operation. |
| | 4364 | | /// </summary> |
| | 4365 | | public string ContentMD5 { get; internal set; } |
| | 4366 | |
|
| | 4367 | | /// <summary> |
| | 4368 | | /// An HTTP entity tag associated with the file or directory. |
| | 4369 | | /// </summary> |
| | 4370 | | public Azure.ETag ETag { get; internal set; } |
| | 4371 | |
|
| | 4372 | | /// <summary> |
| | 4373 | | /// The data and time the file or directory was last modified. Write operations on the file or directory update |
| | 4374 | | /// </summary> |
| | 4375 | | public System.DateTimeOffset LastModified { get; internal set; } |
| | 4376 | |
|
| | 4377 | | /// <summary> |
| | 4378 | | /// The type of the resource. The value may be "file" or "directory". If not set, the value is "file". |
| | 4379 | | /// </summary> |
| | 4380 | | public string ResourceType { get; internal set; } |
| | 4381 | |
|
| | 4382 | | /// <summary> |
| | 4383 | | /// The user-defined properties associated with the file or directory, in the format of a comma-separated list o |
| | 4384 | | /// </summary> |
| | 4385 | | public string Properties { get; internal set; } |
| | 4386 | |
|
| | 4387 | | /// <summary> |
| | 4388 | | /// The owner of the file or directory. Included in the response if Hierarchical Namespace is enabled for the ac |
| | 4389 | | /// </summary> |
| | 4390 | | public string Owner { get; internal set; } |
| | 4391 | |
|
| | 4392 | | /// <summary> |
| | 4393 | | /// The owning group of the file or directory. Included in the response if Hierarchical Namespace is enabled for |
| | 4394 | | /// </summary> |
| | 4395 | | public string Group { get; internal set; } |
| | 4396 | |
|
| | 4397 | | /// <summary> |
| | 4398 | | /// The POSIX access permissions for the file owner, the file owning group, and others. Included in the response |
| | 4399 | | /// </summary> |
| | 4400 | | public string Permissions { get; internal set; } |
| | 4401 | |
|
| | 4402 | | /// <summary> |
| | 4403 | | /// The POSIX access control list for the file or directory. Included in the response only if the action is "ge |
| | 4404 | | /// </summary> |
| | 4405 | | public string ACL { get; internal set; } |
| | 4406 | |
|
| | 4407 | | /// <summary> |
| | 4408 | | /// When a resource is leased, specifies whether the lease is of infinite or fixed duration. |
| | 4409 | | /// </summary> |
| | 4410 | | public string LeaseDuration { get; internal set; } |
| | 4411 | |
|
| | 4412 | | /// <summary> |
| | 4413 | | /// Lease state of the resource. |
| | 4414 | | /// </summary> |
| | 4415 | | public string LeaseState { get; internal set; } |
| | 4416 | |
|
| | 4417 | | /// <summary> |
| | 4418 | | /// The lease status of the resource. |
| | 4419 | | /// </summary> |
| | 4420 | | public string LeaseStatus { get; internal set; } |
| | 4421 | |
|
| | 4422 | | /// <summary> |
| | 4423 | | /// Prevent direct instantiation of PathGetPropertiesResult instances. |
| | 4424 | | /// You can use DataLakeModelFactory.PathGetPropertiesResult instead. |
| | 4425 | | /// </summary> |
| | 4426 | | internal PathGetPropertiesResult() { } |
| | 4427 | | } |
| | 4428 | | } |
| | 4429 | | #endregion class PathGetPropertiesResult |
| | 4430 | |
|
| | 4431 | | #region class PathLeaseResult |
| | 4432 | | namespace Azure.Storage.Files.DataLake.Models |
| | 4433 | | { |
| | 4434 | | /// <summary> |
| | 4435 | | /// Path LeaseResult |
| | 4436 | | /// </summary> |
| | 4437 | | internal partial class PathLeaseResult |
| | 4438 | | { |
| | 4439 | | /// <summary> |
| | 4440 | | /// An HTTP entity tag associated with the file. |
| | 4441 | | /// </summary> |
| | 4442 | | public Azure.ETag ETag { get; internal set; } |
| | 4443 | |
|
| | 4444 | | /// <summary> |
| | 4445 | | /// The data and time the file was last modified. Write operations on the file update the last modified time. |
| | 4446 | | /// </summary> |
| | 4447 | | public System.DateTimeOffset LastModified { get; internal set; } |
| | 4448 | |
|
| | 4449 | | /// <summary> |
| | 4450 | | /// The time remaining in the lease period in seconds. |
| | 4451 | | /// </summary> |
| | 4452 | | public string LeaseTime { get; internal set; } |
| | 4453 | |
|
| | 4454 | | /// <summary> |
| | 4455 | | /// A successful "renew" action returns the lease ID. |
| | 4456 | | /// </summary> |
| | 4457 | | public string LeaseId { get; internal set; } |
| | 4458 | |
|
| | 4459 | | /// <summary> |
| | 4460 | | /// Prevent direct instantiation of PathLeaseResult instances. |
| | 4461 | | /// You can use DataLakeModelFactory.PathLeaseResult instead. |
| | 4462 | | /// </summary> |
| | 4463 | | internal PathLeaseResult() { } |
| | 4464 | | } |
| | 4465 | | } |
| | 4466 | | #endregion class PathLeaseResult |
| | 4467 | |
|
| | 4468 | | #region class PathReadResult |
| | 4469 | | namespace Azure.Storage.Files.DataLake.Models |
| | 4470 | | { |
| | 4471 | | /// <summary> |
| | 4472 | | /// Path ReadResult |
| | 4473 | | /// </summary> |
| | 4474 | | internal partial class PathReadResult |
| | 4475 | | { |
| | 4476 | | /// <summary> |
| | 4477 | | /// Indicates that the service supports requests for partial file content. |
| | 4478 | | /// </summary> |
| | 4479 | | public string AcceptRanges { get; internal set; } |
| | 4480 | |
|
| | 4481 | | /// <summary> |
| | 4482 | | /// If the Cache-Control request header has previously been set for the resource, that value is returned in this |
| | 4483 | | /// </summary> |
| | 4484 | | public string CacheControl { get; internal set; } |
| | 4485 | |
|
| | 4486 | | /// <summary> |
| | 4487 | | /// If the Content-Disposition request header has previously been set for the resource, that value is returned i |
| | 4488 | | /// </summary> |
| | 4489 | | public string ContentDisposition { get; internal set; } |
| | 4490 | |
|
| | 4491 | | /// <summary> |
| | 4492 | | /// If the Content-Encoding request header has previously been set for the resource, that value is returned in t |
| | 4493 | | /// </summary> |
| | 4494 | | public string ContentEncoding { get; internal set; } |
| | 4495 | |
|
| | 4496 | | /// <summary> |
| | 4497 | | /// If the Content-Language request header has previously been set for the resource, that value is returned in t |
| | 4498 | | /// </summary> |
| | 4499 | | public string ContentLanguage { get; internal set; } |
| | 4500 | |
|
| | 4501 | | /// <summary> |
| | 4502 | | /// The size of the resource in bytes. |
| | 4503 | | /// </summary> |
| | 4504 | | public long ContentLength { get; internal set; } |
| | 4505 | |
|
| | 4506 | | /// <summary> |
| | 4507 | | /// Indicates the range of bytes returned in the event that the client requested a subset of the file by setting |
| | 4508 | | /// </summary> |
| | 4509 | | public string ContentRange { get; internal set; } |
| | 4510 | |
|
| | 4511 | | /// <summary> |
| | 4512 | | /// The content type specified for the resource. If no content type was specified, the default content type is a |
| | 4513 | | /// </summary> |
| | 4514 | | public string ContentType { get; internal set; } |
| | 4515 | |
|
| | 4516 | | /// <summary> |
| | 4517 | | /// The MD5 hash of complete file. If the file has an MD5 hash and this read operation is to read the complete f |
| | 4518 | | /// </summary> |
| | 4519 | | public string ContentMD5 { get; internal set; } |
| | 4520 | |
|
| | 4521 | | /// <summary> |
| | 4522 | | /// The MD5 hash of complete file stored in storage. If the file has a MD5 hash, and if request contains range h |
| | 4523 | | /// </summary> |
| | 4524 | | public string XMSContentMd5 { get; internal set; } |
| | 4525 | |
|
| | 4526 | | /// <summary> |
| | 4527 | | /// An HTTP entity tag associated with the file or directory. |
| | 4528 | | /// </summary> |
| | 4529 | | public Azure.ETag ETag { get; internal set; } |
| | 4530 | |
|
| | 4531 | | /// <summary> |
| | 4532 | | /// The data and time the file or directory was last modified. Write operations on the file or directory update |
| | 4533 | | /// </summary> |
| | 4534 | | public System.DateTimeOffset LastModified { get; internal set; } |
| | 4535 | |
|
| | 4536 | | /// <summary> |
| | 4537 | | /// The type of the resource. The value may be "file" or "directory". If not set, the value is "file". |
| | 4538 | | /// </summary> |
| | 4539 | | public string ResourceType { get; internal set; } |
| | 4540 | |
|
| | 4541 | | /// <summary> |
| | 4542 | | /// The user-defined properties associated with the file or directory, in the format of a comma-separated list o |
| | 4543 | | /// </summary> |
| | 4544 | | public string Properties { get; internal set; } |
| | 4545 | |
|
| | 4546 | | /// <summary> |
| | 4547 | | /// When a resource is leased, specifies whether the lease is of infinite or fixed duration. |
| | 4548 | | /// </summary> |
| | 4549 | | public string LeaseDuration { get; internal set; } |
| | 4550 | |
|
| | 4551 | | /// <summary> |
| | 4552 | | /// Lease state of the resource. |
| | 4553 | | /// </summary> |
| | 4554 | | public string LeaseState { get; internal set; } |
| | 4555 | |
|
| | 4556 | | /// <summary> |
| | 4557 | | /// The lease status of the resource. |
| | 4558 | | /// </summary> |
| | 4559 | | public string LeaseStatus { get; internal set; } |
| | 4560 | |
|
| | 4561 | | /// <summary> |
| | 4562 | | /// Body |
| | 4563 | | /// </summary> |
| | 4564 | | public System.IO.Stream Body { get; internal set; } |
| | 4565 | |
|
| | 4566 | | /// <summary> |
| | 4567 | | /// Prevent direct instantiation of PathReadResult instances. |
| | 4568 | | /// You can use DataLakeModelFactory.PathReadResult instead. |
| | 4569 | | /// </summary> |
| | 4570 | | internal PathReadResult() { } |
| | 4571 | | } |
| | 4572 | | } |
| | 4573 | | #endregion class PathReadResult |
| | 4574 | |
|
| | 4575 | | #region class PathSetAccessControlRecursiveResult |
| | 4576 | | namespace Azure.Storage.Files.DataLake.Models |
| | 4577 | | { |
| | 4578 | | /// <summary> |
| | 4579 | | /// Path SetAccessControlRecursiveResult |
| | 4580 | | /// </summary> |
| | 4581 | | internal partial class PathSetAccessControlRecursiveResult |
| | 4582 | | { |
| | 4583 | | /// <summary> |
| | 4584 | | /// If a client request id header is sent in the request, this header will be present in the response with the s |
| | 4585 | | /// </summary> |
| | 4586 | | public string ClientRequestId { get; internal set; } |
| | 4587 | |
|
| | 4588 | | /// <summary> |
| | 4589 | | /// When performing setAccessControlRecursive on a directory, the number of paths that are processed with each i |
| | 4590 | | /// </summary> |
| | 4591 | | public string Continuation { get; internal set; } |
| | 4592 | |
|
| | 4593 | | /// <summary> |
| | 4594 | | /// Body |
| | 4595 | | /// </summary> |
| | 4596 | | public System.IO.Stream Body { get; internal set; } |
| | 4597 | |
|
| | 4598 | | /// <summary> |
| | 4599 | | /// Prevent direct instantiation of PathSetAccessControlRecursiveResult instances. |
| | 4600 | | /// You can use DataLakeModelFactory.PathSetAccessControlRecursiveResult instead. |
| | 4601 | | /// </summary> |
| | 4602 | | internal PathSetAccessControlRecursiveResult() { } |
| | 4603 | | } |
| | 4604 | | } |
| | 4605 | | #endregion class PathSetAccessControlRecursiveResult |
| | 4606 | |
|
| | 4607 | | #region class PathSetAccessControlResult |
| | 4608 | | namespace Azure.Storage.Files.DataLake.Models |
| | 4609 | | { |
| | 4610 | | /// <summary> |
| | 4611 | | /// Path SetAccessControlResult |
| | 4612 | | /// </summary> |
| | 4613 | | internal partial class PathSetAccessControlResult |
| | 4614 | | { |
| | 4615 | | /// <summary> |
| | 4616 | | /// An HTTP entity tag associated with the file or directory. |
| | 4617 | | /// </summary> |
| | 4618 | | public Azure.ETag ETag { get; internal set; } |
| | 4619 | |
|
| | 4620 | | /// <summary> |
| | 4621 | | /// The data and time the file or directory was last modified. Write operations on the file or directory update |
| | 4622 | | /// </summary> |
| | 4623 | | public System.DateTimeOffset LastModified { get; internal set; } |
| | 4624 | |
|
| | 4625 | | /// <summary> |
| | 4626 | | /// If a client request id header is sent in the request, this header will be present in the response with the s |
| | 4627 | | /// </summary> |
| | 4628 | | public string ClientRequestId { get; internal set; } |
| | 4629 | |
|
| | 4630 | | /// <summary> |
| | 4631 | | /// Prevent direct instantiation of PathSetAccessControlResult instances. |
| | 4632 | | /// You can use DataLakeModelFactory.PathSetAccessControlResult instead. |
| | 4633 | | /// </summary> |
| | 4634 | | internal PathSetAccessControlResult() { } |
| | 4635 | | } |
| | 4636 | | } |
| | 4637 | | #endregion class PathSetAccessControlResult |
| | 4638 | |
|
| | 4639 | | #region class PathUpdateResult |
| | 4640 | | namespace Azure.Storage.Files.DataLake.Models |
| | 4641 | | { |
| | 4642 | | /// <summary> |
| | 4643 | | /// Path UpdateResult |
| | 4644 | | /// </summary> |
| | 4645 | | internal partial class PathUpdateResult |
| | 4646 | | { |
| | 4647 | | /// <summary> |
| | 4648 | | /// An MD5 hash of the request content. This header is only returned for "Flush" operation. This header is retur |
| | 4649 | | /// </summary> |
| | 4650 | | public string ContentMD5 { get; internal set; } |
| | 4651 | |
|
| | 4652 | | /// <summary> |
| | 4653 | | /// An HTTP entity tag associated with the file or directory. |
| | 4654 | | /// </summary> |
| | 4655 | | public Azure.ETag ETag { get; internal set; } |
| | 4656 | |
|
| | 4657 | | /// <summary> |
| | 4658 | | /// The data and time the file or directory was last modified. Write operations on the file or directory update |
| | 4659 | | /// </summary> |
| | 4660 | | public System.DateTimeOffset LastModified { get; internal set; } |
| | 4661 | |
|
| | 4662 | | /// <summary> |
| | 4663 | | /// Indicates that the service supports requests for partial file content. |
| | 4664 | | /// </summary> |
| | 4665 | | public string AcceptRanges { get; internal set; } |
| | 4666 | |
|
| | 4667 | | /// <summary> |
| | 4668 | | /// If the Cache-Control request header has previously been set for the resource, that value is returned in this |
| | 4669 | | /// </summary> |
| | 4670 | | public string CacheControl { get; internal set; } |
| | 4671 | |
|
| | 4672 | | /// <summary> |
| | 4673 | | /// If the Content-Disposition request header has previously been set for the resource, that value is returned i |
| | 4674 | | /// </summary> |
| | 4675 | | public string ContentDisposition { get; internal set; } |
| | 4676 | |
|
| | 4677 | | /// <summary> |
| | 4678 | | /// If the Content-Encoding request header has previously been set for the resource, that value is returned in t |
| | 4679 | | /// </summary> |
| | 4680 | | public string ContentEncoding { get; internal set; } |
| | 4681 | |
|
| | 4682 | | /// <summary> |
| | 4683 | | /// If the Content-Language request header has previously been set for the resource, that value is returned in t |
| | 4684 | | /// </summary> |
| | 4685 | | public string ContentLanguage { get; internal set; } |
| | 4686 | |
|
| | 4687 | | /// <summary> |
| | 4688 | | /// The size of the resource in bytes. |
| | 4689 | | /// </summary> |
| | 4690 | | public long ContentLength { get; internal set; } |
| | 4691 | |
|
| | 4692 | | /// <summary> |
| | 4693 | | /// Indicates the range of bytes returned in the event that the client requested a subset of the file by setting |
| | 4694 | | /// </summary> |
| | 4695 | | public string ContentRange { get; internal set; } |
| | 4696 | |
|
| | 4697 | | /// <summary> |
| | 4698 | | /// The content type specified for the resource. If no content type was specified, the default content type is a |
| | 4699 | | /// </summary> |
| | 4700 | | public string ContentType { get; internal set; } |
| | 4701 | |
|
| | 4702 | | /// <summary> |
| | 4703 | | /// User-defined properties associated with the file or directory, in the format of a comma-separated list of na |
| | 4704 | | /// </summary> |
| | 4705 | | public string Properties { get; internal set; } |
| | 4706 | |
|
| | 4707 | | /// <summary> |
| | 4708 | | /// When performing setAccessControlRecursive on a directory, the number of paths that are processed with each i |
| | 4709 | | /// </summary> |
| | 4710 | | public string XMSContinuation { get; internal set; } |
| | 4711 | |
|
| | 4712 | | /// <summary> |
| | 4713 | | /// Body |
| | 4714 | | /// </summary> |
| | 4715 | | public Azure.Storage.Files.DataLake.Models.SetAccessControlRecursiveResponse Body { get; internal set; } |
| | 4716 | |
|
| | 4717 | | /// <summary> |
| | 4718 | | /// Creates a new PathUpdateResult instance |
| | 4719 | | /// </summary> |
| | 4720 | | public PathUpdateResult() |
| | 4721 | | { |
| | 4722 | | Body = new Azure.Storage.Files.DataLake.Models.SetAccessControlRecursiveResponse(); |
| | 4723 | | } |
| | 4724 | | } |
| | 4725 | | } |
| | 4726 | | #endregion class PathUpdateResult |
| | 4727 | |
|
| | 4728 | | #region enum strings PathExpiryOptions |
| | 4729 | | namespace Azure.Storage.Files.DataLake.Models |
| | 4730 | | { |
| | 4731 | | /// <summary> |
| | 4732 | | /// Required. Indicates mode of the expiry time |
| | 4733 | | /// </summary> |
| | 4734 | | internal readonly struct PathExpiryOptions : System.IEquatable<PathExpiryOptions> |
| | 4735 | | { |
| | 4736 | | /// <summary> |
| | 4737 | | /// The PathExpiryOptions value. |
| | 4738 | | /// </summary> |
| | 4739 | | private readonly string _value; |
| | 4740 | |
|
| | 4741 | | /// <summary> |
| | 4742 | | /// Initializes a new instance of the <see cref="PathExpiryOptions"/> structure. |
| | 4743 | | /// </summary> |
| | 4744 | | /// <param name="value">The string value of the instance.</param> |
| | 4745 | | public PathExpiryOptions(string value) { _value = value ?? throw new System.ArgumentNullException(nameof(value)) |
| | 4746 | |
|
| | 4747 | | /// <summary> |
| | 4748 | | /// NeverExpire |
| | 4749 | | /// </summary> |
| | 4750 | | public static Azure.Storage.Files.DataLake.Models.PathExpiryOptions NeverExpire { get; } = new PathExpiryOptions |
| | 4751 | |
|
| | 4752 | | /// <summary> |
| | 4753 | | /// RelativeToCreation |
| | 4754 | | /// </summary> |
| | 4755 | | public static Azure.Storage.Files.DataLake.Models.PathExpiryOptions RelativeToCreation { get; } = new PathExpiry |
| | 4756 | |
|
| | 4757 | | /// <summary> |
| | 4758 | | /// RelativeToNow |
| | 4759 | | /// </summary> |
| | 4760 | | public static Azure.Storage.Files.DataLake.Models.PathExpiryOptions RelativeToNow { get; } = new PathExpiryOptio |
| | 4761 | |
|
| | 4762 | | /// <summary> |
| | 4763 | | /// Absolute |
| | 4764 | | /// </summary> |
| | 4765 | | public static Azure.Storage.Files.DataLake.Models.PathExpiryOptions Absolute { get; } = new PathExpiryOptions(@" |
| | 4766 | |
|
| | 4767 | | /// <summary> |
| | 4768 | | /// Determines if two <see cref="PathExpiryOptions"/> values are the same. |
| | 4769 | | /// </summary> |
| | 4770 | | /// <param name="left">The first <see cref="PathExpiryOptions"/> to compare.</param> |
| | 4771 | | /// <param name="right">The second <see cref="PathExpiryOptions"/> to compare.</param> |
| | 4772 | | /// <returns>True if <paramref name="left"/> and <paramref name="right"/> are the same; otherwise, false.</retur |
| | 4773 | | public static bool operator ==(Azure.Storage.Files.DataLake.Models.PathExpiryOptions left, Azure.Storage.Files.D |
| | 4774 | |
|
| | 4775 | | /// <summary> |
| | 4776 | | /// Determines if two <see cref="PathExpiryOptions"/> values are different. |
| | 4777 | | /// </summary> |
| | 4778 | | /// <param name="left">The first <see cref="PathExpiryOptions"/> to compare.</param> |
| | 4779 | | /// <param name="right">The second <see cref="PathExpiryOptions"/> to compare.</param> |
| | 4780 | | /// <returns>True if <paramref name="left"/> and <paramref name="right"/> are different; otherwise, false.</retu |
| | 4781 | | public static bool operator !=(Azure.Storage.Files.DataLake.Models.PathExpiryOptions left, Azure.Storage.Files.D |
| | 4782 | |
|
| | 4783 | | /// <summary> |
| | 4784 | | /// Converts a string to a <see cref="PathExpiryOptions"/>. |
| | 4785 | | /// </summary> |
| | 4786 | | /// <param name="value">The string value to convert.</param> |
| | 4787 | | /// <returns>The PathExpiryOptions value.</returns> |
| | 4788 | | public static implicit operator PathExpiryOptions(string value) => new Azure.Storage.Files.DataLake.Models.PathE |
| | 4789 | |
|
| | 4790 | | /// <summary> |
| | 4791 | | /// Check if two <see cref="PathExpiryOptions"/> instances are equal. |
| | 4792 | | /// </summary> |
| | 4793 | | /// <param name="obj">The instance to compare to.</param> |
| | 4794 | | /// <returns>True if they're equal, false otherwise.</returns> |
| | 4795 | | [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] |
| | 4796 | | public override bool Equals(object obj) => obj is Azure.Storage.Files.DataLake.Models.PathExpiryOptions other && |
| | 4797 | |
|
| | 4798 | | /// <summary> |
| | 4799 | | /// Check if two <see cref="PathExpiryOptions"/> instances are equal. |
| | 4800 | | /// </summary> |
| | 4801 | | /// <param name="other">The instance to compare to.</param> |
| | 4802 | | /// <returns>True if they're equal, false otherwise.</returns> |
| | 4803 | | public bool Equals(Azure.Storage.Files.DataLake.Models.PathExpiryOptions other) => string.Equals(_value, other._ |
| | 4804 | |
|
| | 4805 | | /// <summary> |
| | 4806 | | /// Get a hash code for the <see cref="PathExpiryOptions"/>. |
| | 4807 | | /// </summary> |
| | 4808 | | /// <returns>Hash code for the PathExpiryOptions.</returns> |
| | 4809 | | [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] |
| | 4810 | | public override int GetHashCode() => _value?.GetHashCode() ?? 0; |
| | 4811 | |
|
| | 4812 | | /// <summary> |
| | 4813 | | /// Convert the <see cref="PathExpiryOptions"/> to a string. |
| | 4814 | | /// </summary> |
| | 4815 | | /// <returns>String representation of the PathExpiryOptions.</returns> |
| | 4816 | | public override string ToString() => _value; |
| | 4817 | | } |
| | 4818 | | } |
| | 4819 | | #endregion enum strings PathExpiryOptions |
| | 4820 | |
|
| | 4821 | | #region enum PathGetPropertiesAction |
| | 4822 | | namespace Azure.Storage.Files.DataLake.Models |
| | 4823 | | { |
| | 4824 | | /// <summary> |
| | 4825 | | /// Optional. If the value is "getStatus" only the system defined properties for the path are returned. If the value |
| | 4826 | | /// </summary> |
| | 4827 | | public enum PathGetPropertiesAction |
| | 4828 | | { |
| | 4829 | | /// <summary> |
| | 4830 | | /// getAccessControl |
| | 4831 | | /// </summary> |
| | 4832 | | GetAccessControl, |
| | 4833 | |
|
| | 4834 | | /// <summary> |
| | 4835 | | /// getStatus |
| | 4836 | | /// </summary> |
| | 4837 | | GetStatus |
| | 4838 | | } |
| | 4839 | | } |
| | 4840 | |
|
| | 4841 | | namespace Azure.Storage.Files.DataLake |
| | 4842 | | { |
| | 4843 | | internal static partial class DataLakeRestClient |
| | 4844 | | { |
| | 4845 | | public static partial class Serialization |
| | 4846 | | { |
| | 4847 | | public static string ToString(Azure.Storage.Files.DataLake.Models.PathGetPropertiesAction value) |
| | 4848 | | { |
| | 4849 | | return value switch |
| | 4850 | | { |
| | 4851 | | Azure.Storage.Files.DataLake.Models.PathGetPropertiesAction.GetAccessControl => "getAccessControl", |
| | 4852 | | Azure.Storage.Files.DataLake.Models.PathGetPropertiesAction.GetStatus => "getStatus", |
| | 4853 | | _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Files |
| | 4854 | | }; |
| | 4855 | | } |
| | 4856 | |
|
| | 4857 | | public static Azure.Storage.Files.DataLake.Models.PathGetPropertiesAction ParsePathGetPropertiesAction(strin |
| | 4858 | | { |
| | 4859 | | return value switch |
| | 4860 | | { |
| | 4861 | | "getAccessControl" => Azure.Storage.Files.DataLake.Models.PathGetPropertiesAction.GetAccessControl, |
| | 4862 | | "getStatus" => Azure.Storage.Files.DataLake.Models.PathGetPropertiesAction.GetStatus, |
| | 4863 | | _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Files |
| | 4864 | | }; |
| | 4865 | | } |
| | 4866 | | } |
| | 4867 | | } |
| | 4868 | | } |
| | 4869 | | #endregion enum PathGetPropertiesAction |
| | 4870 | |
|
| | 4871 | | #region enum PathLeaseAction |
| | 4872 | | namespace Azure.Storage.Files.DataLake.Models |
| | 4873 | | { |
| | 4874 | | /// <summary> |
| | 4875 | | /// There are five lease actions: "acquire", "break", "change", "renew", and "release". Use "acquire" and specify th |
| | 4876 | | /// </summary> |
| | 4877 | | public enum PathLeaseAction |
| | 4878 | | { |
| | 4879 | | /// <summary> |
| | 4880 | | /// acquire |
| | 4881 | | /// </summary> |
| | 4882 | | Acquire, |
| | 4883 | |
|
| | 4884 | | /// <summary> |
| | 4885 | | /// break |
| | 4886 | | /// </summary> |
| | 4887 | | Break, |
| | 4888 | |
|
| | 4889 | | /// <summary> |
| | 4890 | | /// change |
| | 4891 | | /// </summary> |
| | 4892 | | Change, |
| | 4893 | |
|
| | 4894 | | /// <summary> |
| | 4895 | | /// renew |
| | 4896 | | /// </summary> |
| | 4897 | | Renew, |
| | 4898 | |
|
| | 4899 | | /// <summary> |
| | 4900 | | /// release |
| | 4901 | | /// </summary> |
| | 4902 | | Release |
| | 4903 | | } |
| | 4904 | | } |
| | 4905 | |
|
| | 4906 | | namespace Azure.Storage.Files.DataLake |
| | 4907 | | { |
| | 4908 | | internal static partial class DataLakeRestClient |
| | 4909 | | { |
| | 4910 | | public static partial class Serialization |
| | 4911 | | { |
| | 4912 | | public static string ToString(Azure.Storage.Files.DataLake.Models.PathLeaseAction value) |
| | 4913 | | { |
| | 4914 | | return value switch |
| | 4915 | | { |
| | 4916 | | Azure.Storage.Files.DataLake.Models.PathLeaseAction.Acquire => "acquire", |
| | 4917 | | Azure.Storage.Files.DataLake.Models.PathLeaseAction.Break => "break", |
| | 4918 | | Azure.Storage.Files.DataLake.Models.PathLeaseAction.Change => "change", |
| | 4919 | | Azure.Storage.Files.DataLake.Models.PathLeaseAction.Renew => "renew", |
| | 4920 | | Azure.Storage.Files.DataLake.Models.PathLeaseAction.Release => "release", |
| | 4921 | | _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Files |
| | 4922 | | }; |
| | 4923 | | } |
| | 4924 | |
|
| | 4925 | | public static Azure.Storage.Files.DataLake.Models.PathLeaseAction ParsePathLeaseAction(string value) |
| | 4926 | | { |
| | 4927 | | return value switch |
| | 4928 | | { |
| | 4929 | | "acquire" => Azure.Storage.Files.DataLake.Models.PathLeaseAction.Acquire, |
| | 4930 | | "break" => Azure.Storage.Files.DataLake.Models.PathLeaseAction.Break, |
| | 4931 | | "change" => Azure.Storage.Files.DataLake.Models.PathLeaseAction.Change, |
| | 4932 | | "renew" => Azure.Storage.Files.DataLake.Models.PathLeaseAction.Renew, |
| | 4933 | | "release" => Azure.Storage.Files.DataLake.Models.PathLeaseAction.Release, |
| | 4934 | | _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Files |
| | 4935 | | }; |
| | 4936 | | } |
| | 4937 | | } |
| | 4938 | | } |
| | 4939 | | } |
| | 4940 | | #endregion enum PathLeaseAction |
| | 4941 | |
|
| | 4942 | | #region class PathList |
| | 4943 | | namespace Azure.Storage.Files.DataLake.Models |
| | 4944 | | { |
| | 4945 | | /// <summary> |
| | 4946 | | /// PathList |
| | 4947 | | /// </summary> |
| | 4948 | | internal partial class PathList |
| | 4949 | | { |
| | 4950 | | /// <summary> |
| | 4951 | | /// paths |
| | 4952 | | /// </summary> |
| | 4953 | | public System.Collections.Generic.IEnumerable<Azure.Storage.Files.DataLake.Models.Path> Paths { get; internal se |
| | 4954 | |
|
| | 4955 | | /// <summary> |
| | 4956 | | /// Creates a new PathList instance |
| | 4957 | | /// </summary> |
| | 4958 | | public PathList() |
| | 4959 | | { |
| | 4960 | | Paths = new System.Collections.Generic.List<Azure.Storage.Files.DataLake.Models.Path>(); |
| | 4961 | | } |
| | 4962 | | } |
| | 4963 | | } |
| | 4964 | | #endregion class PathList |
| | 4965 | |
|
| | 4966 | | #region enum PathRenameMode |
| | 4967 | | namespace Azure.Storage.Files.DataLake.Models |
| | 4968 | | { |
| | 4969 | | /// <summary> |
| | 4970 | | /// Optional. Valid only when namespace is enabled. This parameter determines the behavior of the rename operation. |
| | 4971 | | /// </summary> |
| | 4972 | | public enum PathRenameMode |
| | 4973 | | { |
| | 4974 | | /// <summary> |
| | 4975 | | /// legacy |
| | 4976 | | /// </summary> |
| | 4977 | | Legacy, |
| | 4978 | |
|
| | 4979 | | /// <summary> |
| | 4980 | | /// posix |
| | 4981 | | /// </summary> |
| | 4982 | | Posix |
| | 4983 | | } |
| | 4984 | | } |
| | 4985 | |
|
| | 4986 | | namespace Azure.Storage.Files.DataLake |
| | 4987 | | { |
| | 4988 | | internal static partial class DataLakeRestClient |
| | 4989 | | { |
| | 4990 | | public static partial class Serialization |
| | 4991 | | { |
| | 4992 | | public static string ToString(Azure.Storage.Files.DataLake.Models.PathRenameMode value) |
| | 4993 | | { |
| | 4994 | | return value switch |
| | 4995 | | { |
| | 4996 | | Azure.Storage.Files.DataLake.Models.PathRenameMode.Legacy => "legacy", |
| | 4997 | | Azure.Storage.Files.DataLake.Models.PathRenameMode.Posix => "posix", |
| | 4998 | | _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Files |
| | 4999 | | }; |
| | 5000 | | } |
| | 5001 | |
|
| | 5002 | | public static Azure.Storage.Files.DataLake.Models.PathRenameMode ParsePathRenameMode(string value) |
| | 5003 | | { |
| | 5004 | | return value switch |
| | 5005 | | { |
| | 5006 | | "legacy" => Azure.Storage.Files.DataLake.Models.PathRenameMode.Legacy, |
| | 5007 | | "posix" => Azure.Storage.Files.DataLake.Models.PathRenameMode.Posix, |
| | 5008 | | _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Files |
| | 5009 | | }; |
| | 5010 | | } |
| | 5011 | | } |
| | 5012 | | } |
| | 5013 | | } |
| | 5014 | | #endregion enum PathRenameMode |
| | 5015 | |
|
| | 5016 | | #region enum PathResourceType |
| | 5017 | | namespace Azure.Storage.Files.DataLake.Models |
| | 5018 | | { |
| | 5019 | | /// <summary> |
| | 5020 | | /// Required only for Create File and Create Directory. The value must be "file" or "directory". |
| | 5021 | | /// </summary> |
| | 5022 | | public enum PathResourceType |
| | 5023 | | { |
| | 5024 | | /// <summary> |
| | 5025 | | /// directory |
| | 5026 | | /// </summary> |
| | 5027 | | Directory, |
| | 5028 | |
|
| | 5029 | | /// <summary> |
| | 5030 | | /// file |
| | 5031 | | /// </summary> |
| | 5032 | | File |
| | 5033 | | } |
| | 5034 | | } |
| | 5035 | |
|
| | 5036 | | namespace Azure.Storage.Files.DataLake |
| | 5037 | | { |
| | 5038 | | internal static partial class DataLakeRestClient |
| | 5039 | | { |
| | 5040 | | public static partial class Serialization |
| | 5041 | | { |
| | 5042 | | public static string ToString(Azure.Storage.Files.DataLake.Models.PathResourceType value) |
| | 5043 | | { |
| | 5044 | | return value switch |
| | 5045 | | { |
| | 5046 | | Azure.Storage.Files.DataLake.Models.PathResourceType.Directory => "directory", |
| | 5047 | | Azure.Storage.Files.DataLake.Models.PathResourceType.File => "file", |
| | 5048 | | _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Files |
| | 5049 | | }; |
| | 5050 | | } |
| | 5051 | |
|
| | 5052 | | public static Azure.Storage.Files.DataLake.Models.PathResourceType ParsePathResourceType(string value) |
| | 5053 | | { |
| | 5054 | | return value switch |
| | 5055 | | { |
| | 5056 | | "directory" => Azure.Storage.Files.DataLake.Models.PathResourceType.Directory, |
| | 5057 | | "file" => Azure.Storage.Files.DataLake.Models.PathResourceType.File, |
| | 5058 | | _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Files |
| | 5059 | | }; |
| | 5060 | | } |
| | 5061 | | } |
| | 5062 | | } |
| | 5063 | | } |
| | 5064 | | #endregion enum PathResourceType |
| | 5065 | |
|
| | 5066 | | #region enum PathSetAccessControlRecursiveMode |
| | 5067 | | namespace Azure.Storage.Files.DataLake.Models |
| | 5068 | | { |
| | 5069 | | /// <summary> |
| | 5070 | | /// Mode "set" sets POSIX access control rights on files and directories, "modify" modifies one or more POSIX access |
| | 5071 | | /// </summary> |
| | 5072 | | internal enum PathSetAccessControlRecursiveMode |
| | 5073 | | { |
| | 5074 | | /// <summary> |
| | 5075 | | /// set |
| | 5076 | | /// </summary> |
| | 5077 | | Set, |
| | 5078 | |
|
| | 5079 | | /// <summary> |
| | 5080 | | /// modify |
| | 5081 | | /// </summary> |
| | 5082 | | Modify, |
| | 5083 | |
|
| | 5084 | | /// <summary> |
| | 5085 | | /// remove |
| | 5086 | | /// </summary> |
| | 5087 | | Remove |
| | 5088 | | } |
| | 5089 | | } |
| | 5090 | |
|
| | 5091 | | namespace Azure.Storage.Files.DataLake |
| | 5092 | | { |
| | 5093 | | internal static partial class DataLakeRestClient |
| | 5094 | | { |
| | 5095 | | public static partial class Serialization |
| | 5096 | | { |
| | 5097 | | public static string ToString(Azure.Storage.Files.DataLake.Models.PathSetAccessControlRecursiveMode value) |
| | 5098 | | { |
| | 5099 | | return value switch |
| | 5100 | | { |
| | 5101 | | Azure.Storage.Files.DataLake.Models.PathSetAccessControlRecursiveMode.Set => "set", |
| | 5102 | | Azure.Storage.Files.DataLake.Models.PathSetAccessControlRecursiveMode.Modify => "modify", |
| | 5103 | | Azure.Storage.Files.DataLake.Models.PathSetAccessControlRecursiveMode.Remove => "remove", |
| | 5104 | | _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Files |
| | 5105 | | }; |
| | 5106 | | } |
| | 5107 | |
|
| | 5108 | | public static Azure.Storage.Files.DataLake.Models.PathSetAccessControlRecursiveMode ParsePathSetAccessContro |
| | 5109 | | { |
| | 5110 | | return value switch |
| | 5111 | | { |
| | 5112 | | "set" => Azure.Storage.Files.DataLake.Models.PathSetAccessControlRecursiveMode.Set, |
| | 5113 | | "modify" => Azure.Storage.Files.DataLake.Models.PathSetAccessControlRecursiveMode.Modify, |
| | 5114 | | "remove" => Azure.Storage.Files.DataLake.Models.PathSetAccessControlRecursiveMode.Remove, |
| | 5115 | | _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Files |
| | 5116 | | }; |
| | 5117 | | } |
| | 5118 | | } |
| | 5119 | | } |
| | 5120 | | } |
| | 5121 | | #endregion enum PathSetAccessControlRecursiveMode |
| | 5122 | |
|
| | 5123 | | #region class PathSetExpiryInternal |
| | 5124 | | namespace Azure.Storage.Files.DataLake.Models |
| | 5125 | | { |
| | 5126 | | /// <summary> |
| | 5127 | | /// PathSetExpiryInternal |
| | 5128 | | /// </summary> |
| | 5129 | | internal partial class PathSetExpiryInternal |
| | 5130 | | { |
| | 5131 | | /// <summary> |
| | 5132 | | /// The ETag contains a value that you can use to perform operations conditionally. If the request version is 20 |
| | 5133 | | /// </summary> |
| | 5134 | | public Azure.ETag ETag { get; internal set; } |
| | 5135 | |
|
| | 5136 | | /// <summary> |
| | 5137 | | /// Returns the date and time the container was last modified. Any operation that modifies the blob, including a |
| | 5138 | | /// </summary> |
| | 5139 | | public System.DateTimeOffset LastModified { get; internal set; } |
| | 5140 | |
|
| | 5141 | | /// <summary> |
| | 5142 | | /// If a client request id header is sent in the request, this header will be present in the response with the s |
| | 5143 | | /// </summary> |
| | 5144 | | public string ClientRequestId { get; internal set; } |
| | 5145 | |
|
| | 5146 | | /// <summary> |
| | 5147 | | /// Prevent direct instantiation of PathSetExpiryInternal instances. |
| | 5148 | | /// You can use DataLakeModelFactory.PathSetExpiryInternal instead. |
| | 5149 | | /// </summary> |
| | 5150 | | internal PathSetExpiryInternal() { } |
| | 5151 | | } |
| | 5152 | | } |
| | 5153 | | #endregion class PathSetExpiryInternal |
| | 5154 | |
|
| | 5155 | | #region enum PathUpdateAction |
| | 5156 | | namespace Azure.Storage.Files.DataLake.Models |
| | 5157 | | { |
| | 5158 | | /// <summary> |
| | 5159 | | /// The action must be "append" to upload data to be appended to a file, "flush" to flush previously uploaded data t |
| | 5160 | | /// </summary> |
| | 5161 | | public enum PathUpdateAction |
| | 5162 | | { |
| | 5163 | | /// <summary> |
| | 5164 | | /// append |
| | 5165 | | /// </summary> |
| | 5166 | | Append, |
| | 5167 | |
|
| | 5168 | | /// <summary> |
| | 5169 | | /// flush |
| | 5170 | | /// </summary> |
| | 5171 | | Flush, |
| | 5172 | |
|
| | 5173 | | /// <summary> |
| | 5174 | | /// setProperties |
| | 5175 | | /// </summary> |
| | 5176 | | SetProperties, |
| | 5177 | |
|
| | 5178 | | /// <summary> |
| | 5179 | | /// setAccessControl |
| | 5180 | | /// </summary> |
| | 5181 | | SetAccessControl, |
| | 5182 | |
|
| | 5183 | | /// <summary> |
| | 5184 | | /// setAccessControlRecursive |
| | 5185 | | /// </summary> |
| | 5186 | | SetAccessControlRecursive |
| | 5187 | | } |
| | 5188 | | } |
| | 5189 | |
|
| | 5190 | | namespace Azure.Storage.Files.DataLake |
| | 5191 | | { |
| | 5192 | | internal static partial class DataLakeRestClient |
| | 5193 | | { |
| | 5194 | | public static partial class Serialization |
| | 5195 | | { |
| | 5196 | | public static string ToString(Azure.Storage.Files.DataLake.Models.PathUpdateAction value) |
| | 5197 | | { |
| | 5198 | | return value switch |
| | 5199 | | { |
| | 5200 | | Azure.Storage.Files.DataLake.Models.PathUpdateAction.Append => "append", |
| | 5201 | | Azure.Storage.Files.DataLake.Models.PathUpdateAction.Flush => "flush", |
| | 5202 | | Azure.Storage.Files.DataLake.Models.PathUpdateAction.SetProperties => "setProperties", |
| | 5203 | | Azure.Storage.Files.DataLake.Models.PathUpdateAction.SetAccessControl => "setAccessControl", |
| | 5204 | | Azure.Storage.Files.DataLake.Models.PathUpdateAction.SetAccessControlRecursive => "setAccessControlR |
| | 5205 | | _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Files |
| | 5206 | | }; |
| | 5207 | | } |
| | 5208 | |
|
| | 5209 | | public static Azure.Storage.Files.DataLake.Models.PathUpdateAction ParsePathUpdateAction(string value) |
| | 5210 | | { |
| | 5211 | | return value switch |
| | 5212 | | { |
| | 5213 | | "append" => Azure.Storage.Files.DataLake.Models.PathUpdateAction.Append, |
| | 5214 | | "flush" => Azure.Storage.Files.DataLake.Models.PathUpdateAction.Flush, |
| | 5215 | | "setProperties" => Azure.Storage.Files.DataLake.Models.PathUpdateAction.SetProperties, |
| | 5216 | | "setAccessControl" => Azure.Storage.Files.DataLake.Models.PathUpdateAction.SetAccessControl, |
| | 5217 | | "setAccessControlRecursive" => Azure.Storage.Files.DataLake.Models.PathUpdateAction.SetAccessControl |
| | 5218 | | _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Files |
| | 5219 | | }; |
| | 5220 | | } |
| | 5221 | | } |
| | 5222 | | } |
| | 5223 | | } |
| | 5224 | | #endregion enum PathUpdateAction |
| | 5225 | |
|
| | 5226 | | #region class ServiceListFileSystemsResult |
| | 5227 | | namespace Azure.Storage.Files.DataLake.Models |
| | 5228 | | { |
| | 5229 | | /// <summary> |
| | 5230 | | /// Service ListFileSystemsResult |
| | 5231 | | /// </summary> |
| | 5232 | | internal partial class ServiceListFileSystemsResult |
| | 5233 | | { |
| | 5234 | | /// <summary> |
| | 5235 | | /// If the number of filesystems to be listed exceeds the maxResults limit, a continuation token is returned in |
| | 5236 | | /// </summary> |
| 0 | 5237 | | public string Continuation { get; internal set; } |
| | 5238 | |
|
| | 5239 | | /// <summary> |
| | 5240 | | /// The content type of list filesystem response. The default content type is application/json. |
| | 5241 | | /// </summary> |
| 0 | 5242 | | public string ContentType { get; internal set; } |
| | 5243 | |
|
| | 5244 | | /// <summary> |
| | 5245 | | /// Body |
| | 5246 | | /// </summary> |
| 0 | 5247 | | public Azure.Storage.Files.DataLake.Models.FileSystemList Body { get; internal set; } |
| | 5248 | |
|
| | 5249 | | /// <summary> |
| | 5250 | | /// Creates a new ServiceListFileSystemsResult instance |
| | 5251 | | /// </summary> |
| 0 | 5252 | | public ServiceListFileSystemsResult() |
| | 5253 | | { |
| 0 | 5254 | | Body = new Azure.Storage.Files.DataLake.Models.FileSystemList(); |
| 0 | 5255 | | } |
| | 5256 | | } |
| | 5257 | | } |
| | 5258 | | #endregion class ServiceListFileSystemsResult |
| | 5259 | |
|
| | 5260 | | #region class SetAccessControlRecursiveResponse |
| | 5261 | | namespace Azure.Storage.Files.DataLake.Models |
| | 5262 | | { |
| | 5263 | | /// <summary> |
| | 5264 | | /// SetAccessControlRecursiveResponse |
| | 5265 | | /// </summary> |
| | 5266 | | internal partial class SetAccessControlRecursiveResponse |
| | 5267 | | { |
| | 5268 | | /// <summary> |
| | 5269 | | /// directoriesSuccessful |
| | 5270 | | /// </summary> |
| | 5271 | | public int? DirectoriesSuccessful { get; internal set; } |
| | 5272 | |
|
| | 5273 | | /// <summary> |
| | 5274 | | /// filesSuccessful |
| | 5275 | | /// </summary> |
| | 5276 | | public int? FilesSuccessful { get; internal set; } |
| | 5277 | |
|
| | 5278 | | /// <summary> |
| | 5279 | | /// failureCount |
| | 5280 | | /// </summary> |
| | 5281 | | public int? FailureCount { get; internal set; } |
| | 5282 | |
|
| | 5283 | | /// <summary> |
| | 5284 | | /// failedEntries |
| | 5285 | | /// </summary> |
| | 5286 | | public System.Collections.Generic.IEnumerable<Azure.Storage.Files.DataLake.Models.AclFailedEntry> FailedEntries |
| | 5287 | |
|
| | 5288 | | /// <summary> |
| | 5289 | | /// Creates a new SetAccessControlRecursiveResponse instance |
| | 5290 | | /// </summary> |
| | 5291 | | public SetAccessControlRecursiveResponse() |
| | 5292 | | : this(false) |
| | 5293 | | { |
| | 5294 | | } |
| | 5295 | |
|
| | 5296 | | /// <summary> |
| | 5297 | | /// Creates a new SetAccessControlRecursiveResponse instance |
| | 5298 | | /// </summary> |
| | 5299 | | /// <param name="skipInitialization">Whether to skip initializing nested objects.</param> |
| | 5300 | | internal SetAccessControlRecursiveResponse(bool skipInitialization) |
| | 5301 | | { |
| | 5302 | | if (!skipInitialization) |
| | 5303 | | { |
| | 5304 | | FailedEntries = new System.Collections.Generic.List<Azure.Storage.Files.DataLake.Models.AclFailedEntry>( |
| | 5305 | | } |
| | 5306 | | } |
| | 5307 | |
|
| | 5308 | | /// <summary> |
| | 5309 | | /// Deserializes XML into a new SetAccessControlRecursiveResponse instance. |
| | 5310 | | /// </summary> |
| | 5311 | | /// <param name="element">The XML element to deserialize.</param> |
| | 5312 | | /// <returns>A deserialized SetAccessControlRecursiveResponse instance.</returns> |
| | 5313 | | internal static Azure.Storage.Files.DataLake.Models.SetAccessControlRecursiveResponse FromXml(System.Xml.Linq.XE |
| | 5314 | | { |
| | 5315 | | System.Diagnostics.Debug.Assert(element != null); |
| | 5316 | | System.Xml.Linq.XElement _child; |
| | 5317 | | Azure.Storage.Files.DataLake.Models.SetAccessControlRecursiveResponse _value = new Azure.Storage.Files.DataL |
| | 5318 | | _child = element.Element(System.Xml.Linq.XName.Get("directoriesSuccessful", "")); |
| | 5319 | | if (_child != null) |
| | 5320 | | { |
| | 5321 | | _value.DirectoriesSuccessful = int.Parse(_child.Value, System.Globalization.CultureInfo.InvariantCulture |
| | 5322 | | } |
| | 5323 | | _child = element.Element(System.Xml.Linq.XName.Get("filesSuccessful", "")); |
| | 5324 | | if (_child != null) |
| | 5325 | | { |
| | 5326 | | _value.FilesSuccessful = int.Parse(_child.Value, System.Globalization.CultureInfo.InvariantCulture); |
| | 5327 | | } |
| | 5328 | | _child = element.Element(System.Xml.Linq.XName.Get("failureCount", "")); |
| | 5329 | | if (_child != null) |
| | 5330 | | { |
| | 5331 | | _value.FailureCount = int.Parse(_child.Value, System.Globalization.CultureInfo.InvariantCulture); |
| | 5332 | | } |
| | 5333 | | _value.FailedEntries = System.Linq.Enumerable.ToList( |
| | 5334 | | System.Linq.Enumerable.Select( |
| | 5335 | | element.Elements(System.Xml.Linq.XName.Get("AclFailedEntry", "")), |
| | 5336 | | e => Azure.Storage.Files.DataLake.Models.AclFailedEntry.FromXml(e))); |
| | 5337 | | CustomizeFromXml(element, _value); |
| | 5338 | | return _value; |
| | 5339 | | } |
| | 5340 | |
|
| | 5341 | | static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Files.DataLake.Models.SetAc |
| | 5342 | | } |
| | 5343 | | } |
| | 5344 | | #endregion class SetAccessControlRecursiveResponse |
| | 5345 | | #endregion Models |
| | 5346 | |
|