Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for AccountInfo.IsHierarchicalNamespaceEnabled #17285

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ public partial class AccountInfo
{
internal AccountInfo() { }
public Azure.Storage.Blobs.Models.AccountKind AccountKind { get { throw null; } }
public bool IsHierarchicalNamespaceEnabled { get { throw null; } }
public Azure.Storage.Blobs.Models.SkuName SkuName { get { throw null; } }
}
public enum AccountKind
Expand Down Expand Up @@ -825,7 +826,9 @@ public BlobSignedIdentifier() { }
}
public static partial class BlobsModelFactory
{
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static Azure.Storage.Blobs.Models.AccountInfo AccountInfo(Azure.Storage.Blobs.Models.SkuName skuName, Azure.Storage.Blobs.Models.AccountKind accountKind) { throw null; }
public static Azure.Storage.Blobs.Models.AccountInfo AccountInfo(Azure.Storage.Blobs.Models.SkuName skuName, Azure.Storage.Blobs.Models.AccountKind accountKind, bool isHierarchicalNamespaceEnabled) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static Azure.Storage.Blobs.Models.BlobAppendInfo BlobAppendInfo(Azure.ETag eTag, System.DateTimeOffset lastModified, byte[] contentHash, byte[] contentCrc64, string blobAppendOffset, int blobCommittedBlockCount, bool isServerEncrypted, string encryptionKeySha256) { throw null; }
public static Azure.Storage.Blobs.Models.BlobAppendInfo BlobAppendInfo(Azure.ETag eTag, System.DateTimeOffset lastModified, byte[] contentHash, byte[] contentCrc64, string blobAppendOffset, int blobCommittedBlockCount, bool isServerEncrypted, string encryptionKeySha256, string encryptionScope) { throw null; }
Expand Down
13 changes: 12 additions & 1 deletion sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions sdk/storage/Azure.Storage.Blobs/src/Models/BlobsModelFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1002,5 +1002,20 @@ public static BlobContainerProperties BlobContainerProperties(
Metadata = metadata,
HasImmutabilityPolicy = hasImmutabilityPolicy,
};

/// <summary>
/// Creates a new AccountInfo instance for mocking.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public static AccountInfo AccountInfo(
Azure.Storage.Blobs.Models.SkuName skuName,
Azure.Storage.Blobs.Models.AccountKind accountKind)
{
return new AccountInfo()
{
SkuName = skuName,
AccountKind = accountKind,
};
}
}
}
28 changes: 28 additions & 0 deletions sdk/storage/Azure.Storage.Blobs/tests/ServiceClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,34 @@ public async Task GetAccountInfoAsync()
Assert.IsNotNull(response.GetRawResponse().Headers.RequestId);
}

[Test]
[ServiceVersion(Min = BlobClientOptions.ServiceVersion.V2019_07_07)]
public async Task GetAccountInfoAsync_HnsFalse()
{
// Arrange
BlobServiceClient service = GetServiceClient_SharedKey();

// Act
Response<AccountInfo> response = await service.GetAccountInfoAsync();

// Assert
Assert.IsFalse(response.Value.IsHierarchicalNamespaceEnabled);
}

[Test]
[ServiceVersion(Min = BlobClientOptions.ServiceVersion.V2019_07_07)]
public async Task GetAccountInfoAsync_HnsTrue()
{
// Arrange
BlobServiceClient service = GetServiceClient_Hns();

// Act
Response<AccountInfo> response = await service.GetAccountInfoAsync();

// Assert
Assert.IsTrue(response.Value.IsHierarchicalNamespaceEnabled);
}

[Test]
public async Task GetAccountInfoAsync_Error()
{
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.