Skip to content

Commit

Permalink
Added Premium to Share Access Tier (#45603)
Browse files Browse the repository at this point in the history
* Added Premium to Share Access Tier

* Updated autorest
  • Loading branch information
seanmcc-msft authored Sep 20, 2024
1 parent 683dacc commit d209893
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,7 @@ public ShareAccessPolicy() { }
public ShareAccessTier(string value) { throw null; }
public static Azure.Storage.Files.Shares.Models.ShareAccessTier Cool { get { throw null; } }
public static Azure.Storage.Files.Shares.Models.ShareAccessTier Hot { get { throw null; } }
public static Azure.Storage.Files.Shares.Models.ShareAccessTier Premium { get { throw null; } }
public static Azure.Storage.Files.Shares.Models.ShareAccessTier TransactionOptimized { get { throw null; } }
public bool Equals(Azure.Storage.Files.Shares.Models.ShareAccessTier other) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,7 @@ public ShareAccessPolicy() { }
public ShareAccessTier(string value) { throw null; }
public static Azure.Storage.Files.Shares.Models.ShareAccessTier Cool { get { throw null; } }
public static Azure.Storage.Files.Shares.Models.ShareAccessTier Hot { get { throw null; } }
public static Azure.Storage.Files.Shares.Models.ShareAccessTier Premium { get { throw null; } }
public static Azure.Storage.Files.Shares.Models.ShareAccessTier TransactionOptimized { get { throw null; } }
public bool Equals(Azure.Storage.Files.Shares.Models.ShareAccessTier other) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/Azure.Storage.Files.Shares/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -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_14e0fa0c22"
"Tag": "net/storage/Azure.Storage.Files.Shares_95c2a36dbc"
}

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.

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

2 changes: 1 addition & 1 deletion sdk/storage/Azure.Storage.Files.Shares/src/autorest.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Run `dotnet build /t:GenerateCode` to generate code.

``` yaml
input-file:
- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/98b600498947073c18c2ac5eb7c3c658db5a1a59/specification/storage/data-plane/Microsoft.FileStorage/stable/2024-11-04/file.json
- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/718996a0c4435626d2f55d4ab6e65da5ac48916c/specification/storage/data-plane/Microsoft.FileStorage/stable/2025-01-05/file.json
generation1-convenience-client: true
# https://github.com/Azure/autorest/issues/4075
skip-semantics-validation: true
Expand Down
45 changes: 45 additions & 0 deletions sdk/storage/Azure.Storage.Files.Shares/tests/ShareClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,30 @@ public async Task CreateAsync_AccessTier()
await share.DeleteAsync();
}

[RecordedTest]
[ServiceVersion(Min = ShareClientOptions.ServiceVersion.V2019_12_12)]
public async Task CreateAsync_AccessTier_Premium()
{
// Arrange
var shareName = GetNewShareName();
ShareServiceClient service = SharesClientBuilder.GetServiceClient_PremiumFile();
ShareClient share = InstrumentClient(service.GetShareClient(shareName));
ShareCreateOptions options = new ShareCreateOptions
{
AccessTier = ShareAccessTier.Premium
};

// Act
await share.CreateAsync(options);

// Assert
Response<ShareProperties> propertiesResponse = await share.GetPropertiesAsync();
Assert.AreEqual(ShareAccessTier.Premium.ToString(), propertiesResponse.Value.AccessTier);

// Cleanup
await share.DeleteAsync();
}

[RecordedTest]
public async Task CreateAsync_Error()
{
Expand Down Expand Up @@ -1774,6 +1798,27 @@ public async Task SetPropertiesAsync_AccessTier()
Assert.IsNotNull(response.Value.AccessTierChangeTime);
}

[RecordedTest]
[ServiceVersion(Min = ShareClientOptions.ServiceVersion.V2019_12_12)]
public async Task SetPropertiesAsync_AccessTier_Premium()
{
// Arrange
await using DisposingShare test = await GetTestShareAsync(SharesClientBuilder.GetServiceClient_PremiumFile());
ShareClient share = test.Share;

ShareSetPropertiesOptions options = new ShareSetPropertiesOptions
{
AccessTier = ShareAccessTier.Premium
};

// Act
await share.SetPropertiesAsync(options);

// Assert
Response<ShareProperties> response = await share.GetPropertiesAsync();
Assert.AreEqual(ShareAccessTier.Premium.ToString(), response.Value.AccessTier);
}

[RecordedTest]
[PlaybackOnly("https://github.com/Azure/azure-sdk-for-net/issues/17262")]
[ServiceVersion(Min = ShareClientOptions.ServiceVersion.V2020_04_08)]
Expand Down

0 comments on commit d209893

Please sign in to comment.