From 4c1feaf2cbcd2e972d543e491e8d8a2091f64623 Mon Sep 17 00:00:00 2001 From: aarifullin Date: Mon, 23 Oct 2023 17:37:50 +0300 Subject: [PATCH] [#182] pool: Fix linter error about deprecated methods Signed-off-by: Airat Arifullin --- pool/object_put_pool_transformer.go | 30 +++++++++++------------------ 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/pool/object_put_pool_transformer.go b/pool/object_put_pool_transformer.go index 52c6813..099a12d 100644 --- a/pool/object_put_pool_transformer.go +++ b/pool/object_put_pool_transformer.go @@ -110,16 +110,11 @@ func (it *internalTarget) WriteObject(ctx context.Context, o *object.Object) err } func (it *internalTarget) putAsStream(ctx context.Context, o *object.Object) error { - var cliPrm sdkClient.PrmObjectPutInit - cliPrm.SetCopiesNumberByVectors(it.prm.copiesNumber) - if it.prm.stoken != nil { - cliPrm.WithinSession(*it.prm.stoken) - } - if it.prm.key != nil { - cliPrm.UseKey(*it.prm.key) - } - if it.prm.btoken != nil { - cliPrm.WithBearerToken(*it.prm.btoken) + cliPrm := sdkClient.PrmObjectPutInit{ + CopiesNumber: it.prm.copiesNumber, + Session: it.prm.stoken, + Key: it.prm.key, + BearerToken: it.prm.btoken, } wrt, err := it.client.ObjectPutInit(ctx, cliPrm) @@ -141,16 +136,13 @@ func (it *internalTarget) tryPutSingle(ctx context.Context, o *object.Object) (b if it.useStream { return false, nil } - var cliPrm sdkClient.PrmObjectPutSingle - cliPrm.SetCopiesNumber(it.prm.copiesNumber) - cliPrm.UseKey(it.prm.key) - if it.prm.stoken != nil { - cliPrm.WithinSession(*it.prm.stoken) + cliPrm := sdkClient.PrmObjectPutSingle{ + CopiesNumber: it.prm.copiesNumber, + Key: it.prm.key, + Session: it.prm.stoken, + BearerToken: it.prm.btoken, + Object: o, } - if it.prm.btoken != nil { - cliPrm.WithBearerToken(*it.prm.btoken) - } - cliPrm.SetObject(o.ToV2()) res, err := it.client.ObjectPutSingle(ctx, cliPrm) if err != nil && status.Code(err) == codes.Unimplemented { -- 2.45.2