Skip to content

Commit

Permalink
azfile: API View feedback (#21413)
Browse files Browse the repository at this point in the history
  • Loading branch information
souravgupta-msft authored Aug 24, 2023
1 parent bd70612 commit f35ce3c
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 15 deletions.
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))
}

0 comments on commit f35ce3c

Please sign in to comment.