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

Prefix service property types with Blob/Queue/File. #7882

Merged
merged 4 commits into from
Oct 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
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
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