From 51c3618850bdadd0a6ed72b3a1f024a678498fe7 Mon Sep 17 00:00:00 2001 From: aarifullin Date: Mon, 23 Oct 2023 17:25:46 +0300 Subject: [PATCH] [#121] client: Make PrmContainerList fields public Signed-off-by: Airat Arifullin a.arifullin@yadro.com --- client/container_list.go | 14 +++++++------- pool/pool.go | 5 +++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/client/container_list.go b/client/container_list.go index 4197d3d..ebe27c3 100644 --- a/client/container_list.go +++ b/client/container_list.go @@ -17,26 +17,26 @@ import ( // PrmContainerList groups parameters of ContainerList operation. type PrmContainerList struct { - prmCommonMeta + XHeaders []string - ownerSet bool - ownerID user.ID + Account *user.ID } // SetAccount sets identifier of the FrostFS account to list the containers. // Required parameter. +// +// Deprecated: Use PrmContainerList.Account instead. func (x *PrmContainerList) SetAccount(id user.ID) { - x.ownerID = id - x.ownerSet = true + x.Account = &id } func (x *PrmContainerList) buildRequest(c *Client) (*v2container.ListRequest, error) { - if !x.ownerSet { + if x.Account == nil { return nil, errorAccountNotSet } var ownerV2 refs.OwnerID - x.ownerID.WriteToV2(&ownerV2) + x.Account.WriteToV2(&ownerV2) reqBody := new(v2container.ListRequestBody) reqBody.SetOwnerID(&ownerV2) diff --git a/pool/pool.go b/pool/pool.go index a333711..9eb00b9 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -503,8 +503,9 @@ func (c *clientWrapper) containerList(ctx context.Context, prm PrmContainerList) return nil, err } - var cliPrm sdkClient.PrmContainerList - cliPrm.SetAccount(prm.ownerID) + cliPrm := sdkClient.PrmContainerList{ + Account: &prm.ownerID, + } start := time.Now() res, err := cl.ContainerList(ctx, cliPrm)