client: rename formRequest() to buildRequest()

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2023-04-17 10:31:07 +03:00 committed by fyrchik
parent f60bea4be5
commit cae2f37cdd
7 changed files with 14 additions and 14 deletions

View file

@ -34,7 +34,7 @@ func (x *PrmContainerDelete) SetContainer(id cid.ID) {
x.idSet = true
}
func (x *PrmContainerDelete) formRequest(c *Client) (*v2container.DeleteRequest, error) {
func (x *PrmContainerDelete) buildRequest(c *Client) (*v2container.DeleteRequest, error) {
if !x.idSet {
return nil, errorMissingContainer
}
@ -114,7 +114,7 @@ type ResContainerDelete struct {
// Return statuses:
// - global (see Client docs).
func (c *Client) ContainerDelete(ctx context.Context, prm PrmContainerDelete) (*ResContainerDelete, error) {
req, err := prm.formRequest(c)
req, err := prm.buildRequest(c)
if err != nil {
return nil, err
}

View file

@ -30,7 +30,7 @@ func (x *PrmContainerEACL) SetContainer(id cid.ID) {
x.idSet = true
}
func (x *PrmContainerEACL) formRequest(c *Client) (*v2container.GetExtendedACLRequest, error) {
func (x *PrmContainerEACL) buildRequest(c *Client) (*v2container.GetExtendedACLRequest, error) {
if !x.idSet {
return nil, errorMissingContainer
}
@ -75,7 +75,7 @@ func (x ResContainerEACL) Table() eacl.Table {
// - *apistatus.ContainerNotFound;
// - *apistatus.EACLNotFound.
func (c *Client) ContainerEACL(ctx context.Context, prm PrmContainerEACL) (*ResContainerEACL, error) {
req, err := prm.formRequest(c)
req, err := prm.buildRequest(c)
if err != nil {
return nil, err
}

View file

@ -31,7 +31,7 @@ func (x *PrmContainerGet) SetContainer(id cid.ID) {
x.idSet = true
}
func (x *PrmContainerGet) formRequest(c *Client) (*v2container.GetRequest, error) {
func (x *PrmContainerGet) buildRequest(c *Client) (*v2container.GetRequest, error) {
if !x.idSet {
return nil, errorMissingContainer
}
@ -77,7 +77,7 @@ func (x ResContainerGet) Container() container.Container {
// - global (see Client docs);
// - *apistatus.ContainerNotFound.
func (c *Client) ContainerGet(ctx context.Context, prm PrmContainerGet) (*ResContainerGet, error) {
req, err := prm.formRequest(c)
req, err := prm.buildRequest(c)
if err != nil {
return nil, err
}

View file

@ -30,7 +30,7 @@ func (x *PrmContainerList) SetAccount(id user.ID) {
x.ownerSet = true
}
func (x *PrmContainerList) formRequest(c *Client) (*v2container.ListRequest, error) {
func (x *PrmContainerList) buildRequest(c *Client) (*v2container.ListRequest, error) {
if !x.ownerSet {
return nil, errorAccountNotSet
}
@ -75,7 +75,7 @@ func (x ResContainerList) Containers() []cid.ID {
// Return statuses:
// - global (see Client docs).
func (c *Client) ContainerList(ctx context.Context, prm PrmContainerList) (*ResContainerList, error) {
req, err := prm.formRequest(c)
req, err := prm.buildRequest(c)
if err != nil {
return nil, err
}

View file

@ -48,7 +48,7 @@ func (x *PrmContainerPut) WithinSession(s session.Container) {
x.sessionSet = true
}
func (x *PrmContainerPut) formRequest(c *Client) (*v2container.PutRequest, error) {
func (x *PrmContainerPut) buildRequest(c *Client) (*v2container.PutRequest, error) {
if !x.cnrSet {
return nil, errorMissingContainer
}
@ -122,7 +122,7 @@ func (x ResContainerPut) ID() cid.ID {
//
// nolint: funlen
func (c *Client) ContainerPut(ctx context.Context, prm PrmContainerPut) (*ResContainerPut, error) {
req, err := prm.formRequest(c)
req, err := prm.buildRequest(c)
if err != nil {
return nil, err
}

View file

@ -50,7 +50,7 @@ func (x *PrmContainerSetEACL) WithinSession(s session.Container) {
x.sessionSet = true
}
func (x *PrmContainerSetEACL) formRequest(c *Client) (*v2container.SetExtendedACLRequest, error) {
func (x *PrmContainerSetEACL) buildRequest(c *Client) (*v2container.SetExtendedACLRequest, error) {
if !x.tableSet {
return nil, errorEACLTableNotSet
}
@ -111,7 +111,7 @@ type ResContainerSetEACL struct {
// Return statuses:
// - global (see Client docs).
func (c *Client) ContainerSetEACL(ctx context.Context, prm PrmContainerSetEACL) (*ResContainerSetEACL, error) {
req, err := prm.formRequest(c)
req, err := prm.buildRequest(c)
if err != nil {
return nil, err
}

View file

@ -27,7 +27,7 @@ func (x *PrmAnnounceSpace) SetValues(vs []container.SizeEstimation) {
x.announcements = vs
}
func (x *PrmAnnounceSpace) formRequest(c *Client) (*v2container.AnnounceUsedSpaceRequest, error) {
func (x *PrmAnnounceSpace) buildRequest(c *Client) (*v2container.AnnounceUsedSpaceRequest, error) {
if len(x.announcements) == 0 {
return nil, errorMissingAnnouncements
}
@ -70,7 +70,7 @@ type ResAnnounceSpace struct {
// Return statuses:
// - global (see Client docs).
func (c *Client) ContainerAnnounceUsedSpace(ctx context.Context, prm PrmAnnounceSpace) (*ResAnnounceSpace, error) {
req, err := prm.formRequest(c)
req, err := prm.buildRequest(c)
if err != nil {
return nil, err
}