Skip to content

Commit

Permalink
Added support for AccountInfo.IsHierarchicalNamespaceEnabled (Azure#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmcc-msft authored and annelo-msft committed Feb 17, 2021
1 parent 8dd8de7 commit d7439d8
Show file tree
Hide file tree
Showing 9 changed files with 227 additions and 1 deletion.
1 change: 1 addition & 0 deletions sdk/storage/Azure.Storage.Blobs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 12.8.0-beta.1 (Unreleased)
- Fixed bug where BlobContainerClient.GetBlobClient(), BlobContainerClient.GetParentServiceClient(), BlobServiceClient.GetBlobContainerClient(), BlobBaseClient.WithClientSideEncryptionOptions(), BlobBaseClient.GetParentBlobContainerClient(), BlobBaseClient.WithSnapshot() and BlobBaseClient.WithVersion() created clients that could not generate a SAS from clients that could generate a SAS
- Added IsHierarchicalNamespaceEnabled to AccountInfo.

## 12.7.0 (2020-11-10)
- Includes all features from 12.7.0-preview.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,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 @@ -827,7 +828,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 @@ -322,6 +322,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.

0 comments on commit d7439d8

Please sign in to comment.