forked from TrueCloudLab/frostfs-sdk-go
[#121] client: Make PrmAnnounceSpace fields public
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
This commit is contained in:
parent
5a471e5002
commit
291a71ba84
1 changed files with 9 additions and 7 deletions
|
@ -14,27 +14,29 @@ import (
|
||||||
|
|
||||||
// PrmAnnounceSpace groups parameters of ContainerAnnounceUsedSpace operation.
|
// PrmAnnounceSpace groups parameters of ContainerAnnounceUsedSpace operation.
|
||||||
type PrmAnnounceSpace struct {
|
type PrmAnnounceSpace struct {
|
||||||
prmCommonMeta
|
XHeaders []string
|
||||||
|
|
||||||
announcements []container.SizeEstimation
|
Announcements []container.SizeEstimation
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetValues sets values describing volume of space that is used for the container objects.
|
// SetValues sets values describing volume of space that is used for the container objects.
|
||||||
// Required parameter. Must not be empty.
|
// Required parameter. Must not be empty.
|
||||||
//
|
//
|
||||||
// Must not be mutated before the end of the operation.
|
// Must not be mutated before the end of the operation.
|
||||||
|
//
|
||||||
|
// Deprecated: Use PrmAnnounceSpace.Announcements instead.
|
||||||
func (x *PrmAnnounceSpace) SetValues(vs []container.SizeEstimation) {
|
func (x *PrmAnnounceSpace) SetValues(vs []container.SizeEstimation) {
|
||||||
x.announcements = vs
|
x.Announcements = vs
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *PrmAnnounceSpace) buildRequest(c *Client) (*v2container.AnnounceUsedSpaceRequest, error) {
|
func (x *PrmAnnounceSpace) buildRequest(c *Client) (*v2container.AnnounceUsedSpaceRequest, error) {
|
||||||
if len(x.announcements) == 0 {
|
if len(x.Announcements) == 0 {
|
||||||
return nil, errorMissingAnnouncements
|
return nil, errorMissingAnnouncements
|
||||||
}
|
}
|
||||||
|
|
||||||
v2announce := make([]v2container.UsedSpaceAnnouncement, len(x.announcements))
|
v2announce := make([]v2container.UsedSpaceAnnouncement, len(x.Announcements))
|
||||||
for i := range x.announcements {
|
for i := range x.Announcements {
|
||||||
x.announcements[i].WriteToV2(&v2announce[i])
|
x.Announcements[i].WriteToV2(&v2announce[i])
|
||||||
}
|
}
|
||||||
|
|
||||||
reqBody := new(v2container.AnnounceUsedSpaceRequestBody)
|
reqBody := new(v2container.AnnounceUsedSpaceRequestBody)
|
||||||
|
|
Loading…
Reference in a new issue