Skip to content

Commit

Permalink
Prefix service property types with Blob/Queue/File. (#7882)
Browse files Browse the repository at this point in the history
* Prefix service property types with Blob/Queue/File.

* Fix comments in readme

* Remove CA1724 suppression as this warning not fire anymore

* rebase and regenerate
  • Loading branch information
JoshLove-msft authored and mitchdenny committed Oct 4, 2019
1 parent 03d1022 commit 752d72f
Show file tree
Hide file tree
Showing 9 changed files with 1,128 additions and 1,092 deletions.
1,126 changes: 562 additions & 564 deletions sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs

Large diffs are not rendered by default.

33 changes: 24 additions & 9 deletions sdk/storage/Azure.Storage.Blobs/swagger/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -1025,15 +1025,6 @@ directive:
$["x-ms-enum"].name = "ListBlobContainersIncludeType"
```
### Logging
``` yaml
directive:
- from: swagger-document
where: $.definitions.Logging
transform: >
$["x-az-disable-warnings"] = "CA1724";
```
### Hide Error models
``` yaml
directive:
Expand Down Expand Up @@ -1204,3 +1195,27 @@ directive:
transform: >
$.put.operationId = "Blob_SetAccessTier";
```
### Prepend Blob prefix to service property types
``` yaml
directive:
- from: swagger-document
where: $.definitions
transform: >
$.Logging["x-ms-client-name"] = "BlobAnalyticsLogging";
$.Logging.xml = { "name": "Logging"};
$.BlobServiceProperties.properties.Logging.xml = { "name": "Logging"};
$.Metrics["x-ms-client-name"] = "BlobMetrics";
$.Metrics.xml = { "name": "Metrics"};
$.BlobServiceProperties.properties.HourMetrics.xml = { "name": "HourMetrics"};
$.BlobServiceProperties.properties.MinuteMetrics.xml = { "name": "MinuteMetrics"};
$.CorsRule["x-ms-client-name"] = "BlobCorsRule";
$.CorsRule.xml = { "name": "CorsRule"};
$.BlobServiceProperties.properties.Cors.xml.name = "Cors";
$.RetentionPolicy["x-ms-client-name"] = "BlobRetentionPolicy";
$.RetentionPolicy.xml = { "name": "RetentionPolicy"};
$.BlobServiceProperties.properties.DeleteRetentionPolicy.xml = { "name": "DeleteRetentionPolicy"};
$.StaticWebsite["x-ms-client-name"] = "BlobStaticWebsite";
$.StaticWebsite.xml = { "name": "StaticWebsite"};
$.BlobServiceProperties.properties.StaticWebsite.xml = { "name": "StaticWebsite"};
```
4 changes: 2 additions & 2 deletions sdk/storage/Azure.Storage.Blobs/tests/BlobTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ public async Task EnableSoftDelete()
{
BlobServiceClient service = GetServiceClient_SharedKey();
Response<BlobServiceProperties> properties = await service.GetPropertiesAsync();
properties.Value.DeleteRetentionPolicy = new RetentionPolicy
properties.Value.DeleteRetentionPolicy = new BlobRetentionPolicy
{
Enabled = true,
Days = 2
Expand All @@ -419,7 +419,7 @@ public async Task DisableSoftDelete()
{
BlobServiceClient service = GetServiceClient_SharedKey();
Response<BlobServiceProperties> properties = await service.GetPropertiesAsync();
properties.Value.DeleteRetentionPolicy = new RetentionPolicy
properties.Value.DeleteRetentionPolicy = new BlobRetentionPolicy
{
Enabled = false
};
Expand Down
4 changes: 2 additions & 2 deletions sdk/storage/Azure.Storage.Blobs/tests/ServiceClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,11 @@ public async Task SetPropertiesAsync()
// Arrange
BlobServiceClient service = GetServiceClient_SharedKey();
BlobServiceProperties properties = (await service.GetPropertiesAsync()).Value;
CorsRule[] originalCors = properties.Cors.ToArray();
BlobCorsRule[] originalCors = properties.Cors.ToArray();
properties.Cors =
new[]
{
new CorsRule
new BlobCorsRule
{
MaxAgeInSeconds = 1000,
AllowedHeaders = "x-ms-meta-data*,x-ms-meta-target*,x-ms-meta-abc",
Expand Down
434 changes: 217 additions & 217 deletions sdk/storage/Azure.Storage.Files/src/Generated/FileRestClient.cs

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions sdk/storage/Azure.Storage.Files/swagger/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -658,3 +658,18 @@ directive:
delete $.required;
delete $.properties;
```
### Prepend File prefix to service property types
``` yaml
directive:
- from: swagger-document
where: $.definitions
transform: >
$.Metrics["x-ms-client-name"] = "FileMetrics";
$.Metrics.xml = { "name": "Metrics" };
$.FileServiceProperties.properties.HourMetrics.xml = { "name": "HourMetrics"};
$.FileServiceProperties.properties.MinuteMetrics.xml = { "name": "MinuteMetrics"};
$.CorsRule["x-ms-client-name"] = "FileCorsRule";
$.CorsRule.xml = { "name": "CorsRule"};
$.FileServiceProperties.properties.Cors.xml.name = "Cors";
```
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public async Task SetPropertiesAsync()
_ = properties.Value.Cors.ToArray();
properties.Value.Cors.Clear();
properties.Value.Cors.Add(
new CorsRule
new FileCorsRule
{
MaxAgeInSeconds = 1000,
AllowedHeaders = "x-ms-meta-data*,x-ms-meta-target*,x-ms-meta-abc",
Expand Down
Loading

0 comments on commit 752d72f

Please sign in to comment.