| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | using Azure.Storage.Blobs; |
| | 5 | |
|
| | 6 | | namespace Azure.Storage.Files.DataLake |
| | 7 | | { |
| | 8 | | /// <summary> |
| | 9 | | /// Add easy to discover methods to <see cref="DataLakeFileSystemClient"/> and |
| | 10 | | /// <see cref="DataLakePathClient"/> for easily creating <see cref="DataLakeLeaseClient"/> |
| | 11 | | /// instances. |
| | 12 | | /// </summary> |
| | 13 | | public static partial class DataLakeLeaseClientExtensions |
| | 14 | | { |
| | 15 | | /// <summary> |
| | 16 | | /// Initializes a new instance of the <see cref="DataLakeLeaseClient"/> class. |
| | 17 | | /// </summary> |
| | 18 | | /// <param name="client"> |
| | 19 | | /// A <see cref="DataLakePathClient"/> representing the path being leased. |
| | 20 | | /// </param> |
| | 21 | | /// <param name="leaseId"> |
| | 22 | | /// An optional lease ID. If no lease ID is provided, a random lease |
| | 23 | | /// ID will be created. |
| | 24 | | /// </param> |
| | 25 | | public static DataLakeLeaseClient GetDataLakeLeaseClient( |
| | 26 | | this DataLakePathClient client, |
| | 27 | | string leaseId = null) => |
| 548 | 28 | | new DataLakeLeaseClient(client, leaseId); |
| | 29 | |
|
| | 30 | | /// <summary> |
| | 31 | | /// Initializes a new instance of the <see cref="DataLakeLeaseClient"/> class. |
| | 32 | | /// </summary> |
| | 33 | | /// <param name="client"> |
| | 34 | | /// A <see cref="DataLakeFileSystemClient"/> representing the file system being leased. |
| | 35 | | /// </param> |
| | 36 | | /// <param name="leaseId"> |
| | 37 | | /// An optional lease ID. If no lease ID is provided, a random lease |
| | 38 | | /// ID will be created. |
| | 39 | | /// </param> |
| | 40 | | public static DataLakeLeaseClient GetDataLakeLeaseClient( |
| | 41 | | this DataLakeFileSystemClient client, |
| | 42 | | string leaseId = null) => |
| 212 | 43 | | new DataLakeLeaseClient(client, leaseId); |
| | 44 | | } |
| | 45 | | } |