diff --git a/sdk/storage/Azure.Storage.Blobs.Batch/CHANGELOG.md b/sdk/storage/Azure.Storage.Blobs.Batch/CHANGELOG.md
index 440e95b4ea6e1..f6bcf9e2b44f6 100644
--- a/sdk/storage/Azure.Storage.Blobs.Batch/CHANGELOG.md
+++ b/sdk/storage/Azure.Storage.Blobs.Batch/CHANGELOG.md
@@ -3,12 +3,7 @@
## 12.21.0-beta.1 (Unreleased)
### Features Added
-
-### Breaking Changes
-
-### Bugs Fixed
-
-### Other Changes
+- Added support for service version 2025-05-05.
## 12.20.0 (2024-11-12)
diff --git a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md
index eaa0dca1ce579..af2ef51643b16 100644
--- a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md
+++ b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md
@@ -3,12 +3,7 @@
## 12.0.0-preview.53 (Unreleased)
### Features Added
-
-### Breaking Changes
-
-### Bugs Fixed
-
-### Other Changes
+- Added support for service version 2025-05-05.
## 12.0.0-preview.52 (2024-11-12)
diff --git a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/tests/ChangeFeedTestBase.cs b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/tests/ChangeFeedTestBase.cs
index d65ba1264ce66..1edae8044c6aa 100644
--- a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/tests/ChangeFeedTestBase.cs
+++ b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/tests/ChangeFeedTestBase.cs
@@ -33,6 +33,7 @@ namespace Azure.Storage.Blobs.ChangeFeed.Tests
BlobClientOptions.ServiceVersion.V2024_08_04,
BlobClientOptions.ServiceVersion.V2024_11_04,
BlobClientOptions.ServiceVersion.V2025_01_05,
+ BlobClientOptions.ServiceVersion.V2025_05_05,
StorageVersionExtensions.LatestVersion,
StorageVersionExtensions.MaxVersion,
RecordingServiceVersion = StorageVersionExtensions.MaxVersion,
diff --git a/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md b/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md
index e59f18e7fbd38..3070cac9a9a6d 100644
--- a/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md
+++ b/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md
@@ -3,12 +3,7 @@
## 12.24.0-beta.1 (Unreleased)
### Features Added
-
-### Breaking Changes
-
-### Bugs Fixed
-
-### Other Changes
+- Added support for service version 2025-05-05.
## 12.23.0 (2024-11-12)
diff --git a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.net6.0.cs b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.net6.0.cs
index 2cb9eb52ea60f..51769f818526a 100644
--- a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.net6.0.cs
+++ b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.net6.0.cs
@@ -51,7 +51,7 @@ public BlobClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredential c
}
public partial class BlobClientOptions : Azure.Core.ClientOptions
{
- public BlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_01_05) { }
+ public BlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_05_05) { }
public Azure.Storage.Blobs.Models.BlobAudience? Audience { get { throw null; } set { } }
public Azure.Storage.Blobs.Models.CustomerProvidedKey? CustomerProvidedKey { get { throw null; } set { } }
public bool EnableTenantDiscovery { get { throw null; } set { } }
@@ -88,6 +88,7 @@ public enum ServiceVersion
V2024_08_04 = 23,
V2024_11_04 = 24,
V2025_01_05 = 25,
+ V2025_05_05 = 26,
}
}
public partial class BlobContainerClient
@@ -1850,7 +1851,7 @@ public PageBlobClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredenti
}
public partial class SpecializedBlobClientOptions : Azure.Storage.Blobs.BlobClientOptions
{
- public SpecializedBlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_01_05) : base (default(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion)) { }
+ public SpecializedBlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_05_05) : base (default(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion)) { }
public Azure.Storage.ClientSideEncryptionOptions ClientSideEncryption { get { throw null; } set { } }
}
public static partial class SpecializedBlobExtensions
diff --git a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.net8.0.cs b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.net8.0.cs
index 167e4b1d926a1..40b216f43dfad 100644
--- a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.net8.0.cs
+++ b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.net8.0.cs
@@ -51,7 +51,7 @@ public BlobClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredential c
}
public partial class BlobClientOptions : Azure.Core.ClientOptions
{
- public BlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_01_05) { }
+ public BlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_05_05) { }
public Azure.Storage.Blobs.Models.BlobAudience? Audience { get { throw null; } set { } }
public Azure.Storage.Blobs.Models.CustomerProvidedKey? CustomerProvidedKey { get { throw null; } set { } }
public bool EnableTenantDiscovery { get { throw null; } set { } }
@@ -88,6 +88,7 @@ public enum ServiceVersion
V2024_08_04 = 23,
V2024_11_04 = 24,
V2025_01_05 = 25,
+ V2025_05_05 = 26,
}
}
public partial class BlobContainerClient
@@ -1850,7 +1851,7 @@ public PageBlobClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredenti
}
public partial class SpecializedBlobClientOptions : Azure.Storage.Blobs.BlobClientOptions
{
- public SpecializedBlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_01_05) : base (default(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion)) { }
+ public SpecializedBlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_05_05) : base (default(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion)) { }
public Azure.Storage.ClientSideEncryptionOptions ClientSideEncryption { get { throw null; } set { } }
}
public static partial class SpecializedBlobExtensions
diff --git a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs
index d93de39ce28c0..41c77a5a3f5fd 100644
--- a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs
+++ b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs
@@ -51,7 +51,7 @@ public BlobClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredential c
}
public partial class BlobClientOptions : Azure.Core.ClientOptions
{
- public BlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_01_05) { }
+ public BlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_05_05) { }
public Azure.Storage.Blobs.Models.BlobAudience? Audience { get { throw null; } set { } }
public Azure.Storage.Blobs.Models.CustomerProvidedKey? CustomerProvidedKey { get { throw null; } set { } }
public bool EnableTenantDiscovery { get { throw null; } set { } }
@@ -88,6 +88,7 @@ public enum ServiceVersion
V2024_08_04 = 23,
V2024_11_04 = 24,
V2025_01_05 = 25,
+ V2025_05_05 = 26,
}
}
public partial class BlobContainerClient
@@ -1850,7 +1851,7 @@ public PageBlobClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredenti
}
public partial class SpecializedBlobClientOptions : Azure.Storage.Blobs.BlobClientOptions
{
- public SpecializedBlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_01_05) : base (default(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion)) { }
+ public SpecializedBlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_05_05) : base (default(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion)) { }
public Azure.Storage.ClientSideEncryptionOptions ClientSideEncryption { get { throw null; } set { } }
}
public static partial class SpecializedBlobExtensions
diff --git a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.1.cs b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.1.cs
index d93de39ce28c0..41c77a5a3f5fd 100644
--- a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.1.cs
+++ b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.1.cs
@@ -51,7 +51,7 @@ public BlobClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredential c
}
public partial class BlobClientOptions : Azure.Core.ClientOptions
{
- public BlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_01_05) { }
+ public BlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_05_05) { }
public Azure.Storage.Blobs.Models.BlobAudience? Audience { get { throw null; } set { } }
public Azure.Storage.Blobs.Models.CustomerProvidedKey? CustomerProvidedKey { get { throw null; } set { } }
public bool EnableTenantDiscovery { get { throw null; } set { } }
@@ -88,6 +88,7 @@ public enum ServiceVersion
V2024_08_04 = 23,
V2024_11_04 = 24,
V2025_01_05 = 25,
+ V2025_05_05 = 26,
}
}
public partial class BlobContainerClient
@@ -1850,7 +1851,7 @@ public PageBlobClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredenti
}
public partial class SpecializedBlobClientOptions : Azure.Storage.Blobs.BlobClientOptions
{
- public SpecializedBlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_01_05) : base (default(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion)) { }
+ public SpecializedBlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_05_05) : base (default(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion)) { }
public Azure.Storage.ClientSideEncryptionOptions ClientSideEncryption { get { throw null; } set { } }
}
public static partial class SpecializedBlobExtensions
diff --git a/sdk/storage/Azure.Storage.Blobs/assets.json b/sdk/storage/Azure.Storage.Blobs/assets.json
index 0facb33e2a026..73d4916e57607 100644
--- a/sdk/storage/Azure.Storage.Blobs/assets.json
+++ b/sdk/storage/Azure.Storage.Blobs/assets.json
@@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "net",
"TagPrefix": "net/storage/Azure.Storage.Blobs",
- "Tag": "net/storage/Azure.Storage.Blobs_5c382dfb14"
+ "Tag": "net/storage/Azure.Storage.Blobs_4d91c5bf9c"
}
diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlobClientOptions.cs b/sdk/storage/Azure.Storage.Blobs/src/BlobClientOptions.cs
index b16cefc83a535..0f90cb42066d2 100644
--- a/sdk/storage/Azure.Storage.Blobs/src/BlobClientOptions.cs
+++ b/sdk/storage/Azure.Storage.Blobs/src/BlobClientOptions.cs
@@ -156,7 +156,12 @@ public enum ServiceVersion
///
/// The 2025-01-05 service version.
///
- V2025_01_05 = 25
+ V2025_01_05 = 25,
+
+ ///
+ /// The 2025-05-05 service version.
+ ///
+ V2025_05_05 = 26
#pragma warning restore CA1707 // Identifiers should not contain underscores
}
diff --git a/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs b/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs
index 8e51aa708c24b..d0ef9cabe003f 100644
--- a/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs
+++ b/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs
@@ -8597,7 +8597,7 @@ public async Task GetAccountInfoAsync_Error()
// Act
await TestHelper.AssertExpectedExceptionAsync(
blobClient.GetAccountInfoAsync(),
- e => Assert.AreEqual("ResourceNotFound", e.ErrorCode));
+ e => Assert.AreEqual("NoAuthenticationInformation", e.ErrorCode));
}
public IEnumerable AccessConditions_Data
diff --git a/sdk/storage/Azure.Storage.Blobs/tests/BlobsClientTestFixtureAttribute.cs b/sdk/storage/Azure.Storage.Blobs/tests/BlobsClientTestFixtureAttribute.cs
index d0372ab20cf47..b5fa207562666 100644
--- a/sdk/storage/Azure.Storage.Blobs/tests/BlobsClientTestFixtureAttribute.cs
+++ b/sdk/storage/Azure.Storage.Blobs/tests/BlobsClientTestFixtureAttribute.cs
@@ -36,6 +36,7 @@ public BlobsClientTestFixtureAttribute(params object[] additionalParameters)
BlobClientOptions.ServiceVersion.V2024_08_04,
BlobClientOptions.ServiceVersion.V2024_11_04,
BlobClientOptions.ServiceVersion.V2025_01_05,
+ BlobClientOptions.ServiceVersion.V2025_05_05,
StorageVersionExtensions.LatestVersion,
StorageVersionExtensions.MaxVersion
},
diff --git a/sdk/storage/Azure.Storage.Blobs/tests/ContainerClientTests.cs b/sdk/storage/Azure.Storage.Blobs/tests/ContainerClientTests.cs
index 451586836669f..e22726ff4fca4 100644
--- a/sdk/storage/Azure.Storage.Blobs/tests/ContainerClientTests.cs
+++ b/sdk/storage/Azure.Storage.Blobs/tests/ContainerClientTests.cs
@@ -4319,7 +4319,7 @@ public async Task GetAccountInfoAsync_Error()
// Act
await TestHelper.AssertExpectedExceptionAsync(
containerClient.GetAccountInfoAsync(),
- e => Assert.AreEqual("ResourceNotFound", e.ErrorCode));
+ e => Assert.AreEqual("NoAuthenticationInformation", e.ErrorCode));
}
[RecordedTest]
diff --git a/sdk/storage/Azure.Storage.Blobs/tests/ServiceClientTests.cs b/sdk/storage/Azure.Storage.Blobs/tests/ServiceClientTests.cs
index c10fcfbd73ab2..34b15d3036694 100644
--- a/sdk/storage/Azure.Storage.Blobs/tests/ServiceClientTests.cs
+++ b/sdk/storage/Azure.Storage.Blobs/tests/ServiceClientTests.cs
@@ -522,7 +522,7 @@ public async Task GetAccountInfoAsync_Error()
// Act
await TestHelper.AssertExpectedExceptionAsync(
service.GetAccountInfoAsync(),
- e => Assert.AreEqual("ResourceNotFound", e.ErrorCode));
+ e => Assert.AreEqual("NoAuthenticationInformation", e.ErrorCode));
}
[RecordedTest]
diff --git a/sdk/storage/Azure.Storage.Common/CHANGELOG.md b/sdk/storage/Azure.Storage.Common/CHANGELOG.md
index a2d9f13d92892..dc1764d16bc6e 100644
--- a/sdk/storage/Azure.Storage.Common/CHANGELOG.md
+++ b/sdk/storage/Azure.Storage.Common/CHANGELOG.md
@@ -3,12 +3,7 @@
## 12.23.0-beta.1 (Unreleased)
### Features Added
-
-### Breaking Changes
-
-### Bugs Fixed
-
-### Other Changes
+- This release contains bug fixes to improve quality.
## 12.22.0 (2024-11-12)
diff --git a/sdk/storage/Azure.Storage.Common/api/Azure.Storage.Common.net6.0.cs b/sdk/storage/Azure.Storage.Common/api/Azure.Storage.Common.net6.0.cs
index 121838723ee4f..aebd7cfb6a16d 100644
--- a/sdk/storage/Azure.Storage.Common/api/Azure.Storage.Common.net6.0.cs
+++ b/sdk/storage/Azure.Storage.Common/api/Azure.Storage.Common.net6.0.cs
@@ -183,7 +183,7 @@ public enum SasProtocol
}
public partial class SasQueryParameters
{
- public const string DefaultSasVersion = "2025-01-05";
+ public const string DefaultSasVersion = "2025-05-05";
protected SasQueryParameters() { }
protected SasQueryParameters(System.Collections.Generic.IDictionary values) { }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
diff --git a/sdk/storage/Azure.Storage.Common/api/Azure.Storage.Common.net8.0.cs b/sdk/storage/Azure.Storage.Common/api/Azure.Storage.Common.net8.0.cs
index 121838723ee4f..aebd7cfb6a16d 100644
--- a/sdk/storage/Azure.Storage.Common/api/Azure.Storage.Common.net8.0.cs
+++ b/sdk/storage/Azure.Storage.Common/api/Azure.Storage.Common.net8.0.cs
@@ -183,7 +183,7 @@ public enum SasProtocol
}
public partial class SasQueryParameters
{
- public const string DefaultSasVersion = "2025-01-05";
+ public const string DefaultSasVersion = "2025-05-05";
protected SasQueryParameters() { }
protected SasQueryParameters(System.Collections.Generic.IDictionary values) { }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
diff --git a/sdk/storage/Azure.Storage.Common/api/Azure.Storage.Common.netstandard2.0.cs b/sdk/storage/Azure.Storage.Common/api/Azure.Storage.Common.netstandard2.0.cs
index 9b59550e809d0..73d1004bbb02a 100644
--- a/sdk/storage/Azure.Storage.Common/api/Azure.Storage.Common.netstandard2.0.cs
+++ b/sdk/storage/Azure.Storage.Common/api/Azure.Storage.Common.netstandard2.0.cs
@@ -182,7 +182,7 @@ public enum SasProtocol
}
public partial class SasQueryParameters
{
- public const string DefaultSasVersion = "2025-01-05";
+ public const string DefaultSasVersion = "2025-05-05";
protected SasQueryParameters() { }
protected SasQueryParameters(System.Collections.Generic.IDictionary values) { }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
diff --git a/sdk/storage/Azure.Storage.Common/src/Shared/Constants.cs b/sdk/storage/Azure.Storage.Common/src/Shared/Constants.cs
index 3e00882188fba..c16ed90ead55b 100644
--- a/sdk/storage/Azure.Storage.Common/src/Shared/Constants.cs
+++ b/sdk/storage/Azure.Storage.Common/src/Shared/Constants.cs
@@ -25,7 +25,7 @@ internal static class Constants
/// Gets the default service version to use when building shared access
/// signatures.
///
- public const string DefaultSasVersion = "2025-01-05";
+ public const string DefaultSasVersion = "2025-05-05";
///
/// Max download range size while requesting a transactional hash.
diff --git a/sdk/storage/Azure.Storage.Common/src/Shared/StorageVersionExtensions.cs b/sdk/storage/Azure.Storage.Common/src/Shared/StorageVersionExtensions.cs
index 44c0973ea9be1..b657980045ffe 100644
--- a/sdk/storage/Azure.Storage.Common/src/Shared/StorageVersionExtensions.cs
+++ b/sdk/storage/Azure.Storage.Common/src/Shared/StorageVersionExtensions.cs
@@ -46,7 +46,7 @@ internal static class StorageVersionExtensions
///
public const ServiceVersion LatestVersion =
#if BlobSDK || QueueSDK || FileSDK || DataLakeSDK || ChangeFeedSDK || DataMovementSDK || BlobDataMovementSDK || ShareDataMovementSDK
- ServiceVersion.V2025_01_05;
+ ServiceVersion.V2025_05_05;
#else
ERROR_STORAGE_SERVICE_NOT_DEFINED;
#endif
@@ -56,7 +56,7 @@ internal static class StorageVersionExtensions
///
internal const ServiceVersion MaxVersion =
#if BlobSDK || QueueSDK || FileSDK || DataLakeSDK || ChangeFeedSDK || DataMovementSDK || BlobDataMovementSDK || ShareDataMovementSDK
- ServiceVersion.V2025_01_05;
+ ServiceVersion.V2025_05_05;
#else
ERROR_STORAGE_SERVICE_NOT_DEFINED;
#endif
@@ -95,6 +95,7 @@ public static string ToVersionString(this ServiceVersion version) =>
ServiceVersion.V2024_08_04 => "2024-08-04",
ServiceVersion.V2024_11_04 => "2024-11-04",
ServiceVersion.V2025_01_05 => "2025-01-05",
+ ServiceVersion.V2025_05_05 => "2025-05-05",
#endif
_ => throw Errors.VersionNotSupported(nameof(version))
};
@@ -158,6 +159,8 @@ public static Azure.Storage.Blobs.BlobClientOptions.ServiceVersion AsBlobsVersio
Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2024_11_04,
Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion.V2025_01_05 =>
Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_01_05,
+ Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion.V2025_05_05 =>
+ Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_05_05,
_ => throw Errors.VersionNotSupported(nameof(version))
};
#endif
diff --git a/sdk/storage/Azure.Storage.Common/tests/CommonTestBase.cs b/sdk/storage/Azure.Storage.Common/tests/CommonTestBase.cs
index 5694c805d3550..80d95bab47932 100644
--- a/sdk/storage/Azure.Storage.Common/tests/CommonTestBase.cs
+++ b/sdk/storage/Azure.Storage.Common/tests/CommonTestBase.cs
@@ -35,8 +35,9 @@ namespace Azure.Storage.Test
BlobClientOptions.ServiceVersion.V2024_08_04,
BlobClientOptions.ServiceVersion.V2024_11_04,
BlobClientOptions.ServiceVersion.V2025_01_05,
- RecordingServiceVersion = BlobClientOptions.ServiceVersion.V2025_01_05,
- LiveServiceVersions = new object[] { BlobClientOptions.ServiceVersion.V2024_11_04, })]
+ BlobClientOptions.ServiceVersion.V2025_05_05,
+ RecordingServiceVersion = BlobClientOptions.ServiceVersion.V2025_05_05,
+ LiveServiceVersions = new object[] { BlobClientOptions.ServiceVersion.V2025_01_05, })]
public abstract class CommonTestBase : StorageTestBase
{
protected readonly BlobClientOptions.ServiceVersion _serviceVersion;
diff --git a/sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md b/sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md
index 27804061ada50..a5d4e56442265 100644
--- a/sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md
+++ b/sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md
@@ -3,12 +3,7 @@
## 12.22.0-beta.1 (Unreleased)
### Features Added
-
-### Breaking Changes
-
-### Bugs Fixed
-
-### Other Changes
+- Added support for service version 2025-05-05.
## 12.21.0 (2024-11-12)
diff --git a/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.net6.0.cs b/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.net6.0.cs
index c5b8a7798a0cf..7a1c3bd97cad0 100644
--- a/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.net6.0.cs
+++ b/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.net6.0.cs
@@ -2,7 +2,7 @@ namespace Azure.Storage.Files.DataLake
{
public partial class DataLakeClientOptions : Azure.Core.ClientOptions
{
- public DataLakeClientOptions(Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion version = Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion.V2025_01_05) { }
+ public DataLakeClientOptions(Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion version = Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion.V2025_05_05) { }
public Azure.Storage.Files.DataLake.Models.DataLakeAudience? Audience { get { throw null; } set { } }
public Azure.Storage.Files.DataLake.Models.DataLakeCustomerProvidedKey? CustomerProvidedKey { get { throw null; } set { } }
public bool EnableTenantDiscovery { get { throw null; } set { } }
@@ -36,6 +36,7 @@ public enum ServiceVersion
V2024_08_04 = 23,
V2024_11_04 = 24,
V2025_01_05 = 25,
+ V2025_05_05 = 26,
}
}
public partial class DataLakeDirectoryClient : Azure.Storage.Files.DataLake.DataLakePathClient
diff --git a/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.net8.0.cs b/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.net8.0.cs
index 373451bb75efa..e1cee30d23481 100644
--- a/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.net8.0.cs
+++ b/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.net8.0.cs
@@ -2,7 +2,7 @@ namespace Azure.Storage.Files.DataLake
{
public partial class DataLakeClientOptions : Azure.Core.ClientOptions
{
- public DataLakeClientOptions(Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion version = Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion.V2025_01_05) { }
+ public DataLakeClientOptions(Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion version = Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion.V2025_05_05) { }
public Azure.Storage.Files.DataLake.Models.DataLakeAudience? Audience { get { throw null; } set { } }
public Azure.Storage.Files.DataLake.Models.DataLakeCustomerProvidedKey? CustomerProvidedKey { get { throw null; } set { } }
public bool EnableTenantDiscovery { get { throw null; } set { } }
@@ -36,6 +36,7 @@ public enum ServiceVersion
V2024_08_04 = 23,
V2024_11_04 = 24,
V2025_01_05 = 25,
+ V2025_05_05 = 26,
}
}
public partial class DataLakeDirectoryClient : Azure.Storage.Files.DataLake.DataLakePathClient
diff --git a/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.netstandard2.0.cs b/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.netstandard2.0.cs
index c5b8a7798a0cf..7a1c3bd97cad0 100644
--- a/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.netstandard2.0.cs
+++ b/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.netstandard2.0.cs
@@ -2,7 +2,7 @@ namespace Azure.Storage.Files.DataLake
{
public partial class DataLakeClientOptions : Azure.Core.ClientOptions
{
- public DataLakeClientOptions(Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion version = Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion.V2025_01_05) { }
+ public DataLakeClientOptions(Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion version = Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion.V2025_05_05) { }
public Azure.Storage.Files.DataLake.Models.DataLakeAudience? Audience { get { throw null; } set { } }
public Azure.Storage.Files.DataLake.Models.DataLakeCustomerProvidedKey? CustomerProvidedKey { get { throw null; } set { } }
public bool EnableTenantDiscovery { get { throw null; } set { } }
@@ -36,6 +36,7 @@ public enum ServiceVersion
V2024_08_04 = 23,
V2024_11_04 = 24,
V2025_01_05 = 25,
+ V2025_05_05 = 26,
}
}
public partial class DataLakeDirectoryClient : Azure.Storage.Files.DataLake.DataLakePathClient
diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeClientOptions.cs b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeClientOptions.cs
index 5f8fd0849ba0f..5fcb4ca03f06d 100644
--- a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeClientOptions.cs
+++ b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeClientOptions.cs
@@ -156,7 +156,12 @@ public enum ServiceVersion
///
/// The 2025-01-05 service version.
///
- V2025_01_05 = 25
+ V2025_01_05 = 25,
+
+ ///
+ /// The 2025-05-05 service version.
+ ///
+ V2025_05_05 = 26
#pragma warning restore CA1707 // Identifiers should not contain underscores
}
diff --git a/sdk/storage/Azure.Storage.Files.DataLake/tests/DataLakeClientTestFixtureAttribute.cs b/sdk/storage/Azure.Storage.Files.DataLake/tests/DataLakeClientTestFixtureAttribute.cs
index eab0498c5dfcc..8d1b0227c208a 100644
--- a/sdk/storage/Azure.Storage.Files.DataLake/tests/DataLakeClientTestFixtureAttribute.cs
+++ b/sdk/storage/Azure.Storage.Files.DataLake/tests/DataLakeClientTestFixtureAttribute.cs
@@ -34,6 +34,7 @@ public DataLakeClientTestFixtureAttribute()
DataLakeClientOptions.ServiceVersion.V2024_08_04,
DataLakeClientOptions.ServiceVersion.V2024_11_04,
DataLakeClientOptions.ServiceVersion.V2025_01_05,
+ DataLakeClientOptions.ServiceVersion.V2025_05_05,
StorageVersionExtensions.LatestVersion,
StorageVersionExtensions.MaxVersion)
{
diff --git a/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md b/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md
index b458e72774070..2d5e90999f73d 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md
+++ b/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md
@@ -3,12 +3,15 @@
## 12.22.0-beta.1 (Unreleased)
### Features Added
+- Added support for service version 2025-05-05.
+- Added support for NFS over REST.
### Breaking Changes
-
-### Bugs Fixed
-
-### Other Changes
+- The following APIs no longer send the x-ms-file-permission-key, x-ms-file-attributes, x-ms-file-creation-time, and x-ms-file-last-write-time request headers by default. These headers have been optional in the REST API since x-ms-version 2021-06-08:
+ - ShareFileClient.Create() and .CreateAsync()
+ - ShareFileClient.SetHttpHeaders() and .SetHttpHeadersAsync()
+ - ShareDirectoryClient.Create() and .CreateAsync()
+ - ShareDirectoryClient.SetHttpHeaders() and .SetHttpHeadersAsync()
## 12.21.0 (2024-11-12)
diff --git a/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.net6.0.cs b/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.net6.0.cs
index b1b355dda471c..68144bac3267c 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.net6.0.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.net6.0.cs
@@ -115,7 +115,7 @@ public ShareClient(System.Uri shareUri, Azure.Storage.StorageSharedKeyCredential
}
public partial class ShareClientOptions : Azure.Core.ClientOptions
{
- public ShareClientOptions(Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion version = Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion.V2025_01_05) { }
+ public ShareClientOptions(Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion version = Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion.V2025_05_05) { }
public bool? AllowSourceTrailingDot { get { throw null; } set { } }
public bool? AllowTrailingDot { get { throw null; } set { } }
public Azure.Storage.Files.Shares.Models.ShareAudience? Audience { get { throw null; } set { } }
@@ -149,6 +149,7 @@ public enum ServiceVersion
V2024_08_04 = 23,
V2024_11_04 = 24,
V2025_01_05 = 25,
+ V2025_05_05 = 26,
}
}
public partial class ShareDirectoryClient
@@ -267,6 +268,8 @@ public ShareFileClient(System.Uri fileUri, Azure.Storage.StorageSharedKeyCredent
public virtual System.Threading.Tasks.Task> CreateAsync(long maxSize, Azure.Storage.Files.Shares.Models.ShareFileHttpHeaders httpHeaders, System.Collections.Generic.IDictionary metadata, Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties, string filePermission, Azure.Storage.Files.Shares.Models.ShareFileRequestConditions conditions, System.Threading.CancellationToken cancellationToken) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public virtual System.Threading.Tasks.Task> CreateAsync(long maxSize, Azure.Storage.Files.Shares.Models.ShareFileHttpHeaders httpHeaders, System.Collections.Generic.IDictionary metadata, Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties, string filePermission, System.Threading.CancellationToken cancellationToken) { throw null; }
+ public virtual Azure.Response CreateHardLink(string targetFile, Azure.Storage.Files.Shares.Models.ShareFileRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ public virtual System.Threading.Tasks.Task> CreateHardLinkAsync(string targetFile, Azure.Storage.Files.Shares.Models.ShareFileRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response Delete(Azure.Storage.Files.Shares.Models.ShareFileRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public virtual Azure.Response Delete(System.Threading.CancellationToken cancellationToken) { throw null; }
@@ -494,6 +497,15 @@ public enum FilePermissionFormat
Sddl = 0,
Binary = 1,
}
+ public partial class FilePosixProperties
+ {
+ public FilePosixProperties() { }
+ public Azure.Storage.Files.Shares.Models.NfsFileMode FileMode { get { throw null; } set { } }
+ public Azure.Storage.Files.Shares.Models.NfsFileType? FileType { get { throw null; } }
+ public string Group { get { throw null; } set { } }
+ public long? LinkCount { get { throw null; } }
+ public string Owner { get { throw null; } set { } }
+ }
public partial class FileSmbProperties
{
public FileSmbProperties() { }
@@ -511,16 +523,62 @@ public FileSmbProperties() { }
}
public static partial class FilesModelFactory
{
+ public static Azure.Storage.Files.Shares.Models.FilePosixProperties FilePosixProperties(Azure.Storage.Files.Shares.Models.NfsFileMode fileMode, string owner, string group, Azure.Storage.Files.Shares.Models.NfsFileType fileType, long? linkCount) { throw null; }
+ public static Azure.Storage.Files.Shares.Models.FileSmbProperties FileSmbProperties(System.DateTimeOffset? fileChangedOn, string fileId, string parentId) { throw null; }
public static Azure.Storage.Files.Shares.Models.ShareFileItem ShareFileItem(bool isDirectory = false, string name = null, long? fileSize = default(long?), string id = null, Azure.Storage.Files.Shares.Models.ShareFileItemProperties properties = null, Azure.Storage.Files.Shares.Models.NtfsFileAttributes? fileAttributes = default(Azure.Storage.Files.Shares.Models.NtfsFileAttributes?), string permissionKey = null) { throw null; }
+ public static Azure.Storage.Files.Shares.Models.ShareDirectoryInfo StorageDirectoryInfo(Azure.ETag eTag = default(Azure.ETag), System.DateTimeOffset lastModified = default(System.DateTimeOffset), Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties = null, Azure.Storage.Files.Shares.Models.FilePosixProperties posixProperties = null) { throw null; }
+ public static Azure.Storage.Files.Shares.Models.ShareDirectoryProperties StorageDirectoryProperties(System.Collections.Generic.IDictionary metadata = null, Azure.ETag eTag = default(Azure.ETag), System.DateTimeOffset lastModified = default(System.DateTimeOffset), bool isServerEncrypted = false, Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties = null, Azure.Storage.Files.Shares.Models.FilePosixProperties posixProperties = null) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static Azure.Storage.Files.Shares.Models.ShareDirectoryProperties StorageDirectoryProperties(System.Collections.Generic.IDictionary metadata, Azure.ETag eTag, System.DateTimeOffset lastModified, bool isServerEncrypted, string fileAttributes, System.DateTimeOffset fileCreationTime, System.DateTimeOffset fileLastWriteTime, System.DateTimeOffset fileChangeTime, string filePermissionKey, string fileId, string fileParentId) { throw null; }
public static Azure.Storage.Files.Shares.Models.ShareFileDownloadInfo StorageFileDownloadInfo(System.DateTimeOffset lastModified = default(System.DateTimeOffset), System.Collections.Generic.IEnumerable contentLanguage = null, string acceptRanges = null, System.DateTimeOffset copyCompletionTime = default(System.DateTimeOffset), string copyStatusDescription = null, string contentDisposition = null, string copyProgress = null, System.Uri copySource = null, Azure.Storage.Files.Shares.Models.CopyStatus copyStatus = Azure.Storage.Files.Shares.Models.CopyStatus.Pending, byte[] fileContentHash = null, bool isServerEncrypted = false, string cacheControl = null, string fileAttributes = null, System.Collections.Generic.IEnumerable contentEncoding = null, System.DateTimeOffset fileCreationTime = default(System.DateTimeOffset), byte[] contentHash = null, System.DateTimeOffset fileLastWriteTime = default(System.DateTimeOffset), Azure.ETag eTag = default(Azure.ETag), System.DateTimeOffset fileChangeTime = default(System.DateTimeOffset), string contentRange = null, string filePermissionKey = null, string contentType = null, string fileId = null, long contentLength = (long)0, string fileParentId = null, System.Collections.Generic.IDictionary metadata = null, System.IO.Stream content = null, string copyId = null) { throw null; }
+ public static Azure.Storage.Files.Shares.Models.ShareFileDownloadDetails StorageFileDownloadProperties(System.DateTimeOffset lastModified = default(System.DateTimeOffset), System.Collections.Generic.IDictionary metadata = null, string contentRange = null, Azure.ETag eTag = default(Azure.ETag), System.Collections.Generic.IEnumerable contentEncoding = null, string cacheControl = null, string contentDisposition = null, System.Collections.Generic.IEnumerable contentLanguage = null, string acceptRanges = null, System.DateTimeOffset copyCompletedOn = default(System.DateTimeOffset), string copyStatusDescription = null, string copyId = null, string copyProgress = null, System.Uri copySource = null, Azure.Storage.Files.Shares.Models.CopyStatus copyStatus = Azure.Storage.Files.Shares.Models.CopyStatus.Pending, byte[] fileContentHash = null, bool isServiceEncrypted = false, Azure.Storage.Files.Shares.Models.ShareLeaseDuration leaseDuration = Azure.Storage.Files.Shares.Models.ShareLeaseDuration.Infinite, Azure.Storage.Files.Shares.Models.ShareLeaseState leaseState = Azure.Storage.Files.Shares.Models.ShareLeaseState.Available, Azure.Storage.Files.Shares.Models.ShareLeaseStatus leaseStatus = Azure.Storage.Files.Shares.Models.ShareLeaseStatus.Locked, Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties = null, Azure.Storage.Files.Shares.Models.FilePosixProperties posixProperties = null) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static Azure.Storage.Files.Shares.Models.ShareFileDownloadDetails StorageFileDownloadProperties(System.DateTimeOffset lastModified, System.Collections.Generic.IDictionary metadata, string contentType, string contentRange, Azure.ETag eTag, System.Collections.Generic.IEnumerable contentEncoding, string cacheControl, string contentDisposition, System.Collections.Generic.IEnumerable contentLanguage, string acceptRanges, System.DateTimeOffset copyCompletedOn, string copyStatusDescription, string copyId, string copyProgress, System.Uri copySource, Azure.Storage.Files.Shares.Models.CopyStatus copyStatus, byte[] fileContentHash, bool isServiceEncrypted) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static Azure.Storage.Files.Shares.Models.ShareFileInfo StorageFileInfo(Azure.ETag eTag, System.DateTimeOffset lastModified, bool isServerEncrypted, string filePermissionKey, string fileAttributes, System.DateTimeOffset fileCreationTime, System.DateTimeOffset fileLastWriteTime, System.DateTimeOffset fileChangeTime, string fileId, string fileParentId) { throw null; }
+ public static Azure.Storage.Files.Shares.Models.ShareFileInfo StorageFileInfo(Azure.ETag eTag = default(Azure.ETag), System.DateTimeOffset lastModified = default(System.DateTimeOffset), bool isServerEncrypted = false, string filePermissionKey = null, string fileAttributes = null, System.DateTimeOffset fileCreationTime = default(System.DateTimeOffset), System.DateTimeOffset fileLastWriteTime = default(System.DateTimeOffset), System.DateTimeOffset fileChangeTime = default(System.DateTimeOffset), string fileId = null, string fileParentId = null, Azure.Storage.Files.Shares.Models.NfsFileMode nfsFileMode = null, string owner = null, string group = null, Azure.Storage.Files.Shares.Models.NfsFileType nfsFileType = default(Azure.Storage.Files.Shares.Models.NfsFileType)) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static Azure.Storage.Files.Shares.Models.ShareFileItem StorageFileItem(bool isDirectory, string name, long? fileSize) { throw null; }
+ public static Azure.Storage.Files.Shares.Models.ShareFileProperties StorageFileProperties(System.DateTimeOffset lastModified = default(System.DateTimeOffset), System.Collections.Generic.IDictionary metadata = null, long contentLength = (long)0, string contentType = null, Azure.ETag eTag = default(Azure.ETag), byte[] contentHash = null, System.Collections.Generic.IEnumerable contentEncoding = null, string cacheControl = null, string contentDisposition = null, System.Collections.Generic.IEnumerable contentLanguage = null, System.DateTimeOffset copyCompletedOn = default(System.DateTimeOffset), string copyStatusDescription = null, string copyId = null, string copyProgress = null, string copySource = null, Azure.Storage.Files.Shares.Models.CopyStatus copyStatus = Azure.Storage.Files.Shares.Models.CopyStatus.Pending, bool isServerEncrypted = false, Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties = null, Azure.Storage.Files.Shares.Models.FilePosixProperties posixProperties = null) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static Azure.Storage.Files.Shares.Models.ShareFileProperties StorageFileProperties(System.DateTimeOffset lastModified, System.Collections.Generic.IDictionary metadata, long contentLength, string contentType, Azure.ETag eTag, byte[] contentHash, System.Collections.Generic.IEnumerable contentEncoding, string cacheControl, string contentDisposition, System.Collections.Generic.IEnumerable contentLanguage, System.DateTimeOffset copyCompletedOn, string copyStatusDescription, string copyId, string copyProgress, string copySource, Azure.Storage.Files.Shares.Models.CopyStatus copyStatus, bool isServerEncrypted, Azure.Storage.Files.Shares.Models.NtfsFileAttributes fileAttributes, System.DateTimeOffset fileCreationTime, System.DateTimeOffset fileLastWriteTime, System.DateTimeOffset fileChangeTime, string filePermissionKey, string fileId, string fileParentId) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static Azure.Storage.Files.Shares.Models.ShareFileProperties StorageFileProperties(System.DateTimeOffset lastModified, System.Collections.Generic.IDictionary metadata, long contentLength, string contentType, Azure.ETag eTag, byte[] contentHash, System.Collections.Generic.IEnumerable contentEncoding, string cacheControl, string contentDisposition, System.Collections.Generic.IEnumerable contentLanguage, System.DateTimeOffset copyCompletedOn, string copyStatusDescription, string copyId, string copyProgress, string copySource, Azure.Storage.Files.Shares.Models.CopyStatus copyStatus, bool isServerEncrypted, string fileAttributes, System.DateTimeOffset fileCreationTime, System.DateTimeOffset fileLastWriteTime, System.DateTimeOffset fileChangeTime, string filePermissionKey, string fileId, string fileParentId) { throw null; }
}
+ public partial class NfsFileMode
+ {
+ public NfsFileMode() { }
+ public bool EffectiveGroupIdentity { get { throw null; } set { } }
+ public bool EffectiveUserIdentity { get { throw null; } set { } }
+ public Azure.Storage.Files.Shares.Models.PosixRolePermissions Group { get { throw null; } set { } }
+ public Azure.Storage.Files.Shares.Models.PosixRolePermissions Other { get { throw null; } set { } }
+ public Azure.Storage.Files.Shares.Models.PosixRolePermissions Owner { get { throw null; } set { } }
+ public bool StickyBit { get { throw null; } set { } }
+ public static Azure.Storage.Files.Shares.Models.NfsFileMode ParseOctalFileMode(string modeString) { throw null; }
+ public static Azure.Storage.Files.Shares.Models.NfsFileMode ParseSymbolicFileMode(string modeString) { throw null; }
+ public string ToOctalFileMode() { throw null; }
+ public override string ToString() { throw null; }
+ public string ToSymbolicFileMode() { throw null; }
+ }
+ [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
+ public readonly partial struct NfsFileType : System.IEquatable
+ {
+ private readonly object _dummy;
+ private readonly int _dummyPrimitive;
+ public NfsFileType(string value) { throw null; }
+ public static Azure.Storage.Files.Shares.Models.NfsFileType Directory { get { throw null; } }
+ public static Azure.Storage.Files.Shares.Models.NfsFileType Regular { get { throw null; } }
+ public static Azure.Storage.Files.Shares.Models.NfsFileType SymLink { get { throw null; } }
+ public bool Equals(Azure.Storage.Files.Shares.Models.NfsFileType other) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ public override bool Equals(object obj) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ public override int GetHashCode() { throw null; }
+ public static bool operator ==(Azure.Storage.Files.Shares.Models.NfsFileType left, Azure.Storage.Files.Shares.Models.NfsFileType right) { throw null; }
+ public static implicit operator Azure.Storage.Files.Shares.Models.NfsFileType (string value) { throw null; }
+ public static bool operator !=(Azure.Storage.Files.Shares.Models.NfsFileType left, Azure.Storage.Files.Shares.Models.NfsFileType right) { throw null; }
+ public override string ToString() { throw null; }
+ }
[System.FlagsAttribute]
public enum NtfsFileAttributes
{
@@ -545,6 +603,14 @@ public partial class PermissionInfo
internal PermissionInfo() { }
public string FilePermissionKey { get { throw null; } }
}
+ [System.FlagsAttribute]
+ public enum PosixRolePermissions
+ {
+ None = 0,
+ Execute = 1,
+ Write = 2,
+ Read = 4,
+ }
public partial class ShareAccessPolicy
{
public ShareAccessPolicy() { }
@@ -629,6 +695,7 @@ public partial class ShareDirectoryCreateOptions
public ShareDirectoryCreateOptions() { }
public Azure.Storage.Files.Shares.Models.ShareFilePermission FilePermission { get { throw null; } set { } }
public System.Collections.Generic.IDictionary Metadata { get { throw null; } set { } }
+ public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } set { } }
public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } }
}
public partial class ShareDirectoryGetFilesAndDirectoriesOptions
@@ -643,6 +710,7 @@ public partial class ShareDirectoryInfo
internal ShareDirectoryInfo() { }
public Azure.ETag ETag { get { throw null; } }
public System.DateTimeOffset LastModified { get { throw null; } }
+ public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } }
public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } }
}
public partial class ShareDirectoryProperties
@@ -652,12 +720,14 @@ internal ShareDirectoryProperties() { }
public bool IsServerEncrypted { get { throw null; } }
public System.DateTimeOffset LastModified { get { throw null; } }
public System.Collections.Generic.IDictionary Metadata { get { throw null; } }
+ public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } }
public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } }
}
public partial class ShareDirectorySetHttpHeadersOptions
{
public ShareDirectorySetHttpHeadersOptions() { }
public Azure.Storage.Files.Shares.Models.ShareFilePermission FilePermission { get { throw null; } set { } }
+ public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } set { } }
public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } }
}
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
@@ -768,6 +838,7 @@ public ShareFileCopyOptions() { }
public bool? IgnoreReadOnly { get { throw null; } set { } }
public System.Collections.Generic.IDictionary Metadata { get { throw null; } set { } }
public Azure.Storage.Files.Shares.Models.FilePermissionFormat? PermissionFormat { get { throw null; } set { } }
+ public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } set { } }
public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } }
public Azure.Storage.Files.Shares.Models.CopyableFileSmbProperties SmbPropertiesToCopy { get { throw null; } set { } }
}
@@ -777,6 +848,7 @@ public ShareFileCreateOptions() { }
public Azure.Storage.Files.Shares.Models.ShareFilePermission FilePermission { get { throw null; } set { } }
public Azure.Storage.Files.Shares.Models.ShareFileHttpHeaders HttpHeaders { get { throw null; } set { } }
public System.Collections.Generic.IDictionary Metadata { get { throw null; } set { } }
+ public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } set { } }
public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } }
}
public partial class ShareFileDownloadDetails
@@ -802,6 +874,7 @@ internal ShareFileDownloadDetails() { }
public Azure.Storage.Files.Shares.Models.ShareLeaseState LeaseState { get { throw null; } }
public Azure.Storage.Files.Shares.Models.ShareLeaseStatus LeaseStatus { get { throw null; } }
public System.Collections.Generic.IDictionary Metadata { get { throw null; } }
+ public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } }
public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } }
}
public partial class ShareFileDownloadInfo : System.IDisposable
@@ -879,6 +952,7 @@ internal ShareFileInfo() { }
public Azure.ETag ETag { get { throw null; } }
public bool IsServerEncrypted { get { throw null; } }
public System.DateTimeOffset LastModified { get { throw null; } }
+ public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } }
public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } }
}
public partial class ShareFileItem
@@ -966,6 +1040,7 @@ internal ShareFileProperties() { }
public Azure.Storage.Files.Shares.Models.ShareLeaseState LeaseState { get { throw null; } }
public Azure.Storage.Files.Shares.Models.ShareLeaseStatus LeaseStatus { get { throw null; } }
public System.Collections.Generic.IDictionary Metadata { get { throw null; } }
+ public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } }
public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } }
}
public partial class ShareFileRangeInfo
@@ -1007,6 +1082,7 @@ public ShareFileSetHttpHeadersOptions() { }
public Azure.Storage.Files.Shares.Models.ShareFilePermission FilePermission { get { throw null; } set { } }
public Azure.Storage.Files.Shares.Models.ShareFileHttpHeaders HttpHeaders { get { throw null; } set { } }
public long? NewSize { get { throw null; } set { } }
+ public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } set { } }
public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } }
}
[System.FlagsAttribute]
@@ -1225,7 +1301,9 @@ public ShareSmbSettings() { }
}
public static partial class SharesModelFactory
{
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static Azure.Storage.Files.Shares.Models.FileSmbProperties FileSmbProperties(System.DateTimeOffset? fileChangedOn, string fileId, string parentId) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static Azure.Storage.Files.Shares.Models.ShareDirectoryInfo StorageDirectoryInfo(Azure.ETag eTag, System.DateTimeOffset lastModified, string filePermissionKey, string fileAttributes, System.DateTimeOffset fileCreationTime, System.DateTimeOffset fileLastWriteTime, System.DateTimeOffset fileChangeTime, string fileId, string fileParentId) { throw null; }
}
public partial class ShareSnapshotInfo
diff --git a/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.net8.0.cs b/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.net8.0.cs
index 9391c7f96c977..27e880fc4ae81 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.net8.0.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.net8.0.cs
@@ -115,7 +115,7 @@ public ShareClient(System.Uri shareUri, Azure.Storage.StorageSharedKeyCredential
}
public partial class ShareClientOptions : Azure.Core.ClientOptions
{
- public ShareClientOptions(Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion version = Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion.V2025_01_05) { }
+ public ShareClientOptions(Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion version = Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion.V2025_05_05) { }
public bool? AllowSourceTrailingDot { get { throw null; } set { } }
public bool? AllowTrailingDot { get { throw null; } set { } }
public Azure.Storage.Files.Shares.Models.ShareAudience? Audience { get { throw null; } set { } }
@@ -149,6 +149,7 @@ public enum ServiceVersion
V2024_08_04 = 23,
V2024_11_04 = 24,
V2025_01_05 = 25,
+ V2025_05_05 = 26,
}
}
public partial class ShareDirectoryClient
@@ -267,6 +268,8 @@ public ShareFileClient(System.Uri fileUri, Azure.Storage.StorageSharedKeyCredent
public virtual System.Threading.Tasks.Task> CreateAsync(long maxSize, Azure.Storage.Files.Shares.Models.ShareFileHttpHeaders httpHeaders, System.Collections.Generic.IDictionary metadata, Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties, string filePermission, Azure.Storage.Files.Shares.Models.ShareFileRequestConditions conditions, System.Threading.CancellationToken cancellationToken) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public virtual System.Threading.Tasks.Task> CreateAsync(long maxSize, Azure.Storage.Files.Shares.Models.ShareFileHttpHeaders httpHeaders, System.Collections.Generic.IDictionary metadata, Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties, string filePermission, System.Threading.CancellationToken cancellationToken) { throw null; }
+ public virtual Azure.Response CreateHardLink(string targetFile, Azure.Storage.Files.Shares.Models.ShareFileRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ public virtual System.Threading.Tasks.Task> CreateHardLinkAsync(string targetFile, Azure.Storage.Files.Shares.Models.ShareFileRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response Delete(Azure.Storage.Files.Shares.Models.ShareFileRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public virtual Azure.Response Delete(System.Threading.CancellationToken cancellationToken) { throw null; }
@@ -494,6 +497,15 @@ public enum FilePermissionFormat
Sddl = 0,
Binary = 1,
}
+ public partial class FilePosixProperties
+ {
+ public FilePosixProperties() { }
+ public Azure.Storage.Files.Shares.Models.NfsFileMode FileMode { get { throw null; } set { } }
+ public Azure.Storage.Files.Shares.Models.NfsFileType? FileType { get { throw null; } }
+ public string Group { get { throw null; } set { } }
+ public long? LinkCount { get { throw null; } }
+ public string Owner { get { throw null; } set { } }
+ }
public partial class FileSmbProperties
{
public FileSmbProperties() { }
@@ -511,16 +523,62 @@ public FileSmbProperties() { }
}
public static partial class FilesModelFactory
{
+ public static Azure.Storage.Files.Shares.Models.FilePosixProperties FilePosixProperties(Azure.Storage.Files.Shares.Models.NfsFileMode fileMode, string owner, string group, Azure.Storage.Files.Shares.Models.NfsFileType fileType, long? linkCount) { throw null; }
+ public static Azure.Storage.Files.Shares.Models.FileSmbProperties FileSmbProperties(System.DateTimeOffset? fileChangedOn, string fileId, string parentId) { throw null; }
public static Azure.Storage.Files.Shares.Models.ShareFileItem ShareFileItem(bool isDirectory = false, string name = null, long? fileSize = default(long?), string id = null, Azure.Storage.Files.Shares.Models.ShareFileItemProperties properties = null, Azure.Storage.Files.Shares.Models.NtfsFileAttributes? fileAttributes = default(Azure.Storage.Files.Shares.Models.NtfsFileAttributes?), string permissionKey = null) { throw null; }
+ public static Azure.Storage.Files.Shares.Models.ShareDirectoryInfo StorageDirectoryInfo(Azure.ETag eTag = default(Azure.ETag), System.DateTimeOffset lastModified = default(System.DateTimeOffset), Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties = null, Azure.Storage.Files.Shares.Models.FilePosixProperties posixProperties = null) { throw null; }
+ public static Azure.Storage.Files.Shares.Models.ShareDirectoryProperties StorageDirectoryProperties(System.Collections.Generic.IDictionary metadata = null, Azure.ETag eTag = default(Azure.ETag), System.DateTimeOffset lastModified = default(System.DateTimeOffset), bool isServerEncrypted = false, Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties = null, Azure.Storage.Files.Shares.Models.FilePosixProperties posixProperties = null) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static Azure.Storage.Files.Shares.Models.ShareDirectoryProperties StorageDirectoryProperties(System.Collections.Generic.IDictionary metadata, Azure.ETag eTag, System.DateTimeOffset lastModified, bool isServerEncrypted, string fileAttributes, System.DateTimeOffset fileCreationTime, System.DateTimeOffset fileLastWriteTime, System.DateTimeOffset fileChangeTime, string filePermissionKey, string fileId, string fileParentId) { throw null; }
public static Azure.Storage.Files.Shares.Models.ShareFileDownloadInfo StorageFileDownloadInfo(System.DateTimeOffset lastModified = default(System.DateTimeOffset), System.Collections.Generic.IEnumerable contentLanguage = null, string acceptRanges = null, System.DateTimeOffset copyCompletionTime = default(System.DateTimeOffset), string copyStatusDescription = null, string contentDisposition = null, string copyProgress = null, System.Uri copySource = null, Azure.Storage.Files.Shares.Models.CopyStatus copyStatus = Azure.Storage.Files.Shares.Models.CopyStatus.Pending, byte[] fileContentHash = null, bool isServerEncrypted = false, string cacheControl = null, string fileAttributes = null, System.Collections.Generic.IEnumerable contentEncoding = null, System.DateTimeOffset fileCreationTime = default(System.DateTimeOffset), byte[] contentHash = null, System.DateTimeOffset fileLastWriteTime = default(System.DateTimeOffset), Azure.ETag eTag = default(Azure.ETag), System.DateTimeOffset fileChangeTime = default(System.DateTimeOffset), string contentRange = null, string filePermissionKey = null, string contentType = null, string fileId = null, long contentLength = (long)0, string fileParentId = null, System.Collections.Generic.IDictionary metadata = null, System.IO.Stream content = null, string copyId = null) { throw null; }
+ public static Azure.Storage.Files.Shares.Models.ShareFileDownloadDetails StorageFileDownloadProperties(System.DateTimeOffset lastModified = default(System.DateTimeOffset), System.Collections.Generic.IDictionary metadata = null, string contentRange = null, Azure.ETag eTag = default(Azure.ETag), System.Collections.Generic.IEnumerable contentEncoding = null, string cacheControl = null, string contentDisposition = null, System.Collections.Generic.IEnumerable contentLanguage = null, string acceptRanges = null, System.DateTimeOffset copyCompletedOn = default(System.DateTimeOffset), string copyStatusDescription = null, string copyId = null, string copyProgress = null, System.Uri copySource = null, Azure.Storage.Files.Shares.Models.CopyStatus copyStatus = Azure.Storage.Files.Shares.Models.CopyStatus.Pending, byte[] fileContentHash = null, bool isServiceEncrypted = false, Azure.Storage.Files.Shares.Models.ShareLeaseDuration leaseDuration = Azure.Storage.Files.Shares.Models.ShareLeaseDuration.Infinite, Azure.Storage.Files.Shares.Models.ShareLeaseState leaseState = Azure.Storage.Files.Shares.Models.ShareLeaseState.Available, Azure.Storage.Files.Shares.Models.ShareLeaseStatus leaseStatus = Azure.Storage.Files.Shares.Models.ShareLeaseStatus.Locked, Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties = null, Azure.Storage.Files.Shares.Models.FilePosixProperties posixProperties = null) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static Azure.Storage.Files.Shares.Models.ShareFileDownloadDetails StorageFileDownloadProperties(System.DateTimeOffset lastModified, System.Collections.Generic.IDictionary metadata, string contentType, string contentRange, Azure.ETag eTag, System.Collections.Generic.IEnumerable contentEncoding, string cacheControl, string contentDisposition, System.Collections.Generic.IEnumerable contentLanguage, string acceptRanges, System.DateTimeOffset copyCompletedOn, string copyStatusDescription, string copyId, string copyProgress, System.Uri copySource, Azure.Storage.Files.Shares.Models.CopyStatus copyStatus, byte[] fileContentHash, bool isServiceEncrypted) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static Azure.Storage.Files.Shares.Models.ShareFileInfo StorageFileInfo(Azure.ETag eTag, System.DateTimeOffset lastModified, bool isServerEncrypted, string filePermissionKey, string fileAttributes, System.DateTimeOffset fileCreationTime, System.DateTimeOffset fileLastWriteTime, System.DateTimeOffset fileChangeTime, string fileId, string fileParentId) { throw null; }
+ public static Azure.Storage.Files.Shares.Models.ShareFileInfo StorageFileInfo(Azure.ETag eTag = default(Azure.ETag), System.DateTimeOffset lastModified = default(System.DateTimeOffset), bool isServerEncrypted = false, string filePermissionKey = null, string fileAttributes = null, System.DateTimeOffset fileCreationTime = default(System.DateTimeOffset), System.DateTimeOffset fileLastWriteTime = default(System.DateTimeOffset), System.DateTimeOffset fileChangeTime = default(System.DateTimeOffset), string fileId = null, string fileParentId = null, Azure.Storage.Files.Shares.Models.NfsFileMode nfsFileMode = null, string owner = null, string group = null, Azure.Storage.Files.Shares.Models.NfsFileType nfsFileType = default(Azure.Storage.Files.Shares.Models.NfsFileType)) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static Azure.Storage.Files.Shares.Models.ShareFileItem StorageFileItem(bool isDirectory, string name, long? fileSize) { throw null; }
+ public static Azure.Storage.Files.Shares.Models.ShareFileProperties StorageFileProperties(System.DateTimeOffset lastModified = default(System.DateTimeOffset), System.Collections.Generic.IDictionary metadata = null, long contentLength = (long)0, string contentType = null, Azure.ETag eTag = default(Azure.ETag), byte[] contentHash = null, System.Collections.Generic.IEnumerable contentEncoding = null, string cacheControl = null, string contentDisposition = null, System.Collections.Generic.IEnumerable contentLanguage = null, System.DateTimeOffset copyCompletedOn = default(System.DateTimeOffset), string copyStatusDescription = null, string copyId = null, string copyProgress = null, string copySource = null, Azure.Storage.Files.Shares.Models.CopyStatus copyStatus = Azure.Storage.Files.Shares.Models.CopyStatus.Pending, bool isServerEncrypted = false, Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties = null, Azure.Storage.Files.Shares.Models.FilePosixProperties posixProperties = null) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static Azure.Storage.Files.Shares.Models.ShareFileProperties StorageFileProperties(System.DateTimeOffset lastModified, System.Collections.Generic.IDictionary metadata, long contentLength, string contentType, Azure.ETag eTag, byte[] contentHash, System.Collections.Generic.IEnumerable contentEncoding, string cacheControl, string contentDisposition, System.Collections.Generic.IEnumerable contentLanguage, System.DateTimeOffset copyCompletedOn, string copyStatusDescription, string copyId, string copyProgress, string copySource, Azure.Storage.Files.Shares.Models.CopyStatus copyStatus, bool isServerEncrypted, Azure.Storage.Files.Shares.Models.NtfsFileAttributes fileAttributes, System.DateTimeOffset fileCreationTime, System.DateTimeOffset fileLastWriteTime, System.DateTimeOffset fileChangeTime, string filePermissionKey, string fileId, string fileParentId) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static Azure.Storage.Files.Shares.Models.ShareFileProperties StorageFileProperties(System.DateTimeOffset lastModified, System.Collections.Generic.IDictionary metadata, long contentLength, string contentType, Azure.ETag eTag, byte[] contentHash, System.Collections.Generic.IEnumerable contentEncoding, string cacheControl, string contentDisposition, System.Collections.Generic.IEnumerable contentLanguage, System.DateTimeOffset copyCompletedOn, string copyStatusDescription, string copyId, string copyProgress, string copySource, Azure.Storage.Files.Shares.Models.CopyStatus copyStatus, bool isServerEncrypted, string fileAttributes, System.DateTimeOffset fileCreationTime, System.DateTimeOffset fileLastWriteTime, System.DateTimeOffset fileChangeTime, string filePermissionKey, string fileId, string fileParentId) { throw null; }
}
+ public partial class NfsFileMode
+ {
+ public NfsFileMode() { }
+ public bool EffectiveGroupIdentity { get { throw null; } set { } }
+ public bool EffectiveUserIdentity { get { throw null; } set { } }
+ public Azure.Storage.Files.Shares.Models.PosixRolePermissions Group { get { throw null; } set { } }
+ public Azure.Storage.Files.Shares.Models.PosixRolePermissions Other { get { throw null; } set { } }
+ public Azure.Storage.Files.Shares.Models.PosixRolePermissions Owner { get { throw null; } set { } }
+ public bool StickyBit { get { throw null; } set { } }
+ public static Azure.Storage.Files.Shares.Models.NfsFileMode ParseOctalFileMode(string modeString) { throw null; }
+ public static Azure.Storage.Files.Shares.Models.NfsFileMode ParseSymbolicFileMode(string modeString) { throw null; }
+ public string ToOctalFileMode() { throw null; }
+ public override string ToString() { throw null; }
+ public string ToSymbolicFileMode() { throw null; }
+ }
+ [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
+ public readonly partial struct NfsFileType : System.IEquatable
+ {
+ private readonly object _dummy;
+ private readonly int _dummyPrimitive;
+ public NfsFileType(string value) { throw null; }
+ public static Azure.Storage.Files.Shares.Models.NfsFileType Directory { get { throw null; } }
+ public static Azure.Storage.Files.Shares.Models.NfsFileType Regular { get { throw null; } }
+ public static Azure.Storage.Files.Shares.Models.NfsFileType SymLink { get { throw null; } }
+ public bool Equals(Azure.Storage.Files.Shares.Models.NfsFileType other) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ public override bool Equals(object obj) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ public override int GetHashCode() { throw null; }
+ public static bool operator ==(Azure.Storage.Files.Shares.Models.NfsFileType left, Azure.Storage.Files.Shares.Models.NfsFileType right) { throw null; }
+ public static implicit operator Azure.Storage.Files.Shares.Models.NfsFileType (string value) { throw null; }
+ public static bool operator !=(Azure.Storage.Files.Shares.Models.NfsFileType left, Azure.Storage.Files.Shares.Models.NfsFileType right) { throw null; }
+ public override string ToString() { throw null; }
+ }
[System.FlagsAttribute]
public enum NtfsFileAttributes
{
@@ -545,6 +603,14 @@ public partial class PermissionInfo
internal PermissionInfo() { }
public string FilePermissionKey { get { throw null; } }
}
+ [System.FlagsAttribute]
+ public enum PosixRolePermissions
+ {
+ None = 0,
+ Execute = 1,
+ Write = 2,
+ Read = 4,
+ }
public partial class ShareAccessPolicy
{
public ShareAccessPolicy() { }
@@ -629,6 +695,7 @@ public partial class ShareDirectoryCreateOptions
public ShareDirectoryCreateOptions() { }
public Azure.Storage.Files.Shares.Models.ShareFilePermission FilePermission { get { throw null; } set { } }
public System.Collections.Generic.IDictionary Metadata { get { throw null; } set { } }
+ public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } set { } }
public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } }
}
public partial class ShareDirectoryGetFilesAndDirectoriesOptions
@@ -643,6 +710,7 @@ public partial class ShareDirectoryInfo
internal ShareDirectoryInfo() { }
public Azure.ETag ETag { get { throw null; } }
public System.DateTimeOffset LastModified { get { throw null; } }
+ public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } }
public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } }
}
public partial class ShareDirectoryProperties
@@ -652,12 +720,14 @@ internal ShareDirectoryProperties() { }
public bool IsServerEncrypted { get { throw null; } }
public System.DateTimeOffset LastModified { get { throw null; } }
public System.Collections.Generic.IDictionary Metadata { get { throw null; } }
+ public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } }
public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } }
}
public partial class ShareDirectorySetHttpHeadersOptions
{
public ShareDirectorySetHttpHeadersOptions() { }
public Azure.Storage.Files.Shares.Models.ShareFilePermission FilePermission { get { throw null; } set { } }
+ public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } set { } }
public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } }
}
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
@@ -768,6 +838,7 @@ public ShareFileCopyOptions() { }
public bool? IgnoreReadOnly { get { throw null; } set { } }
public System.Collections.Generic.IDictionary Metadata { get { throw null; } set { } }
public Azure.Storage.Files.Shares.Models.FilePermissionFormat? PermissionFormat { get { throw null; } set { } }
+ public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } set { } }
public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } }
public Azure.Storage.Files.Shares.Models.CopyableFileSmbProperties SmbPropertiesToCopy { get { throw null; } set { } }
}
@@ -777,6 +848,7 @@ public ShareFileCreateOptions() { }
public Azure.Storage.Files.Shares.Models.ShareFilePermission FilePermission { get { throw null; } set { } }
public Azure.Storage.Files.Shares.Models.ShareFileHttpHeaders HttpHeaders { get { throw null; } set { } }
public System.Collections.Generic.IDictionary Metadata { get { throw null; } set { } }
+ public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } set { } }
public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } }
}
public partial class ShareFileDownloadDetails
@@ -802,6 +874,7 @@ internal ShareFileDownloadDetails() { }
public Azure.Storage.Files.Shares.Models.ShareLeaseState LeaseState { get { throw null; } }
public Azure.Storage.Files.Shares.Models.ShareLeaseStatus LeaseStatus { get { throw null; } }
public System.Collections.Generic.IDictionary Metadata { get { throw null; } }
+ public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } }
public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } }
}
public partial class ShareFileDownloadInfo : System.IDisposable
@@ -879,6 +952,7 @@ internal ShareFileInfo() { }
public Azure.ETag ETag { get { throw null; } }
public bool IsServerEncrypted { get { throw null; } }
public System.DateTimeOffset LastModified { get { throw null; } }
+ public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } }
public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } }
}
public partial class ShareFileItem
@@ -967,6 +1041,7 @@ internal ShareFileProperties() { }
public Azure.Storage.Files.Shares.Models.ShareLeaseState LeaseState { get { throw null; } }
public Azure.Storage.Files.Shares.Models.ShareLeaseStatus LeaseStatus { get { throw null; } }
public System.Collections.Generic.IDictionary Metadata { get { throw null; } }
+ public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } }
public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } }
}
public partial class ShareFileRangeInfo
@@ -1008,6 +1083,7 @@ public ShareFileSetHttpHeadersOptions() { }
public Azure.Storage.Files.Shares.Models.ShareFilePermission FilePermission { get { throw null; } set { } }
public Azure.Storage.Files.Shares.Models.ShareFileHttpHeaders HttpHeaders { get { throw null; } set { } }
public long? NewSize { get { throw null; } set { } }
+ public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } set { } }
public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } }
}
[System.FlagsAttribute]
@@ -1226,7 +1302,9 @@ public ShareSmbSettings() { }
}
public static partial class SharesModelFactory
{
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static Azure.Storage.Files.Shares.Models.FileSmbProperties FileSmbProperties(System.DateTimeOffset? fileChangedOn, string fileId, string parentId) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static Azure.Storage.Files.Shares.Models.ShareDirectoryInfo StorageDirectoryInfo(Azure.ETag eTag, System.DateTimeOffset lastModified, string filePermissionKey, string fileAttributes, System.DateTimeOffset fileCreationTime, System.DateTimeOffset fileLastWriteTime, System.DateTimeOffset fileChangeTime, string fileId, string fileParentId) { throw null; }
}
public partial class ShareSnapshotInfo
diff --git a/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.netstandard2.0.cs b/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.netstandard2.0.cs
index b1b355dda471c..68144bac3267c 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.netstandard2.0.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.netstandard2.0.cs
@@ -115,7 +115,7 @@ public ShareClient(System.Uri shareUri, Azure.Storage.StorageSharedKeyCredential
}
public partial class ShareClientOptions : Azure.Core.ClientOptions
{
- public ShareClientOptions(Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion version = Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion.V2025_01_05) { }
+ public ShareClientOptions(Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion version = Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion.V2025_05_05) { }
public bool? AllowSourceTrailingDot { get { throw null; } set { } }
public bool? AllowTrailingDot { get { throw null; } set { } }
public Azure.Storage.Files.Shares.Models.ShareAudience? Audience { get { throw null; } set { } }
@@ -149,6 +149,7 @@ public enum ServiceVersion
V2024_08_04 = 23,
V2024_11_04 = 24,
V2025_01_05 = 25,
+ V2025_05_05 = 26,
}
}
public partial class ShareDirectoryClient
@@ -267,6 +268,8 @@ public ShareFileClient(System.Uri fileUri, Azure.Storage.StorageSharedKeyCredent
public virtual System.Threading.Tasks.Task> CreateAsync(long maxSize, Azure.Storage.Files.Shares.Models.ShareFileHttpHeaders httpHeaders, System.Collections.Generic.IDictionary metadata, Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties, string filePermission, Azure.Storage.Files.Shares.Models.ShareFileRequestConditions conditions, System.Threading.CancellationToken cancellationToken) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public virtual System.Threading.Tasks.Task> CreateAsync(long maxSize, Azure.Storage.Files.Shares.Models.ShareFileHttpHeaders httpHeaders, System.Collections.Generic.IDictionary metadata, Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties, string filePermission, System.Threading.CancellationToken cancellationToken) { throw null; }
+ public virtual Azure.Response CreateHardLink(string targetFile, Azure.Storage.Files.Shares.Models.ShareFileRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ public virtual System.Threading.Tasks.Task> CreateHardLinkAsync(string targetFile, Azure.Storage.Files.Shares.Models.ShareFileRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response Delete(Azure.Storage.Files.Shares.Models.ShareFileRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public virtual Azure.Response Delete(System.Threading.CancellationToken cancellationToken) { throw null; }
@@ -494,6 +497,15 @@ public enum FilePermissionFormat
Sddl = 0,
Binary = 1,
}
+ public partial class FilePosixProperties
+ {
+ public FilePosixProperties() { }
+ public Azure.Storage.Files.Shares.Models.NfsFileMode FileMode { get { throw null; } set { } }
+ public Azure.Storage.Files.Shares.Models.NfsFileType? FileType { get { throw null; } }
+ public string Group { get { throw null; } set { } }
+ public long? LinkCount { get { throw null; } }
+ public string Owner { get { throw null; } set { } }
+ }
public partial class FileSmbProperties
{
public FileSmbProperties() { }
@@ -511,16 +523,62 @@ public FileSmbProperties() { }
}
public static partial class FilesModelFactory
{
+ public static Azure.Storage.Files.Shares.Models.FilePosixProperties FilePosixProperties(Azure.Storage.Files.Shares.Models.NfsFileMode fileMode, string owner, string group, Azure.Storage.Files.Shares.Models.NfsFileType fileType, long? linkCount) { throw null; }
+ public static Azure.Storage.Files.Shares.Models.FileSmbProperties FileSmbProperties(System.DateTimeOffset? fileChangedOn, string fileId, string parentId) { throw null; }
public static Azure.Storage.Files.Shares.Models.ShareFileItem ShareFileItem(bool isDirectory = false, string name = null, long? fileSize = default(long?), string id = null, Azure.Storage.Files.Shares.Models.ShareFileItemProperties properties = null, Azure.Storage.Files.Shares.Models.NtfsFileAttributes? fileAttributes = default(Azure.Storage.Files.Shares.Models.NtfsFileAttributes?), string permissionKey = null) { throw null; }
+ public static Azure.Storage.Files.Shares.Models.ShareDirectoryInfo StorageDirectoryInfo(Azure.ETag eTag = default(Azure.ETag), System.DateTimeOffset lastModified = default(System.DateTimeOffset), Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties = null, Azure.Storage.Files.Shares.Models.FilePosixProperties posixProperties = null) { throw null; }
+ public static Azure.Storage.Files.Shares.Models.ShareDirectoryProperties StorageDirectoryProperties(System.Collections.Generic.IDictionary metadata = null, Azure.ETag eTag = default(Azure.ETag), System.DateTimeOffset lastModified = default(System.DateTimeOffset), bool isServerEncrypted = false, Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties = null, Azure.Storage.Files.Shares.Models.FilePosixProperties posixProperties = null) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static Azure.Storage.Files.Shares.Models.ShareDirectoryProperties StorageDirectoryProperties(System.Collections.Generic.IDictionary metadata, Azure.ETag eTag, System.DateTimeOffset lastModified, bool isServerEncrypted, string fileAttributes, System.DateTimeOffset fileCreationTime, System.DateTimeOffset fileLastWriteTime, System.DateTimeOffset fileChangeTime, string filePermissionKey, string fileId, string fileParentId) { throw null; }
public static Azure.Storage.Files.Shares.Models.ShareFileDownloadInfo StorageFileDownloadInfo(System.DateTimeOffset lastModified = default(System.DateTimeOffset), System.Collections.Generic.IEnumerable contentLanguage = null, string acceptRanges = null, System.DateTimeOffset copyCompletionTime = default(System.DateTimeOffset), string copyStatusDescription = null, string contentDisposition = null, string copyProgress = null, System.Uri copySource = null, Azure.Storage.Files.Shares.Models.CopyStatus copyStatus = Azure.Storage.Files.Shares.Models.CopyStatus.Pending, byte[] fileContentHash = null, bool isServerEncrypted = false, string cacheControl = null, string fileAttributes = null, System.Collections.Generic.IEnumerable contentEncoding = null, System.DateTimeOffset fileCreationTime = default(System.DateTimeOffset), byte[] contentHash = null, System.DateTimeOffset fileLastWriteTime = default(System.DateTimeOffset), Azure.ETag eTag = default(Azure.ETag), System.DateTimeOffset fileChangeTime = default(System.DateTimeOffset), string contentRange = null, string filePermissionKey = null, string contentType = null, string fileId = null, long contentLength = (long)0, string fileParentId = null, System.Collections.Generic.IDictionary metadata = null, System.IO.Stream content = null, string copyId = null) { throw null; }
+ public static Azure.Storage.Files.Shares.Models.ShareFileDownloadDetails StorageFileDownloadProperties(System.DateTimeOffset lastModified = default(System.DateTimeOffset), System.Collections.Generic.IDictionary metadata = null, string contentRange = null, Azure.ETag eTag = default(Azure.ETag), System.Collections.Generic.IEnumerable contentEncoding = null, string cacheControl = null, string contentDisposition = null, System.Collections.Generic.IEnumerable contentLanguage = null, string acceptRanges = null, System.DateTimeOffset copyCompletedOn = default(System.DateTimeOffset), string copyStatusDescription = null, string copyId = null, string copyProgress = null, System.Uri copySource = null, Azure.Storage.Files.Shares.Models.CopyStatus copyStatus = Azure.Storage.Files.Shares.Models.CopyStatus.Pending, byte[] fileContentHash = null, bool isServiceEncrypted = false, Azure.Storage.Files.Shares.Models.ShareLeaseDuration leaseDuration = Azure.Storage.Files.Shares.Models.ShareLeaseDuration.Infinite, Azure.Storage.Files.Shares.Models.ShareLeaseState leaseState = Azure.Storage.Files.Shares.Models.ShareLeaseState.Available, Azure.Storage.Files.Shares.Models.ShareLeaseStatus leaseStatus = Azure.Storage.Files.Shares.Models.ShareLeaseStatus.Locked, Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties = null, Azure.Storage.Files.Shares.Models.FilePosixProperties posixProperties = null) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static Azure.Storage.Files.Shares.Models.ShareFileDownloadDetails StorageFileDownloadProperties(System.DateTimeOffset lastModified, System.Collections.Generic.IDictionary metadata, string contentType, string contentRange, Azure.ETag eTag, System.Collections.Generic.IEnumerable contentEncoding, string cacheControl, string contentDisposition, System.Collections.Generic.IEnumerable contentLanguage, string acceptRanges, System.DateTimeOffset copyCompletedOn, string copyStatusDescription, string copyId, string copyProgress, System.Uri copySource, Azure.Storage.Files.Shares.Models.CopyStatus copyStatus, byte[] fileContentHash, bool isServiceEncrypted) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static Azure.Storage.Files.Shares.Models.ShareFileInfo StorageFileInfo(Azure.ETag eTag, System.DateTimeOffset lastModified, bool isServerEncrypted, string filePermissionKey, string fileAttributes, System.DateTimeOffset fileCreationTime, System.DateTimeOffset fileLastWriteTime, System.DateTimeOffset fileChangeTime, string fileId, string fileParentId) { throw null; }
+ public static Azure.Storage.Files.Shares.Models.ShareFileInfo StorageFileInfo(Azure.ETag eTag = default(Azure.ETag), System.DateTimeOffset lastModified = default(System.DateTimeOffset), bool isServerEncrypted = false, string filePermissionKey = null, string fileAttributes = null, System.DateTimeOffset fileCreationTime = default(System.DateTimeOffset), System.DateTimeOffset fileLastWriteTime = default(System.DateTimeOffset), System.DateTimeOffset fileChangeTime = default(System.DateTimeOffset), string fileId = null, string fileParentId = null, Azure.Storage.Files.Shares.Models.NfsFileMode nfsFileMode = null, string owner = null, string group = null, Azure.Storage.Files.Shares.Models.NfsFileType nfsFileType = default(Azure.Storage.Files.Shares.Models.NfsFileType)) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static Azure.Storage.Files.Shares.Models.ShareFileItem StorageFileItem(bool isDirectory, string name, long? fileSize) { throw null; }
+ public static Azure.Storage.Files.Shares.Models.ShareFileProperties StorageFileProperties(System.DateTimeOffset lastModified = default(System.DateTimeOffset), System.Collections.Generic.IDictionary metadata = null, long contentLength = (long)0, string contentType = null, Azure.ETag eTag = default(Azure.ETag), byte[] contentHash = null, System.Collections.Generic.IEnumerable contentEncoding = null, string cacheControl = null, string contentDisposition = null, System.Collections.Generic.IEnumerable contentLanguage = null, System.DateTimeOffset copyCompletedOn = default(System.DateTimeOffset), string copyStatusDescription = null, string copyId = null, string copyProgress = null, string copySource = null, Azure.Storage.Files.Shares.Models.CopyStatus copyStatus = Azure.Storage.Files.Shares.Models.CopyStatus.Pending, bool isServerEncrypted = false, Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties = null, Azure.Storage.Files.Shares.Models.FilePosixProperties posixProperties = null) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static Azure.Storage.Files.Shares.Models.ShareFileProperties StorageFileProperties(System.DateTimeOffset lastModified, System.Collections.Generic.IDictionary metadata, long contentLength, string contentType, Azure.ETag eTag, byte[] contentHash, System.Collections.Generic.IEnumerable contentEncoding, string cacheControl, string contentDisposition, System.Collections.Generic.IEnumerable contentLanguage, System.DateTimeOffset copyCompletedOn, string copyStatusDescription, string copyId, string copyProgress, string copySource, Azure.Storage.Files.Shares.Models.CopyStatus copyStatus, bool isServerEncrypted, Azure.Storage.Files.Shares.Models.NtfsFileAttributes fileAttributes, System.DateTimeOffset fileCreationTime, System.DateTimeOffset fileLastWriteTime, System.DateTimeOffset fileChangeTime, string filePermissionKey, string fileId, string fileParentId) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static Azure.Storage.Files.Shares.Models.ShareFileProperties StorageFileProperties(System.DateTimeOffset lastModified, System.Collections.Generic.IDictionary metadata, long contentLength, string contentType, Azure.ETag eTag, byte[] contentHash, System.Collections.Generic.IEnumerable contentEncoding, string cacheControl, string contentDisposition, System.Collections.Generic.IEnumerable contentLanguage, System.DateTimeOffset copyCompletedOn, string copyStatusDescription, string copyId, string copyProgress, string copySource, Azure.Storage.Files.Shares.Models.CopyStatus copyStatus, bool isServerEncrypted, string fileAttributes, System.DateTimeOffset fileCreationTime, System.DateTimeOffset fileLastWriteTime, System.DateTimeOffset fileChangeTime, string filePermissionKey, string fileId, string fileParentId) { throw null; }
}
+ public partial class NfsFileMode
+ {
+ public NfsFileMode() { }
+ public bool EffectiveGroupIdentity { get { throw null; } set { } }
+ public bool EffectiveUserIdentity { get { throw null; } set { } }
+ public Azure.Storage.Files.Shares.Models.PosixRolePermissions Group { get { throw null; } set { } }
+ public Azure.Storage.Files.Shares.Models.PosixRolePermissions Other { get { throw null; } set { } }
+ public Azure.Storage.Files.Shares.Models.PosixRolePermissions Owner { get { throw null; } set { } }
+ public bool StickyBit { get { throw null; } set { } }
+ public static Azure.Storage.Files.Shares.Models.NfsFileMode ParseOctalFileMode(string modeString) { throw null; }
+ public static Azure.Storage.Files.Shares.Models.NfsFileMode ParseSymbolicFileMode(string modeString) { throw null; }
+ public string ToOctalFileMode() { throw null; }
+ public override string ToString() { throw null; }
+ public string ToSymbolicFileMode() { throw null; }
+ }
+ [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
+ public readonly partial struct NfsFileType : System.IEquatable
+ {
+ private readonly object _dummy;
+ private readonly int _dummyPrimitive;
+ public NfsFileType(string value) { throw null; }
+ public static Azure.Storage.Files.Shares.Models.NfsFileType Directory { get { throw null; } }
+ public static Azure.Storage.Files.Shares.Models.NfsFileType Regular { get { throw null; } }
+ public static Azure.Storage.Files.Shares.Models.NfsFileType SymLink { get { throw null; } }
+ public bool Equals(Azure.Storage.Files.Shares.Models.NfsFileType other) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ public override bool Equals(object obj) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ public override int GetHashCode() { throw null; }
+ public static bool operator ==(Azure.Storage.Files.Shares.Models.NfsFileType left, Azure.Storage.Files.Shares.Models.NfsFileType right) { throw null; }
+ public static implicit operator Azure.Storage.Files.Shares.Models.NfsFileType (string value) { throw null; }
+ public static bool operator !=(Azure.Storage.Files.Shares.Models.NfsFileType left, Azure.Storage.Files.Shares.Models.NfsFileType right) { throw null; }
+ public override string ToString() { throw null; }
+ }
[System.FlagsAttribute]
public enum NtfsFileAttributes
{
@@ -545,6 +603,14 @@ public partial class PermissionInfo
internal PermissionInfo() { }
public string FilePermissionKey { get { throw null; } }
}
+ [System.FlagsAttribute]
+ public enum PosixRolePermissions
+ {
+ None = 0,
+ Execute = 1,
+ Write = 2,
+ Read = 4,
+ }
public partial class ShareAccessPolicy
{
public ShareAccessPolicy() { }
@@ -629,6 +695,7 @@ public partial class ShareDirectoryCreateOptions
public ShareDirectoryCreateOptions() { }
public Azure.Storage.Files.Shares.Models.ShareFilePermission FilePermission { get { throw null; } set { } }
public System.Collections.Generic.IDictionary Metadata { get { throw null; } set { } }
+ public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } set { } }
public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } }
}
public partial class ShareDirectoryGetFilesAndDirectoriesOptions
@@ -643,6 +710,7 @@ public partial class ShareDirectoryInfo
internal ShareDirectoryInfo() { }
public Azure.ETag ETag { get { throw null; } }
public System.DateTimeOffset LastModified { get { throw null; } }
+ public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } }
public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } }
}
public partial class ShareDirectoryProperties
@@ -652,12 +720,14 @@ internal ShareDirectoryProperties() { }
public bool IsServerEncrypted { get { throw null; } }
public System.DateTimeOffset LastModified { get { throw null; } }
public System.Collections.Generic.IDictionary Metadata { get { throw null; } }
+ public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } }
public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } }
}
public partial class ShareDirectorySetHttpHeadersOptions
{
public ShareDirectorySetHttpHeadersOptions() { }
public Azure.Storage.Files.Shares.Models.ShareFilePermission FilePermission { get { throw null; } set { } }
+ public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } set { } }
public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } }
}
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
@@ -768,6 +838,7 @@ public ShareFileCopyOptions() { }
public bool? IgnoreReadOnly { get { throw null; } set { } }
public System.Collections.Generic.IDictionary Metadata { get { throw null; } set { } }
public Azure.Storage.Files.Shares.Models.FilePermissionFormat? PermissionFormat { get { throw null; } set { } }
+ public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } set { } }
public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } }
public Azure.Storage.Files.Shares.Models.CopyableFileSmbProperties SmbPropertiesToCopy { get { throw null; } set { } }
}
@@ -777,6 +848,7 @@ public ShareFileCreateOptions() { }
public Azure.Storage.Files.Shares.Models.ShareFilePermission FilePermission { get { throw null; } set { } }
public Azure.Storage.Files.Shares.Models.ShareFileHttpHeaders HttpHeaders { get { throw null; } set { } }
public System.Collections.Generic.IDictionary Metadata { get { throw null; } set { } }
+ public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } set { } }
public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } }
}
public partial class ShareFileDownloadDetails
@@ -802,6 +874,7 @@ internal ShareFileDownloadDetails() { }
public Azure.Storage.Files.Shares.Models.ShareLeaseState LeaseState { get { throw null; } }
public Azure.Storage.Files.Shares.Models.ShareLeaseStatus LeaseStatus { get { throw null; } }
public System.Collections.Generic.IDictionary Metadata { get { throw null; } }
+ public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } }
public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } }
}
public partial class ShareFileDownloadInfo : System.IDisposable
@@ -879,6 +952,7 @@ internal ShareFileInfo() { }
public Azure.ETag ETag { get { throw null; } }
public bool IsServerEncrypted { get { throw null; } }
public System.DateTimeOffset LastModified { get { throw null; } }
+ public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } }
public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } }
}
public partial class ShareFileItem
@@ -966,6 +1040,7 @@ internal ShareFileProperties() { }
public Azure.Storage.Files.Shares.Models.ShareLeaseState LeaseState { get { throw null; } }
public Azure.Storage.Files.Shares.Models.ShareLeaseStatus LeaseStatus { get { throw null; } }
public System.Collections.Generic.IDictionary Metadata { get { throw null; } }
+ public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } }
public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } }
}
public partial class ShareFileRangeInfo
@@ -1007,6 +1082,7 @@ public ShareFileSetHttpHeadersOptions() { }
public Azure.Storage.Files.Shares.Models.ShareFilePermission FilePermission { get { throw null; } set { } }
public Azure.Storage.Files.Shares.Models.ShareFileHttpHeaders HttpHeaders { get { throw null; } set { } }
public long? NewSize { get { throw null; } set { } }
+ public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } set { } }
public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } }
}
[System.FlagsAttribute]
@@ -1225,7 +1301,9 @@ public ShareSmbSettings() { }
}
public static partial class SharesModelFactory
{
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static Azure.Storage.Files.Shares.Models.FileSmbProperties FileSmbProperties(System.DateTimeOffset? fileChangedOn, string fileId, string parentId) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static Azure.Storage.Files.Shares.Models.ShareDirectoryInfo StorageDirectoryInfo(Azure.ETag eTag, System.DateTimeOffset lastModified, string filePermissionKey, string fileAttributes, System.DateTimeOffset fileCreationTime, System.DateTimeOffset fileLastWriteTime, System.DateTimeOffset fileChangeTime, string fileId, string fileParentId) { throw null; }
}
public partial class ShareSnapshotInfo
diff --git a/sdk/storage/Azure.Storage.Files.Shares/assets.json b/sdk/storage/Azure.Storage.Files.Shares/assets.json
index c2b5c3d31e6a2..0369c7abc0d76 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/assets.json
+++ b/sdk/storage/Azure.Storage.Files.Shares/assets.json
@@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "net",
"TagPrefix": "net/storage/Azure.Storage.Files.Shares",
- "Tag": "net/storage/Azure.Storage.Files.Shares_df67d82d59"
+ "Tag": "net/storage/Azure.Storage.Files.Shares_6cb8aed97e"
}
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/DirectoryCreateHeaders.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/DirectoryCreateHeaders.cs
index 2893eee8248cc..2eaa2796f382f 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/DirectoryCreateHeaders.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/DirectoryCreateHeaders.cs
@@ -7,6 +7,7 @@
using System;
using Azure.Core;
+using Azure.Storage.Files.Shares.Models;
namespace Azure.Storage.Files.Shares
{
@@ -37,5 +38,13 @@ public DirectoryCreateHeaders(Response response)
public string FileId => _response.Headers.TryGetValue("x-ms-file-id", out string value) ? value : null;
/// The parent fileId of the directory.
public string FileParentId => _response.Headers.TryGetValue("x-ms-file-parent-id", out string value) ? value : null;
+ /// NFS only. The mode of the file or directory.
+ public string FileMode => _response.Headers.TryGetValue("x-ms-mode", out string value) ? value : null;
+ /// NFS only. The owner of the file or directory.
+ public string Owner => _response.Headers.TryGetValue("x-ms-owner", out string value) ? value : null;
+ /// NFS only. The owning group of the file or directory.
+ public string Group => _response.Headers.TryGetValue("x-ms-group", out string value) ? value : null;
+ /// NFS only. Type of the file or directory.
+ public NfsFileType? NfsFileType => _response.Headers.TryGetValue("x-ms-file-file-type", out string value) ? new NfsFileType(value) : (NfsFileType?)null;
}
}
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/DirectoryGetPropertiesHeaders.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/DirectoryGetPropertiesHeaders.cs
index 43cac7bf49396..c7706aa600673 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/DirectoryGetPropertiesHeaders.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/DirectoryGetPropertiesHeaders.cs
@@ -8,6 +8,7 @@
using System;
using System.Collections.Generic;
using Azure.Core;
+using Azure.Storage.Files.Shares.Models;
namespace Azure.Storage.Files.Shares
{
@@ -40,5 +41,13 @@ public DirectoryGetPropertiesHeaders(Response response)
public string FileId => _response.Headers.TryGetValue("x-ms-file-id", out string value) ? value : null;
/// The parent fileId of the directory.
public string FileParentId => _response.Headers.TryGetValue("x-ms-file-parent-id", out string value) ? value : null;
+ /// NFS only. The mode of the file or directory.
+ public string FileMode => _response.Headers.TryGetValue("x-ms-mode", out string value) ? value : null;
+ /// NFS only. The owner of the file or directory.
+ public string Owner => _response.Headers.TryGetValue("x-ms-owner", out string value) ? value : null;
+ /// NFS only. The owning group of the file or directory.
+ public string Group => _response.Headers.TryGetValue("x-ms-group", out string value) ? value : null;
+ /// NFS only. Type of the file or directory.
+ public NfsFileType? NfsFileType => _response.Headers.TryGetValue("x-ms-file-file-type", out string value) ? new NfsFileType(value) : (NfsFileType?)null;
}
}
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/DirectoryRestClient.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/DirectoryRestClient.cs
index 8a2edb8b99134..927f91370d88a 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/DirectoryRestClient.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/DirectoryRestClient.cs
@@ -33,7 +33,7 @@ internal partial class DirectoryRestClient
/// The handler for diagnostic messaging in the client.
/// The HTTP pipeline for sending and receiving REST requests and responses.
/// The URL of the service account, share, directory or file that is the target of the desired operation.
- /// Specifies the version of the operation to use for this request. The default value is "2025-01-05".
+ /// Specifies the version of the operation to use for this request. The default value is "2025-05-05".
/// If true, the trailing dot will not be trimmed from the target URI.
/// Valid value is backup.
/// If true, the trailing dot will not be trimmed from the source URI.
@@ -49,7 +49,7 @@ public DirectoryRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pip
_allowSourceTrailingDot = allowSourceTrailingDot;
}
- internal HttpMessage CreateCreateRequest(string fileAttributes, int? timeout, IDictionary metadata, string filePermission, FilePermissionFormat? filePermissionFormat, string filePermissionKey, string fileCreationTime, string fileLastWriteTime, string fileChangeTime)
+ internal HttpMessage CreateCreateRequest(int? timeout, IDictionary metadata, string filePermission, FilePermissionFormat? filePermissionFormat, string filePermissionKey, string fileAttributes, string fileCreationTime, string fileLastWriteTime, string fileChangeTime, string owner, string group, string fileMode)
{
var message = _pipeline.CreateMessage();
var request = message.Request;
@@ -83,7 +83,10 @@ internal HttpMessage CreateCreateRequest(string fileAttributes, int? timeout, ID
{
request.Headers.Add("x-ms-file-permission-key", filePermissionKey);
}
- request.Headers.Add("x-ms-file-attributes", fileAttributes);
+ if (fileAttributes != null)
+ {
+ request.Headers.Add("x-ms-file-attributes", fileAttributes);
+ }
if (fileCreationTime != null)
{
request.Headers.Add("x-ms-file-creation-time", fileCreationTime);
@@ -100,30 +103,39 @@ internal HttpMessage CreateCreateRequest(string fileAttributes, int? timeout, ID
{
request.Headers.Add("x-ms-file-request-intent", _fileRequestIntent.Value.ToString());
}
+ if (owner != null)
+ {
+ request.Headers.Add("x-ms-owner", owner);
+ }
+ if (group != null)
+ {
+ request.Headers.Add("x-ms-group", group);
+ }
+ if (fileMode != null)
+ {
+ request.Headers.Add("x-ms-mode", fileMode);
+ }
request.Headers.Add("Accept", "application/xml");
return message;
}
/// Creates a new directory under the specified share or parent directory.
- /// If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default.
/// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>.
/// A name-value pair to associate with a file storage object.
/// If specified the permission (security descriptor) shall be set for the directory/file. This header can be used if Permission size is <= 8KB, else x-ms-file-permission-key header shall be used. Default value: Inherit. If SDDL is specified as input, it must have owner, group and dacl. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified.
/// Optional. Available for version 2023-06-01 and later. Specifies the format in which the permission is returned. Acceptable values are SDDL or binary. If x-ms-file-permission-format is unspecified or explicitly set to SDDL, the permission is returned in SDDL format. If x-ms-file-permission-format is explicitly set to binary, the permission is returned as a base64 string representing the binary encoding of the permission.
/// Key of the permission to be set for the directory/file. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified.
+ /// If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default.
/// Creation time for the file/directory. Default value: Now.
/// Last write time for the file/directory. Default value: Now.
/// Change time for the file/directory. Default value: Now.
+ /// Optional, NFS only. The owner of the file or directory.
+ /// Optional, NFS only. The owning group of the file or directory.
+ /// Optional, NFS only. The file mode of the file or directory.
/// The cancellation token to use.
- /// is null.
- public async Task> CreateAsync(string fileAttributes, int? timeout = null, IDictionary metadata = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, string fileCreationTime = null, string fileLastWriteTime = null, string fileChangeTime = null, CancellationToken cancellationToken = default)
+ public async Task> CreateAsync(int? timeout = null, IDictionary metadata = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, string fileAttributes = null, string fileCreationTime = null, string fileLastWriteTime = null, string fileChangeTime = null, string owner = null, string group = null, string fileMode = null, CancellationToken cancellationToken = default)
{
- if (fileAttributes == null)
- {
- throw new ArgumentNullException(nameof(fileAttributes));
- }
-
- using var message = CreateCreateRequest(fileAttributes, timeout, metadata, filePermission, filePermissionFormat, filePermissionKey, fileCreationTime, fileLastWriteTime, fileChangeTime);
+ using var message = CreateCreateRequest(timeout, metadata, filePermission, filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, owner, group, fileMode);
await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
var headers = new DirectoryCreateHeaders(message.Response);
switch (message.Response.Status)
@@ -136,25 +148,22 @@ public async Task> CreateAsync(strin
}
/// Creates a new directory under the specified share or parent directory.
- /// If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default.
/// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>.
/// A name-value pair to associate with a file storage object.
/// If specified the permission (security descriptor) shall be set for the directory/file. This header can be used if Permission size is <= 8KB, else x-ms-file-permission-key header shall be used. Default value: Inherit. If SDDL is specified as input, it must have owner, group and dacl. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified.
/// Optional. Available for version 2023-06-01 and later. Specifies the format in which the permission is returned. Acceptable values are SDDL or binary. If x-ms-file-permission-format is unspecified or explicitly set to SDDL, the permission is returned in SDDL format. If x-ms-file-permission-format is explicitly set to binary, the permission is returned as a base64 string representing the binary encoding of the permission.
/// Key of the permission to be set for the directory/file. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified.
+ /// If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default.
/// Creation time for the file/directory. Default value: Now.
/// Last write time for the file/directory. Default value: Now.
/// Change time for the file/directory. Default value: Now.
+ /// Optional, NFS only. The owner of the file or directory.
+ /// Optional, NFS only. The owning group of the file or directory.
+ /// Optional, NFS only. The file mode of the file or directory.
/// The cancellation token to use.
- /// is null.
- public ResponseWithHeaders Create(string fileAttributes, int? timeout = null, IDictionary metadata = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, string fileCreationTime = null, string fileLastWriteTime = null, string fileChangeTime = null, CancellationToken cancellationToken = default)
+ public ResponseWithHeaders Create(int? timeout = null, IDictionary metadata = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, string fileAttributes = null, string fileCreationTime = null, string fileLastWriteTime = null, string fileChangeTime = null, string owner = null, string group = null, string fileMode = null, CancellationToken cancellationToken = default)
{
- if (fileAttributes == null)
- {
- throw new ArgumentNullException(nameof(fileAttributes));
- }
-
- using var message = CreateCreateRequest(fileAttributes, timeout, metadata, filePermission, filePermissionFormat, filePermissionKey, fileCreationTime, fileLastWriteTime, fileChangeTime);
+ using var message = CreateCreateRequest(timeout, metadata, filePermission, filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, owner, group, fileMode);
_pipeline.Send(message, cancellationToken);
var headers = new DirectoryCreateHeaders(message.Response);
switch (message.Response.Status)
@@ -292,7 +301,7 @@ public ResponseWithHeaders Delete(int? timeout = null, C
}
}
- internal HttpMessage CreateSetPropertiesRequest(string fileAttributes, int? timeout, string filePermission, FilePermissionFormat? filePermissionFormat, string filePermissionKey, string fileCreationTime, string fileLastWriteTime, string fileChangeTime)
+ internal HttpMessage CreateSetPropertiesRequest(int? timeout, string filePermission, FilePermissionFormat? filePermissionFormat, string filePermissionKey, string fileAttributes, string fileCreationTime, string fileLastWriteTime, string fileChangeTime, string owner, string group, string fileMode)
{
var message = _pipeline.CreateMessage();
var request = message.Request;
@@ -319,7 +328,10 @@ internal HttpMessage CreateSetPropertiesRequest(string fileAttributes, int? time
{
request.Headers.Add("x-ms-file-permission-key", filePermissionKey);
}
- request.Headers.Add("x-ms-file-attributes", fileAttributes);
+ if (fileAttributes != null)
+ {
+ request.Headers.Add("x-ms-file-attributes", fileAttributes);
+ }
if (fileCreationTime != null)
{
request.Headers.Add("x-ms-file-creation-time", fileCreationTime);
@@ -340,29 +352,38 @@ internal HttpMessage CreateSetPropertiesRequest(string fileAttributes, int? time
{
request.Headers.Add("x-ms-file-request-intent", _fileRequestIntent.Value.ToString());
}
+ if (owner != null)
+ {
+ request.Headers.Add("x-ms-owner", owner);
+ }
+ if (group != null)
+ {
+ request.Headers.Add("x-ms-group", group);
+ }
+ if (fileMode != null)
+ {
+ request.Headers.Add("x-ms-mode", fileMode);
+ }
request.Headers.Add("Accept", "application/xml");
return message;
}
/// Sets properties on the directory.
- /// If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default.
/// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>.
/// If specified the permission (security descriptor) shall be set for the directory/file. This header can be used if Permission size is <= 8KB, else x-ms-file-permission-key header shall be used. Default value: Inherit. If SDDL is specified as input, it must have owner, group and dacl. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified.
/// Optional. Available for version 2023-06-01 and later. Specifies the format in which the permission is returned. Acceptable values are SDDL or binary. If x-ms-file-permission-format is unspecified or explicitly set to SDDL, the permission is returned in SDDL format. If x-ms-file-permission-format is explicitly set to binary, the permission is returned as a base64 string representing the binary encoding of the permission.
/// Key of the permission to be set for the directory/file. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified.
+ /// If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default.
/// Creation time for the file/directory. Default value: Now.
/// Last write time for the file/directory. Default value: Now.
/// Change time for the file/directory. Default value: Now.
+ /// Optional, NFS only. The owner of the file or directory.
+ /// Optional, NFS only. The owning group of the file or directory.
+ /// Optional, NFS only. The file mode of the file or directory.
/// The cancellation token to use.
- /// is null.
- public async Task> SetPropertiesAsync(string fileAttributes, int? timeout = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, string fileCreationTime = null, string fileLastWriteTime = null, string fileChangeTime = null, CancellationToken cancellationToken = default)
+ public async Task> SetPropertiesAsync(int? timeout = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, string fileAttributes = null, string fileCreationTime = null, string fileLastWriteTime = null, string fileChangeTime = null, string owner = null, string group = null, string fileMode = null, CancellationToken cancellationToken = default)
{
- if (fileAttributes == null)
- {
- throw new ArgumentNullException(nameof(fileAttributes));
- }
-
- using var message = CreateSetPropertiesRequest(fileAttributes, timeout, filePermission, filePermissionFormat, filePermissionKey, fileCreationTime, fileLastWriteTime, fileChangeTime);
+ using var message = CreateSetPropertiesRequest(timeout, filePermission, filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, owner, group, fileMode);
await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
var headers = new DirectorySetPropertiesHeaders(message.Response);
switch (message.Response.Status)
@@ -375,24 +396,21 @@ public async Task> SetPropert
}
/// Sets properties on the directory.
- /// If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default.
/// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>.
/// If specified the permission (security descriptor) shall be set for the directory/file. This header can be used if Permission size is <= 8KB, else x-ms-file-permission-key header shall be used. Default value: Inherit. If SDDL is specified as input, it must have owner, group and dacl. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified.
/// Optional. Available for version 2023-06-01 and later. Specifies the format in which the permission is returned. Acceptable values are SDDL or binary. If x-ms-file-permission-format is unspecified or explicitly set to SDDL, the permission is returned in SDDL format. If x-ms-file-permission-format is explicitly set to binary, the permission is returned as a base64 string representing the binary encoding of the permission.
/// Key of the permission to be set for the directory/file. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified.
+ /// If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default.
/// Creation time for the file/directory. Default value: Now.
/// Last write time for the file/directory. Default value: Now.
/// Change time for the file/directory. Default value: Now.
+ /// Optional, NFS only. The owner of the file or directory.
+ /// Optional, NFS only. The owning group of the file or directory.
+ /// Optional, NFS only. The file mode of the file or directory.
/// The cancellation token to use.
- /// is null.
- public ResponseWithHeaders SetProperties(string fileAttributes, int? timeout = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, string fileCreationTime = null, string fileLastWriteTime = null, string fileChangeTime = null, CancellationToken cancellationToken = default)
+ public ResponseWithHeaders SetProperties(int? timeout = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, string fileAttributes = null, string fileCreationTime = null, string fileLastWriteTime = null, string fileChangeTime = null, string owner = null, string group = null, string fileMode = null, CancellationToken cancellationToken = default)
{
- if (fileAttributes == null)
- {
- throw new ArgumentNullException(nameof(fileAttributes));
- }
-
- using var message = CreateSetPropertiesRequest(fileAttributes, timeout, filePermission, filePermissionFormat, filePermissionKey, fileCreationTime, fileLastWriteTime, fileChangeTime);
+ using var message = CreateSetPropertiesRequest(timeout, filePermission, filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, owner, group, fileMode);
_pipeline.Send(message, cancellationToken);
var headers = new DirectorySetPropertiesHeaders(message.Response);
switch (message.Response.Status)
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/DirectorySetPropertiesHeaders.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/DirectorySetPropertiesHeaders.cs
index 122579967f528..70c784d9fcd7c 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/DirectorySetPropertiesHeaders.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/DirectorySetPropertiesHeaders.cs
@@ -37,5 +37,11 @@ public DirectorySetPropertiesHeaders(Response response)
public string FileId => _response.Headers.TryGetValue("x-ms-file-id", out string value) ? value : null;
/// The parent fileId of the directory.
public string FileParentId => _response.Headers.TryGetValue("x-ms-file-parent-id", out string value) ? value : null;
+ /// NFS only. The mode of the file or directory.
+ public string FileMode => _response.Headers.TryGetValue("x-ms-mode", out string value) ? value : null;
+ /// NFS only. The owner of the file or directory.
+ public string Owner => _response.Headers.TryGetValue("x-ms-owner", out string value) ? value : null;
+ /// NFS only. The owning group of the file or directory.
+ public string Group => _response.Headers.TryGetValue("x-ms-group", out string value) ? value : null;
}
}
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileCreateHardLinkHeaders.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileCreateHardLinkHeaders.cs
new file mode 100644
index 0000000000000..0760e0e32c2a7
--- /dev/null
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileCreateHardLinkHeaders.cs
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using Azure.Core;
+using Azure.Storage.Files.Shares.Models;
+
+namespace Azure.Storage.Files.Shares
+{
+ internal partial class FileCreateHardLinkHeaders
+ {
+ private readonly Response _response;
+ public FileCreateHardLinkHeaders(Response response)
+ {
+ _response = response;
+ }
+ /// Returns the date and time the share was last modified. Any operation that modifies the directory or its properties updates the last modified time. Operations on files do not affect the last modified time of the directory.
+ public DateTimeOffset? LastModified => _response.Headers.TryGetValue("Last-Modified", out DateTimeOffset? value) ? value : null;
+ /// Indicates the version of the File service used to execute the request.
+ public string Version => _response.Headers.TryGetValue("x-ms-version", out string value) ? value : null;
+ /// Creation time for the file.
+ public DateTimeOffset? FileCreationTime => _response.Headers.TryGetValue("x-ms-file-creation-time", out DateTimeOffset? value) ? value : null;
+ /// Last write time for the file.
+ public DateTimeOffset? FileLastWriteTime => _response.Headers.TryGetValue("x-ms-file-last-write-time", out DateTimeOffset? value) ? value : null;
+ /// Change time for the file.
+ public DateTimeOffset? FileChangeTime => _response.Headers.TryGetValue("x-ms-file-change-time", out DateTimeOffset? value) ? value : null;
+ /// The fileId of the file.
+ public string FileId => _response.Headers.TryGetValue("x-ms-file-id", out string value) ? value : null;
+ /// The parent fileId of the directory.
+ public string FileParentId => _response.Headers.TryGetValue("x-ms-file-parent-id", out string value) ? value : null;
+ /// NFS only. The link count of the file or directory.
+ public long? LinkCount => _response.Headers.TryGetValue("x-ms-link-count", out long? value) ? value : null;
+ /// NFS only. The mode of the file or directory.
+ public string FileMode => _response.Headers.TryGetValue("x-ms-mode", out string value) ? value : null;
+ /// NFS only. The owner of the file or directory.
+ public string Owner => _response.Headers.TryGetValue("x-ms-owner", out string value) ? value : null;
+ /// NFS only. The owning group of the file or directory.
+ public string Group => _response.Headers.TryGetValue("x-ms-group", out string value) ? value : null;
+ /// NFS only. Type of the file or directory.
+ public NfsFileType? NfsFileType => _response.Headers.TryGetValue("x-ms-file-file-type", out string value) ? new NfsFileType(value) : (NfsFileType?)null;
+ }
+}
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileCreateHeaders.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileCreateHeaders.cs
index 69e1975f86c7b..5a28bfff5489e 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileCreateHeaders.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileCreateHeaders.cs
@@ -7,6 +7,7 @@
using System;
using Azure.Core;
+using Azure.Storage.Files.Shares.Models;
namespace Azure.Storage.Files.Shares
{
@@ -37,5 +38,13 @@ public FileCreateHeaders(Response response)
public string FileId => _response.Headers.TryGetValue("x-ms-file-id", out string value) ? value : null;
/// The parent fileId of the file.
public string FileParentId => _response.Headers.TryGetValue("x-ms-file-parent-id", out string value) ? value : null;
+ /// NFS only. The mode of the file or directory.
+ public string FileMode => _response.Headers.TryGetValue("x-ms-mode", out string value) ? value : null;
+ /// NFS only. The owner of the file or directory.
+ public string Owner => _response.Headers.TryGetValue("x-ms-owner", out string value) ? value : null;
+ /// NFS only. The owning group of the file or directory.
+ public string Group => _response.Headers.TryGetValue("x-ms-group", out string value) ? value : null;
+ /// NFS only. Type of the file or directory.
+ public NfsFileType? NfsFileType => _response.Headers.TryGetValue("x-ms-file-file-type", out string value) ? new NfsFileType(value) : (NfsFileType?)null;
}
}
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileCreateSymbolicLinkHeaders.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileCreateSymbolicLinkHeaders.cs
new file mode 100644
index 0000000000000..bda9480cdb734
--- /dev/null
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileCreateSymbolicLinkHeaders.cs
@@ -0,0 +1,44 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using Azure.Core;
+using Azure.Storage.Files.Shares.Models;
+
+namespace Azure.Storage.Files.Shares
+{
+ internal partial class FileCreateSymbolicLinkHeaders
+ {
+ private readonly Response _response;
+ public FileCreateSymbolicLinkHeaders(Response response)
+ {
+ _response = response;
+ }
+ /// Returns the date and time the share was last modified. Any operation that modifies the directory or its properties updates the last modified time. Operations on files do not affect the last modified time of the directory.
+ public DateTimeOffset? LastModified => _response.Headers.TryGetValue("Last-Modified", out DateTimeOffset? value) ? value : null;
+ /// Indicates the version of the File service used to execute the request.
+ public string Version => _response.Headers.TryGetValue("x-ms-version", out string value) ? value : null;
+ /// Creation time for the file.
+ public DateTimeOffset? FileCreationTime => _response.Headers.TryGetValue("x-ms-file-creation-time", out DateTimeOffset? value) ? value : null;
+ /// Last write time for the file.
+ public DateTimeOffset? FileLastWriteTime => _response.Headers.TryGetValue("x-ms-file-last-write-time", out DateTimeOffset? value) ? value : null;
+ /// Change time for the file.
+ public DateTimeOffset? FileChangeTime => _response.Headers.TryGetValue("x-ms-file-change-time", out DateTimeOffset? value) ? value : null;
+ /// The fileId of the file.
+ public string FileId => _response.Headers.TryGetValue("x-ms-file-id", out string value) ? value : null;
+ /// The parent fileId of the directory.
+ public string FileParentId => _response.Headers.TryGetValue("x-ms-file-parent-id", out string value) ? value : null;
+ /// NFS only. The mode of the file or directory.
+ public string FileMode => _response.Headers.TryGetValue("x-ms-mode", out string value) ? value : null;
+ /// NFS only. The owner of the file or directory.
+ public string Owner => _response.Headers.TryGetValue("x-ms-owner", out string value) ? value : null;
+ /// NFS only. The owning group of the file or directory.
+ public string Group => _response.Headers.TryGetValue("x-ms-group", out string value) ? value : null;
+ /// NFS only. Type of the file or directory.
+ public NfsFileType? NfsFileType => _response.Headers.TryGetValue("x-ms-file-file-type", out string value) ? new NfsFileType(value) : (NfsFileType?)null;
+ }
+}
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileDeleteHeaders.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileDeleteHeaders.cs
index b1db3dbf3963c..131cec8d9c146 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileDeleteHeaders.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileDeleteHeaders.cs
@@ -18,5 +18,7 @@ public FileDeleteHeaders(Response response)
}
/// Indicates the version of the File service used to execute the request.
public string Version => _response.Headers.TryGetValue("x-ms-version", out string value) ? value : null;
+ /// NFS only. The link count of the file or directory.
+ public long? LinkCount => _response.Headers.TryGetValue("x-ms-link-count", out long? value) ? value : null;
}
}
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileDownloadHeaders.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileDownloadHeaders.cs
index c4d7056a5cfa3..174d478602c24 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileDownloadHeaders.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileDownloadHeaders.cs
@@ -83,5 +83,13 @@ public FileDownloadHeaders(Response response)
public string StructuredBodyType => _response.Headers.TryGetValue("x-ms-structured-body", out string value) ? value : null;
/// The length of the blob/file content inside the message body when the response body is returned as a structured message. Will always be smaller than Content-Length.
public long? StructuredContentLength => _response.Headers.TryGetValue("x-ms-structured-content-length", out long? value) ? value : null;
+ /// NFS only. The mode of the file or directory.
+ public string FileMode => _response.Headers.TryGetValue("x-ms-mode", out string value) ? value : null;
+ /// NFS only. The owner of the file or directory.
+ public string Owner => _response.Headers.TryGetValue("x-ms-owner", out string value) ? value : null;
+ /// NFS only. The owning group of the file or directory.
+ public string Group => _response.Headers.TryGetValue("x-ms-group", out string value) ? value : null;
+ /// NFS only. The link count of the file or directory.
+ public long? LinkCount => _response.Headers.TryGetValue("x-ms-link-count", out long? value) ? value : null;
}
}
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileGetPropertiesHeaders.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileGetPropertiesHeaders.cs
index 4e2050c13c06d..29e642249adda 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileGetPropertiesHeaders.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileGetPropertiesHeaders.cs
@@ -75,5 +75,15 @@ public FileGetPropertiesHeaders(Response response)
public ShareLeaseState? LeaseState => _response.Headers.TryGetValue("x-ms-lease-state", out string value) ? value.ToShareLeaseState() : null;
/// The current lease status of the file.
public ShareLeaseStatus? LeaseStatus => _response.Headers.TryGetValue("x-ms-lease-status", out string value) ? value.ToShareLeaseStatus() : null;
+ /// NFS only. The mode of the file or directory.
+ public string FileMode => _response.Headers.TryGetValue("x-ms-mode", out string value) ? value : null;
+ /// NFS only. The owner of the file or directory.
+ public string Owner => _response.Headers.TryGetValue("x-ms-owner", out string value) ? value : null;
+ /// NFS only. The owning group of the file or directory.
+ public string Group => _response.Headers.TryGetValue("x-ms-group", out string value) ? value : null;
+ /// NFS only. The link count of the file or directory.
+ public long? LinkCount => _response.Headers.TryGetValue("x-ms-link-count", out long? value) ? value : null;
+ /// NFS only. Type of the file or directory.
+ public NfsFileType? NfsFileType => _response.Headers.TryGetValue("x-ms-file-file-type", out string value) ? new NfsFileType(value) : (NfsFileType?)null;
}
}
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileGetSymbolicLinkHeaders.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileGetSymbolicLinkHeaders.cs
new file mode 100644
index 0000000000000..255a50bc98f9e
--- /dev/null
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileGetSymbolicLinkHeaders.cs
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using Azure.Core;
+
+namespace Azure.Storage.Files.Shares
+{
+ internal partial class FileGetSymbolicLinkHeaders
+ {
+ private readonly Response _response;
+ public FileGetSymbolicLinkHeaders(Response response)
+ {
+ _response = response;
+ }
+ /// Returns the date and time the share was last modified. Any operation that modifies the directory or its properties updates the last modified time. Operations on files do not affect the last modified time of the directory.
+ public DateTimeOffset? LastModified => _response.Headers.TryGetValue("Last-Modified", out DateTimeOffset? value) ? value : null;
+ /// Indicates the version of the File service used to execute the request.
+ public string Version => _response.Headers.TryGetValue("x-ms-version", out string value) ? value : null;
+ /// The path to the original file, the symbolic link is pointing to. The path is of type string which is not resolved and is stored as is. The path can be absolute path or the relative path depending on the content stored in the symbolic link file.
+ public string LinkText => _response.Headers.TryGetValue("x-ms-link-text", out string value) ? value : null;
+ }
+}
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileRestClient.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileRestClient.cs
index 07f88af545aec..0800d2818937b 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileRestClient.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileRestClient.cs
@@ -34,7 +34,7 @@ internal partial class FileRestClient
/// The handler for diagnostic messaging in the client.
/// The HTTP pipeline for sending and receiving REST requests and responses.
/// The URL of the service account, share, directory or file that is the target of the desired operation.
- /// Specifies the version of the operation to use for this request. The default value is "2025-01-05".
+ /// Specifies the version of the operation to use for this request. The default value is "2025-05-05".
/// Only update is supported: - Update: Writes the bytes downloaded from the source url into the specified range. The default value is "update".
/// If true, the trailing dot will not be trimmed from the target URI.
/// Valid value is backup.
@@ -52,7 +52,7 @@ public FileRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline
_allowSourceTrailingDot = allowSourceTrailingDot;
}
- internal HttpMessage CreateCreateRequest(long fileContentLength, string fileAttributes, int? timeout, IDictionary metadata, string filePermission, FilePermissionFormat? filePermissionFormat, string filePermissionKey, string fileCreationTime, string fileLastWriteTime, string fileChangeTime, FileHttpHeaders fileHttpHeaders, ShareFileRequestConditions shareFileRequestConditions)
+ internal HttpMessage CreateCreateRequest(long fileContentLength, int? timeout, IDictionary metadata, string filePermission, FilePermissionFormat? filePermissionFormat, string filePermissionKey, string fileAttributes, string fileCreationTime, string fileLastWriteTime, string fileChangeTime, string owner, string group, string fileMode, NfsFileType? nfsFileType, FileHttpHeaders fileHttpHeaders, ShareFileRequestConditions shareFileRequestConditions)
{
var message = _pipeline.CreateMessage();
var request = message.Request;
@@ -111,7 +111,10 @@ internal HttpMessage CreateCreateRequest(long fileContentLength, string fileAttr
{
request.Headers.Add("x-ms-file-permission-key", filePermissionKey);
}
- request.Headers.Add("x-ms-file-attributes", fileAttributes);
+ if (fileAttributes != null)
+ {
+ request.Headers.Add("x-ms-file-attributes", fileAttributes);
+ }
if (fileCreationTime != null)
{
request.Headers.Add("x-ms-file-creation-time", fileCreationTime);
@@ -132,33 +135,47 @@ internal HttpMessage CreateCreateRequest(long fileContentLength, string fileAttr
{
request.Headers.Add("x-ms-file-request-intent", _fileRequestIntent.Value.ToString());
}
+ if (owner != null)
+ {
+ request.Headers.Add("x-ms-owner", owner);
+ }
+ if (group != null)
+ {
+ request.Headers.Add("x-ms-group", group);
+ }
+ if (fileMode != null)
+ {
+ request.Headers.Add("x-ms-mode", fileMode);
+ }
+ if (nfsFileType != null)
+ {
+ request.Headers.Add("x-ms-file-file-type", nfsFileType.Value.ToString());
+ }
request.Headers.Add("Accept", "application/xml");
return message;
}
/// Creates a new file or replaces a file. Note it only initializes the file with no content.
/// Specifies the maximum size for the file, up to 4 TB.
- /// If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default.
/// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>.
/// A name-value pair to associate with a file storage object.
/// If specified the permission (security descriptor) shall be set for the directory/file. This header can be used if Permission size is <= 8KB, else x-ms-file-permission-key header shall be used. Default value: Inherit. If SDDL is specified as input, it must have owner, group and dacl. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified.
/// Optional. Available for version 2023-06-01 and later. Specifies the format in which the permission is returned. Acceptable values are SDDL or binary. If x-ms-file-permission-format is unspecified or explicitly set to SDDL, the permission is returned in SDDL format. If x-ms-file-permission-format is explicitly set to binary, the permission is returned as a base64 string representing the binary encoding of the permission.
/// Key of the permission to be set for the directory/file. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified.
+ /// If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default.
/// Creation time for the file/directory. Default value: Now.
/// Last write time for the file/directory. Default value: Now.
/// Change time for the file/directory. Default value: Now.
+ /// Optional, NFS only. The owner of the file or directory.
+ /// Optional, NFS only. The owning group of the file or directory.
+ /// Optional, NFS only. The file mode of the file or directory.
+ /// Optional, NFS only. Type of the file or directory.
/// Parameter group.
/// Parameter group.
/// The cancellation token to use.
- /// is null.
- public async Task> CreateAsync(long fileContentLength, string fileAttributes, int? timeout = null, IDictionary metadata = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, string fileCreationTime = null, string fileLastWriteTime = null, string fileChangeTime = null, FileHttpHeaders fileHttpHeaders = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default)
+ public async Task> CreateAsync(long fileContentLength, int? timeout = null, IDictionary metadata = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, string fileAttributes = null, string fileCreationTime = null, string fileLastWriteTime = null, string fileChangeTime = null, string owner = null, string group = null, string fileMode = null, NfsFileType? nfsFileType = null, FileHttpHeaders fileHttpHeaders = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default)
{
- if (fileAttributes == null)
- {
- throw new ArgumentNullException(nameof(fileAttributes));
- }
-
- using var message = CreateCreateRequest(fileContentLength, fileAttributes, timeout, metadata, filePermission, filePermissionFormat, filePermissionKey, fileCreationTime, fileLastWriteTime, fileChangeTime, fileHttpHeaders, shareFileRequestConditions);
+ using var message = CreateCreateRequest(fileContentLength, timeout, metadata, filePermission, filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, owner, group, fileMode, nfsFileType, fileHttpHeaders, shareFileRequestConditions);
await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
var headers = new FileCreateHeaders(message.Response);
switch (message.Response.Status)
@@ -172,27 +189,25 @@ public async Task> CreateAsync(long fileC
/// Creates a new file or replaces a file. Note it only initializes the file with no content.
/// Specifies the maximum size for the file, up to 4 TB.
- /// If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default.
/// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>.
/// A name-value pair to associate with a file storage object.
/// If specified the permission (security descriptor) shall be set for the directory/file. This header can be used if Permission size is <= 8KB, else x-ms-file-permission-key header shall be used. Default value: Inherit. If SDDL is specified as input, it must have owner, group and dacl. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified.
/// Optional. Available for version 2023-06-01 and later. Specifies the format in which the permission is returned. Acceptable values are SDDL or binary. If x-ms-file-permission-format is unspecified or explicitly set to SDDL, the permission is returned in SDDL format. If x-ms-file-permission-format is explicitly set to binary, the permission is returned as a base64 string representing the binary encoding of the permission.
/// Key of the permission to be set for the directory/file. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified.
+ /// If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default.
/// Creation time for the file/directory. Default value: Now.
/// Last write time for the file/directory. Default value: Now.
/// Change time for the file/directory. Default value: Now.
+ /// Optional, NFS only. The owner of the file or directory.
+ /// Optional, NFS only. The owning group of the file or directory.
+ /// Optional, NFS only. The file mode of the file or directory.
+ /// Optional, NFS only. Type of the file or directory.
/// Parameter group.
/// Parameter group.
/// The cancellation token to use.
- /// is null.
- public ResponseWithHeaders Create(long fileContentLength, string fileAttributes, int? timeout = null, IDictionary metadata = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, string fileCreationTime = null, string fileLastWriteTime = null, string fileChangeTime = null, FileHttpHeaders fileHttpHeaders = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default)
+ public ResponseWithHeaders Create(long fileContentLength, int? timeout = null, IDictionary metadata = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, string fileAttributes = null, string fileCreationTime = null, string fileLastWriteTime = null, string fileChangeTime = null, string owner = null, string group = null, string fileMode = null, NfsFileType? nfsFileType = null, FileHttpHeaders fileHttpHeaders = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default)
{
- if (fileAttributes == null)
- {
- throw new ArgumentNullException(nameof(fileAttributes));
- }
-
- using var message = CreateCreateRequest(fileContentLength, fileAttributes, timeout, metadata, filePermission, filePermissionFormat, filePermissionKey, fileCreationTime, fileLastWriteTime, fileChangeTime, fileHttpHeaders, shareFileRequestConditions);
+ using var message = CreateCreateRequest(fileContentLength, timeout, metadata, filePermission, filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, owner, group, fileMode, nfsFileType, fileHttpHeaders, shareFileRequestConditions);
_pipeline.Send(message, cancellationToken);
var headers = new FileCreateHeaders(message.Response);
switch (message.Response.Status)
@@ -432,7 +447,7 @@ public ResponseWithHeaders Delete(int? timeout = null, ShareF
}
}
- internal HttpMessage CreateSetHttpHeadersRequest(string fileAttributes, int? timeout, long? fileContentLength, string filePermission, FilePermissionFormat? filePermissionFormat, string filePermissionKey, string fileCreationTime, string fileLastWriteTime, string fileChangeTime, FileHttpHeaders fileHttpHeaders, ShareFileRequestConditions shareFileRequestConditions)
+ internal HttpMessage CreateSetHttpHeadersRequest(int? timeout, long? fileContentLength, string filePermission, FilePermissionFormat? filePermissionFormat, string filePermissionKey, string fileAttributes, string fileCreationTime, string fileLastWriteTime, string fileChangeTime, string owner, string group, string fileMode, FileHttpHeaders fileHttpHeaders, ShareFileRequestConditions shareFileRequestConditions)
{
var message = _pipeline.CreateMessage();
var request = message.Request;
@@ -486,7 +501,10 @@ internal HttpMessage CreateSetHttpHeadersRequest(string fileAttributes, int? tim
{
request.Headers.Add("x-ms-file-permission-key", filePermissionKey);
}
- request.Headers.Add("x-ms-file-attributes", fileAttributes);
+ if (fileAttributes != null)
+ {
+ request.Headers.Add("x-ms-file-attributes", fileAttributes);
+ }
if (fileCreationTime != null)
{
request.Headers.Add("x-ms-file-creation-time", fileCreationTime);
@@ -511,32 +529,41 @@ internal HttpMessage CreateSetHttpHeadersRequest(string fileAttributes, int? tim
{
request.Headers.Add("x-ms-file-request-intent", _fileRequestIntent.Value.ToString());
}
+ if (owner != null)
+ {
+ request.Headers.Add("x-ms-owner", owner);
+ }
+ if (group != null)
+ {
+ request.Headers.Add("x-ms-group", group);
+ }
+ if (fileMode != null)
+ {
+ request.Headers.Add("x-ms-mode", fileMode);
+ }
request.Headers.Add("Accept", "application/xml");
return message;
}
/// Sets HTTP headers on the file.
- /// If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default.
/// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>.
/// Resizes a file to the specified size. If the specified byte value is less than the current size of the file, then all ranges above the specified byte value are cleared.
/// If specified the permission (security descriptor) shall be set for the directory/file. This header can be used if Permission size is <= 8KB, else x-ms-file-permission-key header shall be used. Default value: Inherit. If SDDL is specified as input, it must have owner, group and dacl. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified.
/// Optional. Available for version 2023-06-01 and later. Specifies the format in which the permission is returned. Acceptable values are SDDL or binary. If x-ms-file-permission-format is unspecified or explicitly set to SDDL, the permission is returned in SDDL format. If x-ms-file-permission-format is explicitly set to binary, the permission is returned as a base64 string representing the binary encoding of the permission.
/// Key of the permission to be set for the directory/file. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified.
+ /// If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default.
/// Creation time for the file/directory. Default value: Now.
/// Last write time for the file/directory. Default value: Now.
/// Change time for the file/directory. Default value: Now.
+ /// Optional, NFS only. The owner of the file or directory.
+ /// Optional, NFS only. The owning group of the file or directory.
+ /// Optional, NFS only. The file mode of the file or directory.
/// Parameter group.
/// Parameter group.
/// The cancellation token to use.
- /// is null.
- public async Task> SetHttpHeadersAsync(string fileAttributes, int? timeout = null, long? fileContentLength = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, string fileCreationTime = null, string fileLastWriteTime = null, string fileChangeTime = null, FileHttpHeaders fileHttpHeaders = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default)
+ public async Task> SetHttpHeadersAsync(int? timeout = null, long? fileContentLength = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, string fileAttributes = null, string fileCreationTime = null, string fileLastWriteTime = null, string fileChangeTime = null, string owner = null, string group = null, string fileMode = null, FileHttpHeaders fileHttpHeaders = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default)
{
- if (fileAttributes == null)
- {
- throw new ArgumentNullException(nameof(fileAttributes));
- }
-
- using var message = CreateSetHttpHeadersRequest(fileAttributes, timeout, fileContentLength, filePermission, filePermissionFormat, filePermissionKey, fileCreationTime, fileLastWriteTime, fileChangeTime, fileHttpHeaders, shareFileRequestConditions);
+ using var message = CreateSetHttpHeadersRequest(timeout, fileContentLength, filePermission, filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, owner, group, fileMode, fileHttpHeaders, shareFileRequestConditions);
await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
var headers = new FileSetHttpHeadersHeaders(message.Response);
switch (message.Response.Status)
@@ -549,27 +576,24 @@ public async Task> SetHttpHeaders
}
/// Sets HTTP headers on the file.
- /// If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default.
/// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>.
/// Resizes a file to the specified size. If the specified byte value is less than the current size of the file, then all ranges above the specified byte value are cleared.
/// If specified the permission (security descriptor) shall be set for the directory/file. This header can be used if Permission size is <= 8KB, else x-ms-file-permission-key header shall be used. Default value: Inherit. If SDDL is specified as input, it must have owner, group and dacl. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified.
/// Optional. Available for version 2023-06-01 and later. Specifies the format in which the permission is returned. Acceptable values are SDDL or binary. If x-ms-file-permission-format is unspecified or explicitly set to SDDL, the permission is returned in SDDL format. If x-ms-file-permission-format is explicitly set to binary, the permission is returned as a base64 string representing the binary encoding of the permission.
/// Key of the permission to be set for the directory/file. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified.
+ /// If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default.
/// Creation time for the file/directory. Default value: Now.
/// Last write time for the file/directory. Default value: Now.
/// Change time for the file/directory. Default value: Now.
+ /// Optional, NFS only. The owner of the file or directory.
+ /// Optional, NFS only. The owning group of the file or directory.
+ /// Optional, NFS only. The file mode of the file or directory.
/// Parameter group.
/// Parameter group.
/// The cancellation token to use.
- /// is null.
- public ResponseWithHeaders SetHttpHeaders(string fileAttributes, int? timeout = null, long? fileContentLength = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, string fileCreationTime = null, string fileLastWriteTime = null, string fileChangeTime = null, FileHttpHeaders fileHttpHeaders = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default)
+ public ResponseWithHeaders SetHttpHeaders(int? timeout = null, long? fileContentLength = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, string fileAttributes = null, string fileCreationTime = null, string fileLastWriteTime = null, string fileChangeTime = null, string owner = null, string group = null, string fileMode = null, FileHttpHeaders fileHttpHeaders = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default)
{
- if (fileAttributes == null)
- {
- throw new ArgumentNullException(nameof(fileAttributes));
- }
-
- using var message = CreateSetHttpHeadersRequest(fileAttributes, timeout, fileContentLength, filePermission, filePermissionFormat, filePermissionKey, fileCreationTime, fileLastWriteTime, fileChangeTime, fileHttpHeaders, shareFileRequestConditions);
+ using var message = CreateSetHttpHeadersRequest(timeout, fileContentLength, filePermission, filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, owner, group, fileMode, fileHttpHeaders, shareFileRequestConditions);
_pipeline.Send(message, cancellationToken);
var headers = new FileSetHttpHeadersHeaders(message.Response);
switch (message.Response.Status)
@@ -1308,7 +1332,7 @@ public ResponseWithHeaders GetRange
}
}
- internal HttpMessage CreateStartCopyRequest(string copySource, int? timeout, IDictionary metadata, string filePermission, FilePermissionFormat? filePermissionFormat, string filePermissionKey, CopyFileSmbInfo copyFileSmbInfo, ShareFileRequestConditions shareFileRequestConditions)
+ internal HttpMessage CreateStartCopyRequest(string copySource, int? timeout, IDictionary metadata, string filePermission, FilePermissionFormat? filePermissionFormat, string filePermissionKey, string owner, string group, string fileMode, ModeCopyMode? fileModeCopyMode, OwnerCopyMode? fileOwnerCopyMode, CopyFileSmbInfo copyFileSmbInfo, ShareFileRequestConditions shareFileRequestConditions)
{
var message = _pipeline.CreateMessage();
var request = message.Request;
@@ -1382,6 +1406,26 @@ internal HttpMessage CreateStartCopyRequest(string copySource, int? timeout, IDi
{
request.Headers.Add("x-ms-file-request-intent", _fileRequestIntent.Value.ToString());
}
+ if (owner != null)
+ {
+ request.Headers.Add("x-ms-owner", owner);
+ }
+ if (group != null)
+ {
+ request.Headers.Add("x-ms-group", group);
+ }
+ if (fileMode != null)
+ {
+ request.Headers.Add("x-ms-mode", fileMode);
+ }
+ if (fileModeCopyMode != null)
+ {
+ request.Headers.Add("x-ms-file-mode-copy-mode", fileModeCopyMode.Value.ToSerialString());
+ }
+ if (fileOwnerCopyMode != null)
+ {
+ request.Headers.Add("x-ms-file-owner-copy-mode", fileOwnerCopyMode.Value.ToSerialString());
+ }
request.Headers.Add("Accept", "application/xml");
return message;
}
@@ -1393,18 +1437,23 @@ internal HttpMessage CreateStartCopyRequest(string copySource, int? timeout, IDi
/// If specified the permission (security descriptor) shall be set for the directory/file. This header can be used if Permission size is <= 8KB, else x-ms-file-permission-key header shall be used. Default value: Inherit. If SDDL is specified as input, it must have owner, group and dacl. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified.
/// Optional. Available for version 2023-06-01 and later. Specifies the format in which the permission is returned. Acceptable values are SDDL or binary. If x-ms-file-permission-format is unspecified or explicitly set to SDDL, the permission is returned in SDDL format. If x-ms-file-permission-format is explicitly set to binary, the permission is returned as a base64 string representing the binary encoding of the permission.
/// Key of the permission to be set for the directory/file. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified.
+ /// Optional, NFS only. The owner of the file or directory.
+ /// Optional, NFS only. The owning group of the file or directory.
+ /// Optional, NFS only. The file mode of the file or directory.
+ /// NFS only. Applicable only when the copy source is a File. Determines the copy behavior of the mode bits of the file. source: The mode on the destination file is copied from the source file. override: The mode on the destination file is determined via the x-ms-mode header.
+ /// NFS only. Determines the copy behavior of the owner user identifier (UID) and group identifier (GID) of the file. source: The owner user identifier (UID) and group identifier (GID) on the destination file is copied from the source file. override: The owner user identifier (UID) and group identifier (GID) on the destination file is determined via the x-ms-owner and x-ms-group headers.
/// Parameter group.
/// Parameter group.
/// The cancellation token to use.
/// is null.
- public async Task> StartCopyAsync(string copySource, int? timeout = null, IDictionary metadata = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, CopyFileSmbInfo copyFileSmbInfo = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default)
+ public async Task> StartCopyAsync(string copySource, int? timeout = null, IDictionary metadata = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, string owner = null, string group = null, string fileMode = null, ModeCopyMode? fileModeCopyMode = null, OwnerCopyMode? fileOwnerCopyMode = null, CopyFileSmbInfo copyFileSmbInfo = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default)
{
if (copySource == null)
{
throw new ArgumentNullException(nameof(copySource));
}
- using var message = CreateStartCopyRequest(copySource, timeout, metadata, filePermission, filePermissionFormat, filePermissionKey, copyFileSmbInfo, shareFileRequestConditions);
+ using var message = CreateStartCopyRequest(copySource, timeout, metadata, filePermission, filePermissionFormat, filePermissionKey, owner, group, fileMode, fileModeCopyMode, fileOwnerCopyMode, copyFileSmbInfo, shareFileRequestConditions);
await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
var headers = new FileStartCopyHeaders(message.Response);
switch (message.Response.Status)
@@ -1423,18 +1472,23 @@ public async Task> StartCopyAsync(stri
/// If specified the permission (security descriptor) shall be set for the directory/file. This header can be used if Permission size is <= 8KB, else x-ms-file-permission-key header shall be used. Default value: Inherit. If SDDL is specified as input, it must have owner, group and dacl. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified.
/// Optional. Available for version 2023-06-01 and later. Specifies the format in which the permission is returned. Acceptable values are SDDL or binary. If x-ms-file-permission-format is unspecified or explicitly set to SDDL, the permission is returned in SDDL format. If x-ms-file-permission-format is explicitly set to binary, the permission is returned as a base64 string representing the binary encoding of the permission.
/// Key of the permission to be set for the directory/file. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified.
+ /// Optional, NFS only. The owner of the file or directory.
+ /// Optional, NFS only. The owning group of the file or directory.
+ /// Optional, NFS only. The file mode of the file or directory.
+ /// NFS only. Applicable only when the copy source is a File. Determines the copy behavior of the mode bits of the file. source: The mode on the destination file is copied from the source file. override: The mode on the destination file is determined via the x-ms-mode header.
+ /// NFS only. Determines the copy behavior of the owner user identifier (UID) and group identifier (GID) of the file. source: The owner user identifier (UID) and group identifier (GID) on the destination file is copied from the source file. override: The owner user identifier (UID) and group identifier (GID) on the destination file is determined via the x-ms-owner and x-ms-group headers.
/// Parameter group.
/// Parameter group.
/// The cancellation token to use.
/// is null.
- public ResponseWithHeaders StartCopy(string copySource, int? timeout = null, IDictionary metadata = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, CopyFileSmbInfo copyFileSmbInfo = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default)
+ public ResponseWithHeaders StartCopy(string copySource, int? timeout = null, IDictionary metadata = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, string owner = null, string group = null, string fileMode = null, ModeCopyMode? fileModeCopyMode = null, OwnerCopyMode? fileOwnerCopyMode = null, CopyFileSmbInfo copyFileSmbInfo = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default)
{
if (copySource == null)
{
throw new ArgumentNullException(nameof(copySource));
}
- using var message = CreateStartCopyRequest(copySource, timeout, metadata, filePermission, filePermissionFormat, filePermissionKey, copyFileSmbInfo, shareFileRequestConditions);
+ using var message = CreateStartCopyRequest(copySource, timeout, metadata, filePermission, filePermissionFormat, filePermissionKey, owner, group, fileMode, fileModeCopyMode, fileOwnerCopyMode, copyFileSmbInfo, shareFileRequestConditions);
_pipeline.Send(message, cancellationToken);
var headers = new FileStartCopyHeaders(message.Response);
switch (message.Response.Status)
@@ -1859,5 +1913,250 @@ public ResponseWithHeaders Rename(string renameSource, int? t
throw new RequestFailedException(message.Response);
}
}
+
+ internal HttpMessage CreateCreateSymbolicLinkRequest(string linkText, int? timeout, IDictionary metadata, string fileCreationTime, string fileLastWriteTime, string owner, string group, ShareFileRequestConditions shareFileRequestConditions)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Put;
+ var uri = new RawRequestUriBuilder();
+ uri.AppendRaw(_url, false);
+ uri.AppendQuery("restype", "symboliclink", true);
+ if (timeout != null)
+ {
+ uri.AppendQuery("timeout", timeout.Value, true);
+ }
+ request.Uri = uri;
+ request.Headers.Add("x-ms-version", _version);
+ if (metadata != null)
+ {
+ request.Headers.Add("x-ms-meta-", metadata);
+ }
+ if (fileCreationTime != null)
+ {
+ request.Headers.Add("x-ms-file-creation-time", fileCreationTime);
+ }
+ if (fileLastWriteTime != null)
+ {
+ request.Headers.Add("x-ms-file-last-write-time", fileLastWriteTime);
+ }
+ if (shareFileRequestConditions?.LeaseId != null)
+ {
+ request.Headers.Add("x-ms-lease-id", shareFileRequestConditions.LeaseId);
+ }
+ if (owner != null)
+ {
+ request.Headers.Add("x-ms-owner", owner);
+ }
+ if (group != null)
+ {
+ request.Headers.Add("x-ms-group", group);
+ }
+ request.Headers.Add("x-ms-link-text", linkText);
+ if (_fileRequestIntent != null)
+ {
+ request.Headers.Add("x-ms-file-request-intent", _fileRequestIntent.Value.ToString());
+ }
+ request.Headers.Add("Accept", "application/xml");
+ return message;
+ }
+
+ /// Creates a symbolic link.
+ /// NFS only. Required. The path to the original file, the symbolic link is pointing to. The path is of type string which is not resolved and is stored as is. The path can be absolute path or the relative path depending on the content stored in the symbolic link file.
+ /// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>.
+ /// A name-value pair to associate with a file storage object.
+ /// Creation time for the file/directory. Default value: Now.
+ /// Last write time for the file/directory. Default value: Now.
+ /// Optional, NFS only. The owner of the file or directory.
+ /// Optional, NFS only. The owning group of the file or directory.
+ /// Parameter group.
+ /// The cancellation token to use.
+ /// is null.
+ public async Task> CreateSymbolicLinkAsync(string linkText, int? timeout = null, IDictionary metadata = null, string fileCreationTime = null, string fileLastWriteTime = null, string owner = null, string group = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default)
+ {
+ if (linkText == null)
+ {
+ throw new ArgumentNullException(nameof(linkText));
+ }
+
+ using var message = CreateCreateSymbolicLinkRequest(linkText, timeout, metadata, fileCreationTime, fileLastWriteTime, owner, group, shareFileRequestConditions);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ var headers = new FileCreateSymbolicLinkHeaders(message.Response);
+ switch (message.Response.Status)
+ {
+ case 201:
+ return ResponseWithHeaders.FromValue(headers, message.Response);
+ default:
+ throw new RequestFailedException(message.Response);
+ }
+ }
+
+ /// Creates a symbolic link.
+ /// NFS only. Required. The path to the original file, the symbolic link is pointing to. The path is of type string which is not resolved and is stored as is. The path can be absolute path or the relative path depending on the content stored in the symbolic link file.
+ /// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>.
+ /// A name-value pair to associate with a file storage object.
+ /// Creation time for the file/directory. Default value: Now.
+ /// Last write time for the file/directory. Default value: Now.
+ /// Optional, NFS only. The owner of the file or directory.
+ /// Optional, NFS only. The owning group of the file or directory.
+ /// Parameter group.
+ /// The cancellation token to use.
+ /// is null.
+ public ResponseWithHeaders CreateSymbolicLink(string linkText, int? timeout = null, IDictionary metadata = null, string fileCreationTime = null, string fileLastWriteTime = null, string owner = null, string group = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default)
+ {
+ if (linkText == null)
+ {
+ throw new ArgumentNullException(nameof(linkText));
+ }
+
+ using var message = CreateCreateSymbolicLinkRequest(linkText, timeout, metadata, fileCreationTime, fileLastWriteTime, owner, group, shareFileRequestConditions);
+ _pipeline.Send(message, cancellationToken);
+ var headers = new FileCreateSymbolicLinkHeaders(message.Response);
+ switch (message.Response.Status)
+ {
+ case 201:
+ return ResponseWithHeaders.FromValue(headers, message.Response);
+ default:
+ throw new RequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateGetSymbolicLinkRequest(int? timeout, string sharesnapshot)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Get;
+ var uri = new RawRequestUriBuilder();
+ uri.AppendRaw(_url, false);
+ uri.AppendQuery("restype", "symboliclink", true);
+ if (timeout != null)
+ {
+ uri.AppendQuery("timeout", timeout.Value, true);
+ }
+ if (sharesnapshot != null)
+ {
+ uri.AppendQuery("sharesnapshot", sharesnapshot, true);
+ }
+ request.Uri = uri;
+ request.Headers.Add("x-ms-version", _version);
+ if (_fileRequestIntent != null)
+ {
+ request.Headers.Add("x-ms-file-request-intent", _fileRequestIntent.Value.ToString());
+ }
+ request.Headers.Add("Accept", "application/xml");
+ return message;
+ }
+
+ /// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>.
+ /// The snapshot parameter is an opaque DateTime value that, when present, specifies the share snapshot to query.
+ /// The cancellation token to use.
+ public async Task> GetSymbolicLinkAsync(int? timeout = null, string sharesnapshot = null, CancellationToken cancellationToken = default)
+ {
+ using var message = CreateGetSymbolicLinkRequest(timeout, sharesnapshot);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ var headers = new FileGetSymbolicLinkHeaders(message.Response);
+ switch (message.Response.Status)
+ {
+ case 200:
+ return ResponseWithHeaders.FromValue(headers, message.Response);
+ default:
+ throw new RequestFailedException(message.Response);
+ }
+ }
+
+ /// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>.
+ /// The snapshot parameter is an opaque DateTime value that, when present, specifies the share snapshot to query.
+ /// The cancellation token to use.
+ public ResponseWithHeaders GetSymbolicLink(int? timeout = null, string sharesnapshot = null, CancellationToken cancellationToken = default)
+ {
+ using var message = CreateGetSymbolicLinkRequest(timeout, sharesnapshot);
+ _pipeline.Send(message, cancellationToken);
+ var headers = new FileGetSymbolicLinkHeaders(message.Response);
+ switch (message.Response.Status)
+ {
+ case 200:
+ return ResponseWithHeaders.FromValue(headers, message.Response);
+ default:
+ throw new RequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateCreateHardLinkRequest(string targetFile, int? timeout, ShareFileRequestConditions shareFileRequestConditions)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Put;
+ var uri = new RawRequestUriBuilder();
+ uri.AppendRaw(_url, false);
+ uri.AppendQuery("restype", "hardlink", true);
+ if (timeout != null)
+ {
+ uri.AppendQuery("timeout", timeout.Value, true);
+ }
+ request.Uri = uri;
+ request.Headers.Add("x-ms-version", _version);
+ request.Headers.Add("x-ms-type", "file");
+ if (shareFileRequestConditions?.LeaseId != null)
+ {
+ request.Headers.Add("x-ms-lease-id", shareFileRequestConditions.LeaseId);
+ }
+ request.Headers.Add("x-ms-file-target-file", targetFile);
+ if (_fileRequestIntent != null)
+ {
+ request.Headers.Add("x-ms-file-request-intent", _fileRequestIntent.Value.ToString());
+ }
+ request.Headers.Add("Accept", "application/xml");
+ return message;
+ }
+
+ /// Creates a hard link.
+ /// NFS only. Required. Specifies the path of the target file to which the link will be created, up to 2 KiB in length. It should be full path of the target from the root.The target file must be in the same share and hence the same storage account.
+ /// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>.
+ /// Parameter group.
+ /// The cancellation token to use.
+ /// is null.
+ public async Task> CreateHardLinkAsync(string targetFile, int? timeout = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default)
+ {
+ if (targetFile == null)
+ {
+ throw new ArgumentNullException(nameof(targetFile));
+ }
+
+ using var message = CreateCreateHardLinkRequest(targetFile, timeout, shareFileRequestConditions);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ var headers = new FileCreateHardLinkHeaders(message.Response);
+ switch (message.Response.Status)
+ {
+ case 201:
+ return ResponseWithHeaders.FromValue(headers, message.Response);
+ default:
+ throw new RequestFailedException(message.Response);
+ }
+ }
+
+ /// Creates a hard link.
+ /// NFS only. Required. Specifies the path of the target file to which the link will be created, up to 2 KiB in length. It should be full path of the target from the root.The target file must be in the same share and hence the same storage account.
+ /// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>.
+ /// Parameter group.
+ /// The cancellation token to use.
+ /// is null.
+ public ResponseWithHeaders CreateHardLink(string targetFile, int? timeout = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default)
+ {
+ if (targetFile == null)
+ {
+ throw new ArgumentNullException(nameof(targetFile));
+ }
+
+ using var message = CreateCreateHardLinkRequest(targetFile, timeout, shareFileRequestConditions);
+ _pipeline.Send(message, cancellationToken);
+ var headers = new FileCreateHardLinkHeaders(message.Response);
+ switch (message.Response.Status)
+ {
+ case 201:
+ return ResponseWithHeaders.FromValue(headers, message.Response);
+ default:
+ throw new RequestFailedException(message.Response);
+ }
+ }
}
}
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileSetHttpHeadersHeaders.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileSetHttpHeadersHeaders.cs
index ff2030851669b..cb6c9cb38d062 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileSetHttpHeadersHeaders.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileSetHttpHeadersHeaders.cs
@@ -37,5 +37,13 @@ public FileSetHttpHeadersHeaders(Response response)
public string FileId => _response.Headers.TryGetValue("x-ms-file-id", out string value) ? value : null;
/// The parent fileId of the directory.
public string FileParentId => _response.Headers.TryGetValue("x-ms-file-parent-id", out string value) ? value : null;
+ /// NFS only. The mode of the file or directory.
+ public string FileMode => _response.Headers.TryGetValue("x-ms-mode", out string value) ? value : null;
+ /// NFS only. The owner of the file or directory.
+ public string Owner => _response.Headers.TryGetValue("x-ms-owner", out string value) ? value : null;
+ /// NFS only. The owning group of the file or directory.
+ public string Group => _response.Headers.TryGetValue("x-ms-group", out string value) ? value : null;
+ /// NFS only. The link count of the file or directory.
+ public long? LinkCount => _response.Headers.TryGetValue("x-ms-link-count", out long? value) ? value : null;
}
}
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/ModeCopyMode.Serialization.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/ModeCopyMode.Serialization.cs
new file mode 100644
index 0000000000000..40e7ec8999e73
--- /dev/null
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/ModeCopyMode.Serialization.cs
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+
+namespace Azure.Storage.Files.Shares.Models
+{
+ internal static partial class ModeCopyModeExtensions
+ {
+ public static string ToSerialString(this ModeCopyMode value) => value switch
+ {
+ ModeCopyMode.Source => "source",
+ ModeCopyMode.Override => "override",
+ _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ModeCopyMode value.")
+ };
+
+ public static ModeCopyMode ToModeCopyMode(this string value)
+ {
+ if (StringComparer.OrdinalIgnoreCase.Equals(value, "source")) return ModeCopyMode.Source;
+ if (StringComparer.OrdinalIgnoreCase.Equals(value, "override")) return ModeCopyMode.Override;
+ throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ModeCopyMode value.");
+ }
+ }
+}
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/NfsFileType.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/NfsFileType.cs
new file mode 100644
index 0000000000000..efc9c74d412e6
--- /dev/null
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/NfsFileType.cs
@@ -0,0 +1,54 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.Storage.Files.Shares.Models
+{
+ /// The NfsFileType.
+ public readonly partial struct NfsFileType : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public NfsFileType(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string RegularValue = "Regular";
+ private const string DirectoryValue = "Directory";
+ private const string SymLinkValue = "SymLink";
+
+ /// Regular.
+ public static NfsFileType Regular { get; } = new NfsFileType(RegularValue);
+ /// Directory.
+ public static NfsFileType Directory { get; } = new NfsFileType(DirectoryValue);
+ /// SymLink.
+ public static NfsFileType SymLink { get; } = new NfsFileType(SymLinkValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(NfsFileType left, NfsFileType right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(NfsFileType left, NfsFileType right) => !left.Equals(right);
+ /// Converts a to a .
+ public static implicit operator NfsFileType(string value) => new NfsFileType(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is NfsFileType other && Equals(other);
+ ///
+ public bool Equals(NfsFileType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;
+ ///
+ public override string ToString() => _value;
+ }
+}
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/OwnerCopyMode.Serialization.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/OwnerCopyMode.Serialization.cs
new file mode 100644
index 0000000000000..38bc10e4d5984
--- /dev/null
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/OwnerCopyMode.Serialization.cs
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+
+namespace Azure.Storage.Files.Shares.Models
+{
+ internal static partial class OwnerCopyModeExtensions
+ {
+ public static string ToSerialString(this OwnerCopyMode value) => value switch
+ {
+ OwnerCopyMode.Source => "source",
+ OwnerCopyMode.Override => "override",
+ _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown OwnerCopyMode value.")
+ };
+
+ public static OwnerCopyMode ToOwnerCopyMode(this string value)
+ {
+ if (StringComparer.OrdinalIgnoreCase.Equals(value, "source")) return OwnerCopyMode.Source;
+ if (StringComparer.OrdinalIgnoreCase.Equals(value, "override")) return OwnerCopyMode.Override;
+ throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown OwnerCopyMode value.");
+ }
+ }
+}
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ServiceRestClient.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ServiceRestClient.cs
index fe5ea495a7a15..d3182cfe4d216 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ServiceRestClient.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ServiceRestClient.cs
@@ -31,7 +31,7 @@ internal partial class ServiceRestClient
/// The handler for diagnostic messaging in the client.
/// The HTTP pipeline for sending and receiving REST requests and responses.
/// The URL of the service account, share, directory or file that is the target of the desired operation.
- /// Specifies the version of the operation to use for this request. The default value is "2025-01-05".
+ /// Specifies the version of the operation to use for this request. The default value is "2025-05-05".
/// Valid value is backup.
/// , , or is null.
public ServiceRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string url, string version, ShareTokenIntent? fileRequestIntent = null)
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ShareRestClient.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ShareRestClient.cs
index 69bb02404dd49..7740558db7a46 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ShareRestClient.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ShareRestClient.cs
@@ -32,7 +32,7 @@ internal partial class ShareRestClient
/// The handler for diagnostic messaging in the client.
/// The HTTP pipeline for sending and receiving REST requests and responses.
/// The URL of the service account, share, directory or file that is the target of the desired operation.
- /// Specifies the version of the operation to use for this request. The default value is "2025-01-05".
+ /// Specifies the version of the operation to use for this request. The default value is "2025-05-05".
/// Valid value is backup.
/// , , or is null.
public ShareRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string url, string version, ShareTokenIntent? fileRequestIntent = null)
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/FilePosixProperties.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/FilePosixProperties.cs
new file mode 100644
index 0000000000000..84f1a02dd1cc4
--- /dev/null
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/FilePosixProperties.cs
@@ -0,0 +1,69 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+#pragma warning disable SA1402 // File may only contain a single type
+
+using System.Collections.Generic;
+using System;
+
+namespace Azure.Storage.Files.Shares.Models
+{
+ ///
+ /// NFS properties.
+ /// Note that these properties only apply to files or directories in
+ /// premium NFS file accounts.
+ ///
+ public class FilePosixProperties
+ {
+ ///
+ /// Optional. Version TBD and newer. The mode permissions to be set on the file or directory.
+ ///
+ public NfsFileMode FileMode { get; set; }
+
+ ///
+ /// Optional. The owner user identifier (UID) to be set on the file or directory. The default value is 0 (root).
+ ///
+ public string Owner { get; set; }
+
+ ///
+ /// Optional. The owner group identifier (GID) to be set on the file or directory. The default value is 0 (root group).
+ ///
+ public string Group { get; set; }
+
+ ///
+ /// Optional, only applicable to files. The type of the file. The default value is .
+ ///
+ public NfsFileType? FileType { get; internal set; }
+
+ ///
+ /// The link count of the file or directory.
+ ///
+ public long? LinkCount { get; internal set; }
+ }
+
+ ///
+ /// FilesModelFactory provides utilities for mocking.
+ ///
+ public static partial class FilesModelFactory
+ {
+ ///
+ /// Creates a new StorageFileDownloadProperties instance for mocking.
+ ///
+ public static FilePosixProperties FilePosixProperties(
+ NfsFileMode fileMode,
+ string owner,
+ string group,
+ NfsFileType fileType,
+ long? linkCount)
+ {
+ return new FilePosixProperties
+ {
+ FileMode = fileMode,
+ Owner = owner,
+ Group = group,
+ FileType = fileType,
+ LinkCount = linkCount
+ };
+ }
+ }
+}
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/FileSmbProperties.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/FileSmbProperties.cs
index 4c8569cc28e6a..4a6069bc9eaac 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/src/Models/FileSmbProperties.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/FileSmbProperties.cs
@@ -74,14 +74,34 @@ public override bool Equals(object other)
public override int GetHashCode() => base.GetHashCode();
}
- ///
- /// FilesModelFactory provides utilities for mocking.
- ///
+ ///
+ /// FilesModelFactory provides utilities for mocking.
+ ///
+ public static partial class FilesModelFactory
+ {
+ ///
+ /// Creates a new FileSmbProperties instance for mocking.
+ ///
+ public static FileSmbProperties FileSmbProperties(
+ DateTimeOffset? fileChangedOn,
+ string fileId,
+ string parentId) => new FileSmbProperties
+ {
+ FileChangedOn = fileChangedOn,
+ FileId = fileId,
+ ParentId = parentId
+ };
+ }
+
+ ///
+ /// FilesModelFactory provides utilities for mocking.
+ ///
public static partial class SharesModelFactory
{
///
/// Creates a new FileSmbProperties instance for mocking.
///
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static FileSmbProperties FileSmbProperties(
DateTimeOffset? fileChangedOn,
string fileId,
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/Internal/ModeCopyMode.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/Internal/ModeCopyMode.cs
new file mode 100644
index 0000000000000..f2f43604a7d8d
--- /dev/null
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/Internal/ModeCopyMode.cs
@@ -0,0 +1,14 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+namespace Azure.Storage.Files.Shares.Models
+{
+ /// The ModeCopyMode.
+ internal enum ModeCopyMode
+ {
+ /// source.
+ Source,
+ /// override.
+ Override
+ }
+}
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/Internal/OwnerCopyMode.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/Internal/OwnerCopyMode.cs
new file mode 100644
index 0000000000000..31b1c6c9dc8bd
--- /dev/null
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/Internal/OwnerCopyMode.cs
@@ -0,0 +1,14 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+namespace Azure.Storage.Files.Shares.Models
+{
+ /// The OwnerCopyMode.
+ internal enum OwnerCopyMode
+ {
+ /// source.
+ Source,
+ /// override.
+ Override
+ }
+}
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/NfsFileMode.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/NfsFileMode.cs
new file mode 100644
index 0000000000000..d1271a4e52acb
--- /dev/null
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/NfsFileMode.cs
@@ -0,0 +1,208 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System;
+using System.Globalization;
+using System.Text;
+
+namespace Azure.Storage.Files.Shares.Models
+{
+ ///
+ /// The mode permissions of the file or directory.
+ ///
+ public class NfsFileMode
+ {
+ ///
+ /// Permissions the owner has over the file or directory.
+ ///
+ public PosixRolePermissions Owner { get; set; }
+
+ ///
+ /// Permissions the group has over the file or directory.
+ ///
+ public PosixRolePermissions Group { get; set; }
+
+ ///
+ /// Permissions other have over the file or directory.
+ ///
+ public PosixRolePermissions Other { get; set; }
+
+ ///
+ /// Set effective user ID (setuid) on the file or directory.
+ ///
+ public bool EffectiveUserIdentity { get; set; }
+
+ ///
+ /// Set effective group ID (setgid) on the file or directory.
+ ///
+ public bool EffectiveGroupIdentity { get; set; }
+
+ ///
+ /// The sticky bit may be set on directories. The files in that
+ /// directory may only be renamed or deleted by the file's owner, the directory's owner, or the root user.
+ ///
+ public bool StickyBit { get; set; }
+
+ ///
+ /// Returns the octal represenation of this as a string.
+ ///
+ public string ToOctalFileMode()
+ {
+ // https://en.wikipedia.org/wiki/File-system_permissions#Numeric_notation
+ StringBuilder stringBuilder = new StringBuilder();
+
+ int higherOrderDigit = 0;
+
+ if (EffectiveUserIdentity)
+ {
+ higherOrderDigit |= 4;
+ }
+
+ if (EffectiveGroupIdentity)
+ {
+ higherOrderDigit |= 2;
+ }
+
+ if (StickyBit)
+ {
+ higherOrderDigit |= 1;
+ }
+
+ stringBuilder.Append(higherOrderDigit.ToString(CultureInfo.InvariantCulture));
+ stringBuilder.Append(Owner.ToOctalRolePermissions());
+ stringBuilder.Append(Group.ToOctalRolePermissions());
+ stringBuilder.Append(Other.ToOctalRolePermissions());
+ return stringBuilder.ToString();
+ }
+
+ ///
+ /// Returns a from the octal string representation.
+ ///
+ ///
+ /// A 4-digit octal string representation of a File Mode.
+ ///
+ public static NfsFileMode ParseOctalFileMode(string modeString)
+ {
+ // https://en.wikipedia.org/wiki/File-system_permissions#Numeric_notation
+ if (modeString == null)
+ {
+ return null;
+ }
+
+ if (modeString.Length != 4)
+ {
+ throw Errors.InvalidFormat(nameof(modeString));
+ }
+
+ NfsFileMode nfsFileMode = new NfsFileMode
+ {
+ Owner = RolePermissionExtensions.ParseOctalRolePermissions(modeString[1]),
+ Group = RolePermissionExtensions.ParseOctalRolePermissions(modeString[2]),
+ Other = RolePermissionExtensions.ParseOctalRolePermissions(modeString[3])
+ };
+
+ int value = (int)char.GetNumericValue(modeString[0]);
+
+ if ((value & 4) > 0)
+ {
+ nfsFileMode.EffectiveUserIdentity = true;
+ }
+
+ if ((value & 2) > 0)
+ {
+ nfsFileMode.EffectiveGroupIdentity = true;
+ }
+
+ if ((value & 1) > 0)
+ {
+ nfsFileMode.StickyBit = true;
+ }
+
+ return nfsFileMode;
+ }
+
+ ///
+ /// Returns this as a string in symbolic notation.
+ ///
+ public string ToSymbolicFileMode()
+ {
+ // https://en.wikipedia.org/wiki/File-system_permissions#Symbolic_notation
+ StringBuilder stringBuilder = new StringBuilder();
+ stringBuilder.Append(Owner.ToSymbolicRolePermissions());
+ stringBuilder.Append(Group.ToSymbolicRolePermissions());
+ stringBuilder.Append(Other.ToSymbolicRolePermissions());
+
+ if (EffectiveUserIdentity)
+ {
+ if (stringBuilder[2] == 'x')
+ {
+ stringBuilder[2] = 's';
+ }
+ else
+ {
+ stringBuilder[2] = 'S';
+ }
+ }
+
+ if (EffectiveGroupIdentity)
+ {
+ if (stringBuilder[5] == 'x')
+ {
+ stringBuilder[5] = 's';
+ }
+ else
+ {
+ stringBuilder[5] = 'S';
+ }
+ }
+
+ if (StickyBit)
+ {
+ if (stringBuilder[8] == 'x')
+ {
+ stringBuilder[8] = 't';
+ }
+ else
+ {
+ stringBuilder[8] = 'T';
+ }
+ }
+ return stringBuilder.ToString();
+ }
+ ///
+ /// Returns a from the symbolic string representation.
+ ///
+ ///
+ /// A 9-character symbolic string representation of a File Mode.
+ ///
+ public static NfsFileMode ParseSymbolicFileMode(string modeString)
+ {
+ // https://en.wikipedia.org/wiki/File-system_permissions#Symbolic_notation
+ if (modeString == null)
+ {
+ return null;
+ }
+
+ if (modeString.Length != 9)
+ {
+ throw Errors.InvalidFormat(nameof(modeString));
+ }
+
+ NfsFileMode nfsFileMode = new NfsFileMode();
+
+ nfsFileMode.Owner = RolePermissionExtensions.ParseSymbolicRolePermissions(modeString.Substring(0, 3), out bool effectiveUserIdentity);
+ nfsFileMode.EffectiveUserIdentity = effectiveUserIdentity;
+
+ nfsFileMode.Group = RolePermissionExtensions.ParseSymbolicRolePermissions(modeString.Substring(3, 3), out bool effectiveGroupIdentity);
+ nfsFileMode.EffectiveGroupIdentity = effectiveGroupIdentity;
+
+ nfsFileMode.Other = RolePermissionExtensions.ParseSymbolicRolePermissions(modeString.Substring(6, 3), out bool stickyBit);
+ nfsFileMode.StickyBit = stickyBit;
+
+ return nfsFileMode;
+ }
+
+ ///
+ public override string ToString() => ToSymbolicFileMode();
+ }
+}
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/PosixRolePermissions.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/PosixRolePermissions.cs
new file mode 100644
index 0000000000000..6f7cf6d549678
--- /dev/null
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/PosixRolePermissions.cs
@@ -0,0 +1,34 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System;
+
+namespace Azure.Storage.Files.Shares.Models
+{
+ ///
+ /// Represents file permissions for a specific role.
+ ///
+ [Flags]
+ public enum PosixRolePermissions
+ {
+ ///
+ /// No permissions.
+ ///
+ None = 0,
+
+ ///
+ /// The execute permission.
+ ///
+ Execute = 1,
+
+ ///
+ /// The write permission.
+ ///
+ Write = 2,
+
+ ///
+ /// The read permission.
+ ///
+ Read = 4,
+ }
+}
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/RolePermissionExtensions.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/RolePermissionExtensions.cs
new file mode 100644
index 0000000000000..dfb65f0af884d
--- /dev/null
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/RolePermissionExtensions.cs
@@ -0,0 +1,165 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System;
+using System.Globalization;
+using System.Text;
+
+namespace Azure.Storage.Files.Shares.Models
+{
+ ///
+ /// Extension methods for .
+ ///
+ internal static class RolePermissionExtensions
+ {
+ ///
+ /// Parses octal char to RolePermissions.
+ ///
+ public static PosixRolePermissions ParseOctalRolePermissions(char c)
+ {
+ PosixRolePermissions rolePermissions = PosixRolePermissions.None;
+
+ int value = (int)char.GetNumericValue(c);
+
+ if (value < 0 || value > 7)
+ {
+ throw Errors.MustBeBetweenInclusive(nameof(c), 0, 7, value);
+ }
+
+ if ((value & 4) > 0)
+ {
+ rolePermissions |= PosixRolePermissions.Read;
+ }
+
+ if ((value & 2) > 0)
+ {
+ rolePermissions |= PosixRolePermissions.Write;
+ }
+
+ if ((value & 1) > 0)
+ {
+ rolePermissions |= PosixRolePermissions.Execute;
+ }
+
+ return rolePermissions;
+ }
+
+ ///
+ /// Returns the octal string representation of this RolePermissions.
+ ///
+ public static string ToOctalRolePermissions(this PosixRolePermissions rolePermissions)
+ {
+ int result = 0;
+
+ if (rolePermissions.HasFlag(PosixRolePermissions.Read))
+ {
+ result |= 4;
+ }
+
+ if (rolePermissions.HasFlag(PosixRolePermissions.Write))
+ {
+ result |= 2;
+ }
+
+ if (rolePermissions.HasFlag(PosixRolePermissions.Execute))
+ {
+ result |= 1;
+ }
+
+ return result.ToString(CultureInfo.InvariantCulture);
+ }
+
+ ///
+ /// Returns the symbolic string representation of this RolePermissions.
+ ///
+ public static string ToSymbolicRolePermissions(this PosixRolePermissions rolePermissions)
+ {
+ StringBuilder stringBuilder = new StringBuilder();
+
+ if (rolePermissions.HasFlag(PosixRolePermissions.Read))
+ {
+ stringBuilder.Append("r");
+ }
+ else
+ {
+ stringBuilder.Append("-");
+ }
+
+ if (rolePermissions.HasFlag(PosixRolePermissions.Write))
+ {
+ stringBuilder.Append("w");
+ }
+ else
+ {
+ stringBuilder.Append("-");
+ }
+
+ if (rolePermissions.HasFlag(PosixRolePermissions.Execute))
+ {
+ stringBuilder.Append("x");
+ }
+ else
+ {
+ stringBuilder.Append("-");
+ }
+
+ return stringBuilder.ToString();
+ }
+
+ public static PosixRolePermissions ParseSymbolicRolePermissions(string s, out bool setSticky)
+ {
+ if (s == null)
+ {
+ throw new ArgumentNullException("s");
+ }
+ if (s.Length != 3)
+ {
+ throw new FormatException($"s must be 3 characters long");
+ }
+
+ PosixRolePermissions rolePermissions = new PosixRolePermissions();
+ setSticky = false;
+
+ // Read character
+ if (s[0] == 'r')
+ {
+ rolePermissions |= PosixRolePermissions.Read;
+ }
+ else if (s[0] != '-')
+ {
+ throw new ArgumentException($"Invalid character in symbolic role permission: {s[0]}");
+ }
+
+ // Write character
+ if (s[1] == 'w')
+ {
+ rolePermissions |= PosixRolePermissions.Write;
+ }
+ else if (s[1] != '-')
+ {
+ throw new ArgumentException($"Invalid character in symbolic role permission: {s[1]}");
+ }
+
+ // Execute character
+ if (s[2] == 'x' || s[2] == 's' || s[2] == 't')
+ {
+ rolePermissions |= PosixRolePermissions.Execute;
+ if (s[2] == 's' || s[2] == 't')
+ {
+ setSticky = true;
+ }
+ }
+ if (s[2] == 'S' || s[2] == 'T')
+ {
+ setSticky = true;
+ }
+
+ if (s[2] != 'x' && s[2] != 's' && s[2] != 'S' && s[2] != 't' && s[2] != 'T' && s[2] != '-')
+ {
+ throw new ArgumentException($"Invalid character in symbolic role permission: {s[2]}");
+ }
+
+ return rolePermissions;
+ }
+ }
+}
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareDirectoryCreateOptions.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareDirectoryCreateOptions.cs
index 929ad0adc9e3a..018e2ab435208 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareDirectoryCreateOptions.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareDirectoryCreateOptions.cs
@@ -24,5 +24,13 @@ public class ShareDirectoryCreateOptions
/// Optional file permission to set on the directory.
///
public ShareFilePermission FilePermission { get; set; }
+
+ ///
+ ///
+ /// Optional properties to set on NFS directories.
+ /// Note that this property is only applicable to directories created in NFS shares.
+ ///
+ ///
+ public FilePosixProperties PosixProperties { get; set; }
}
}
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareDirectoryInfo.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareDirectoryInfo.cs
index 1d9f258b79caf..5f9527be6fa3c 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareDirectoryInfo.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareDirectoryInfo.cs
@@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
+using System.ComponentModel;
using System.Text;
#pragma warning disable SA1402 // File may only contain a single type
@@ -30,12 +31,40 @@ public class ShareDirectoryInfo
///
public FileSmbProperties SmbProperties { get; set; }
+ ///
+ /// The directory's NFS properties.
+ /// Only applicable to files in a NFS share.
+ ///
+ public FilePosixProperties PosixProperties { get; internal set; }
+
///
/// Constructor.
///
internal ShareDirectoryInfo() { }
}
+ ///
+ /// FilesModelFactory provides utilities for mocking.
+ ///
+ public static partial class FilesModelFactory
+ {
+ ///
+ /// Creates a new StorageDirectoryInfo instance for mocking.
+ ///
+ public static ShareDirectoryInfo StorageDirectoryInfo(
+ ETag eTag = default,
+ DateTimeOffset lastModified = default,
+ FileSmbProperties smbProperties = default,
+ FilePosixProperties posixProperties = default)
+ => new ShareDirectoryInfo
+ {
+ ETag = eTag,
+ LastModified = lastModified,
+ SmbProperties = smbProperties,
+ PosixProperties = posixProperties,
+ };
+ }
+
///
/// FilesModelFactory provides utilities for mocking.
///
@@ -44,6 +73,7 @@ public static partial class SharesModelFactory
///
/// Creates a new StorageDirectoryInfo instance for mocking.
///
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static ShareDirectoryInfo StorageDirectoryInfo(
ETag eTag,
DateTimeOffset lastModified,
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareDirectoryProperties.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareDirectoryProperties.cs
index b225e512ac385..2300c581cd82d 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareDirectoryProperties.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareDirectoryProperties.cs
@@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
+using System.ComponentModel;
using System.Text;
#pragma warning disable SA1402 // File may only contain a single type
@@ -41,6 +42,12 @@ public class ShareDirectoryProperties
///
public FileSmbProperties SmbProperties { get; set; }
+ ///
+ /// NFS properties.
+ /// Note that this property is only applicable to directories created in NFS shares.
+ ///
+ public FilePosixProperties PosixProperties { get; internal set; }
+
///
/// Constructor.
///
@@ -55,6 +62,28 @@ public static partial class FilesModelFactory
///
/// Creates a new StorageDirectoryProperties instance for mocking.
///
+ public static ShareDirectoryProperties StorageDirectoryProperties(
+ IDictionary metadata = default,
+ ETag eTag = default,
+ DateTimeOffset lastModified = default,
+ bool isServerEncrypted = default,
+ FileSmbProperties smbProperties = default,
+ FilePosixProperties posixProperties = default
+ )
+ => new ShareDirectoryProperties
+ {
+ Metadata = metadata,
+ ETag = eTag,
+ LastModified = lastModified,
+ IsServerEncrypted = isServerEncrypted,
+ SmbProperties = smbProperties,
+ PosixProperties = posixProperties
+ };
+
+ ///
+ /// Creates a new StorageDirectoryProperties instance for mocking.
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static ShareDirectoryProperties StorageDirectoryProperties(
IDictionary metadata,
ETag eTag,
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareDirectorySetHttpHeadersOptions.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareDirectorySetHttpHeadersOptions.cs
index 9c07466061b1f..d45a01d3ba305 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareDirectorySetHttpHeadersOptions.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareDirectorySetHttpHeadersOptions.cs
@@ -18,5 +18,11 @@ public class ShareDirectorySetHttpHeadersOptions
/// Optional file permission to set for the directory.
///
public ShareFilePermission FilePermission { get; set; }
+
+ ///
+ /// Optional properties to set on NFS files.
+ /// Note that this property is only applicable to directories created in NFS shares.
+ ///
+ public FilePosixProperties PosixProperties { get; set; }
}
}
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileCopyOptions.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileCopyOptions.cs
index d74113002f182..c0e2e065ec3ad 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileCopyOptions.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileCopyOptions.cs
@@ -64,5 +64,10 @@ public class ShareFileCopyOptions
/// SMB properties to copy from the source file.
///
public CopyableFileSmbProperties SmbPropertiesToCopy { get; set; }
+
+ ///
+ /// Only applicable to NFS Files. NFS properties to set on the destination file.
+ ///
+ public FilePosixProperties PosixProperties { get; set; }
}
}
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileCreateOptions.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileCreateOptions.cs
index 9f3a517321834..aabd3b3cc3b46 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileCreateOptions.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileCreateOptions.cs
@@ -22,6 +22,7 @@ public class ShareFileCreateOptions
///
/// Optional SMB properties to set for the file.
+ /// Note that this property is only applicable to files created in SMB shares.
///
public FileSmbProperties SmbProperties { get; set; }
@@ -29,5 +30,11 @@ public class ShareFileCreateOptions
/// Optional file permission to set on file.
///
public ShareFilePermission FilePermission { get; set; }
+
+ ///
+ /// Optional properties to set on NFS files.
+ /// Note that this property is only applicable to files created in NFS shares.
+ ///
+ public FilePosixProperties PosixProperties { get; set; }
}
}
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileCreateSymbolicLinkOptions.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileCreateSymbolicLinkOptions.cs
new file mode 100644
index 0000000000000..7efafb00c3e1e
--- /dev/null
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileCreateSymbolicLinkOptions.cs
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System;
+using Metadata = System.Collections.Generic.IDictionary;
+
+namespace Azure.Storage.Files.Shares.Models
+{
+ ///
+ /// NFS only. Options for creating a symbolic link.
+ ///
+ /// https://github.com/Azure/azure-sdk-for-net/issues/46907
+ internal class ShareFileCreateSymbolicLinkOptions
+ {
+ ///
+ /// Optional custom metadata to set for the symbolic link.
+ ///
+ public Metadata Metadata { get; set; }
+
+ ///
+ /// The creation time of the symbolic link.
+ ///
+ public DateTimeOffset? FileCreatedOn { get; set; }
+
+ ///
+ /// The last write time of the symbolic link.
+ ///
+ public DateTimeOffset? FileLastWrittenOn { get; set; }
+
+ ///
+ /// Optional. The owner user identifier (UID) to be set on the symbolic link. The default value is 0 (root).
+ ///
+ public string Owner { get; set; }
+
+ ///
+ /// Optional. The owner group identifier (GID) to be set on the symbolic link. The default value is 0 (root group).
+ ///
+ public string Group { get; set; }
+
+ ///
+ /// Optional to add conditions
+ /// on creating the symbolic link.
+ ///
+ public ShareFileRequestConditions Conditions { get; set; }
+ }
+}
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileDownloadDetails.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileDownloadDetails.cs
index 8de847b910f64..011af2e84cf8f 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileDownloadDetails.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileDownloadDetails.cs
@@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
+using System.ComponentModel;
#pragma warning disable SA1402 // File may only contain a single type
@@ -122,10 +123,16 @@ public partial class ShareFileDownloadDetails
public ShareLeaseStatus LeaseStatus { get; internal set; }
///
- /// The SMB properties for the file
+ /// The SMB properties for the file.
///
public FileSmbProperties SmbProperties { get; set; }
+ ///
+ /// NFS properties.
+ /// Note that this property is only applicable to files created in NFS shares.
+ ///
+ public FilePosixProperties PosixProperties { get; internal set; }
+
///
/// Constructor.
///
@@ -140,6 +147,60 @@ public static partial class FilesModelFactory
///
/// Creates a new StorageFileDownloadProperties instance for mocking.
///
+ public static ShareFileDownloadDetails StorageFileDownloadProperties(
+ DateTimeOffset lastModified = default,
+ IDictionary metadata = default,
+ string contentRange = default,
+ ETag eTag = default,
+ IEnumerable contentEncoding = default,
+ string cacheControl = default,
+ string contentDisposition = default,
+ IEnumerable contentLanguage = default,
+ string acceptRanges = default,
+ DateTimeOffset copyCompletedOn = default,
+ string copyStatusDescription = default,
+ string copyId = default,
+ string copyProgress = default,
+ Uri copySource = default,
+ CopyStatus copyStatus = default,
+ byte[] fileContentHash = default,
+ bool isServiceEncrypted = default,
+ ShareLeaseDuration leaseDuration = default,
+ ShareLeaseState leaseState = default,
+ ShareLeaseStatus leaseStatus = default,
+ FileSmbProperties smbProperties = default,
+ FilePosixProperties posixProperties = default)
+ {
+ return new ShareFileDownloadDetails
+ {
+ LastModified = lastModified,
+ Metadata = metadata,
+ ContentRange = contentRange,
+ ETag = eTag,
+ ContentEncoding = contentEncoding,
+ CacheControl = cacheControl,
+ ContentDisposition = contentDisposition,
+ ContentLanguage = contentLanguage,
+ AcceptRanges = acceptRanges,
+ CopyCompletedOn = copyCompletedOn,
+ CopyStatusDescription = copyStatusDescription,
+ CopyId = copyId,
+ CopyProgress = copyProgress,
+ CopySource = copySource,
+ CopyStatus = copyStatus,
+ FileContentHash = fileContentHash,
+ IsServerEncrypted = isServiceEncrypted,
+ LeaseDuration = leaseDuration,
+ LeaseState = leaseState,
+ SmbProperties = smbProperties,
+ PosixProperties = posixProperties,
+ };
+ }
+
+ ///
+ /// Creates a new StorageFileDownloadProperties instance for mocking.
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static ShareFileDownloadDetails StorageFileDownloadProperties(
DateTimeOffset lastModified,
IDictionary metadata,
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileInfo.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileInfo.cs
index 46212582505fe..29ce3b2f834b3 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileInfo.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileInfo.cs
@@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
+using System.ComponentModel;
using System.Text;
#pragma warning disable SA1402 // File may only contain a single type
@@ -31,9 +32,16 @@ public class ShareFileInfo
///
/// The file's SMB properties.
+ /// Only applicable to files in a SMB share.
///
public FileSmbProperties SmbProperties { get; set; }
+ ///
+ /// The file's NFS properties.
+ /// Only applicable to files in a NFS share.
+ ///
+ public FilePosixProperties PosixProperties { get; internal set; }
+
///
/// Constructor.
///
@@ -48,6 +56,49 @@ public static partial class FilesModelFactory
///
/// Creates a new StorageFileInfo instance for mocking.
///
+ public static ShareFileInfo StorageFileInfo(
+ ETag eTag = default,
+ DateTimeOffset lastModified = default,
+ bool isServerEncrypted = default,
+ string filePermissionKey = default,
+ string fileAttributes = default,
+ DateTimeOffset fileCreationTime = default,
+ DateTimeOffset fileLastWriteTime = default,
+ DateTimeOffset fileChangeTime = default,
+ string fileId = default,
+ string fileParentId = default,
+ NfsFileMode nfsFileMode = default,
+ string owner = default,
+ string group = default,
+ NfsFileType nfsFileType = default)
+ => new ShareFileInfo
+ {
+ ETag = eTag,
+ LastModified = lastModified,
+ IsServerEncrypted = isServerEncrypted,
+ SmbProperties = new FileSmbProperties
+ {
+ FileAttributes = ShareModelExtensions.ToFileAttributes(fileAttributes),
+ FilePermissionKey = filePermissionKey,
+ FileCreatedOn = fileCreationTime,
+ FileLastWrittenOn = fileLastWriteTime,
+ FileChangedOn = fileChangeTime,
+ FileId = fileId,
+ ParentId = fileParentId
+ },
+ PosixProperties = new FilePosixProperties
+ {
+ FileMode = nfsFileMode,
+ Owner = owner,
+ Group = group,
+ FileType = nfsFileType,
+ }
+ };
+
+ ///
+ /// Creates a new StorageFileInfo instance for mocking.
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static ShareFileInfo StorageFileInfo(
ETag eTag,
DateTimeOffset lastModified,
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileProperties.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileProperties.cs
index 05715a8e12b6b..722a99361a8ed 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileProperties.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileProperties.cs
@@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
+using System.ComponentModel;
#pragma warning disable SA1402 // File may only contain a single type
@@ -119,6 +120,12 @@ public class ShareFileProperties
///
public ShareLeaseStatus LeaseStatus { get; internal set; }
+ ///
+ /// NFS properties.
+ /// Note that this property is only applicable to files created in NFS shares.
+ ///
+ public FilePosixProperties PosixProperties { get; internal set; }
+
///
/// Constructor.
///
@@ -133,6 +140,53 @@ public static partial class FilesModelFactory
///
/// Creates a new StorageFileProperties instance for mocking.
///
+ public static ShareFileProperties StorageFileProperties(
+ DateTimeOffset lastModified = default,
+ IDictionary metadata = default,
+ long contentLength = default,
+ string contentType = default,
+ ETag eTag = default,
+ byte[] contentHash = default,
+ IEnumerable contentEncoding = default,
+ string cacheControl = default,
+ string contentDisposition = default,
+ IEnumerable contentLanguage = default,
+ DateTimeOffset copyCompletedOn = default,
+ string copyStatusDescription = default,
+ string copyId = default,
+ string copyProgress = default,
+ string copySource = default,
+ CopyStatus copyStatus = default,
+ bool isServerEncrypted = default,
+ FileSmbProperties smbProperties = default,
+ FilePosixProperties posixProperties = default
+ ) => new ShareFileProperties
+ {
+ LastModified = lastModified,
+ Metadata = metadata,
+ ContentLength = contentLength,
+ ContentType = contentType,
+ ETag = eTag,
+ ContentHash = contentHash,
+ ContentEncoding = contentEncoding,
+ CacheControl = cacheControl,
+ ContentDisposition = contentDisposition,
+ ContentLanguage = contentLanguage,
+ CopyCompletedOn = copyCompletedOn,
+ CopyStatusDescription = copyStatusDescription,
+ CopyId = copyId,
+ CopyProgress = copyProgress,
+ CopySource = copySource,
+ CopyStatus = copyStatus,
+ IsServerEncrypted = isServerEncrypted,
+ SmbProperties = smbProperties,
+ PosixProperties = posixProperties,
+ };
+
+ ///
+ /// Creates a new StorageFileProperties instance for mocking.
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static ShareFileProperties StorageFileProperties(
DateTimeOffset lastModified,
IDictionary metadata,
@@ -194,6 +248,7 @@ string fileParentId
///
/// Creates a new StorageFileProperties instance for mocking.
///
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static ShareFileProperties StorageFileProperties(
DateTimeOffset lastModified,
IDictionary metadata,
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileSetHttpHeadersOptions.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileSetHttpHeadersOptions.cs
index 3f73e0e99e75a..6b3e95eae9c03 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileSetHttpHeadersOptions.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileSetHttpHeadersOptions.cs
@@ -31,5 +31,11 @@ public class ShareFileSetHttpHeadersOptions
/// Optional file permission to set for the file.
///
public ShareFilePermission FilePermission { get; set; }
+
+ ///
+ /// Optional properties to set on NFS files.
+ /// Note that this property is only applicable to files created in NFS shares.
+ ///
+ public FilePosixProperties PosixProperties { get; set; }
}
}
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileSymbolicLinkInfo.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileSymbolicLinkInfo.cs
new file mode 100644
index 0000000000000..990ac2ec5fce5
--- /dev/null
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileSymbolicLinkInfo.cs
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+#pragma warning disable SA1402 // File may only contain a single type
+
+using System;
+
+namespace Azure.Storage.Files.Shares.Models
+{
+ ///
+ /// Infomation about a Symbolic Link.
+ /// Only applicable to NFS files.
+ ///
+ /// https://github.com/Azure/azure-sdk-for-net/issues/46907
+ internal class ShareFileSymbolicLinkInfo
+ {
+ ///
+ /// The ETag contains a value which represents the version of the file, in quotes.
+ ///
+ public ETag ETag { get; internal set; }
+
+ ///
+ /// Returns the date and time the file was last modified.
+ ///
+ public DateTimeOffset LastModified { get; internal set; }
+
+ ///
+ /// Text of the symbolic link.
+ ///
+ public string LinkText { get; internal set; }
+ }
+
+ public static partial class SharesModelFactory
+ {
+ ///
+ /// Creates a new FileSymolicLinkInfo for mocking.
+ ///
+ /// https://github.com/Azure/azure-sdk-for-net/issues/46907
+ internal static ShareFileSymbolicLinkInfo FileSymbolicLinkInfo(
+ ETag eTag = default,
+ DateTimeOffset lastModified = default,
+ string linkText = default)
+ => new ShareFileSymbolicLinkInfo
+ {
+ ETag = eTag,
+ LastModified = lastModified,
+ LinkText = linkText
+ };
+ }
+}
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/ShareClient.cs b/sdk/storage/Azure.Storage.Files.Shares/src/ShareClient.cs
index 75d4430e5b26d..b1289a14422ef 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/src/ShareClient.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/ShareClient.cs
@@ -3710,6 +3710,7 @@ public virtual Response CreateDirectory(
smbProperties: options?.SmbProperties,
filePermission: options?.FilePermission?.Permission,
filePermissionFormat: options?.FilePermission?.PermissionFormat,
+ posixProperties: options?.PosixProperties,
async: false,
cancellationToken,
operationName: $"{nameof(ShareClient)}.{nameof(CreateDirectory)}")
@@ -3765,6 +3766,7 @@ public virtual Response CreateDirectory(
smbProperties,
filePermission,
filePermissionFormat: null,
+ posixProperties: null,
async: false,
cancellationToken,
operationName: $"{nameof(ShareClient)}.{nameof(CreateDirectory)}")
@@ -3809,6 +3811,7 @@ public virtual async Task> CreateDirectoryAsync(
smbProperties: options?.SmbProperties,
filePermission: options?.FilePermission?.Permission,
filePermissionFormat: options?.FilePermission?.PermissionFormat,
+ posixProperties: options?.PosixProperties,
async: true,
cancellationToken,
operationName: $"{nameof(ShareClient)}.{nameof(CreateDirectory)}")
@@ -3864,6 +3867,7 @@ public virtual async Task> CreateDirectoryAsync(
smbProperties,
filePermission,
filePermissionFormat: null,
+ posixProperties: null,
async: true,
cancellationToken,
operationName: $"{nameof(ShareClient)}.{nameof(CreateDirectory)}")
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/ShareClientOptions.cs b/sdk/storage/Azure.Storage.Files.Shares/src/ShareClientOptions.cs
index 30c5ab3b05155..e536e194a80d7 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/src/ShareClientOptions.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/ShareClientOptions.cs
@@ -153,7 +153,12 @@ public enum ServiceVersion
///
/// The 2025-01-05 service version.
///
- V2025_01_05 = 25
+ V2025_01_05 = 25,
+
+ ///
+ /// The 2025-05-05 service version.
+ ///
+ V2025_05_05 = 26
#pragma warning restore CA1707 // Identifiers should not contain underscores
}
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/ShareDirectoryClient.cs b/sdk/storage/Azure.Storage.Files.Shares/src/ShareDirectoryClient.cs
index 1deeef8b6c6d0..4b1d45d8a65df 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/src/ShareDirectoryClient.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/ShareDirectoryClient.cs
@@ -561,6 +561,7 @@ public virtual Response Create(
smbProperties: options?.SmbProperties,
filePermission: options?.FilePermission?.Permission,
filePermissionFormat: options?.FilePermission?.PermissionFormat,
+ posixProperties: options?.PosixProperties,
async: false, // async
cancellationToken: cancellationToken)
.EnsureCompleted();
@@ -607,6 +608,7 @@ public virtual Response Create(
smbProperties,
filePermission,
filePermissionFormat: null,
+ posixProperties: null,
false, // async
cancellationToken)
.EnsureCompleted();
@@ -642,6 +644,7 @@ await CreateInternal(
smbProperties: options?.SmbProperties,
filePermission: options?.FilePermission?.Permission,
filePermissionFormat: options?.FilePermission?.PermissionFormat,
+ posixProperties: options?.PosixProperties,
async: true,
cancellationToken: cancellationToken)
.ConfigureAwait(false);
@@ -688,6 +691,7 @@ await CreateInternal(
smbProperties,
filePermission,
filePermissionFormat: null,
+ posixProperties: null,
true, // async
cancellationToken)
.ConfigureAwait(false);
@@ -712,6 +716,9 @@ await CreateInternal(
///
/// Optional file permission format.
///
+ ///
+ /// Optional NFS properties.
+ ///
///
/// Whether to invoke the operation asynchronously.
///
@@ -735,6 +742,7 @@ internal async Task> CreateInternal(
FileSmbProperties smbProperties,
string filePermission,
FilePermissionFormat? filePermissionFormat,
+ FilePosixProperties posixProperties,
bool async,
CancellationToken cancellationToken,
string operationName = default)
@@ -754,38 +762,40 @@ internal async Task> CreateInternal(
FileSmbProperties smbProps = smbProperties ?? new FileSmbProperties();
ShareExtensions.AssertValidFilePermissionAndKey(filePermission, smbProps.FilePermissionKey);
- if (filePermission == null && smbProps.FilePermissionKey == null)
- {
- filePermission = Constants.File.FilePermissionInherit;
- }
ResponseWithHeaders response;
if (async)
{
response = await DirectoryRestClient.CreateAsync(
- fileAttributes: smbProps.FileAttributes?.ToAttributesString() ?? Constants.File.FileAttributesNone,
- fileCreationTime: smbProps.FileCreatedOn.ToFileDateTimeString() ?? Constants.File.FileTimeNow,
- fileLastWriteTime: smbProps.FileLastWrittenOn.ToFileDateTimeString() ?? Constants.File.FileTimeNow,
+ fileAttributes: smbProps?.FileAttributes.ToAttributesString(),
+ fileCreationTime: smbProps?.FileCreatedOn.ToFileDateTimeString(),
+ fileLastWriteTime: smbProps?.FileLastWrittenOn.ToFileDateTimeString(),
metadata: metadata,
filePermission: filePermission,
filePermissionFormat: filePermissionFormat,
- filePermissionKey: smbProps.FilePermissionKey,
- fileChangeTime: smbProps.FileChangedOn.ToFileDateTimeString(),
+ filePermissionKey: smbProps?.FilePermissionKey,
+ fileChangeTime: smbProps?.FileChangedOn.ToFileDateTimeString(),
+ owner: posixProperties?.Owner,
+ group: posixProperties?.Group,
+ fileMode: posixProperties?.FileMode.ToOctalFileMode(),
cancellationToken: cancellationToken)
.ConfigureAwait(false);
}
else
{
response = DirectoryRestClient.Create(
- fileAttributes: smbProps.FileAttributes?.ToAttributesString() ?? Constants.File.FileAttributesNone,
- fileCreationTime: smbProps.FileCreatedOn.ToFileDateTimeString() ?? Constants.File.FileTimeNow,
- fileLastWriteTime: smbProps.FileLastWrittenOn.ToFileDateTimeString() ?? Constants.File.FileTimeNow,
+ fileAttributes: smbProps?.FileAttributes.ToAttributesString(),
+ fileCreationTime: smbProps?.FileCreatedOn.ToFileDateTimeString(),
+ fileLastWriteTime: smbProps?.FileLastWrittenOn.ToFileDateTimeString(),
metadata: metadata,
filePermission: filePermission,
filePermissionFormat: filePermissionFormat,
- filePermissionKey: smbProps.FilePermissionKey,
- fileChangeTime: smbProps.FileChangedOn.ToFileDateTimeString(),
+ filePermissionKey: smbProps?.FilePermissionKey,
+ fileChangeTime: smbProps?.FileChangedOn.ToFileDateTimeString(),
+ owner: posixProperties?.Owner,
+ group: posixProperties?.Group,
+ fileMode: posixProperties?.FileMode.ToOctalFileMode(),
cancellationToken: cancellationToken);
}
@@ -841,6 +851,7 @@ public virtual Response CreateIfNotExists(
smbProperties: options?.SmbProperties,
filePermission: options?.FilePermission?.Permission,
filePermissionFormat: options?.FilePermission?.PermissionFormat,
+ posixProperties: options?.PosixProperties,
async: false,
cancellationToken).EnsureCompleted();
@@ -887,6 +898,7 @@ public virtual Response CreateIfNotExists(
smbProperties,
filePermission,
filePermissionFormat: null,
+ posixProperties: null,
async: false,
cancellationToken).EnsureCompleted();
@@ -922,6 +934,7 @@ await CreateIfNotExistsInternal(
smbProperties: options?.SmbProperties,
filePermission: options?.FilePermission?.Permission,
filePermissionFormat: options?.FilePermission?.PermissionFormat,
+ posixProperties: options?.PosixProperties,
async: true,
cancellationToken: cancellationToken).ConfigureAwait(false);
@@ -968,6 +981,7 @@ await CreateIfNotExistsInternal(
smbProperties,
filePermission,
filePermissionFormat: null,
+ posixProperties: null,
async: true,
cancellationToken).ConfigureAwait(false);
@@ -992,6 +1006,9 @@ await CreateIfNotExistsInternal(
///
/// Optional file permission format.
///
+ ///
+ /// Optional NFS properties.
+ ///
///
/// Whether to invoke the operation asynchronously.
///
@@ -1015,6 +1032,7 @@ internal async Task> CreateIfNotExistsInternal(
FileSmbProperties smbProperties,
string filePermission,
FilePermissionFormat? filePermissionFormat,
+ FilePosixProperties posixProperties,
bool async,
CancellationToken cancellationToken,
string operationName = default)
@@ -1031,6 +1049,7 @@ internal async Task> CreateIfNotExistsInternal(
smbProperties,
filePermission,
filePermissionFormat,
+ posixProperties,
async,
cancellationToken,
operationName: operationName ?? $"{nameof(ShareDirectoryClient)}.{nameof(CreateIfNotExists)}")
@@ -1566,6 +1585,7 @@ public virtual Response SetHttpHeaders(
options?.SmbProperties,
options?.FilePermission?.Permission,
options?.FilePermission?.PermissionFormat,
+ options?.PosixProperties,
false, // async
cancellationToken)
.EnsureCompleted();
@@ -1598,6 +1618,7 @@ await SetHttpHeadersInternal(
options?.SmbProperties,
options?.FilePermission?.Permission,
options?.FilePermission?.PermissionFormat,
+ options?.PosixProperties,
true, // async
cancellationToken)
.ConfigureAwait(false);
@@ -1639,6 +1660,7 @@ public virtual Response SetHttpHeaders(
smbProperties,
filePermission,
filePermissionFormat: default,
+ posixProperties: default,
false, // async
cancellationToken)
.EnsureCompleted();
@@ -1678,6 +1700,7 @@ await SetHttpHeadersInternal(
smbProperties,
filePermission,
filePermissionFormat: default,
+ posixProperties: default,
true, // async
cancellationToken)
.ConfigureAwait(false);
@@ -1699,6 +1722,9 @@ await SetHttpHeadersInternal(
///
/// Optional file permission format.
///
+ ///
+ /// Optional NFS properties.
+ ///
///
/// Whether to invoke the operation asynchronously.
///
@@ -1718,6 +1744,7 @@ private async Task> SetHttpHeadersInternal(
FileSmbProperties smbProperties,
string filePermission,
FilePermissionFormat? filePermissionFormat,
+ FilePosixProperties posixProperties,
bool async,
CancellationToken cancellationToken)
{
@@ -1736,36 +1763,38 @@ private async Task> SetHttpHeadersInternal(
FileSmbProperties smbProps = smbProperties ?? new FileSmbProperties();
ShareExtensions.AssertValidFilePermissionAndKey(filePermission, smbProps.FilePermissionKey);
- if (filePermission == null && smbProps.FilePermissionKey == null)
- {
- filePermission = Constants.File.Preserve;
- }
ResponseWithHeaders response;
if (async)
{
response = await DirectoryRestClient.SetPropertiesAsync(
- fileAttributes: smbProps.FileAttributes?.ToAttributesString() ?? Constants.File.Preserve,
- fileCreationTime: smbProps.FileCreatedOn.ToFileDateTimeString() ?? Constants.File.Preserve,
- fileLastWriteTime: smbProps.FileLastWrittenOn.ToFileDateTimeString() ?? Constants.File.Preserve,
+ fileAttributes: smbProps?.FileAttributes.ToAttributesString(),
+ fileCreationTime: smbProps.FileCreatedOn.ToFileDateTimeString(),
+ fileLastWriteTime: smbProps.FileLastWrittenOn.ToFileDateTimeString(),
filePermission: filePermission,
filePermissionFormat: filePermissionFormat,
filePermissionKey: smbProps.FilePermissionKey,
fileChangeTime: smbProps.FileChangedOn.ToFileDateTimeString(),
+ owner: posixProperties?.Owner,
+ group: posixProperties?.Group,
+ fileMode: posixProperties?.FileMode.ToOctalFileMode(),
cancellationToken: cancellationToken)
.ConfigureAwait(false);
}
else
{
response = DirectoryRestClient.SetProperties(
- fileAttributes: smbProps.FileAttributes?.ToAttributesString() ?? Constants.File.Preserve,
- fileCreationTime: smbProps.FileCreatedOn.ToFileDateTimeString() ?? Constants.File.Preserve,
- fileLastWriteTime: smbProps.FileLastWrittenOn.ToFileDateTimeString() ?? Constants.File.Preserve,
+ fileAttributes: smbProps?.FileAttributes.ToAttributesString(),
+ fileCreationTime: smbProps.FileCreatedOn.ToFileDateTimeString(),
+ fileLastWriteTime: smbProps.FileLastWrittenOn.ToFileDateTimeString(),
filePermission: filePermission,
filePermissionFormat: filePermissionFormat,
filePermissionKey: smbProps.FilePermissionKey,
fileChangeTime: smbProps.FileChangedOn.ToFileDateTimeString(),
+ owner: posixProperties?.Owner,
+ group: posixProperties?.Group,
+ fileMode: posixProperties?.FileMode.ToOctalFileMode(),
cancellationToken: cancellationToken);
}
@@ -2863,7 +2892,7 @@ private async Task> RenameInternal(
CopyFileSmbInfo copyFileSmbInfo = new CopyFileSmbInfo
{
- FileAttributes = options?.SmbProperties?.FileAttributes?.ToAttributesString(),
+ FileAttributes = options?.SmbProperties?.FileAttributes.ToAttributesString(),
FileCreationTime = options?.SmbProperties?.FileCreatedOn.ToFileDateTimeString(),
FileLastWriteTime = options?.SmbProperties?.FileLastWrittenOn.ToFileDateTimeString(),
FileChangeTime = options?.SmbProperties?.FileChangedOn.ToFileDateTimeString(),
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/ShareExtensions.cs b/sdk/storage/Azure.Storage.Files.Shares/src/ShareExtensions.cs
index 4d7a0950ab0d6..d616f072cf67f 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/src/ShareExtensions.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/ShareExtensions.cs
@@ -6,7 +6,9 @@
using System.Globalization;
using System.IO;
using System.Linq;
+using System.Runtime.CompilerServices;
using System.Text;
+using System.Text.RegularExpressions;
using Azure.Core;
using Azure.Storage.Files.Shares.Models;
@@ -16,14 +18,14 @@ internal static partial class ShareExtensions
{
internal static void AssertValidFilePermissionAndKey(string filePermission, string filePermissionKey)
{
- if (filePermission != null && filePermissionKey != null)
+ if (filePermission != null && Encoding.UTF8.GetByteCount(filePermission) > Constants.File.MaxFilePermissionHeaderSize)
{
- throw Errors.CannotBothBeNotNull(nameof(filePermission), nameof(filePermissionKey));
+ throw Errors.MustBeLessThanOrEqualTo(nameof(filePermission), Constants.File.MaxFilePermissionHeaderSize);
}
- if (filePermission != null && Encoding.UTF8.GetByteCount(filePermission) > Constants.File.MaxFilePermissionHeaderSize)
+ if (filePermission != null && filePermissionKey != null)
{
- throw Errors.MustBeLessThanOrEqualTo(nameof(filePermission), Constants.File.MaxFilePermissionHeaderSize);
+ throw new ArgumentException("filePermission and filePermissionKey cannot both be set");
}
}
@@ -113,6 +115,13 @@ internal static ShareDirectoryInfo ToShareDirectoryInfo(this ResponseWithHeaders
FileChangedOn = response.Headers.FileChangeTime,
FileId = response.Headers.FileId,
ParentId = response.Headers.FileParentId
+ },
+ PosixProperties = new FilePosixProperties
+ {
+ FileMode = NfsFileMode.ParseOctalFileMode(response.Headers.FileMode),
+ Owner = response.Headers.Owner,
+ Group = response.Headers.Group,
+ FileType = response.Headers.NfsFileType,
}
};
}
@@ -138,6 +147,13 @@ internal static ShareDirectoryProperties ToShareDirectoryProperties(this Respons
FileChangedOn = response.Headers.FileChangeTime,
FileId = response.Headers.FileId,
ParentId = response.Headers.FileParentId
+ },
+ PosixProperties = new FilePosixProperties()
+ {
+ FileMode = NfsFileMode.ParseOctalFileMode(response.Headers.FileMode),
+ Owner = response.Headers.Owner,
+ Group = response.Headers.Group,
+ FileType = response.Headers.NfsFileType,
}
};
}
@@ -161,6 +177,12 @@ internal static ShareDirectoryInfo ToShareDirectoryInfo(this ResponseWithHeaders
FileChangedOn = response.Headers.FileChangeTime,
FileId = response.Headers.FileId,
ParentId = response.Headers.FileParentId
+ },
+ PosixProperties = new FilePosixProperties
+ {
+ FileMode = NfsFileMode.ParseOctalFileMode(response.Headers.FileMode),
+ Owner = response.Headers.Owner,
+ Group = response.Headers.Group
}
};
}
@@ -279,7 +301,7 @@ internal static ShareFileInfo ToShareFileInfo(this ResponseWithHeaders response)
@@ -347,7 +378,15 @@ internal static ShareFileProperties ToShareFileProperties(this ResponseWithHeade
},
LeaseDuration = response.Headers.LeaseDuration.GetValueOrDefault(),
LeaseState = response.Headers.LeaseState.GetValueOrDefault(),
- LeaseStatus = response.Headers.LeaseStatus.GetValueOrDefault()
+ LeaseStatus = response.Headers.LeaseStatus.GetValueOrDefault(),
+ PosixProperties = new FilePosixProperties()
+ {
+ FileMode = NfsFileMode.ParseOctalFileMode(response.Headers.FileMode),
+ Owner = response.Headers.Owner,
+ Group = response.Headers.Group,
+ FileType = response.Headers.NfsFileType,
+ LinkCount = response.Headers.LinkCount
+ }
};
if (response.Headers.ContentEncoding != null)
@@ -383,6 +422,13 @@ internal static ShareFileInfo ToShareFileInfo(this ResponseWithHeaders ToShareFilePermission(this Respons
},
response.GetRawResponse());
}
+
+ internal static ShareFileSymbolicLinkInfo ToFileSymbolicLinkInfo(this ResponseWithHeaders response)
+ {
+ if (response == null)
+ {
+ return null;
+ }
+
+ return new ShareFileSymbolicLinkInfo
+ {
+ ETag = response.GetRawResponse().Headers.TryGetValue(Constants.HeaderNames.ETag, out string value) ? new ETag(value) : default,
+ LastModified = response.Headers.LastModified.GetValueOrDefault(),
+ LinkText = response.Headers.LinkText
+ };
+ }
+
+ internal static ShareFileInfo ToShareFileInfo(this ResponseWithHeaders response)
+ {
+ if (response == null)
+ {
+ return null;
+ }
+ return new ShareFileInfo
+ {
+ ETag = response.GetRawResponse().Headers.TryGetValue(Constants.HeaderNames.ETag, out string value) ? new ETag(value) : default,
+ LastModified = response.Headers.LastModified.GetValueOrDefault(),
+ SmbProperties = new FileSmbProperties
+ {
+ FileCreatedOn = response.Headers.FileCreationTime,
+ FileLastWrittenOn = response.Headers.FileLastWriteTime,
+ FileChangedOn = response.Headers.FileChangeTime,
+ FileId = response.Headers.FileId,
+ ParentId = response.Headers.FileParentId
+ },
+ PosixProperties = new FilePosixProperties()
+ {
+ FileType = response.Headers.NfsFileType,
+ FileMode = NfsFileMode.ParseOctalFileMode(response.Headers.FileMode),
+ Owner = response.Headers.Owner,
+ Group = response.Headers.Group
+ }
+ };
+ }
+
+ internal static ShareFileInfo ToShareFileInfo(this ResponseWithHeaders response)
+ {
+ if (response == null)
+ {
+ return null;
+ }
+ return new ShareFileInfo
+ {
+ ETag = response.GetRawResponse().Headers.TryGetValue(Constants.HeaderNames.ETag, out string value) ? new ETag(value) : default,
+ LastModified = response.Headers.LastModified.GetValueOrDefault(),
+ SmbProperties = new FileSmbProperties
+ {
+ FileCreatedOn = response.Headers.FileCreationTime,
+ FileLastWrittenOn = response.Headers.FileLastWriteTime,
+ FileChangedOn = response.Headers.FileChangeTime,
+ FileId = response.Headers.FileId,
+ ParentId = response.Headers.FileParentId
+ },
+ PosixProperties = new FilePosixProperties()
+ {
+ FileMode = NfsFileMode.ParseOctalFileMode(response.Headers.FileMode),
+ Owner = response.Headers.Owner,
+ Group = response.Headers.Group,
+ LinkCount = response.Headers.LinkCount,
+ FileType = response.Headers.NfsFileType
+ }
+ };
+ }
}
}
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/ShareFileClient.cs b/sdk/storage/Azure.Storage.Files.Shares/src/ShareFileClient.cs
index f713200a524de..f5d31a02c1681 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/src/ShareFileClient.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/ShareFileClient.cs
@@ -15,6 +15,7 @@
using Azure.Storage.Sas;
using Metadata = System.Collections.Generic.IDictionary;
using Azure.Storage.Common;
+using System.Net.Http.Headers;
#pragma warning disable SA1402 // File may only contain a single type
@@ -129,7 +130,7 @@ public virtual string Path
///
public virtual bool CanGenerateSasUri => ClientConfiguration.SharedKeyCredential != null;
- //const string fileType = "file";
+ //const string filetype = "file";
//// FileMaxUploadRangeBytes indicates the maximum number of bytes that can be sent in a call to UploadRange.
//public const Int64 FileMaxUploadRangeBytes = 4 * Constants.MB; // 4MB
@@ -578,6 +579,7 @@ public virtual Response Create(
smbProperties: options?.SmbProperties,
filePermission: options?.FilePermission?.Permission,
filePermissionFormat: options?.FilePermission?.PermissionFormat,
+ posixProperties: options?.PosixProperties,
conditions,
async: false,
cancellationToken)
@@ -628,6 +630,7 @@ await CreateInternal(
smbProperties: options?.SmbProperties,
filePermission: options?.FilePermission?.Permission,
filePermissionFormat: options?.FilePermission?.PermissionFormat,
+ posixProperties: options?.PosixProperties,
conditions,
async: true,
cancellationToken)
@@ -693,6 +696,7 @@ public virtual Response Create(
smbProperties,
filePermission,
filePermissionFormat: default,
+ posixProperties: default,
conditions,
async: false,
cancellationToken)
@@ -753,6 +757,7 @@ public virtual Response Create(
smbProperties,
filePermission,
filePermissionFormat: default,
+ posixProperties: default,
conditions: default,
async: false,
cancellationToken)
@@ -818,6 +823,7 @@ await CreateInternal(
smbProperties,
filePermission,
filePermissionFormat: default,
+ posixProperties: default,
conditions,
async: true,
cancellationToken)
@@ -878,6 +884,7 @@ await CreateInternal(
smbProperties,
filePermission,
filePermissionFormat: default,
+ posixProperties: default,
conditions: default,
async: true,
cancellationToken)
@@ -912,6 +919,9 @@ await CreateInternal(
///
/// Optional file permission format.
///
+ ///
+ /// Optional NFS properties.
+ ///
///
/// Optional to add conditions
/// on creating the file.
@@ -941,6 +951,7 @@ private async Task> CreateInternal(
FileSmbProperties smbProperties,
string filePermission,
FilePermissionFormat? filePermissionFormat,
+ FilePosixProperties posixProperties,
ShareFileRequestConditions conditions,
bool async,
CancellationToken cancellationToken,
@@ -965,21 +976,20 @@ private async Task> CreateInternal(
ShareExtensions.AssertValidFilePermissionAndKey(filePermission, smbProps.FilePermissionKey);
- if (filePermission == null && smbProps.FilePermissionKey == null)
- {
- filePermission = Constants.File.FilePermissionInherit;
- }
-
ResponseWithHeaders response;
if (async)
{
response = await FileRestClient.CreateAsync(
fileContentLength: maxSize,
- fileAttributes: smbProps.FileAttributes?.ToAttributesString() ?? Constants.File.FileAttributesNone,
- fileCreationTime: smbProps.FileCreatedOn.ToFileDateTimeString() ?? Constants.File.FileTimeNow,
- fileLastWriteTime: smbProps.FileLastWrittenOn.ToFileDateTimeString() ?? Constants.File.FileTimeNow,
+ fileAttributes: smbProps.FileAttributes.ToAttributesString(),
+ fileCreationTime: smbProps.FileCreatedOn.ToFileDateTimeString(),
+ fileLastWriteTime: smbProps.FileLastWrittenOn.ToFileDateTimeString(),
fileChangeTime: smbProps.FileChangedOn.ToFileDateTimeString(),
+ owner: posixProperties?.Owner,
+ group: posixProperties?.Group,
+ fileMode: posixProperties?.FileMode.ToOctalFileMode(),
+ nfsFileType: posixProperties?.FileType,
metadata: metadata,
filePermission: filePermission,
filePermissionFormat: filePermissionFormat,
@@ -993,10 +1003,14 @@ private async Task> CreateInternal(
{
response = FileRestClient.Create(
fileContentLength: maxSize,
- fileAttributes: smbProps.FileAttributes?.ToAttributesString() ?? Constants.File.FileAttributesNone,
- fileCreationTime: smbProps.FileCreatedOn.ToFileDateTimeString() ?? Constants.File.FileTimeNow,
- fileLastWriteTime: smbProps.FileLastWrittenOn.ToFileDateTimeString() ?? Constants.File.FileTimeNow,
+ fileAttributes: smbProps.FileAttributes.ToAttributesString(),
+ fileCreationTime: smbProps.FileCreatedOn.ToFileDateTimeString(),
+ fileLastWriteTime: smbProps.FileLastWrittenOn.ToFileDateTimeString(),
fileChangeTime: smbProps.FileChangedOn.ToFileDateTimeString(),
+ owner: posixProperties?.Owner,
+ group: posixProperties?.Group,
+ fileMode: posixProperties?.FileMode.ToOctalFileMode(),
+ nfsFileType: posixProperties?.FileType,
metadata: metadata,
filePermission: filePermission,
filePermissionFormat: filePermissionFormat,
@@ -1308,6 +1322,7 @@ public virtual Response StartCopy(
setArchiveAttribute: options?.Archive,
conditions: options?.Conditions,
copyableFileSmbProperties: options?.SmbPropertiesToCopy,
+ posixProperties: options?.PosixProperties,
async: false,
cancellationToken: cancellationToken)
.EnsureCompleted();
@@ -1385,6 +1400,7 @@ public virtual Response StartCopy(
setArchiveAttribute,
conditions,
copyableFileSmbProperties: default,
+ posixProperties: default,
async: false,
cancellationToken)
.EnsureCompleted();
@@ -1432,6 +1448,7 @@ public virtual Response StartCopy(
setArchiveAttribute: default,
conditions: default,
copyableFileSmbProperties: default,
+ posixProperties: default,
async: false,
cancellationToken)
.EnsureCompleted();
@@ -1476,6 +1493,7 @@ await StartCopyInternal(
setArchiveAttribute: options?.Archive,
conditions: options?.Conditions,
copyableFileSmbProperties: options?.SmbPropertiesToCopy,
+ posixProperties: options?.PosixProperties,
async: true,
cancellationToken: cancellationToken).
ConfigureAwait(false);
@@ -1553,6 +1571,7 @@ await StartCopyInternal(
setArchiveAttribute,
conditions,
copyableFileSmbProperties: default,
+ posixProperties: default,
async: true,
cancellationToken).
ConfigureAwait(false);
@@ -1600,6 +1619,7 @@ await StartCopyInternal(
setArchiveAttribute: default,
conditions: default,
copyableFileSmbProperties: default,
+ posixProperties: default,
async: true,
cancellationToken).
ConfigureAwait(false);
@@ -1647,6 +1667,9 @@ await StartCopyInternal(
///
/// SMB properties to copy from the source file.
///
+ ///
+ /// NFS files only. NFS properties to set on the destination file.
+ ///
///
/// Whether to invoke the operation asynchronously.
///
@@ -1673,6 +1696,7 @@ private async Task> StartCopyInternal(
bool? setArchiveAttribute,
ShareFileRequestConditions conditions,
CopyableFileSmbProperties? copyableFileSmbProperties,
+ FilePosixProperties posixProperties,
bool async,
CancellationToken cancellationToken)
{
@@ -1723,7 +1747,7 @@ private async Task> StartCopyInternal(
}
else
{
- fileAttributes = smbProperties?.FileAttributes?.ToAttributesString();
+ fileAttributes = smbProperties?.FileAttributes.ToAttributesString();
}
string fileCreatedOn = null;
@@ -1772,6 +1796,18 @@ private async Task> StartCopyInternal(
ShareUriBuilder uriBuilder = new ShareUriBuilder(sourceUri);
+ ModeCopyMode? modeCopyMode = null;
+ if (posixProperties?.FileMode != null)
+ {
+ modeCopyMode = ModeCopyMode.Override;
+ }
+
+ OwnerCopyMode? ownerCopyMode = null;
+ if (posixProperties?.Owner != null || posixProperties?.Group != null)
+ {
+ ownerCopyMode = OwnerCopyMode.Override;
+ }
+
if (async)
{
response = await FileRestClient.StartCopyAsync(
@@ -1780,6 +1816,11 @@ private async Task> StartCopyInternal(
filePermission: filePermission,
filePermissionFormat: filePermissionFormat,
filePermissionKey: smbProperties?.FilePermissionKey,
+ owner: posixProperties?.Owner,
+ group: posixProperties?.Group,
+ fileMode: posixProperties?.FileMode?.ToOctalFileMode(),
+ fileModeCopyMode: modeCopyMode,
+ fileOwnerCopyMode: ownerCopyMode,
copyFileSmbInfo: copyFileSmbInfo,
shareFileRequestConditions: conditions,
cancellationToken: cancellationToken)
@@ -1793,6 +1834,11 @@ private async Task> StartCopyInternal(
filePermission: filePermission,
filePermissionFormat: filePermissionFormat,
filePermissionKey: smbProperties?.FilePermissionKey,
+ owner: posixProperties?.Owner,
+ group: posixProperties?.Group,
+ fileMode: posixProperties?.FileMode?.ToOctalFileMode(),
+ fileModeCopyMode: modeCopyMode,
+ fileOwnerCopyMode: ownerCopyMode,
copyFileSmbInfo: copyFileSmbInfo,
shareFileRequestConditions: conditions,
cancellationToken: cancellationToken);
@@ -3395,6 +3441,7 @@ public virtual Response SetHttpHeaders(
options?.SmbProperties,
options?.FilePermission?.Permission,
options?.FilePermission?.PermissionFormat,
+ options?.PosixProperties,
conditions,
async: false,
cancellationToken)
@@ -3437,6 +3484,7 @@ await SetHttpHeadersInternal(
options?.SmbProperties,
options?.FilePermission?.Permission,
options?.FilePermission?.PermissionFormat,
+ options?.PosixProperties,
conditions,
async: true,
cancellationToken)
@@ -3497,6 +3545,7 @@ public virtual Response SetHttpHeaders(
smbProperties,
filePermission,
filePermissionFormat: default,
+ posixProperties: default,
conditions,
async: false,
cancellationToken)
@@ -3553,6 +3602,7 @@ public virtual Response SetHttpHeaders(
smbProperties,
filePermission,
filePermissionFormat: default,
+ posixProperties: default,
conditions: default,
async: false,
cancellationToken)
@@ -3613,6 +3663,7 @@ await SetHttpHeadersInternal(
smbProperties,
filePermission,
filePermissionFormat: default,
+ posixProperties: default,
conditions,
async: true,
cancellationToken)
@@ -3668,6 +3719,7 @@ await SetHttpHeadersInternal(
smbProperties,
filePermission,
filePermissionFormat: default,
+ posixProperties: default,
conditions: default,
async: true,
cancellationToken)
@@ -3699,6 +3751,9 @@ await SetHttpHeadersInternal(
///
/// Optional file permission format.
///
+ ///
+ /// Optional NFS properties.
+ ///
///
/// Optional to add conditions
/// on creating the file.
@@ -3724,6 +3779,7 @@ private async Task> SetHttpHeadersInternal(
FileSmbProperties smbProperties,
string filePermission,
FilePermissionFormat? filePermissionFormat,
+ FilePosixProperties posixProperties,
ShareFileRequestConditions conditions,
bool async,
CancellationToken cancellationToken)
@@ -3745,24 +3801,23 @@ private async Task> SetHttpHeadersInternal(
FileSmbProperties smbProps = smbProperties ?? new FileSmbProperties();
ShareExtensions.AssertValidFilePermissionAndKey(filePermission, smbProps.FilePermissionKey);
- if (filePermission == null && smbProps.FilePermissionKey == null)
- {
- filePermission = Constants.File.Preserve;
- }
ResponseWithHeaders response;
if (async)
{
response = await FileRestClient.SetHttpHeadersAsync(
- fileAttributes: smbProps.FileAttributes?.ToAttributesString() ?? Constants.File.Preserve,
- fileCreationTime: smbProps.FileCreatedOn.ToFileDateTimeString() ?? Constants.File.Preserve,
- fileLastWriteTime: smbProps.FileLastWrittenOn.ToFileDateTimeString() ?? Constants.File.Preserve,
+ fileAttributes: smbProps.FileAttributes.ToAttributesString(),
+ fileCreationTime: smbProps.FileCreatedOn.ToFileDateTimeString(),
+ fileLastWriteTime: smbProps.FileLastWrittenOn.ToFileDateTimeString(),
fileContentLength: newSize,
filePermission: filePermission,
filePermissionFormat: filePermissionFormat,
filePermissionKey: smbProps.FilePermissionKey,
fileChangeTime: smbProps.FileChangedOn.ToFileDateTimeString(),
+ owner: posixProperties?.Owner,
+ group: posixProperties?.Group,
+ fileMode: posixProperties?.FileMode.ToOctalFileMode(),
fileHttpHeaders: httpHeaders.ToFileHttpHeaders(),
shareFileRequestConditions: conditions,
cancellationToken: cancellationToken)
@@ -3771,14 +3826,17 @@ private async Task> SetHttpHeadersInternal(
else
{
response = FileRestClient.SetHttpHeaders(
- fileAttributes: smbProps.FileAttributes?.ToAttributesString() ?? Constants.File.Preserve,
- fileCreationTime: smbProps.FileCreatedOn.ToFileDateTimeString() ?? Constants.File.Preserve,
- fileLastWriteTime: smbProps.FileLastWrittenOn.ToFileDateTimeString() ?? Constants.File.Preserve,
+ fileAttributes: smbProps.FileAttributes.ToAttributesString(),
+ fileCreationTime: smbProps.FileCreatedOn.ToFileDateTimeString(),
+ fileLastWriteTime: smbProps.FileLastWrittenOn.ToFileDateTimeString(),
fileContentLength: newSize,
filePermission: filePermission,
filePermissionFormat: filePermissionFormat,
filePermissionKey: smbProps.FilePermissionKey,
fileChangeTime: smbProps.FileChangedOn.ToFileDateTimeString(),
+ owner: posixProperties?.Owner,
+ group: posixProperties?.Group,
+ fileMode: posixProperties?.FileMode.ToOctalFileMode(),
fileHttpHeaders: httpHeaders.ToFileHttpHeaders(),
shareFileRequestConditions: conditions,
cancellationToken: cancellationToken);
@@ -6595,7 +6653,7 @@ private async Task> RenameInternal(
CopyFileSmbInfo copyFileSmbInfo = new CopyFileSmbInfo
{
- FileAttributes = options?.SmbProperties?.FileAttributes?.ToAttributesString(),
+ FileAttributes = options?.SmbProperties?.FileAttributes.ToAttributesString(),
FileCreationTime = options?.SmbProperties?.FileCreatedOn.ToFileDateTimeString(),
FileChangeTime = options?.SmbProperties?.FileChangedOn.ToFileDateTimeString(),
FileLastWriteTime = options?.SmbProperties?.FileLastWrittenOn.ToFileDateTimeString(),
@@ -6660,6 +6718,426 @@ private async Task> RenameInternal(
}
#endregion Rename
+ #region GetSymbolicLink
+ ///
+ /// Reads the value of the symbolic link.
+ /// Only applicable if this is pointed at an NFS symbolic link.
+ ///
+ ///
+ /// Optional to propagate
+ /// notifications that the operation should be cancelled.
+ ///
+ ///
+ /// A describing the symbolic link.
+ ///
+ ///
+ /// A will be thrown if
+ /// a failure occurs.
+ ///
+ /// https://github.com/Azure/azure-sdk-for-net/issues/46907
+ internal virtual Response GetSymbolicLink(
+ CancellationToken cancellationToken = default) =>
+ GetSymbolicLinkInternal(
+ async: false,
+ cancellationToken: cancellationToken)
+ .EnsureCompleted();
+
+ ///
+ /// Reads the value of the symbolic link.
+ /// Only applicable if this is pointed at an NFS symbolic link.
+ ///
+ ///
+ /// Optional to propagate
+ /// notifications that the operation should be cancelled.
+ ///
+ ///
+ /// A describing the symbolic link.
+ ///
+ ///
+ /// A will be thrown if
+ /// a failure occurs.
+ ///
+ /// https://github.com/Azure/azure-sdk-for-net/issues/46907
+ internal virtual async Task> GetSymbolicLinkAsync(
+ CancellationToken cancellationToken = default) =>
+ await GetSymbolicLinkInternal(
+ async: true,
+ cancellationToken: cancellationToken)
+ .ConfigureAwait(false);
+
+ ///
+ /// Reads the value of the symbolic link.
+ /// Only applicable if this is pointed at an NFS symbolic link.
+ ///
+ ///
+ /// Whether to invoke the operation asynchronously.
+ ///
+ ///
+ /// Optional to propagate
+ /// notifications that the operation should be cancelled.
+ ///
+ ///
+ /// A describing the symbolic link.
+ ///
+ ///
+ /// A will be thrown if
+ /// a failure occurs.
+ ///
+ private async Task> GetSymbolicLinkInternal(
+ bool async,
+ CancellationToken cancellationToken)
+ {
+ using (ClientConfiguration.Pipeline.BeginLoggingScope(nameof(ShareFileClient)))
+ {
+ ClientConfiguration.Pipeline.LogMethodEnter(nameof(ShareFileClient), message: string.Empty);
+
+ DiagnosticScope scope = ClientConfiguration.ClientDiagnostics.CreateScope($"{nameof(ShareFileClient)}.{nameof(GetSymbolicLink)}");
+
+ ResponseWithHeaders response;
+
+ try
+ {
+ scope.Start();
+
+ if (async)
+ {
+ response = await FileRestClient.GetSymbolicLinkAsync(
+ cancellationToken: cancellationToken)
+ .ConfigureAwait(false);
+ }
+ else
+ {
+ response = FileRestClient.GetSymbolicLink(
+ cancellationToken: cancellationToken);
+ }
+
+ return Response.FromValue(
+ response.ToFileSymbolicLinkInfo(),
+ response.GetRawResponse());
+ }
+ catch (Exception ex)
+ {
+ ClientConfiguration.Pipeline.LogException(ex);
+ scope.Failed(ex);
+ throw;
+ }
+ finally
+ {
+ ClientConfiguration.Pipeline.LogMethodExit(nameof(ShareFileClient));
+ scope.Dispose();
+ }
+ }
+ }
+ #endregion
+
+ #region CreateSymbolicLink
+ ///
+ /// NFS only. Creates a symoblic link to the file specified by path.
+ ///
+ ///
+ /// The absolution or relative path to the file to be linked to.
+ ///
+ ///
+ /// Optional parameters.
+ ///
+ ///
+ /// Optional to propagate
+ /// notifications that the operation should be cancelled.
+ ///
+ ///
+ /// A describing the
+ /// state of the file.
+ ///
+ ///
+ /// A will be thrown if
+ /// a failure occurs.
+ ///
+ /// https://github.com/Azure/azure-sdk-for-net/issues/46907
+ internal virtual Response CreateSymbolicLink(
+ string linkText,
+ ShareFileCreateSymbolicLinkOptions options = default,
+ CancellationToken cancellationToken = default) =>
+ CreateSymbolicLinkInternal(
+ linkText: linkText,
+ options: options,
+ async: false,
+ cancellationToken: cancellationToken)
+ .EnsureCompleted();
+
+ ///
+ /// NFS only. Creates a symoblic link to the file specified by path.
+ ///
+ ///
+ /// The absolution or relative path to the file to be linked to.
+ ///
+ ///
+ /// Optional parameters.
+ ///
+ ///
+ /// Optional to propagate
+ /// notifications that the operation should be cancelled.
+ ///
+ ///
+ /// A describing the
+ /// state of the file.
+ ///
+ ///
+ /// A will be thrown if
+ /// a failure occurs.
+ ///
+ /// https://github.com/Azure/azure-sdk-for-net/issues/46907
+ internal virtual async Task> CreateSymbolicLinkAsync(
+ string linkText,
+ ShareFileCreateSymbolicLinkOptions options = default,
+ CancellationToken cancellationToken = default) =>
+ await CreateSymbolicLinkInternal(
+ linkText: linkText,
+ options: options,
+ async: true,
+ cancellationToken: cancellationToken)
+ .ConfigureAwait(false);
+
+ ///
+ /// NFS only. Creates a symoblic link to the file specified by path.
+ ///
+ ///
+ /// The absolution or relative path to the file to be linked to.
+ ///
+ ///
+ /// Optional parameters.
+ ///
+ ///
+ /// Whether to invoke the operation asynchronously.
+ ///
+ ///
+ /// Optional to propagate
+ /// notifications that the operation should be cancelled.
+ ///
+ ///
+ /// A describing the
+ /// state of the file.
+ ///
+ ///
+ /// A will be thrown if
+ /// a failure occurs.
+ ///
+ private async Task> CreateSymbolicLinkInternal(
+ string linkText,
+ ShareFileCreateSymbolicLinkOptions options,
+ bool async,
+ CancellationToken cancellationToken)
+ {
+ using (ClientConfiguration.Pipeline.BeginLoggingScope(nameof(ShareFileClient)))
+ {
+ ClientConfiguration.Pipeline.LogMethodEnter(
+ nameof(ShareFileClient),
+ message:
+ $"{nameof(Uri)}: {Uri}\n");
+
+ DiagnosticScope scope = ClientConfiguration.ClientDiagnostics.CreateScope($"{nameof(ShareFileClient)}.{nameof(CreateSymbolicLink)}");
+
+ ResponseWithHeaders response;
+
+ try
+ {
+ scope.Start();
+
+ if (async)
+ {
+ response = await FileRestClient.CreateSymbolicLinkAsync(
+ linkText: linkText,
+ metadata: options?.Metadata,
+ fileCreationTime: options?.FileCreatedOn.ToFileDateTimeString(),
+ fileLastWriteTime: options?.FileLastWrittenOn.ToFileDateTimeString(),
+ owner: options?.Owner,
+ group: options?.Group,
+ shareFileRequestConditions: options?.Conditions,
+ cancellationToken: cancellationToken)
+ .ConfigureAwait(false);
+ }
+ else
+ {
+ response = FileRestClient.CreateSymbolicLink(
+ linkText: linkText,
+ metadata: options?.Metadata,
+ fileCreationTime: options?.FileCreatedOn.ToFileDateTimeString(),
+ fileLastWriteTime: options?.FileLastWrittenOn.ToFileDateTimeString(),
+ owner: options?.Owner,
+ group: options?.Group,
+ shareFileRequestConditions: options?.Conditions,
+ cancellationToken: cancellationToken);
+ }
+
+ return Response.FromValue(
+ response.ToShareFileInfo(),
+ response.GetRawResponse());
+ }
+ catch (Exception ex)
+ {
+ ClientConfiguration.Pipeline.LogException(ex);
+ scope.Failed(ex);
+ throw;
+ }
+ finally
+ {
+ ClientConfiguration.Pipeline.LogMethodExit(nameof(ShareFileClient));
+ scope.Dispose();
+ }
+ }
+ }
+ #endregion
+
+ #region CreateHardLink
+ ///
+ /// NFS only. Creates a hard link to the file file specified by path.
+ ///
+ ///
+ /// Path of the file to create the hard link to, not including the share.
+ /// For example: "targetDirectory/targetSubDirectory/.../targetFile"
+ ///
+ ///
+ /// Optional to add conditions
+ /// on creating the hard link.
+ ///
+ ///
+ /// Optional to propagate
+ /// notifications that the operation should be cancelled.
+ ///
+ ///
+ /// A describing the
+ /// state of the hard link.
+ ///
+ ///
+ /// A will be thrown if
+ /// a failure occurs.
+ ///
+ public virtual Response CreateHardLink(
+ string targetFile,
+ ShareFileRequestConditions conditions = default,
+ CancellationToken cancellationToken = default)
+ => CreateHardLinkInternal(
+ targetFile: targetFile,
+ conditions: conditions,
+ async: false,
+ cancellationToken: cancellationToken)
+ .EnsureCompleted();
+
+ ///
+ /// NFS only. Creates a hard link to the file file specified by path.
+ ///
+ ///
+ /// Path of the file to create the hard link to, not including the share.
+ /// For example: "targetDirectory/targetSubDirectory/.../targetFile"
+ ///
+ ///
+ /// Optional to add conditions
+ /// on creating the hard link.
+ ///
+ ///
+ /// Optional to propagate
+ /// notifications that the operation should be cancelled.
+ ///
+ ///
+ /// A describing the
+ /// state of the hard link.
+ ///
+ ///
+ /// A will be thrown if
+ /// a failure occurs.
+ ///
+ public async virtual Task> CreateHardLinkAsync(
+ string targetFile,
+ ShareFileRequestConditions conditions = default,
+ CancellationToken cancellationToken = default)
+ => await CreateHardLinkInternal(
+ targetFile: targetFile,
+ conditions: conditions,
+ async: true,
+ cancellationToken: cancellationToken)
+ .ConfigureAwait(false);
+
+ ///
+ /// NFS only. Creates a hard link to the file file specified by path.
+ ///
+ ///
+ /// Path of the file to create the hard link to, not including the share.
+ ///
+ ///
+ /// Optional to add conditions
+ /// on creating the hard link.
+ ///
+ ///
+ /// Whether to invoke the operation asynchronously.
+ ///
+ ///
+ /// Optional to propagate
+ /// notifications that the operation should be cancelled.
+ ///
+ ///
+ /// A describing the
+ /// state of the hard link.
+ ///
+ ///
+ /// A will be thrown if
+ /// a failure occurs.
+ ///
+ private async Task> CreateHardLinkInternal(
+ string targetFile,
+ ShareFileRequestConditions conditions,
+ bool async,
+ CancellationToken cancellationToken)
+ {
+ using (ClientConfiguration.Pipeline.BeginLoggingScope(nameof(ShareFileClient)))
+ {
+ ClientConfiguration.Pipeline.LogMethodEnter(
+ nameof(ShareFileClient),
+ message:
+ $"{nameof(Uri)}: {Uri}\n" +
+ $"{nameof(targetFile)}: {targetFile}");
+
+ DiagnosticScope scope = ClientConfiguration.ClientDiagnostics.CreateScope($"{nameof(ShareFileClient)}.{nameof(CreateHardLink)}");
+
+ try
+ {
+ scope.Start();
+
+ ResponseWithHeaders response;
+
+ if (async)
+ {
+ response = await FileRestClient.CreateHardLinkAsync(
+ targetFile: targetFile,
+ shareFileRequestConditions: conditions,
+ cancellationToken: cancellationToken)
+ .ConfigureAwait(false);
+ }
+ else
+ {
+ response = FileRestClient.CreateHardLink(
+ targetFile: targetFile,
+ shareFileRequestConditions: conditions,
+ cancellationToken: cancellationToken);
+ }
+
+ return Response.FromValue(
+ response.ToShareFileInfo(),
+ response.GetRawResponse());
+ }
+ catch (Exception ex)
+ {
+ ClientConfiguration.Pipeline.LogException(ex);
+ scope.Failed(ex);
+ throw;
+ }
+ finally
+ {
+ ClientConfiguration.Pipeline.LogMethodExit(nameof(ShareFileClient));
+ scope.Dispose();
+ }
+ }
+ }
+ #endregion
+
#region OpenWrite
///
/// Opens a stream for writing to the file.
@@ -6790,6 +7268,7 @@ private async Task OpenWriteInternal(
smbProperties: default,
filePermission: default,
filePermissionFormat: default,
+ posixProperties: default,
conditions: options?.OpenConditions,
async: async,
cancellationToken: cancellationToken)
@@ -6820,6 +7299,7 @@ private async Task OpenWriteInternal(
smbProperties: default,
filePermission: default,
filePermissionFormat: default,
+ posixProperties: default,
conditions: options?.OpenConditions,
async: async,
cancellationToken: cancellationToken)
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Shared/ShareModelExtensions.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Shared/ShareModelExtensions.cs
index 21f3f36b1a13d..bcb41d34b9000 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/src/Shared/ShareModelExtensions.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Shared/ShareModelExtensions.cs
@@ -17,9 +17,14 @@ internal static partial class ShareModelExtensions
/// ToString
///
/// string
- public static string ToAttributesString(this NtfsFileAttributes attributes)
+ public static string ToAttributesString(this NtfsFileAttributes? attributes)
{
- var stringBuilder = new StringBuilder();
+ if (attributes == null)
+ {
+ return null;
+ }
+
+ StringBuilder stringBuilder = new StringBuilder();
if ((attributes & NtfsFileAttributes.ReadOnly) == NtfsFileAttributes.ReadOnly)
{
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/autorest.md b/sdk/storage/Azure.Storage.Files.Shares/src/autorest.md
index ed634ae302734..b2678f62dd5fa 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/src/autorest.md
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/autorest.md
@@ -4,7 +4,7 @@ Run `dotnet build /t:GenerateCode` to generate code.
``` yaml
input-file:
- - https://raw.githubusercontent.com/Azure/azure-rest-api-specs/ae95eb6a4701d844bada7d1c4f5ecf4a7444e5b8/specification/storage/data-plane/Microsoft.FileStorage/stable/2025-01-05/file.json
+ - https://raw.githubusercontent.com/Azure/azure-rest-api-specs/d18a495685ccec837b72891b4deea017f62e8190/specification/storage/data-plane/Microsoft.FileStorage/stable/2025-05-05/file.json
generation1-convenience-client: true
# https://github.com/Azure/autorest/issues/4075
skip-semantics-validation: true
diff --git a/sdk/storage/Azure.Storage.Files.Shares/tests/ClientBuilderExtensions.cs b/sdk/storage/Azure.Storage.Files.Shares/tests/ClientBuilderExtensions.cs
index 35f4f78c33aab..23449be0978b3 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/tests/ClientBuilderExtensions.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/tests/ClientBuilderExtensions.cs
@@ -59,6 +59,16 @@ public static ShareServiceClient GetServiceClient_OAuthAccount_SharedKey(this Sh
public static ShareServiceClient GetServiceClient_PremiumFile(this ShareClientBuilder clientBuilder) =>
clientBuilder.GetServiceClientFromSharedKeyConfig(clientBuilder.Tenants.TestConfigPremiumFile);
+ public static ShareServiceClient GetServiceClient_PremiumFileOAuth(
+ this ShareClientBuilder clientBuilder,
+ TokenCredential tokenCredential,
+ ShareClientOptions options = default)
+ {
+ options ??= clientBuilder.GetOptions();
+ options.ShareTokenIntent = ShareTokenIntent.Backup;
+ return clientBuilder.GetServiceClientFromOauthConfig(clientBuilder.Tenants.TestConfigPremiumFile, tokenCredential, options);
+ }
+
public static ShareServiceClient GetServiceClient_SoftDelete(this ShareClientBuilder clientBuilder) =>
clientBuilder.GetServiceClientFromSharedKeyConfig(clientBuilder.Tenants.TestConfigSoftDelete);
@@ -67,13 +77,14 @@ public static async Task GetTestShareAsync(
ShareServiceClient service = default,
string shareName = default,
IDictionary metadata = default,
- ShareClientOptions options = default)
+ ShareClientOptions options = default,
+ bool nfs = false)
{
- service ??= clientBuilder.GetServiceClient_SharedKey(options);
+ service ??= nfs ? clientBuilder.GetServiceClient_PremiumFile() : clientBuilder.GetServiceClient_SharedKey(options);
metadata ??= new Dictionary(StringComparer.OrdinalIgnoreCase);
shareName ??= clientBuilder.GetNewShareName();
ShareClient share = clientBuilder.AzureCoreRecordedTestBase.InstrumentClient(service.GetShareClient(shareName));
- return await DisposingShare.CreateAsync(share, metadata);
+ return await DisposingShare.CreateAsync(share, metadata, nfs);
}
public static async Task GetTestDirectoryAsync(
@@ -81,9 +92,10 @@ public static async Task GetTestDirectoryAsync(
ShareServiceClient service = default,
string shareName = default,
string directoryName = default,
- ShareClientOptions options = default)
+ ShareClientOptions options = default,
+ bool nfs = false)
{
- DisposingShare test = await clientBuilder.GetTestShareAsync(service, shareName, options: options);
+ DisposingShare test = await clientBuilder.GetTestShareAsync(service, shareName, options: options, nfs: nfs);
directoryName ??= clientBuilder.GetNewDirectoryName();
ShareDirectoryClient directory = clientBuilder.AzureCoreRecordedTestBase.InstrumentClient(test.Share.GetDirectoryClient(directoryName));
@@ -96,9 +108,10 @@ public static async Task GetTestFileAsync(
string shareName = default,
string directoryName = default,
string fileName = default,
- ShareClientOptions options = default)
+ ShareClientOptions options = default,
+ bool nfs = false)
{
- DisposingDirectory test = await clientBuilder.GetTestDirectoryAsync(service, shareName, directoryName, options);
+ DisposingDirectory test = await clientBuilder.GetTestDirectoryAsync(service, shareName, directoryName, options, nfs: nfs);
fileName ??= clientBuilder.GetNewFileName();
ShareFileClient file = clientBuilder.AzureCoreRecordedTestBase.InstrumentClient(test.Directory.GetFileClient(fileName));
return await DisposingFile.CreateAsync(test, file);
diff --git a/sdk/storage/Azure.Storage.Files.Shares/tests/DirectoryClientTests.cs b/sdk/storage/Azure.Storage.Files.Shares/tests/DirectoryClientTests.cs
index 66f7ea56a121a..3fff06080fc71 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/tests/DirectoryClientTests.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/tests/DirectoryClientTests.cs
@@ -585,6 +585,44 @@ public async Task CreateAsync_TrailingDot(bool? allowTrailingDot)
}
}
+ [RecordedTest]
+ [ServiceVersion(Min = ShareClientOptions.ServiceVersion.V2025_05_05)]
+ public async Task CreateAsync_NFS()
+ {
+ await using DisposingDirectory test = await SharesClientBuilder.GetTestDirectoryAsync(nfs: true);
+ ShareClient share = test.Share;
+
+ // Arrange
+ var name = GetNewDirectoryName();
+ ShareDirectoryClient directory = InstrumentClient(share.GetDirectoryClient(name));
+
+ string owner = "345";
+ string group = "123";
+ string fileMode = "7777";
+
+ ShareDirectoryCreateOptions options = new ShareDirectoryCreateOptions
+ {
+ PosixProperties = new FilePosixProperties
+ {
+ Owner = owner,
+ Group = group,
+ FileMode = NfsFileMode.ParseOctalFileMode(fileMode)
+ }
+ };
+
+ // Act
+ Response response = await directory.CreateAsync(options);
+
+ // Assert
+ Assert.AreEqual(NfsFileType.Directory, response.Value.PosixProperties.FileType);
+ Assert.AreEqual(owner, response.Value.PosixProperties.Owner);
+ Assert.AreEqual(group, response.Value.PosixProperties.Group);
+ Assert.AreEqual(fileMode, response.Value.PosixProperties.FileMode.ToOctalFileMode());
+
+ Assert.IsNull(response.Value.SmbProperties.FileAttributes);
+ Assert.IsNull(response.Value.SmbProperties.FilePermissionKey);
+ }
+
[RecordedTest]
public async Task CreateIfNotExists_NotExists()
{
@@ -982,6 +1020,27 @@ public async Task GetPropertiesAsync_TrailingDot()
AssertPropertiesEqual(createResponse.Value.SmbProperties, getPropertiesResponse.Value.SmbProperties);
}
+ [RecordedTest]
+ [ServiceVersion(Min = ShareClientOptions.ServiceVersion.V2025_05_05)]
+ public async Task GetPropertiesAsync_NFS()
+ {
+ // Arrange
+ await using DisposingDirectory test = await SharesClientBuilder.GetTestDirectoryAsync(nfs: true);
+
+ // Act
+ Response response = await test.Directory.GetPropertiesAsync();
+
+ // Assert
+ Assert.AreEqual(NfsFileType.Directory, response.Value.PosixProperties.FileType);
+ Assert.AreEqual("0", response.Value.PosixProperties.Owner);
+ Assert.AreEqual("0", response.Value.PosixProperties.Group);
+ Assert.AreEqual("0755", response.Value.PosixProperties.FileMode.ToOctalFileMode());
+
+ Assert.IsNull(response.Value.PosixProperties.LinkCount);
+ Assert.IsNull(response.Value.SmbProperties.FileAttributes);
+ Assert.IsNull(response.Value.SmbProperties.FilePermissionKey);
+ }
+
[RecordedTest]
public async Task SetHttpHeadersAsync()
{
@@ -1221,6 +1280,40 @@ public async Task SetHttpHeadersAsync_TrailingDot()
await directory.SetHttpHeadersAsync();
}
+ [RecordedTest]
+ [ServiceVersion(Min = ShareClientOptions.ServiceVersion.V2025_05_05)]
+ public async Task SetHttpHeadersAsync_NFS()
+ {
+ // Arrange
+ await using DisposingDirectory test = await SharesClientBuilder.GetTestDirectoryAsync(nfs: true);
+
+ string owner = "345";
+ string group = "123";
+ string fileMode = "7777";
+
+ ShareDirectorySetHttpHeadersOptions options = new ShareDirectorySetHttpHeadersOptions
+ {
+ PosixProperties = new FilePosixProperties
+ {
+ Owner = owner,
+ Group = group,
+ FileMode = NfsFileMode.ParseOctalFileMode(fileMode)
+ }
+ };
+
+ // Act
+ Response response = await test.Directory.SetHttpHeadersAsync(options);
+
+ // Assert
+ Assert.AreEqual(owner, response.Value.PosixProperties.Owner);
+ Assert.AreEqual(group, response.Value.PosixProperties.Group);
+ Assert.AreEqual(fileMode, response.Value.PosixProperties.FileMode.ToOctalFileMode());
+
+ Assert.IsNull(response.Value.PosixProperties.LinkCount);
+ Assert.IsNull(response.Value.SmbProperties.FileAttributes);
+ Assert.IsNull(response.Value.SmbProperties.FilePermissionKey);
+ }
+
[RecordedTest]
public async Task SetMetadataAsync()
{
diff --git a/sdk/storage/Azure.Storage.Files.Shares/tests/DisposingShare.cs b/sdk/storage/Azure.Storage.Files.Shares/tests/DisposingShare.cs
index 4389023663cf5..dbff1885fdbce 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/tests/DisposingShare.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/tests/DisposingShare.cs
@@ -15,12 +15,18 @@ public class DisposingShare : IDisposingContainer
public ShareClient Container { get; private set; }
- public static async Task CreateAsync(ShareClient share, IDictionary metadata)
+ public static async Task CreateAsync(ShareClient share, IDictionary metadata, bool nfs = false)
{
ShareCreateOptions options = new ShareCreateOptions
{
Metadata = metadata
};
+
+ if (nfs)
+ {
+ options.Protocols = ShareProtocols.Nfs;
+ }
+
await share.CreateIfNotExistsAsync(options);
return new DisposingShare(share);
}
diff --git a/sdk/storage/Azure.Storage.Files.Shares/tests/FileClientTests.cs b/sdk/storage/Azure.Storage.Files.Shares/tests/FileClientTests.cs
index b1ce4cc25987a..f2f9e33686a49 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/tests/FileClientTests.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/tests/FileClientTests.cs
@@ -10,6 +10,7 @@
using System.Threading;
using System.Threading.Tasks;
using Azure.Core.TestFramework;
+using Azure.Identity;
using Azure.Storage.Files.Shares.Models;
using Azure.Storage.Files.Shares.Specialized;
using Azure.Storage.Sas;
@@ -17,6 +18,7 @@
using Azure.Storage.Test.Shared;
using Moq;
using NUnit.Framework;
+using NUnit.Framework.Internal;
namespace Azure.Storage.Files.Shares.Tests
{
@@ -724,6 +726,46 @@ public async Task CreateAsync_TrailingDot(bool? allowTrailingDot)
}
}
+ [RecordedTest]
+ [ServiceVersion(Min = ShareClientOptions.ServiceVersion.V2025_05_05)]
+ public async Task CreateAsync_NFS()
+ {
+ await using DisposingDirectory test = await SharesClientBuilder.GetTestDirectoryAsync(nfs: true);
+ ShareDirectoryClient directory = test.Directory;
+
+ // Arrange
+ string name = GetNewFileName();
+ ShareFileClient file = InstrumentClient(directory.GetFileClient(name));
+
+ string owner = "345";
+ string group = "123";
+ string fileMode = "7777";
+
+ ShareFileCreateOptions options = new ShareFileCreateOptions
+ {
+ PosixProperties = new FilePosixProperties
+ {
+ Owner = owner,
+ Group = group,
+ FileMode = NfsFileMode.ParseOctalFileMode(fileMode)
+ }
+ };
+
+ // Act
+ Response response = await file.CreateAsync(
+ maxSize: Constants.MB,
+ options: options);
+
+ // Assert
+ Assert.AreEqual(NfsFileType.Regular, response.Value.PosixProperties.FileType);
+ Assert.AreEqual(owner, response.Value.PosixProperties.Owner);
+ Assert.AreEqual(group, response.Value.PosixProperties.Group);
+ Assert.AreEqual(fileMode, response.Value.PosixProperties.FileMode.ToOctalFileMode());
+
+ Assert.IsNull(response.Value.SmbProperties.FileAttributes);
+ Assert.IsNull(response.Value.SmbProperties.FilePermissionKey);
+ }
+
[RecordedTest]
public async Task ExistsAsync_Exists()
{
@@ -1325,6 +1367,26 @@ public async Task GetPropertiesAsync_TrailingDot()
AssertPropertiesEqual(createResponse.Value.SmbProperties, getPropertiesResponse.Value.SmbProperties);
}
+ [RecordedTest]
+ [ServiceVersion(Min = ShareClientOptions.ServiceVersion.V2025_05_05)]
+ public async Task GetProperties_NFS()
+ {
+ await using DisposingFile test = await SharesClientBuilder.GetTestFileAsync(nfs: true);
+
+ // Act
+ Response response = await test.File.GetPropertiesAsync();
+
+ // Assert
+ Assert.AreEqual(NfsFileType.Regular, response.Value.PosixProperties.FileType);
+ Assert.AreEqual("0", response.Value.PosixProperties.Owner);
+ Assert.AreEqual("0", response.Value.PosixProperties.Group);
+ Assert.AreEqual("0664", response.Value.PosixProperties.FileMode.ToOctalFileMode());
+ Assert.AreEqual(1, response.Value.PosixProperties.LinkCount);
+
+ Assert.IsNull(response.Value.SmbProperties.FileAttributes);
+ Assert.IsNull(response.Value.SmbProperties.FilePermissionKey);
+ }
+
[RecordedTest]
public async Task SetHttpHeadersAsync()
{
@@ -1712,6 +1774,39 @@ public async Task SetHttpHeadersAsync_TrailingDot()
Response response = await file.SetHttpHeadersAsync(setHttpHeadersOptions);
}
+ [RecordedTest]
+ [ServiceVersion(Min = ShareClientOptions.ServiceVersion.V2025_05_05)]
+ public async Task SetHttpHeadersAsync_NFS()
+ {
+ await using DisposingFile test = await SharesClientBuilder.GetTestFileAsync(nfs: true);
+
+ string owner = "345";
+ string group = "123";
+ string fileMode = "7777";
+
+ ShareFileSetHttpHeadersOptions options = new ShareFileSetHttpHeadersOptions
+ {
+ PosixProperties = new FilePosixProperties
+ {
+ Owner = owner,
+ Group = group,
+ FileMode = NfsFileMode.ParseOctalFileMode(fileMode)
+ }
+ };
+
+ // Act
+ Response