2020-08-17 12:08:00 +00:00
|
|
|
package container
|
|
|
|
|
|
|
|
import (
|
2020-08-17 16:00:10 +00:00
|
|
|
"github.com/nspcc-dev/neofs-api-go/v2/acl"
|
2021-03-12 12:57:23 +00:00
|
|
|
aclGRPC "github.com/nspcc-dev/neofs-api-go/v2/acl/grpc"
|
2020-08-17 12:08:00 +00:00
|
|
|
container "github.com/nspcc-dev/neofs-api-go/v2/container/grpc"
|
|
|
|
"github.com/nspcc-dev/neofs-api-go/v2/netmap"
|
2021-03-12 12:57:23 +00:00
|
|
|
netmapGRPC "github.com/nspcc-dev/neofs-api-go/v2/netmap/grpc"
|
2020-08-17 12:08:00 +00:00
|
|
|
"github.com/nspcc-dev/neofs-api-go/v2/refs"
|
2020-08-17 16:00:10 +00:00
|
|
|
refsGRPC "github.com/nspcc-dev/neofs-api-go/v2/refs/grpc"
|
2021-11-16 17:30:55 +00:00
|
|
|
"github.com/nspcc-dev/neofs-api-go/v2/rpc/grpc"
|
|
|
|
"github.com/nspcc-dev/neofs-api-go/v2/rpc/message"
|
2021-05-24 18:18:56 +00:00
|
|
|
"github.com/nspcc-dev/neofs-api-go/v2/session"
|
|
|
|
sessionGRPC "github.com/nspcc-dev/neofs-api-go/v2/session/grpc"
|
2020-08-17 12:08:00 +00:00
|
|
|
)
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (a *Attribute) ToGRPCMessage() grpc.Message {
|
|
|
|
var m *container.Container_Attribute
|
2020-08-17 12:08:00 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
if a != nil {
|
|
|
|
m = new(container.Container_Attribute)
|
2020-08-17 12:08:00 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
m.SetKey(a.key)
|
|
|
|
m.SetValue(a.val)
|
|
|
|
}
|
2020-08-17 12:08:00 +00:00
|
|
|
|
|
|
|
return m
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (a *Attribute) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
v, ok := m.(*container.Container_Attribute)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, v)
|
2020-08-17 12:08:00 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
a.key = v.GetKey()
|
|
|
|
a.val = v.GetValue()
|
2020-08-17 12:08:00 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
return nil
|
2020-08-17 12:08:00 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func AttributesToGRPC(xs []*Attribute) (res []*container.Container_Attribute) {
|
|
|
|
if xs != nil {
|
|
|
|
res = make([]*container.Container_Attribute, 0, len(xs))
|
|
|
|
|
|
|
|
for i := range xs {
|
|
|
|
res = append(res, xs[i].ToGRPCMessage().(*container.Container_Attribute))
|
|
|
|
}
|
2020-08-17 12:08:00 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
return
|
|
|
|
}
|
2020-08-17 12:08:00 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func AttributesFromGRPC(xs []*container.Container_Attribute) (res []*Attribute, err error) {
|
|
|
|
if xs != nil {
|
|
|
|
res = make([]*Attribute, 0, len(xs))
|
2020-08-17 12:08:00 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
for i := range xs {
|
|
|
|
var x *Attribute
|
2020-08-17 12:08:00 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
if xs[i] != nil {
|
|
|
|
x = new(Attribute)
|
2020-08-17 12:08:00 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
err = x.FromGRPCMessage(xs[i])
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
2020-08-17 12:08:00 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
res = append(res, x)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|
2020-08-17 12:08:00 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (c *Container) ToGRPCMessage() grpc.Message {
|
|
|
|
var m *container.Container
|
2020-08-17 12:08:00 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
if c != nil {
|
|
|
|
m = new(container.Container)
|
2020-08-17 12:08:00 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
m.SetVersion(c.version.ToGRPCMessage().(*refsGRPC.Version))
|
|
|
|
m.SetOwnerId(c.ownerID.ToGRPCMessage().(*refsGRPC.OwnerID))
|
|
|
|
m.SetPlacementPolicy(c.policy.ToGRPCMessage().(*netmapGRPC.PlacementPolicy))
|
|
|
|
m.SetAttributes(AttributesToGRPC(c.attr))
|
|
|
|
m.SetBasicAcl(c.basicACL)
|
|
|
|
m.SetNonce(c.nonce)
|
|
|
|
}
|
2020-08-17 12:08:00 +00:00
|
|
|
|
|
|
|
return m
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (c *Container) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
v, ok := m.(*container.Container)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, v)
|
2020-08-17 12:08:00 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
var err error
|
2020-08-17 12:08:00 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
version := v.GetVersion()
|
|
|
|
if version == nil {
|
|
|
|
c.version = nil
|
|
|
|
} else {
|
|
|
|
if c.version == nil {
|
|
|
|
c.version = new(refs.Version)
|
|
|
|
}
|
2020-08-17 12:08:00 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
err = c.version.FromGRPCMessage(version)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
2020-08-17 12:08:00 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
ownerID := v.GetOwnerId()
|
|
|
|
if ownerID == nil {
|
|
|
|
c.ownerID = nil
|
|
|
|
} else {
|
|
|
|
if c.ownerID == nil {
|
|
|
|
c.ownerID = new(refs.OwnerID)
|
|
|
|
}
|
2020-08-17 12:08:00 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
err = c.ownerID.FromGRPCMessage(ownerID)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
2020-08-17 12:08:00 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
policy := v.GetPlacementPolicy()
|
|
|
|
if policy == nil {
|
|
|
|
c.policy = nil
|
|
|
|
} else {
|
|
|
|
if c.policy == nil {
|
|
|
|
c.policy = new(netmap.PlacementPolicy)
|
|
|
|
}
|
2020-08-17 12:08:00 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
err = c.policy.FromGRPCMessage(policy)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
2020-08-17 12:08:00 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
c.attr, err = AttributesFromGRPC(v.GetAttributes())
|
|
|
|
if err != nil {
|
|
|
|
return err
|
2020-08-17 12:08:00 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
c.basicACL = v.GetBasicAcl()
|
|
|
|
c.nonce = v.GetNonce()
|
2020-08-17 12:08:00 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
return nil
|
2020-08-17 12:08:00 +00:00
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *PutRequestBody) ToGRPCMessage() grpc.Message {
|
|
|
|
var m *container.PutRequest_Body
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
if r != nil {
|
|
|
|
m = new(container.PutRequest_Body)
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
m.SetContainer(r.cnr.ToGRPCMessage().(*container.Container))
|
|
|
|
m.SetSignature(r.sig.ToGRPCMessage().(*refsGRPC.Signature))
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
|
|
|
return m
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *PutRequestBody) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
v, ok := m.(*container.PutRequest_Body)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, v)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
var err error
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
cnr := v.GetContainer()
|
|
|
|
if cnr == nil {
|
|
|
|
r.cnr = nil
|
|
|
|
} else {
|
|
|
|
if r.cnr == nil {
|
|
|
|
r.cnr = new(Container)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
err = r.cnr.FromGRPCMessage(cnr)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
sig := v.GetSignature()
|
|
|
|
if sig == nil {
|
|
|
|
r.sig = nil
|
|
|
|
} else {
|
|
|
|
if r.sig == nil {
|
|
|
|
r.sig = new(refs.Signature)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
err = r.sig.FromGRPCMessage(sig)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *PutRequest) ToGRPCMessage() grpc.Message {
|
|
|
|
var m *container.PutRequest
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
if r != nil {
|
|
|
|
m = new(container.PutRequest)
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
m.SetBody(r.body.ToGRPCMessage().(*container.PutRequest_Body))
|
|
|
|
r.RequestHeaders.ToMessage(m)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
|
|
|
return m
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *PutRequest) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
v, ok := m.(*container.PutRequest)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, v)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
var err error
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
body := v.GetBody()
|
|
|
|
if body == nil {
|
|
|
|
r.body = nil
|
|
|
|
} else {
|
|
|
|
if r.body == nil {
|
|
|
|
r.body = new(PutRequestBody)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
err = r.body.FromGRPCMessage(body)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
return r.RequestHeaders.FromMessage(v)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *PutResponseBody) ToGRPCMessage() grpc.Message {
|
|
|
|
var m *container.PutResponse_Body
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
if r != nil {
|
|
|
|
m = new(container.PutResponse_Body)
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
m.SetContainerId(r.cid.ToGRPCMessage().(*refsGRPC.ContainerID))
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
|
|
|
return m
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *PutResponseBody) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
v, ok := m.(*container.PutResponse_Body)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, v)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
var err error
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
cid := v.GetContainerId()
|
|
|
|
if cid == nil {
|
|
|
|
r.cid = nil
|
|
|
|
} else {
|
|
|
|
if r.cid == nil {
|
|
|
|
r.cid = new(refs.ContainerID)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
err = r.cid.FromGRPCMessage(cid)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
return err
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *PutResponse) ToGRPCMessage() grpc.Message {
|
|
|
|
var m *container.PutResponse
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
if r != nil {
|
|
|
|
m = new(container.PutResponse)
|
|
|
|
|
|
|
|
m.SetBody(r.body.ToGRPCMessage().(*container.PutResponse_Body))
|
|
|
|
r.ResponseHeaders.ToMessage(m)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
|
|
|
return m
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *PutResponse) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
v, ok := m.(*container.PutResponse)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, v)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
var err error
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
body := v.GetBody()
|
|
|
|
if body == nil {
|
|
|
|
r.body = nil
|
|
|
|
} else {
|
|
|
|
if r.body == nil {
|
|
|
|
r.body = new(PutResponseBody)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
err = r.body.FromGRPCMessage(body)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
return r.ResponseHeaders.FromMessage(v)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *GetRequestBody) ToGRPCMessage() grpc.Message {
|
|
|
|
var m *container.GetRequest_Body
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
if r != nil {
|
|
|
|
m = new(container.GetRequest_Body)
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
m.SetContainerId(r.cid.ToGRPCMessage().(*refsGRPC.ContainerID))
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
|
|
|
return m
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *GetRequestBody) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
v, ok := m.(*container.GetRequest_Body)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, v)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
var err error
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
cid := v.GetContainerId()
|
|
|
|
if cid == nil {
|
|
|
|
r.cid = nil
|
|
|
|
} else {
|
|
|
|
if r.cid == nil {
|
|
|
|
r.cid = new(refs.ContainerID)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
err = r.cid.FromGRPCMessage(cid)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *GetRequest) ToGRPCMessage() grpc.Message {
|
|
|
|
var m *container.GetRequest
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
if r != nil {
|
|
|
|
m = new(container.GetRequest)
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
m.SetBody(r.body.ToGRPCMessage().(*container.GetRequest_Body))
|
|
|
|
r.RequestHeaders.ToMessage(m)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
|
|
|
return m
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *GetRequest) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
v, ok := m.(*container.GetRequest)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, v)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
var err error
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
body := v.GetBody()
|
|
|
|
if body == nil {
|
|
|
|
r.body = nil
|
|
|
|
} else {
|
|
|
|
if r.body == nil {
|
|
|
|
r.body = new(GetRequestBody)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
err = r.body.FromGRPCMessage(body)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
return r.RequestHeaders.FromMessage(v)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *GetResponseBody) ToGRPCMessage() grpc.Message {
|
|
|
|
var m *container.GetResponse_Body
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
if r != nil {
|
|
|
|
m = new(container.GetResponse_Body)
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
m.SetContainer(r.cnr.ToGRPCMessage().(*container.Container))
|
2021-05-24 18:18:56 +00:00
|
|
|
m.SetSessionToken(r.token.ToGRPCMessage().(*sessionGRPC.SessionToken))
|
|
|
|
m.SetSignature(r.sig.ToGRPCMessage().(*refsGRPC.Signature))
|
2021-03-12 12:57:23 +00:00
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
|
|
|
return m
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *GetResponseBody) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
v, ok := m.(*container.GetResponse_Body)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, v)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
var err error
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
cnr := v.GetContainer()
|
|
|
|
if cnr == nil {
|
|
|
|
r.cnr = nil
|
|
|
|
} else {
|
|
|
|
if r.cnr == nil {
|
|
|
|
r.cnr = new(Container)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
err = r.cnr.FromGRPCMessage(cnr)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-05-24 18:18:56 +00:00
|
|
|
sig := v.GetSignature()
|
|
|
|
if sig == nil {
|
|
|
|
r.sig = nil
|
|
|
|
} else {
|
|
|
|
if r.sig == nil {
|
|
|
|
r.sig = new(refs.Signature)
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.sig.FromGRPCMessage(sig)
|
|
|
|
}
|
|
|
|
|
|
|
|
token := v.GetSessionToken()
|
|
|
|
if token == nil {
|
|
|
|
r.token = nil
|
|
|
|
} else {
|
|
|
|
if r.token == nil {
|
|
|
|
r.token = new(session.SessionToken)
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.token.FromGRPCMessage(token)
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *GetResponse) ToGRPCMessage() grpc.Message {
|
|
|
|
var m *container.GetResponse
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
if r != nil {
|
|
|
|
m = new(container.GetResponse)
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
m.SetBody(r.body.ToGRPCMessage().(*container.GetResponse_Body))
|
|
|
|
r.ResponseHeaders.ToMessage(m)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
|
|
|
return m
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *GetResponse) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
v, ok := m.(*container.GetResponse)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, v)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
var err error
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
body := v.GetBody()
|
|
|
|
if body == nil {
|
|
|
|
r.body = nil
|
|
|
|
} else {
|
|
|
|
if r.body == nil {
|
|
|
|
r.body = new(GetResponseBody)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
err = r.body.FromGRPCMessage(body)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
return r.ResponseHeaders.FromMessage(v)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *DeleteRequestBody) ToGRPCMessage() grpc.Message {
|
|
|
|
var m *container.DeleteRequest_Body
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
if r != nil {
|
|
|
|
m = new(container.DeleteRequest_Body)
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
m.SetContainerId(r.cid.ToGRPCMessage().(*refsGRPC.ContainerID))
|
|
|
|
m.SetSignature(r.sig.ToGRPCMessage().(*refsGRPC.Signature))
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
|
|
|
return m
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *DeleteRequestBody) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
v, ok := m.(*container.DeleteRequest_Body)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, v)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
var err error
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
cid := v.GetContainerId()
|
|
|
|
if cid == nil {
|
|
|
|
r.cid = nil
|
|
|
|
} else {
|
|
|
|
if r.cid == nil {
|
|
|
|
r.cid = new(refs.ContainerID)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
err = r.cid.FromGRPCMessage(cid)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
sig := v.GetSignature()
|
|
|
|
if sig == nil {
|
|
|
|
r.sig = nil
|
|
|
|
} else {
|
|
|
|
if r.sig == nil {
|
|
|
|
r.sig = new(refs.Signature)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
err = r.sig.FromGRPCMessage(sig)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
return err
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *DeleteRequest) ToGRPCMessage() grpc.Message {
|
|
|
|
var m *container.DeleteRequest
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
if r != nil {
|
|
|
|
m = new(container.DeleteRequest)
|
|
|
|
|
|
|
|
m.SetBody(r.body.ToGRPCMessage().(*container.DeleteRequest_Body))
|
|
|
|
r.RequestHeaders.ToMessage(m)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
|
|
|
return m
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *DeleteRequest) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
v, ok := m.(*container.DeleteRequest)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, v)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
var err error
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
body := v.GetBody()
|
|
|
|
if body == nil {
|
|
|
|
r.body = nil
|
|
|
|
} else {
|
|
|
|
if r.body == nil {
|
|
|
|
r.body = new(DeleteRequestBody)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
err = r.body.FromGRPCMessage(body)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
return r.RequestHeaders.FromMessage(v)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *DeleteResponseBody) ToGRPCMessage() grpc.Message {
|
|
|
|
var m *container.DeleteResponse_Body
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
if r != nil {
|
|
|
|
m = new(container.DeleteResponse_Body)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
|
|
|
return m
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *DeleteResponseBody) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
v, ok := m.(*container.DeleteResponse_Body)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, v)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
return nil
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *DeleteResponse) ToGRPCMessage() grpc.Message {
|
|
|
|
var m *container.DeleteResponse
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
if r != nil {
|
|
|
|
m = new(container.DeleteResponse)
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
m.SetBody(r.body.ToGRPCMessage().(*container.DeleteResponse_Body))
|
|
|
|
r.ResponseHeaders.ToMessage(m)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
|
|
|
return m
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *DeleteResponse) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
v, ok := m.(*container.DeleteResponse)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, v)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
var err error
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
body := v.GetBody()
|
|
|
|
if body == nil {
|
|
|
|
r.body = nil
|
|
|
|
} else {
|
|
|
|
if r.body == nil {
|
|
|
|
r.body = new(DeleteResponseBody)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
err = r.body.FromGRPCMessage(body)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
return r.ResponseHeaders.FromMessage(v)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *ListRequestBody) ToGRPCMessage() grpc.Message {
|
|
|
|
var m *container.ListRequest_Body
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
if r != nil {
|
|
|
|
m = new(container.ListRequest_Body)
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
m.SetOwnerId(r.ownerID.ToGRPCMessage().(*refsGRPC.OwnerID))
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
|
|
|
return m
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *ListRequestBody) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
v, ok := m.(*container.ListRequest_Body)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, v)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
var err error
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
ownerID := v.GetOwnerId()
|
|
|
|
if ownerID == nil {
|
|
|
|
r.ownerID = nil
|
|
|
|
} else {
|
|
|
|
if r.ownerID == nil {
|
|
|
|
r.ownerID = new(refs.OwnerID)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
err = r.ownerID.FromGRPCMessage(ownerID)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *ListRequest) ToGRPCMessage() grpc.Message {
|
|
|
|
var m *container.ListRequest
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
if r != nil {
|
|
|
|
m = new(container.ListRequest)
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
m.SetBody(r.body.ToGRPCMessage().(*container.ListRequest_Body))
|
|
|
|
r.RequestHeaders.ToMessage(m)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
|
|
|
return m
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *ListRequest) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
v, ok := m.(*container.ListRequest)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, v)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
var err error
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
body := v.GetBody()
|
|
|
|
if body == nil {
|
|
|
|
r.body = nil
|
|
|
|
} else {
|
|
|
|
if r.body == nil {
|
|
|
|
r.body = new(ListRequestBody)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
err = r.body.FromGRPCMessage(body)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
return r.RequestHeaders.FromMessage(v)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *ListResponseBody) ToGRPCMessage() grpc.Message {
|
|
|
|
var m *container.ListResponse_Body
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
if r != nil {
|
|
|
|
m = new(container.ListResponse_Body)
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
m.SetContainerIds(refs.ContainerIDsToGRPCMessage(r.cidList))
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return m
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *ListResponseBody) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
v, ok := m.(*container.ListResponse_Body)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, v)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
var err error
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
r.cidList, err = refs.ContainerIDsFromGRPCMessage(v.GetContainerIds())
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
return err
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *ListResponse) ToGRPCMessage() grpc.Message {
|
|
|
|
var m *container.ListResponse
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
if r != nil {
|
|
|
|
m = new(container.ListResponse)
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
m.SetBody(r.body.ToGRPCMessage().(*container.ListResponse_Body))
|
|
|
|
r.ResponseHeaders.ToMessage(m)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
|
|
|
return m
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *ListResponse) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
v, ok := m.(*container.ListResponse)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, v)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
var err error
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
body := v.GetBody()
|
|
|
|
if body == nil {
|
|
|
|
r.body = nil
|
|
|
|
} else {
|
|
|
|
if r.body == nil {
|
|
|
|
r.body = new(ListResponseBody)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
err = r.body.FromGRPCMessage(body)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
return r.ResponseHeaders.FromMessage(v)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *SetExtendedACLRequestBody) ToGRPCMessage() grpc.Message {
|
|
|
|
var m *container.SetExtendedACLRequest_Body
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
if r != nil {
|
|
|
|
m = new(container.SetExtendedACLRequest_Body)
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
m.SetEacl(r.eacl.ToGRPCMessage().(*aclGRPC.EACLTable))
|
|
|
|
m.SetSignature(r.sig.ToGRPCMessage().(*refsGRPC.Signature))
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
|
|
|
return m
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *SetExtendedACLRequestBody) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
v, ok := m.(*container.SetExtendedACLRequest_Body)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, v)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
var err error
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
eacl := v.GetEacl()
|
|
|
|
if eacl == nil {
|
|
|
|
r.eacl = nil
|
|
|
|
} else {
|
|
|
|
if r.eacl == nil {
|
|
|
|
r.eacl = new(acl.Table)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
err = r.eacl.FromGRPCMessage(eacl)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
2020-08-18 12:48:39 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
sig := v.GetSignature()
|
|
|
|
if sig == nil {
|
|
|
|
r.sig = nil
|
|
|
|
} else {
|
|
|
|
if r.sig == nil {
|
|
|
|
r.sig = new(refs.Signature)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
err = r.sig.FromGRPCMessage(sig)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *SetExtendedACLRequest) ToGRPCMessage() grpc.Message {
|
|
|
|
var m *container.SetExtendedACLRequest
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
if r != nil {
|
|
|
|
m = new(container.SetExtendedACLRequest)
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
m.SetBody(r.body.ToGRPCMessage().(*container.SetExtendedACLRequest_Body))
|
|
|
|
r.RequestHeaders.ToMessage(m)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
|
|
|
return m
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *SetExtendedACLRequest) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
v, ok := m.(*container.SetExtendedACLRequest)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, v)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
var err error
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
body := v.GetBody()
|
|
|
|
if body == nil {
|
|
|
|
r.body = nil
|
|
|
|
} else {
|
|
|
|
if r.body == nil {
|
|
|
|
r.body = new(SetExtendedACLRequestBody)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
err = r.body.FromGRPCMessage(body)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
return r.RequestHeaders.FromMessage(v)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *SetExtendedACLResponseBody) ToGRPCMessage() grpc.Message {
|
|
|
|
var m *container.SetExtendedACLResponse_Body
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
if r != nil {
|
|
|
|
m = new(container.SetExtendedACLResponse_Body)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
|
|
|
return m
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *SetExtendedACLResponseBody) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
v, ok := m.(*container.SetExtendedACLResponse_Body)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, v)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
return nil
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *SetExtendedACLResponse) ToGRPCMessage() grpc.Message {
|
|
|
|
var m *container.SetExtendedACLResponse
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
if r != nil {
|
|
|
|
m = new(container.SetExtendedACLResponse)
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
m.SetBody(r.body.ToGRPCMessage().(*container.SetExtendedACLResponse_Body))
|
|
|
|
r.ResponseHeaders.ToMessage(m)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
|
|
|
return m
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *SetExtendedACLResponse) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
v, ok := m.(*container.SetExtendedACLResponse)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, v)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
var err error
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
body := v.GetBody()
|
|
|
|
if body == nil {
|
|
|
|
r.body = nil
|
|
|
|
} else {
|
|
|
|
if r.body == nil {
|
|
|
|
r.body = new(SetExtendedACLResponseBody)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
err = r.body.FromGRPCMessage(body)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
return r.ResponseHeaders.FromMessage(v)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *GetExtendedACLRequestBody) ToGRPCMessage() grpc.Message {
|
|
|
|
var m *container.GetExtendedACLRequest_Body
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
if r != nil {
|
|
|
|
m = new(container.GetExtendedACLRequest_Body)
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
m.SetContainerId(r.cid.ToGRPCMessage().(*refsGRPC.ContainerID))
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
|
|
|
return m
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *GetExtendedACLRequestBody) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
v, ok := m.(*container.GetExtendedACLRequest_Body)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, v)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
var err error
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
cid := v.GetContainerId()
|
|
|
|
if cid == nil {
|
|
|
|
r.cid = nil
|
|
|
|
} else {
|
|
|
|
if r.cid == nil {
|
|
|
|
r.cid = new(refs.ContainerID)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
err = r.cid.FromGRPCMessage(cid)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *GetExtendedACLRequest) ToGRPCMessage() grpc.Message {
|
|
|
|
var m *container.GetExtendedACLRequest
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
if r != nil {
|
|
|
|
m = new(container.GetExtendedACLRequest)
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
m.SetBody(r.body.ToGRPCMessage().(*container.GetExtendedACLRequest_Body))
|
|
|
|
r.RequestHeaders.ToMessage(m)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
|
|
|
return m
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *GetExtendedACLRequest) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
v, ok := m.(*container.GetExtendedACLRequest)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, v)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
var err error
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
body := v.GetBody()
|
|
|
|
if body == nil {
|
|
|
|
r.body = nil
|
|
|
|
} else {
|
|
|
|
if r.body == nil {
|
|
|
|
r.body = new(GetExtendedACLRequestBody)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
err = r.body.FromGRPCMessage(body)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
return r.RequestHeaders.FromMessage(v)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *GetExtendedACLResponseBody) ToGRPCMessage() grpc.Message {
|
|
|
|
var m *container.GetExtendedACLResponse_Body
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
if r != nil {
|
|
|
|
m = new(container.GetExtendedACLResponse_Body)
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
m.SetEacl(r.eacl.ToGRPCMessage().(*aclGRPC.EACLTable))
|
|
|
|
m.SetSignature(r.sig.ToGRPCMessage().(*refsGRPC.Signature))
|
2021-05-24 18:18:56 +00:00
|
|
|
m.SetSessionToken(r.token.ToGRPCMessage().(*sessionGRPC.SessionToken))
|
2021-03-12 12:57:23 +00:00
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
|
|
|
return m
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *GetExtendedACLResponseBody) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
v, ok := m.(*container.GetExtendedACLResponse_Body)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, v)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
var err error
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
eacl := v.GetEacl()
|
|
|
|
if eacl == nil {
|
|
|
|
r.eacl = nil
|
|
|
|
} else {
|
|
|
|
if r.eacl == nil {
|
|
|
|
r.eacl = new(acl.Table)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
err = r.eacl.FromGRPCMessage(eacl)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
sig := v.GetSignature()
|
|
|
|
if sig == nil {
|
|
|
|
r.sig = nil
|
|
|
|
} else {
|
|
|
|
if r.sig == nil {
|
|
|
|
r.sig = new(refs.Signature)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
err = r.sig.FromGRPCMessage(sig)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-05-24 18:18:56 +00:00
|
|
|
token := v.GetSessionToken()
|
|
|
|
if token == nil {
|
|
|
|
r.token = nil
|
|
|
|
} else {
|
|
|
|
if r.token == nil {
|
|
|
|
r.token = new(session.SessionToken)
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.token.FromGRPCMessage(token)
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
return err
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *GetExtendedACLResponse) ToGRPCMessage() grpc.Message {
|
|
|
|
var m *container.GetExtendedACLResponse
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
if r != nil {
|
|
|
|
m = new(container.GetExtendedACLResponse)
|
|
|
|
|
|
|
|
m.SetBody(r.body.ToGRPCMessage().(*container.GetExtendedACLResponse_Body))
|
|
|
|
r.ResponseHeaders.ToMessage(m)
|
|
|
|
}
|
2020-08-17 16:00:10 +00:00
|
|
|
|
|
|
|
return m
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *GetExtendedACLResponse) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
v, ok := m.(*container.GetExtendedACLResponse)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, v)
|
2020-08-17 16:00:10 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
var err error
|
2020-08-17 16:00:10 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
body := v.GetBody()
|
|
|
|
if body == nil {
|
|
|
|
r.body = nil
|
|
|
|
} else {
|
|
|
|
if r.body == nil {
|
|
|
|
r.body = new(GetExtendedACLResponseBody)
|
|
|
|
}
|
2021-01-21 14:57:04 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
err = r.body.FromGRPCMessage(body)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2021-01-21 14:57:04 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
return r.ResponseHeaders.FromMessage(v)
|
|
|
|
}
|
2021-01-21 14:57:04 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (a *UsedSpaceAnnouncement) ToGRPCMessage() grpc.Message {
|
|
|
|
var m *container.AnnounceUsedSpaceRequest_Body_Announcement
|
2021-01-26 18:32:33 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
if a != nil {
|
|
|
|
m = new(container.AnnounceUsedSpaceRequest_Body_Announcement)
|
2021-01-21 14:57:04 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
m.SetContainerId(a.cid.ToGRPCMessage().(*refsGRPC.ContainerID))
|
|
|
|
m.SetEpoch(a.epoch)
|
|
|
|
m.SetUsedSpace(a.usedSpace)
|
|
|
|
}
|
2021-01-21 14:57:04 +00:00
|
|
|
|
|
|
|
return m
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (a *UsedSpaceAnnouncement) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
v, ok := m.(*container.AnnounceUsedSpaceRequest_Body_Announcement)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, v)
|
2021-01-21 14:57:04 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
var err error
|
2021-01-21 14:57:04 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
cid := v.GetContainerId()
|
|
|
|
if cid == nil {
|
|
|
|
a.cid = nil
|
|
|
|
} else {
|
|
|
|
if a.cid == nil {
|
|
|
|
a.cid = new(refs.ContainerID)
|
|
|
|
}
|
2021-01-26 18:32:33 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
err = a.cid.FromGRPCMessage(cid)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
2021-01-21 14:57:04 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
a.epoch = v.GetEpoch()
|
|
|
|
a.usedSpace = v.GetUsedSpace()
|
2021-01-21 14:57:04 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
return nil
|
2021-01-21 14:57:04 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func UsedSpaceAnnouncementsToGRPCMessage(
|
|
|
|
ids []*UsedSpaceAnnouncement,
|
|
|
|
) (res []*container.AnnounceUsedSpaceRequest_Body_Announcement) {
|
|
|
|
if ids != nil {
|
|
|
|
res = make([]*container.AnnounceUsedSpaceRequest_Body_Announcement, 0, len(ids))
|
|
|
|
|
|
|
|
for i := range ids {
|
|
|
|
res = append(res, ids[i].ToGRPCMessage().(*container.AnnounceUsedSpaceRequest_Body_Announcement))
|
|
|
|
}
|
2021-01-21 14:57:04 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
return
|
|
|
|
}
|
2021-01-21 14:57:04 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func UsedSpaceAnnouncementssFromGRPCMessage(
|
|
|
|
asV2 []*container.AnnounceUsedSpaceRequest_Body_Announcement,
|
|
|
|
) (res []*UsedSpaceAnnouncement, err error) {
|
|
|
|
if asV2 != nil {
|
|
|
|
res = make([]*UsedSpaceAnnouncement, 0, len(asV2))
|
2021-01-21 14:57:04 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
for i := range asV2 {
|
|
|
|
var a *UsedSpaceAnnouncement
|
2021-01-21 14:57:04 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
if asV2[i] != nil {
|
|
|
|
a = new(UsedSpaceAnnouncement)
|
2021-01-21 14:57:04 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
err = a.FromGRPCMessage(asV2[i])
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
2021-01-21 14:57:04 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
res = append(res, a)
|
|
|
|
}
|
2021-01-21 14:57:04 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
return
|
|
|
|
}
|
2021-01-21 14:57:04 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *AnnounceUsedSpaceRequestBody) ToGRPCMessage() grpc.Message {
|
|
|
|
var m *container.AnnounceUsedSpaceRequest_Body
|
2021-01-21 14:57:04 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
if r != nil {
|
|
|
|
m = new(container.AnnounceUsedSpaceRequest_Body)
|
2021-01-21 14:57:04 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
m.SetAnnouncements(UsedSpaceAnnouncementsToGRPCMessage(r.announcements))
|
|
|
|
}
|
2021-01-21 14:57:04 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
return m
|
2021-01-21 14:57:04 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *AnnounceUsedSpaceRequestBody) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
v, ok := m.(*container.AnnounceUsedSpaceRequest_Body)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, v)
|
2021-01-21 14:57:04 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
var err error
|
2021-01-21 14:57:04 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
r.announcements, err = UsedSpaceAnnouncementssFromGRPCMessage(v.GetAnnouncements())
|
2021-01-21 14:57:04 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *AnnounceUsedSpaceRequest) ToGRPCMessage() grpc.Message {
|
|
|
|
var m *container.AnnounceUsedSpaceRequest
|
|
|
|
|
|
|
|
if r != nil {
|
|
|
|
m = new(container.AnnounceUsedSpaceRequest)
|
|
|
|
|
|
|
|
m.SetBody(r.body.ToGRPCMessage().(*container.AnnounceUsedSpaceRequest_Body))
|
|
|
|
r.RequestHeaders.ToMessage(m)
|
|
|
|
}
|
2021-01-21 14:57:04 +00:00
|
|
|
|
|
|
|
return m
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *AnnounceUsedSpaceRequest) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
v, ok := m.(*container.AnnounceUsedSpaceRequest)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, v)
|
2021-01-21 14:57:04 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
var err error
|
2021-01-21 14:57:04 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
body := v.GetBody()
|
|
|
|
if body == nil {
|
|
|
|
r.body = nil
|
|
|
|
} else {
|
|
|
|
if r.body == nil {
|
|
|
|
r.body = new(AnnounceUsedSpaceRequestBody)
|
|
|
|
}
|
2021-01-21 14:57:04 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
err = r.body.FromGRPCMessage(body)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
2021-01-21 14:57:04 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
return r.RequestHeaders.FromMessage(v)
|
2021-01-21 14:57:04 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *AnnounceUsedSpaceResponseBody) ToGRPCMessage() grpc.Message {
|
|
|
|
var m *container.AnnounceUsedSpaceResponse_Body
|
2021-01-21 14:57:04 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
if r != nil {
|
|
|
|
m = new(container.AnnounceUsedSpaceResponse_Body)
|
|
|
|
}
|
2021-01-21 14:57:04 +00:00
|
|
|
|
|
|
|
return m
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *AnnounceUsedSpaceResponseBody) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
v, ok := m.(*container.AnnounceUsedSpaceResponse_Body)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, v)
|
2021-01-21 14:57:04 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
return nil
|
2021-01-21 14:57:04 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *AnnounceUsedSpaceResponse) ToGRPCMessage() grpc.Message {
|
|
|
|
var m *container.AnnounceUsedSpaceResponse
|
2021-01-21 14:57:04 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
if r != nil {
|
|
|
|
m = new(container.AnnounceUsedSpaceResponse)
|
2021-01-21 14:57:04 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
m.SetBody(r.body.ToGRPCMessage().(*container.AnnounceUsedSpaceResponse_Body))
|
|
|
|
r.ResponseHeaders.ToMessage(m)
|
|
|
|
}
|
2021-01-21 14:57:04 +00:00
|
|
|
|
|
|
|
return m
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *AnnounceUsedSpaceResponse) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
v, ok := m.(*container.AnnounceUsedSpaceResponse)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, v)
|
2021-01-21 14:57:04 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
var err error
|
2021-01-21 14:57:04 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
body := v.GetBody()
|
|
|
|
if body == nil {
|
|
|
|
r.body = nil
|
|
|
|
} else {
|
|
|
|
if r.body == nil {
|
|
|
|
r.body = new(AnnounceUsedSpaceResponseBody)
|
|
|
|
}
|
2021-01-21 14:57:04 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
err = r.body.FromGRPCMessage(body)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
2021-01-21 14:57:04 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
return r.ResponseHeaders.FromMessage(v)
|
2021-01-21 14:57:04 +00:00
|
|
|
}
|