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

azfile: API View feedback #21413

Merged
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
2 changes: 1 addition & 1 deletion sdk/storage/azfile/fileerror/error_codes.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const (
UnsupportedHeader Code = "UnsupportedHeader"
UnsupportedQueryParameter Code = "UnsupportedQueryParameter"
UnsupportedXMLNode Code = "UnsupportedXmlNode"
FileOAuthManagementApiRestrictedToSrp Code = "FileOAuthManagementApiRestrictedToSrp"
FileOAuthManagementAPIRestrictedToSRP Code = "FileOAuthManagementApiRestrictedToSrp"
)

var (
Expand Down
10 changes: 10 additions & 0 deletions sdk/storage/azfile/internal/generated/autorest.md
Original file line number Diff line number Diff line change
Expand Up @@ -343,3 +343,13 @@ directive:
transform: >
$.required = false;
```

### Rename ProvisionedBandwidthMiBps response field

``` yaml
directive:
- from: swagger-document
where: $["x-ms-paths"]["/{shareName}?restype=share"]
transform: >
$.get.responses["200"].headers["x-ms-share-provisioned-bandwidth-mibps"]["x-ms-client-name"] = "ProvisionedBandwidthMiBps"
```
4 changes: 2 additions & 2 deletions sdk/storage/azfile/internal/generated/zz_response_types.go

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

6 changes: 3 additions & 3 deletions sdk/storage/azfile/internal/generated/zz_share_client.go

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

6 changes: 3 additions & 3 deletions sdk/storage/azfile/service/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,16 +471,16 @@ func (s *ServiceRecordedTestsSuite) TestServiceOAuthNegative() {
// service-level operations are not supported using token credential authentication.
_, err = svcClient.GetProperties(context.Background(), nil)
_require.Error(err)
testcommon.ValidateFileErrorCode(_require, err, fileerror.FileOAuthManagementApiRestrictedToSrp)
testcommon.ValidateFileErrorCode(_require, err, fileerror.FileOAuthManagementAPIRestrictedToSRP)

_, err = svcClient.SetProperties(context.Background(), nil)
_require.Error(err)
testcommon.ValidateFileErrorCode(_require, err, fileerror.FileOAuthManagementApiRestrictedToSrp)
testcommon.ValidateFileErrorCode(_require, err, fileerror.FileOAuthManagementAPIRestrictedToSRP)

pager := svcClient.NewListSharesPager(nil)
_, err = pager.NextPage(context.Background())
_require.Error(err)
testcommon.ValidateFileErrorCode(_require, err, fileerror.FileOAuthManagementApiRestrictedToSrp)
testcommon.ValidateFileErrorCode(_require, err, fileerror.FileOAuthManagementAPIRestrictedToSRP)
}

func (s *ServiceRecordedTestsSuite) TestServiceCreateDeleteDirOAuth() {
Expand Down
12 changes: 6 additions & 6 deletions sdk/storage/azfile/share/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1477,19 +1477,19 @@ func (s *ShareRecordedTestsSuite) TestShareOAuthNegative() {

_, err = shareClient.Create(context.Background(), nil)
_require.Error(err)
testcommon.ValidateFileErrorCode(_require, err, fileerror.FileOAuthManagementApiRestrictedToSrp)
testcommon.ValidateFileErrorCode(_require, err, fileerror.FileOAuthManagementAPIRestrictedToSRP)

_, err = shareClient.GetProperties(context.Background(), nil)
_require.Error(err)
testcommon.ValidateFileErrorCode(_require, err, fileerror.FileOAuthManagementApiRestrictedToSrp)
testcommon.ValidateFileErrorCode(_require, err, fileerror.FileOAuthManagementAPIRestrictedToSRP)

_, err = shareClient.SetProperties(context.Background(), nil)
_require.Error(err)
testcommon.ValidateFileErrorCode(_require, err, fileerror.FileOAuthManagementApiRestrictedToSrp)
testcommon.ValidateFileErrorCode(_require, err, fileerror.FileOAuthManagementAPIRestrictedToSRP)

_, err = shareClient.Delete(context.Background(), nil)
_require.Error(err)
testcommon.ValidateFileErrorCode(_require, err, fileerror.FileOAuthManagementApiRestrictedToSrp)
testcommon.ValidateFileErrorCode(_require, err, fileerror.FileOAuthManagementAPIRestrictedToSRP)
}

func (s *ShareRecordedTestsSuite) TestShareCreateAndGetPermissionOAuth() {
Expand Down Expand Up @@ -1611,10 +1611,10 @@ func (s *ShareRecordedTestsSuite) TestPremiumShareBandwidth() {

response, err := shareClient.GetProperties(context.Background(), nil)
_require.NoError(err)
_require.NotNil(response.ProvisionedBandwidthMibps)
_require.NotNil(response.ProvisionedBandwidthMiBps)
_require.NotNil(response.ProvisionedIngressMBps)
_require.NotNil(response.ProvisionedEgressMBps)
_require.NotNil(response.ProvisionedIops)
_require.NotNil(response.NextAllowedQuotaDowngradeTime)
_require.Greater(*response.ProvisionedBandwidthMibps, (int32)(0))
_require.Greater(*response.ProvisionedBandwidthMiBps, (int32)(0))
}