From 9de9b732418777ccc3617e18187213dd67c36fed Mon Sep 17 00:00:00 2001 From: Sean Chok Date: Thu, 31 Aug 2023 02:15:36 +0800 Subject: [PATCH] add NewListObjectsPager method to service/dataset client (#9) --- service/dataset/list_objects.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 service/dataset/list_objects.go diff --git a/service/dataset/list_objects.go b/service/dataset/list_objects.go new file mode 100644 index 0000000..f59320c --- /dev/null +++ b/service/dataset/list_objects.go @@ -0,0 +1,25 @@ +package dataset + +import ( + "context" + "github.com/deploifai/sdk-go/api/generated" + "github.com/deploifai/sdk-go/cloud_client/implementable" +) + +type ListObjectsInput = implementable.ListObjectsInput + +func (c *Client) NewListObjectsPager(ctx context.Context, where generated.DataStorageWhereUniqueInput, input *ListObjectsInput) (pager implementable.ListObjectsPager, err error) { + + dataStorage, dataStorageContainer, err := getDataStorageAndContainer(ctx, c.options.API, where) + if err != nil { + return pager, err + } + + dataStorageClient, err := newDataStorageClient(ctx, c.options.API, dataStorage, dataStorageContainer) + if err != nil { + return pager, err + } + + return dataStorageClient.NewListObjectsPager(input), nil + +}