Make PrmContainerEACL fields public #145
1 changed files with 12 additions and 7 deletions
|
@ -17,26 +17,31 @@ import (
|
||||||
|
|
||||||
// PrmContainerEACL groups parameters of ContainerEACL operation.
|
// PrmContainerEACL groups parameters of ContainerEACL operation.
|
||||||
type PrmContainerEACL struct {
|
type PrmContainerEACL struct {
|
||||||
prmCommonMeta
|
// FrostFS request X-Headers.
|
||||||
|
XHeaders []string
|
||||||
|
|
||||||
idSet bool
|
ContainerID *cid.ID
|
||||||
id cid.ID
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetContainer sets identifier of the FrostFS container to read the eACL table.
|
// SetContainer sets identifier of the FrostFS container to read the eACL table.
|
||||||
// Required parameter.
|
// Required parameter.
|
||||||
|
//
|
||||||
|
// Deprecated: Use PrmContainerEACL.ContainerID instead.
|
||||||
func (x *PrmContainerEACL) SetContainer(id cid.ID) {
|
func (x *PrmContainerEACL) SetContainer(id cid.ID) {
|
||||||
x.id = id
|
x.ContainerID = &id
|
||||||
x.idSet = true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *PrmContainerEACL) buildRequest(c *Client) (*v2container.GetExtendedACLRequest, error) {
|
func (x *PrmContainerEACL) buildRequest(c *Client) (*v2container.GetExtendedACLRequest, error) {
|
||||||
if !x.idSet {
|
if x.ContainerID == nil {
|
||||||
return nil, errorMissingContainer
|
return nil, errorMissingContainer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(x.XHeaders)%2 != 0 {
|
||||||
|
return nil, errorInvalidXHeaders
|
||||||
|
}
|
||||||
|
|
||||||
var cidV2 refs.ContainerID
|
var cidV2 refs.ContainerID
|
||||||
x.id.WriteToV2(&cidV2)
|
x.ContainerID.WriteToV2(&cidV2)
|
||||||
|
|
||||||
reqBody := new(v2container.GetExtendedACLRequestBody)
|
reqBody := new(v2container.GetExtendedACLRequestBody)
|
||||||
reqBody.SetContainerID(&cidV2)
|
reqBody.SetContainerID(&cidV2)
|
||||||
|
|
Loading…
Reference in a new issue