From 6fbe1595cb3d1fbc28403c5fafae2c14e343475f Mon Sep 17 00:00:00 2001 From: aarifullin Date: Mon, 23 Oct 2023 16:55:36 +0300 Subject: [PATCH] [#121] pool: Refactor PrmObjectSearch usage Signed-off-by: Airat Arifullin --- pool/pool.go | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/pool/pool.go b/pool/pool.go index 9eb00b9..c871689 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -1000,21 +1000,12 @@ func (c *clientWrapper) objectSearch(ctx context.Context, prm PrmObjectSearch) ( return ResObjectSearch{}, err } - var cliPrm sdkClient.PrmObjectSearch - - cliPrm.InContainer(prm.cnrID) - cliPrm.SetFilters(prm.filters) - - if prm.stoken != nil { - cliPrm.WithinSession(*prm.stoken) - } - - if prm.btoken != nil { - cliPrm.WithBearerToken(*prm.btoken) - } - - if prm.key != nil { - cliPrm.UseKey(*prm.key) + cliPrm := sdkClient.PrmObjectSearch{ + ContainerID: &prm.cnrID, + Filters: prm.filters, + Session: prm.stoken, + BearerToken: prm.btoken, + Key: prm.key, } res, err := cl.ObjectSearchInit(ctx, cliPrm)