[#140] sdk: Refactor reference types

Refactor v2-compatible reference types to be wrappers over corresponding
types from v2.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-09-10 12:57:29 +03:00 committed by Stanislav Bogatyrev
parent 2026473733
commit 524280a5e8
10 changed files with 73 additions and 215 deletions

View file

@ -262,10 +262,7 @@ func (c *Client) putObjectV2(ctx context.Context, p *PutObjectParams, opts ...Ca
}
// convert object identifier
id, err := object.IDFromV2(resp.GetBody().GetObjectID())
if err != nil {
return nil, errors.Wrap(err, "could not convert object identifier")
}
id := object.NewIDFromV2(resp.GetBody().GetObjectID())
return id, nil
}