Skip to content

Commit

Permalink
add filter parameter in list function of fileshare client (#7888)
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinForReal authored Dec 23, 2024
1 parent 4d2680e commit 27216aa
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 2 additions & 4 deletions pkg/azclient/fileshareclient/custom.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,12 @@ func (client *Client) Delete(ctx context.Context, resourceGroupName string, pare
const ListOperationName = "FileSharesClient.List"

// List gets a list of FileShare in the resource group.
func (client *Client) List(ctx context.Context, resourceGroupName string, accountName string, expand *string) (result []*armstorage.FileShareItem, err error) {
func (client *Client) List(ctx context.Context, resourceGroupName string, accountName string, option *armstorage.FileSharesClientListOptions) (result []*armstorage.FileShareItem, err error) {
metricsCtx := metrics.BeginARMRequest(client.subscriptionID, resourceGroupName, "FileShare", "list")
defer func() { metricsCtx.Observe(ctx, err) }()
ctx, endSpan := runtime.StartSpan(ctx, ListOperationName, client.tracer, nil)
defer endSpan(err)
pager := client.FileSharesClient.NewListPager(resourceGroupName, accountName, &armstorage.FileSharesClientListOptions{
Expand: expand,
})
pager := client.FileSharesClient.NewListPager(resourceGroupName, accountName, option)
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
Expand Down
4 changes: 3 additions & 1 deletion pkg/azclient/fileshareclient/custom_test.go

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

2 changes: 1 addition & 1 deletion pkg/azclient/fileshareclient/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
// +azure:client:verbs=get,resource=Account,subResource=FileShare,packageName=github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage,packageAlias=armstorage,clientName=FileSharesClient,expand=false,crossSubFactory=true
type Interface interface {
utils.SubResourceGetFunc[armstorage.FileShare]
List(ctx context.Context, resourceGroupName string, accountName string, expand *string) (result []*armstorage.FileShareItem, err error)
List(ctx context.Context, resourceGroupName string, accountName string, option *armstorage.FileSharesClientListOptions) (result []*armstorage.FileShareItem, err error)
Create(ctx context.Context, resourceGroupName string, resourceName string, parentResourceName string, resource armstorage.FileShare, expand *string) (*armstorage.FileShare, error)
Update(ctx context.Context, resourceGroupName string, resourceName string, parentResourceName string, resource armstorage.FileShare) (*armstorage.FileShare, error)
Delete(ctx context.Context, resourceGroupName string, parentResourceName string, resourceName string, expand *string) error
Expand Down
12 changes: 6 additions & 6 deletions pkg/azclient/fileshareclient/mock_fileshareclient/interface.go

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

0 comments on commit 27216aa

Please sign in to comment.