From 0ee1c3653d97f38ddf438a81ea3f278e7c4a719f Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 12 Aug 2020 22:06:10 +0300 Subject: [PATCH] Implement field setters on all protobuf messages Signed-off-by: Leonard Lyubich --- accounting/v2/service.go | 76 +++++ acl/v2/types.go | 89 ++++++ container/v2/service.go | 362 ++++++++++++++++++++++++ container/v2/types.go | 55 ++++ netmap/v2/types.go | 138 +++++++++ object/v2/service.go | 585 +++++++++++++++++++++++++++++++++++++++ object/v2/types.go | 160 +++++++++++ refs/v2/types.go | 36 +++ service/v2/meta.go | 232 ++++++++++++++++ service/v2/verify.go | 71 +++++ session/v2/service.go | 76 +++++ storagegroup/v2/types.go | 33 +++ 12 files changed, 1913 insertions(+) create mode 100644 accounting/v2/service.go create mode 100644 acl/v2/types.go create mode 100644 container/v2/service.go create mode 100644 container/v2/types.go create mode 100644 netmap/v2/types.go create mode 100644 object/v2/service.go create mode 100644 object/v2/types.go create mode 100644 refs/v2/types.go create mode 100644 service/v2/meta.go create mode 100644 service/v2/verify.go create mode 100644 session/v2/service.go create mode 100644 storagegroup/v2/types.go diff --git a/accounting/v2/service.go b/accounting/v2/service.go new file mode 100644 index 0000000..8898217 --- /dev/null +++ b/accounting/v2/service.go @@ -0,0 +1,76 @@ +package v2 + +import ( + refs "github.com/nspcc-dev/neofs-api-go/refs/v2" + service "github.com/nspcc-dev/neofs-api-go/service/v2" +) + +// SetValue sets value of the decimal number. +func (m *Decimal) SetValue(v int64) { + if m != nil { + m.Value = v + } +} + +// SetPrecision sets precision of the decimal number. +func (m *Decimal) SetPrecision(v uint32) { + if m != nil { + m.Precision = v + } +} + +// SetOwnerId sets identifier of the account owner. +func (m *BalanceRequest_Body) SetOwnerId(v *refs.OwnerID) { + if m != nil { + m.OwnerId = v + } +} + +// SetBody sets body of the request. +func (m *BalanceRequest) SetBody(v *BalanceRequest_Body) { + if m != nil { + m.Body = v + } +} + +// SetMetaHeader sets meta header of the request. +func (m *BalanceRequest) SetMetaHeader(v *service.RequestMetaHeader) { + if m != nil { + m.MetaHeader = v + } +} + +// SetVerifyHeader sets verification header of the request. +func (m *BalanceRequest) SetVerifyHeader(v *service.RequestVerificationHeader) { + if m != nil { + m.VerifyHeader = v + } +} + +// SetBalance sets balance value of the response. +func (m *BalanceResponse_Body) SetBalance(v *Decimal) { + if m != nil { + m.Balance = v + } +} + +// SetBody sets body of the response. +func (m *BalanceResponse) SetBody(v *BalanceResponse_Body) { + if m != nil { + m.Body = v + } +} + +// SetMetaHeader sets meta header of the response. +func (m *BalanceResponse) SetMetaHeader(v *service.ResponseMetaHeader) { + if m != nil { + m.MetaHeader = v + } +} + +// SetVerifyHeader sets verification header of the response. +func (m *BalanceResponse) SetVerifyHeader(v *service.ResponseVerificationHeader) { + if m != nil { + m.VerifyHeader = v + } +} diff --git a/acl/v2/types.go b/acl/v2/types.go new file mode 100644 index 0000000..58eaf2e --- /dev/null +++ b/acl/v2/types.go @@ -0,0 +1,89 @@ +package v2 + +import ( + refs "github.com/nspcc-dev/neofs-api-go/refs/v2" +) + +// SetContainerId sets container identifier of the eACL table. +func (m *EACLTable) SetContainerId(v *refs.ContainerID) { + if m != nil { + m.ContainerId = v + } +} + +// SetRecords sets record list of the eACL table. +func (m *EACLTable) SetRecords(v []*EACLRecord) { + if m != nil { + m.Records = v + } +} + +// SetOperation sets operation of the eACL record. +func (m *EACLRecord) SetOperation(v EACLRecord_Operation) { + if m != nil { + m.Operation = v + } +} + +// SetAction sets action of the eACL record. +func (m *EACLRecord) SetAction(v EACLRecord_Action) { + if m != nil { + m.Action = v + } +} + +// SetFilters sets filter list of the eACL record. +func (m *EACLRecord) SetFilters(v []*EACLRecord_FilterInfo) { + if m != nil { + m.Filters = v + } +} + +// SetTargets sets target list of the eACL record. +func (m *EACLRecord) SetTargets(v []*EACLRecord_TargetInfo) { + if m != nil { + m.Targets = v + } +} + +// SetHeader sets header type of the eACL filter. +func (m *EACLRecord_FilterInfo) SetHeader(v EACLRecord_FilterInfo_Header) { + if m != nil { + m.Header = v + } +} + +// SetMatchType sets match type of the eACL filter. +func (m *EACLRecord_FilterInfo) SetMatchType(v EACLRecord_FilterInfo_MatchType) { + if m != nil { + m.MatchType = v + } +} + +// SetHeaderName sets header name of the eACL filter. +func (m *EACLRecord_FilterInfo) SetHeaderName(v string) { + if m != nil { + m.HeaderName = v + } +} + +// SetHeaderVal sets header value of the eACL filter. +func (m *EACLRecord_FilterInfo) SetHeaderVal(v string) { + if m != nil { + m.HeaderVal = v + } +} + +// SetTarget sets target group of the eACL target. +func (m *EACLRecord_TargetInfo) SetTarget(v Target) { + if m != nil { + m.Target = v + } +} + +// SetKeyList sets key list of the eACL target. +func (m *EACLRecord_TargetInfo) SetKeyList(v [][]byte) { + if m != nil { + m.KeyList = v + } +} diff --git a/container/v2/service.go b/container/v2/service.go new file mode 100644 index 0000000..1995b48 --- /dev/null +++ b/container/v2/service.go @@ -0,0 +1,362 @@ +package v2 + +import ( + acl "github.com/nspcc-dev/neofs-api-go/acl/v2" + refs "github.com/nspcc-dev/neofs-api-go/refs/v2" + service "github.com/nspcc-dev/neofs-api-go/service/v2" +) + +// SetContainer sets container of the request. +func (m *PutRequest_Body) SetContainer(v *Container) { + if m != nil { + m.Container = v + } +} + +// SetPublicKey sets public key of the container owner. +func (m *PutRequest_Body) SetPublicKey(v []byte) { + if m != nil { + m.PublicKey = v + } +} + +// SetSignature sets signature of the container structure. +func (m *PutRequest_Body) SetSignature(v []byte) { + if m != nil { + m.Signature = v + } +} + +// SetBody sets body of the request. +func (m *PutRequest) SetBody(v *PutRequest_Body) { + if m != nil { + m.Body = v + } +} + +// SetMetaHeader sets meta header of the request. +func (m *PutRequest) SetMetaHeader(v *service.RequestMetaHeader) { + if m != nil { + m.MetaHeader = v + } +} + +// SetVerifyHeader sets verification header of the request. +func (m *PutRequest) SetVerifyHeader(v *service.RequestVerificationHeader) { + if m != nil { + m.VerifyHeader = v + } +} + +// SetContainerId sets identifier of the container. +func (m *PutResponse_Body) SetContainerId(v *refs.ContainerID) { + if m != nil { + m.ContainerId = v + } +} + +// SetBody sets body of the response. +func (m *PutResponse) SetBody(v *PutResponse_Body) { + if m != nil { + m.Body = v + } +} + +// SetMetaHeader sets meta header of the response. +func (m *PutResponse) SetMetaHeader(v *service.ResponseMetaHeader) { + if m != nil { + m.MetaHeader = v + } +} + +// SetVerifyHeader sets verification header of the response. +func (m *PutResponse) SetVerifyHeader(v *service.ResponseVerificationHeader) { + if m != nil { + m.VerifyHeader = v + } +} + +// SetContainerId sets identifier of the container. +func (m *DeleteRequest_Body) SetContainerId(v *refs.ContainerID) { + if m != nil { + m.ContainerId = v + } +} + +// SetSignature sets signature of the container identifier. +func (m *DeleteRequest_Body) SetSignature(v []byte) { + if m != nil { + m.Signature = v + } +} + +// SetBody sets body of the request. +func (m *DeleteRequest) SetBody(v *DeleteRequest_Body) { + if m != nil { + m.Body = v + } +} + +// SetMetaHeader sets meta header of the request. +func (m *DeleteRequest) SetMetaHeader(v *service.RequestMetaHeader) { + if m != nil { + m.MetaHeader = v + } +} + +// SetVerifyHeader sets verification header of the request. +func (m *DeleteRequest) SetVerifyHeader(v *service.RequestVerificationHeader) { + if m != nil { + m.VerifyHeader = v + } +} + +// SetBody sets body of the response. +func (m *DeleteResponse) SetBody(v *DeleteResponse_Body) { + if m != nil { + m.Body = v + } +} + +// SetMetaHeader sets meta header of the response. +func (m *DeleteResponse) SetMetaHeader(v *service.ResponseMetaHeader) { + if m != nil { + m.MetaHeader = v + } +} + +// SetVerifyHeader sets verification header of the response. +func (m *DeleteResponse) SetVerifyHeader(v *service.ResponseVerificationHeader) { + if m != nil { + m.VerifyHeader = v + } +} + +// SetContainerId sets identifier of the container. +func (m *GetRequest_Body) SetContainerId(v *refs.ContainerID) { + m.ContainerId = v +} + +// SetBody sets body of the request. +func (m *GetRequest) SetBody(v *GetRequest_Body) { + if m != nil { + m.Body = v + } +} + +// SetMetaHeader sets meta header of the request. +func (m *GetRequest) SetMetaHeader(v *service.RequestMetaHeader) { + if m != nil { + m.MetaHeader = v + } +} + +// SetVerifyHeader sets verification header of the request. +func (m *GetRequest) SetVerifyHeader(v *service.RequestVerificationHeader) { + if m != nil { + m.VerifyHeader = v + } +} + +// SetContainer sets the container structure. +func (m *GetResponse_Body) SetContainer(v *Container) { + if m != nil { + m.Container = v + } +} + +// SetBody sets body of the response. +func (m *GetResponse) SetBody(v *GetResponse_Body) { + if m != nil { + m.Body = v + } +} + +// SetMetaHeader sets meta header of the response. +func (m *GetResponse) SetMetaHeader(v *service.ResponseMetaHeader) { + if m != nil { + m.MetaHeader = v + } +} + +// SetVerifyHeader sets verification header of the response. +func (m *GetResponse) SetVerifyHeader(v *service.ResponseVerificationHeader) { + if m != nil { + m.VerifyHeader = v + } +} + +// SetOwnerId sets identifier of the container owner. +func (m *ListRequest_Body) SetOwnerId(v *refs.OwnerID) { + if m != nil { + m.OwnerId = v + } +} + +// SetBody sets body of the request. +func (m *ListRequest) SetBody(v *ListRequest_Body) { + if m != nil { + m.Body = v + } +} + +// SetMetaHeader sets meta header of the request. +func (m *ListRequest) SetMetaHeader(v *service.RequestMetaHeader) { + if m != nil { + m.MetaHeader = v + } +} + +// SetVerifyHeader sets verification header of the request. +func (m *ListRequest) SetVerifyHeader(v *service.RequestVerificationHeader) { + if m != nil { + m.VerifyHeader = v + } +} + +// SetContainerIds sets list of the container identifiers. +func (m *ListResponse_Body) SetContainerIds(v []*refs.ContainerID) { + if m != nil { + m.ContainerIds = v + } +} + +// SetBody sets body of the response. +func (m *ListResponse) SetBody(v *ListResponse_Body) { + if m != nil { + m.Body = v + } +} + +// SetMetaHeader sets meta header of the response. +func (m *ListResponse) SetMetaHeader(v *service.ResponseMetaHeader) { + if m != nil { + m.MetaHeader = v + } +} + +// SetVerifyHeader sets verification header of the response. +func (m *ListResponse) SetVerifyHeader(v *service.ResponseVerificationHeader) { + if m != nil { + m.VerifyHeader = v + } +} + +// SetEacl sets eACL table structure. +func (m *SetExtendedACLRequest_Body) SetEacl(v *acl.EACLTable) { + if m != nil { + m.Eacl = v + } +} + +// SetSignature sets signature of the eACL table. +func (m *SetExtendedACLRequest_Body) SetSignature(v []byte) { + if m != nil { + m.Signature = v + } +} + +// SetBody sets body of the request. +func (m *SetExtendedACLRequest) SetBody(v *SetExtendedACLRequest_Body) { + if m != nil { + m.Body = v + } +} + +// SetMetaHeader sets meta header of the request. +func (m *SetExtendedACLRequest) SetMetaHeader(v *service.RequestMetaHeader) { + if m != nil { + m.MetaHeader = v + } +} + +// SetVerifyHeader sets verification header of the request. +func (m *SetExtendedACLRequest) SetVerifyHeader(v *service.RequestVerificationHeader) { + if m != nil { + m.VerifyHeader = v + } +} + +// SetBody sets body of the response. +func (m *SetExtendedACLResponse) SetBody(v *SetExtendedACLResponse_Body) { + if m != nil { + m.Body = v + } +} + +// SetMetaHeader sets meta header of the response. +func (m *SetExtendedACLResponse) SetMetaHeader(v *service.ResponseMetaHeader) { + if m != nil { + m.MetaHeader = v + } +} + +// SetVerifyHeader sets verification header of the response. +func (m *SetExtendedACLResponse) SetVerifyHeader(v *service.ResponseVerificationHeader) { + if m != nil { + m.VerifyHeader = v + } +} + +// SetContainerId sets identifier of the container. +func (m *GetExtendedACLRequest_Body) SetContainerId(v *refs.ContainerID) { + if m != nil { + m.ContainerId = v + } +} + +// SetBody sets body of the request. +func (m *GetExtendedACLRequest) SetBody(v *GetExtendedACLRequest_Body) { + if m != nil { + m.Body = v + } +} + +// SetMetaHeader sets meta header of the request. +func (m *GetExtendedACLRequest) SetMetaHeader(v *service.RequestMetaHeader) { + if m != nil { + m.MetaHeader = v + } +} + +// SetVerifyHeader sets verification header of the request. +func (m *GetExtendedACLRequest) SetVerifyHeader(v *service.RequestVerificationHeader) { + if m != nil { + m.VerifyHeader = v + } +} + +// SetEacl sets eACL table structure. +func (m *GetExtendedACLResponse_Body) SetEacl(v *acl.EACLTable) { + if m != nil { + m.Eacl = v + } +} + +// SetSignature sets signature of the eACL table. +func (m *GetExtendedACLResponse_Body) SetSignature(v []byte) { + if m != nil { + m.Signature = v + } +} + +// SetBody sets body of the response. +func (m *GetExtendedACLResponse) SetBody(v *GetExtendedACLResponse_Body) { + if m != nil { + m.Body = v + } +} + +// SetMetaHeader sets meta header of the response. +func (m *GetExtendedACLResponse) SetMetaHeader(v *service.ResponseMetaHeader) { + if m != nil { + m.MetaHeader = v + } +} + +// SetVerifyHeader sets verification header of the response. +func (m *GetExtendedACLResponse) SetVerifyHeader(v *service.ResponseVerificationHeader) { + if m != nil { + m.VerifyHeader = v + } +} diff --git a/container/v2/types.go b/container/v2/types.go new file mode 100644 index 0000000..1379be9 --- /dev/null +++ b/container/v2/types.go @@ -0,0 +1,55 @@ +package v2 + +import ( + netmap "github.com/nspcc-dev/neofs-api-go/netmap/v2" + refs "github.com/nspcc-dev/neofs-api-go/refs/v2" +) + +// SetKey sets key to the container attribute. +func (m *Container_Attribute) SetKey(v string) { + if m != nil { + m.Key = v + } +} + +// SetValue sets value of the container attribute. +func (m *Container_Attribute) SetValue(v string) { + if m != nil { + m.Value = v + } +} + +// SetOwnerId sets identifier of the container owner, +func (m *Container) SetOwnerId(v *refs.OwnerID) { + if m != nil { + m.OwnerId = v + } +} + +// SetNonce sets nonce of the container structure. +func (m *Container) SetNonce(v []byte) { + if m != nil { + m.Nonce = v + } +} + +// SetBasicAcl sets basic ACL of the container. +func (m *Container) SetBasicAcl(v uint32) { + if m != nil { + m.BasicAcl = v + } +} + +// SetAttributes sets list of the container attributes. +func (m *Container) SetAttributes(v []*Container_Attribute) { + if m != nil { + m.Attributes = v + } +} + +// SetRules sets placement rules of the container. +func (m *Container) SetRules(v *netmap.PlacementRule) { + if m != nil { + m.Rules = v + } +} diff --git a/netmap/v2/types.go b/netmap/v2/types.go new file mode 100644 index 0000000..81e63f8 --- /dev/null +++ b/netmap/v2/types.go @@ -0,0 +1,138 @@ +package v2 + +// SetOp sets operation of the simple filter. +func (m *PlacementRule_SFGroup_Filter_SimpleFilter) SetOp(v PlacementRule_SFGroup_Filter_SimpleFilter_Operation) { + if m != nil { + m.Op = v + } +} + +// SetValue sets value of the simple filter. +func (m *PlacementRule_SFGroup_Filter_SimpleFilter) SetValue(v string) { + if m != nil { + m.Args = &PlacementRule_SFGroup_Filter_SimpleFilter_Value{ + Value: v, + } + } +} + +// SetFArgs sets filter args of the simple filter. +func (m *PlacementRule_SFGroup_Filter_SimpleFilter) SetFArgs(v *PlacementRule_SFGroup_Filter_SimpleFilters) { + if m != nil { + m.Args = &PlacementRule_SFGroup_Filter_SimpleFilter_FArgs{ + FArgs: v, + } + } +} + +// SetFilters sets list of the simple filters. +func (m *PlacementRule_SFGroup_Filter_SimpleFilters) SetFilters(v []*PlacementRule_SFGroup_Filter_SimpleFilter) { + if m != nil { + m.Filters = v + } +} + +// SeyKey sets key of the filter. +func (m *PlacementRule_SFGroup_Filter) SeyKey(v string) { + if m != nil { + m.Key = v + } +} + +// SetF sets simple filter of the filter. +func (m *PlacementRule_SFGroup_Filter) SetF(v *PlacementRule_SFGroup_Filter_SimpleFilter) { + if m != nil { + m.F = v + } +} + +// SetCount sets count value of the selector. +func (m *PlacementRule_SFGroup_Selector) SetCount(v uint32) { + if m != nil { + m.Count = v + } +} + +// SetKey sets key of the selector. +func (m *PlacementRule_SFGroup_Selector) SetKey(v string) { + if m != nil { + m.Key = v + } +} + +// SetFilters sets list of the filters. +func (m *PlacementRule_SFGroup) SetFilters(v []*PlacementRule_SFGroup_Filter) { + if m != nil { + m.Filters = v + } +} + +// SetSelectors sets list of the selectors. +func (m *PlacementRule_SFGroup) SetSelectors(v []*PlacementRule_SFGroup_Selector) { + if m != nil { + m.Selectors = v + } +} + +// SetExclude sets exclude list. +func (m *PlacementRule_SFGroup) SetExclude(v []uint32) { + if m != nil { + m.Exclude = v + } +} + +// SetReplFactor sets replication factor of the placement rule. +func (m *PlacementRule) SetReplFactor(v uint32) { + if m != nil { + m.ReplFactor = v + } +} + +// SetSfGroups sets list of the selector-filter groups. +func (m *PlacementRule) SetSfGroups(v []*PlacementRule_SFGroup) { + if m != nil { + m.SfGroups = v + } +} + +// SetKey sets key to the node attribute. +func (m *NodeInfo_Attribute) SetKey(v string) { + if m != nil { + m.Key = v + } +} + +// SetValue sets value of the node attribute. +func (m *NodeInfo_Attribute) SetValue(v string) { + if m != nil { + m.Value = v + } +} + +// SetAddress sets node network address. +func (m *NodeInfo) SetAddress(v string) { + if m != nil { + m.Address = v + } +} + +// SetPublicKey sets node public key in a binary format. +func (m *NodeInfo) SetPublicKey(v []byte) { + if m != nil { + m.PublicKey = v + } +} + +// SetAttributes sets list of the node attributes. +func (m *NodeInfo) SetAttributes(v []*NodeInfo_Attribute) { + if m != nil { + m.Attributes = v + } +} + +// SetState sets node state. +func (m *NodeInfo) SetState(v NodeInfo_State) { + if m != nil { + m.State = v + } +} diff --git a/object/v2/service.go b/object/v2/service.go new file mode 100644 index 0000000..b6e372f --- /dev/null +++ b/object/v2/service.go @@ -0,0 +1,585 @@ +package v2 + +import ( + refs "github.com/nspcc-dev/neofs-api-go/refs/v2" + service "github.com/nspcc-dev/neofs-api-go/service/v2" +) + +// SetAddress sets address of the requested object. +func (m *GetRequest_Body) SetAddress(v *refs.Address) { + if m != nil { + m.Address = v + } +} + +// SetRaw sets raw flag of the request. +func (m *GetRequest_Body) SetRaw(v bool) { + if m != nil { + m.Raw = v + } +} + +// SetBody sets body of the request. +func (m *GetRequest) SetBody(v *GetRequest_Body) { + if m != nil { + m.Body = v + } +} + +// SetMetaHeader sets meta header of the request. +func (m *GetRequest) SetMetaHeader(v *service.RequestMetaHeader) { + if m != nil { + m.MetaHeader = v + } +} + +// SetVerifyHeader sets verification header of the request. +func (m *GetRequest) SetVerifyHeader(v *service.RequestVerificationHeader) { + if m != nil { + m.VerifyHeader = v + } +} + +// SetObjectId sets identifier of the object. +func (m *GetResponse_Body_Init) SetObjectId(v *refs.ObjectID) { + if m != nil { + m.ObjectId = v + } +} + +// SetSignature sets signature of the object identifier. +func (m *GetResponse_Body_Init) SetSignature(v *service.Signature) { + if m != nil { + m.Signature = v + } +} + +// SetHeader sets header of the object. +func (m *GetResponse_Body_Init) SetHeader(v *Header) { + if m != nil { + m.Header = v + } +} + +// SetInit sets initial part of the object. +func (m *GetResponse_Body) SetInit(v *GetResponse_Body_Init) { + if m != nil { + m.ObjectPart = &GetResponse_Body_Init_{ + Init: v, + } + } +} + +// SetChunk sets chunk of the object payload bytes. +func (m *GetResponse_Body) SetChunk(v []byte) { + if m != nil { + m.ObjectPart = &GetResponse_Body_Chunk{ + Chunk: v, + } + } +} + +// SetBody sets body of the response. +func (m *GetResponse) SetBody(v *GetResponse_Body) { + if m != nil { + m.Body = v + } +} + +// SetMetaHeader sets meta header of the response. +func (m *GetResponse) SetMetaHeader(v *service.ResponseMetaHeader) { + if m != nil { + m.MetaHeader = v + } +} + +// SetVerifyHeader sets verification header of the response. +func (m *GetResponse) SetVerifyHeader(v *service.ResponseVerificationHeader) { + if m != nil { + m.VerifyHeader = v + } +} + +// SetObjectId sets identifier of the object. +func (m *PutRequest_Body_Init) SetObjectId(v *refs.ObjectID) { + if m != nil { + m.ObjectId = v + } +} + +// SetSignature sets signature of the object identifier. +func (m *PutRequest_Body_Init) SetSignature(v *service.Signature) { + if m != nil { + m.Signature = v + } +} + +// SetHeader sets header of the object. +func (m *PutRequest_Body_Init) SetHeader(v *Header) { + if m != nil { + m.Header = v + } +} + +// SetCopiesNumber sets number of the copies to save. +func (m *PutRequest_Body_Init) SetCopiesNumber(v uint32) { + if m != nil { + m.CopiesNumber = v + } +} + +// SetInit sets initial part of the object. +func (m *PutRequest_Body) SetInit(v *PutRequest_Body_Init) { + if m != nil { + m.ObjectPart = &PutRequest_Body_Init_{ + Init: v, + } + } +} + +// SetChunk sets chunk of the object paloyad bytes. +func (m *PutRequest_Body) SetChunk(v []byte) { + if m != nil { + m.ObjectPart = &PutRequest_Body_Chunk{ + Chunk: v, + } + } +} + +// SetBody sets body of the request. +func (m *PutRequest) SetBody(v *PutRequest_Body) { + if m != nil { + m.Body = v + } +} + +// SetMetaHeader sets meta header of the request. +func (m *PutRequest) SetMetaHeader(v *service.RequestMetaHeader) { + if m != nil { + m.MetaHeader = v + } +} + +// SetVerifyHeader sets verification header of the request. +func (m *PutRequest) SetVerifyHeader(v *service.RequestVerificationHeader) { + if m != nil { + m.VerifyHeader = v + } +} + +// SetObjectId sets identifier of the saved object. +func (m *PutResponse_Body) SetObjectId(v *refs.ObjectID) { + if m != nil { + m.ObjectId = v + } +} + +// SetBody sets body of the response. +func (m *PutResponse) SetBody(v *PutResponse_Body) { + if m != nil { + m.Body = v + } +} + +// SetMetaHeader sets meta header of the response. +func (m *PutResponse) SetMetaHeader(v *service.ResponseMetaHeader) { + if m != nil { + m.MetaHeader = v + } +} + +// SetVerifyHeader sets verification header of the response. +func (m *PutResponse) SetVerifyHeader(v *service.ResponseVerificationHeader) { + if m != nil { + m.VerifyHeader = v + } +} + +// SetAddress sets address of the object to delete. +func (m *DeleteRequest_Body) SetAddress(v *refs.Address) { + if m != nil { + m.Address = v + } +} + +// SetOwnerId sets identifier of the removing object owner. +func (m *DeleteRequest_Body) SetOwnerId(v *refs.OwnerID) { + if m != nil { + m.OwnerId = v + } +} + +// SetBody sets body of the request. +func (m *DeleteRequest) SetBody(v *DeleteRequest_Body) { + if m != nil { + m.Body = v + } +} + +// SetMetaHeader sets meta header of the request. +func (m *DeleteRequest) SetMetaHeader(v *service.RequestMetaHeader) { + if m != nil { + m.MetaHeader = v + } +} + +// SetVerifyHeader sets verification header of the request. +func (m *DeleteRequest) SetVerifyHeader(v *service.RequestVerificationHeader) { + if m != nil { + m.VerifyHeader = v + } +} + +// SetBody sets body of the response. +func (m *DeleteResponse) SetBody(v *DeleteResponse_Body) { + if m != nil { + m.Body = v + } +} + +// SetMetaHeader sets meta header of the response. +func (m *DeleteResponse) SetMetaHeader(v *service.ResponseMetaHeader) { + if m != nil { + m.MetaHeader = v + } +} + +// SetVerifyHeader sets verification header of the response. +func (m *DeleteResponse) SetVerifyHeader(v *service.ResponseVerificationHeader) { + if m != nil { + m.VerifyHeader = v + } +} + +// SetOwnerId sets identifier of the object with the requested header. +func (m *HeadRequest_Body) SetOwnerId(v *refs.Address) { + if m != nil { + m.Address = v + } +} + +// SetMainOnly sets flag to return the minimal header subset. +func (m *HeadRequest_Body) SetMainOnly(v bool) { + if m != nil { + m.MainOnly = v + } +} + +// SetRaw sets raw flag of the request. +func (m *HeadRequest_Body) SetRaw(v bool) { + if m != nil { + m.Raw = v + } +} + +// SetBody sets body of the request. +func (m *HeadRequest) SetBody(v *HeadRequest_Body) { + if m != nil { + m.Body = v + } +} + +// SetMetaHeader sets meta header of the request. +func (m *HeadRequest) SetMetaHeader(v *service.RequestMetaHeader) { + if m != nil { + m.MetaHeader = v + } +} + +// SetVerifyHeader sets verification header of the request. +func (m *HeadRequest) SetVerifyHeader(v *service.RequestVerificationHeader) { + if m != nil { + m.VerifyHeader = v + } +} + +// SetVersion sets version of the object format. +func (m *HeadResponse_Body_ShortHeader) SetVersion(v *service.Version) { + if m != nil { + m.Version = v + } +} + +// SetCreationEpoch sets creation epoch number of the object. +func (m *HeadResponse_Body_ShortHeader) SetCreationEpoch(v uint64) { + if m != nil { + m.CreationEpoch = v + } +} + +// SetOwnerId sets identifier of the object owner. +func (m *HeadResponse_Body_ShortHeader) SetOwnerId(v *refs.OwnerID) { + if m != nil { + m.OwnerId = v + } +} + +// SetObjectType sets type of the object. +func (m *HeadResponse_Body_ShortHeader) SetObjectType(v ObjectType) { + if m != nil { + m.ObjectType = v + } +} + +// SetPayloadLength sets length of the object payload. +func (m *HeadResponse_Body_ShortHeader) SetPayloadLength(v uint64) { + if m != nil { + m.PayloadLength = v + } +} + +// SetHeader sets full header of the object. +func (m *HeadResponse_Body) SetHeader(v *Header) { + if m != nil { + m.Head = &HeadResponse_Body_Header{ + Header: v, + } + } +} + +// SetShortHeader sets short header of the object. +func (m *HeadResponse_Body) SetShortHeader(v *HeadResponse_Body_ShortHeader) { + if m != nil { + m.Head = &HeadResponse_Body_ShortHeader_{ + ShortHeader: v, + } + } +} + +// SetBody sets body of the response. +func (m *HeadResponse) SetBody(v *HeadResponse_Body) { + if m != nil { + m.Body = v + } +} + +// SetMetaHeader sets meta header of the response. +func (m *HeadResponse) SetMetaHeader(v *service.ResponseMetaHeader) { + if m != nil { + m.MetaHeader = v + } +} + +// SetVerifyHeader sets verification header of the response. +func (m *HeadResponse) SetVerifyHeader(v *service.ResponseVerificationHeader) { + if m != nil { + m.VerifyHeader = v + } +} + +// SetMatchType sets match type of the filter. +func (m *SearchRequest_Body_Query_Filter) SetMatchType(v SearchRequest_Body_Query_Filter_MatchType) { + if m != nil { + m.MatchType = v + } +} + +// SetName sets name of the filtering header. +func (m *SearchRequest_Body_Query_Filter) SetName(v string) { + if m != nil { + m.Name = v + } +} + +// SetValue sets value of the filtering header. +func (m *SearchRequest_Body_Query_Filter) SetValue(v string) { + if m != nil { + m.Value = v + } +} + +// SetVersion sets version of the search query. +func (m *SearchRequest_Body_Query) SetVersion(v uint32) { + if m != nil { + m.Version = v + } +} + +// SetFilters sets list of the query filters. +func (m *SearchRequest_Body_Query) SetFilters(v []*SearchRequest_Body_Query_Filter) { + if m != nil { + m.Filters = v + } +} + +// SetRaw sets raw flag of the request. +func (m *SearchRequest_Body) SetContainerId(v *refs.ContainerID) { + if m != nil { + m.ContainerId = v + } +} + +// SetQuery sets search query structure. +func (m *SearchRequest_Body) SetQuery(v *SearchRequest_Body_Query) { + if m != nil { + m.Query = v + } +} + +// SetBody sets body of the request. +func (m *SearchRequest) SetBody(v *SearchRequest_Body) { + if m != nil { + m.Body = v + } +} + +// SetMetaHeader sets meta header of the request. +func (m *SearchRequest) SetMetaHeader(v *service.RequestMetaHeader) { + if m != nil { + m.MetaHeader = v + } +} + +// SetVerifyHeader sets verification header of the request. +func (m *SearchRequest) SetVerifyHeader(v *service.RequestVerificationHeader) { + if m != nil { + m.VerifyHeader = v + } +} + +// SetIdList sets list of the identifiers of the matched objects. +func (m *SearchResponse_Body) SetIdList(v []*refs.ObjectID) { + if m != nil { + m.IdList = v + } +} + +// SetBody sets body of the response. +func (m *SearchResponse) SetBody(v *SearchResponse_Body) { + if m != nil { + m.Body = v + } +} + +// SetMetaHeader sets meta header of the response. +func (m *SearchResponse) SetMetaHeader(v *service.ResponseMetaHeader) { + if m != nil { + m.MetaHeader = v + } +} + +// SetVerifyHeader sets verification header of the response. +func (m *SearchResponse) SetVerifyHeader(v *service.ResponseVerificationHeader) { + if m != nil { + m.VerifyHeader = v + } +} + +// SetOffset sets offset of the payload range. +func (m *Range) SetOffset(v uint64) { + if m != nil { + m.Offset = v + } +} + +// SetLength sets length of the payload range. +func (m *Range) SetLength(v uint64) { + if m != nil { + m.Length = v + } +} + +// SetAddress sets address of the object with the request payload range. +func (m *GetRangeRequest_Body) SetAddress(v *refs.Address) { + if m != nil { + m.Address = v + } +} + +// SetRange sets range of the object payload. +func (m *GetRangeRequest_Body) SetRange(v *Range) { + if m != nil { + m.Range = v + } +} + +// SetBody sets body of the request. +func (m *GetRangeRequest) SetBody(v *GetRangeRequest_Body) { + if m != nil { + m.Body = v + } +} + +// SetMetaHeader sets meta header of the request. +func (m *GetRangeRequest) SetMetaHeader(v *service.RequestMetaHeader) { + if m != nil { + m.MetaHeader = v + } +} + +// SetVerifyHeader sets verification header of the request. +func (m *GetRangeRequest) SetVerifyHeader(v *service.RequestVerificationHeader) { + if m != nil { + m.VerifyHeader = v + } +} + +// SetChunk sets chunk of the object payload. +func (m *GetRangeResponse_Body) SetChunk(v []byte) { + if m != nil { + m.Chunk = v + } +} + +// SetBody sets body of the response. +func (m *GetRangeResponse) SetBody(v *GetRangeResponse_Body) { + if m != nil { + m.Body = v + } +} + +// SetMetaHeader sets meta header of the response. +func (m *GetRangeResponse) SetMetaHeader(v *service.ResponseMetaHeader) { + if m != nil { + m.MetaHeader = v + } +} + +// SetVerifyHeader sets verification header of the response. +func (m *GetRangeResponse) SetVerifyHeader(v *service.ResponseVerificationHeader) { + if m != nil { + m.VerifyHeader = v + } +} + +// SetAddress sets address of the object with the request payload range. +func (m *GetRangeHashRequest_Body) SetAddress(v *refs.Address) { + if m != nil { + m.Address = v + } +} + +// SetRanges sets list of the ranges of the object payload. +func (m *GetRangeHashRequest_Body) SetRanges(v []*Range) { + if m != nil { + m.Ranges = v + } +} + +// SetSalt sets salt for the object payload ranges. +func (m *GetRangeHashRequest_Body) SetSalt(v []byte) { + if m != nil { + m.Salt = v + } +} + +// SetBody sets body of the request. +func (m *GetRangeHashRequest) SetBody(v *GetRangeHashRequest_Body) { + if m != nil { + m.Body = v + } +} + +// SetMetaHeader sets meta header of the request. +func (m *GetRangeHashRequest) SetMetaHeader(v *service.RequestMetaHeader) { + if m != nil { + m.MetaHeader = v + } +} + +// SetVerifyHeader sets verification header of the request. +func (m *GetRangeHashRequest) SetVerifyHeader(v *service.RequestVerificationHeader) { + if m != nil { + m.VerifyHeader = v + } +} diff --git a/object/v2/types.go b/object/v2/types.go new file mode 100644 index 0000000..9acd3fd --- /dev/null +++ b/object/v2/types.go @@ -0,0 +1,160 @@ +package v2 + +import ( + refs "github.com/nspcc-dev/neofs-api-go/refs/v2" + service "github.com/nspcc-dev/neofs-api-go/service/v2" +) + +// SetKey sets key to the object attribute. +func (m *Header_Attribute) SetKey(v string) { + if m != nil { + m.Key = v + } +} + +// SetValue sets value of the object attribute. +func (m *Header_Attribute) SetValue(v string) { + if m != nil { + m.Value = v + } +} + +// SetParent sets identifier of the parent object. +func (m *Header_Split) SetParent(v *refs.ObjectID) { + if m != nil { + m.Parent = v + } +} + +// SetPrevious sets identifier of the previous object in split-chain. +func (m *Header_Split) SetPrevious(v *refs.ObjectID) { + if m != nil { + m.Previous = v + } +} + +// SetParentSignature sets signature of the parent object header. +func (m *Header_Split) SetParentSignature(v *service.Signature) { + if m != nil { + m.ParentSignature = v + } +} + +// SetParentHeader sets parent header structure. +func (m *Header_Split) SetParentHeader(v *Header) { + if m != nil { + m.ParentHeader = v + } +} + +// SetChildren sets list of the identifiers of the child objects. +func (m *Header_Split) SetChildren(v []*refs.ObjectID) { + if m != nil { + m.Children = v + } +} + +// SetContainerId sets identifier of the container. +func (m *Header) SetContainerId(v *refs.ContainerID) { + if m != nil { + m.ContainerId = v + } +} + +// SetOwnerId sets identifier of the object owner. +func (m *Header) SetOwnerId(v *refs.OwnerID) { + if m != nil { + m.OwnerId = v + } +} + +// SetCreationEpoch sets creation epoch number. +func (m *Header) SetCreationEpoch(v uint64) { + if m != nil { + m.CreationEpoch = v + } +} + +// SetVersion sets version of the object format. +func (m *Header) SetVersion(v *service.Version) { + if m != nil { + m.Version = v + } +} + +// SetPayloadLength sets length of the object payload. +func (m *Header) SetPayloadLength(v uint64) { + if m != nil { + m.PayloadLength = v + } +} + +// SetPayloadHash sets hash of the object payload. +func (m *Header) SetPayloadHash(v []byte) { + if m != nil { + m.PayloadHash = v + } +} + +// SetObjectType sets type of the object. +func (m *Header) SetObjectType(v ObjectType) { + if m != nil { + m.ObjectType = v + } +} + +// SetHomomorphicHash sets homomorphic hash of the object payload. +func (m *Header) SetHomomorphicHash(v []byte) { + if m != nil { + m.HomomorphicHash = v + } +} + +// SetSessionToken sets session token. +func (m *Header) SetSessionToken(v *service.SessionToken) { + if m != nil { + m.SessionToken = v + } +} + +// SetAttributes sets list of the object attributes. +func (m *Header) SetAttributes(v []*Header_Attribute) { + if m != nil { + m.Attributes = v + } +} + +// SetSplit sets split header. +func (m *Header) SetSplit(v *Header_Split) { + if m != nil { + m.Split = v + } +} + +// SetObjectId sets identifier of the object. +func (m *Object) SetObjectId(v *refs.ObjectID) { + if m != nil { + m.ObjectId = v + } +} + +// SetSignature sets signature of the object identifier. +func (m *Object) SetSignature(v *service.Signature) { + if m != nil { + m.Signature = v + } +} + +// SetHeader sets header of the object. +func (m *Object) SetHeader(v *Header) { + if m != nil { + m.Header = v + } +} + +// SetPayload sets payload bytes of the object. +func (m *Object) SetPayload(v []byte) { + if m != nil { + m.Payload = v + } +} diff --git a/refs/v2/types.go b/refs/v2/types.go new file mode 100644 index 0000000..9381202 --- /dev/null +++ b/refs/v2/types.go @@ -0,0 +1,36 @@ +package v2 + +// SetValue sets container identifier in a binary format. +func (m *ContainerID) SetValue(v []byte) { + if m != nil { + m.Value = v + } +} + +// SetValue sets object identifier in a binary format. +func (m *ObjectID) SetValue(v []byte) { + if m != nil { + m.Value = v + } +} + +// SetValue sets owner identifier in a binary format. +func (m *OwnerID) SetValue(v []byte) { + if m != nil { + m.Value = v + } +} + +// SetContainerId sets container identifier of the address. +func (m *Address) SetContainerId(v *ContainerID) { + if m != nil { + m.ContainerId = v + } +} + +// SetObjectId sets object identifier of the address. +func (m *Address) SetObjectId(v *ObjectID) { + if m != nil { + m.ObjectId = v + } +} diff --git a/service/v2/meta.go b/service/v2/meta.go new file mode 100644 index 0000000..b9ac619 --- /dev/null +++ b/service/v2/meta.go @@ -0,0 +1,232 @@ +package v2 + +import ( + acl "github.com/nspcc-dev/neofs-api-go/acl/v2" + refs "github.com/nspcc-dev/neofs-api-go/refs/v2" +) + +// SetKey sets key to the X-Header. +func (m *XHeader) SetKey(v string) { + if m != nil { + m.Key = v + } +} + +// SetValue sets value of the X-Header. +func (m *XHeader) SetValue(v string) { + if m != nil { + m.Value = v + } +} + +// SetMajor sets major version number. +func (m *Version) SetMajor(v uint32) { + if m != nil { + m.Major = v + } +} + +// SetMinor sets minor version number. +func (m *Version) SetMinor(v uint32) { + if m != nil { + m.Minor = v + } +} + +// SetExp sets epoch number of the token expiration. +func (m *TokenLifetime) SetExp(v uint64) { + if m != nil { + m.Exp = v + } +} + +// SetNbf sets starting epoch number of the token. +func (m *TokenLifetime) SetNbf(v uint64) { + if m != nil { + m.Nbf = v + } +} + +// SetIat sets the number of the epoch in which the token was issued. +func (m *TokenLifetime) SetIat(v uint64) { + if m != nil { + m.Iat = v + } +} + +// SetId sets identifier of the session token. +func (m *SessionToken_Body) SetId(v []byte) { + if m != nil { + m.Id = v + } +} + +// SetOwnerId sets identifier of the session token owner. +func (m *SessionToken_Body) SetOwnerId(v *refs.OwnerID) { + if m != nil { + m.OwnerId = v + } +} + +// SetVerb sets verb of the session token. +func (m *SessionToken_Body) SetVerb(v SessionToken_Body_Verb) { + if m != nil { + m.Verb = v + } +} + +// SetLifetime sets lifetime of the session token. +func (m *SessionToken_Body) SetLifetime(v *TokenLifetime) { + if m != nil { + m.Lifetime = v + } +} + +// SetSessionKey sets public session key in a binary format. +func (m *SessionToken_Body) SetSessionKey(v []byte) { + if m != nil { + m.SessionKey = v + } +} + +// SetObjectAddressContext sets object context of the session token. +func (m *SessionToken_Body) SetObjectAddressContext(v *refs.Address) { + if m != nil { + m.Context = &SessionToken_Body_ObjectAddress{ + ObjectAddress: v, + } + } +} + +// SetBody sets session token body. +func (m *SessionToken) SetBody(v *SessionToken_Body) { + if m != nil { + m.Token = v + } +} + +// SetSignature sets session token signature. +func (m *SessionToken) SetSignature(v *Signature) { + if m != nil { + m.Signature = v + } +} + +// SetEaclTable sets eACL table of the bearer token. +func (m *BearerToken_Body) SetEaclTable(v *acl.EACLTable) { + if m != nil { + m.EaclTable = v + } +} + +// SetOwnerId sets identifier of the bearer token owner. +func (m *BearerToken_Body) SetOwnerId(v *refs.OwnerID) { + if m != nil { + m.OwnerId = v + } +} + +// SetLifetime sets lifetime of the bearer token. +func (m *BearerToken_Body) SetLifetime(v *TokenLifetime) { + if m != nil { + m.Lifetime = v + } +} + +// SetBody sets bearer token body. +func (m *BearerToken) SetBody(v *BearerToken_Body) { + if m != nil { + m.Token = v + } +} + +// SetSignature sets bearer token signature. +func (m *BearerToken) SetSignature(v *Signature) { + if m != nil { + m.Signature = v + } +} + +// SetVersion sets client protocol version. +func (m *RequestMetaHeader) SetVersion(v *Version) { + if m != nil { + m.Version = v + } +} + +// SetEpoch sets client local epoch. +func (m *RequestMetaHeader) SetEpoch(v uint64) { + if m != nil { + m.Epoch = v + } +} + +// SetTtl sets request TTL. +func (m *RequestMetaHeader) SetTtl(v uint32) { + if m != nil { + m.Ttl = v + } +} + +// SetXHeaders sets request X-Headers. +func (m *RequestMetaHeader) SetXHeaders(v []*XHeader) { + if m != nil { + m.XHeaders = v + } +} + +// SetSessionToken sets session token of the request. +func (m *RequestMetaHeader) SetSessionToken(v *SessionToken) { + if m != nil { + m.Token = v + } +} + +// SetBearerToken sets bearer token of the request. +func (m *RequestMetaHeader) SetBearerToken(v *BearerToken) { + if m != nil { + m.Bearer = v + } +} + +// SetOrigin sets origin request meta header. +func (m *RequestMetaHeader) SetOrigin(v *RequestMetaHeader) { + if m != nil { + m.Origin = v + } +} + +// SetVersion sets server protocol version. +func (m *ResponseMetaHeader) SetVersion(v *Version) { + if m != nil { + m.Version = v + } +} + +// SetEpoch sets server local epoch. +func (m *ResponseMetaHeader) SetEpoch(v uint64) { + if m != nil { + m.Epoch = v + } +} + +// SetTtl sets response TTL. +func (m *ResponseMetaHeader) SetTtl(v uint32) { + if m != nil { + m.Ttl = v + } +} + +// SetXHeaders sets response X-Headers. +func (m *ResponseMetaHeader) SetXHeaders(v []*XHeader) { + if m != nil { + m.XHeaders = v + } +} + +// SetOrigin sets origin response meta header. +func (m *ResponseMetaHeader) SetOrigin(v *ResponseMetaHeader) { + if m != nil { + m.Origin = v + } +} diff --git a/service/v2/verify.go b/service/v2/verify.go new file mode 100644 index 0000000..8e7e2cf --- /dev/null +++ b/service/v2/verify.go @@ -0,0 +1,71 @@ +package v2 + +// SetKey sets public key in a binary format. +func (m *Signature) SetKey(v []byte) { + if m != nil { + m.Key = v + } +} + +// SetSign sets signature. +func (m *Signature) SetSign(v []byte) { + if m != nil { + m.Sign = v + } +} + +// SetBodySignature sets signature of the request body. +func (m *RequestVerificationHeader) SetBodySignature(v *Signature) { + if m != nil { + m.BodySignature = v + } +} + +// SetMetaSignature sets signature of the request meta. +func (m *RequestVerificationHeader) SetMetaSignature(v *Signature) { + if m != nil { + m.MetaSignature = v + } +} + +// SetOriginSignature sets signature of the origin verification header of the request. +func (m *RequestVerificationHeader) SetOriginSignature(v *Signature) { + if m != nil { + m.OriginSignature = v + } +} + +// SetOrigin sets origin verification header of the request. +func (m *RequestVerificationHeader) SetOrigin(v *RequestVerificationHeader) { + if m != nil { + m.Origin = v + } +} + +// SetBodySignature sets signature of the response body. +func (m *ResponseVerificationHeader) SetBodySignature(v *Signature) { + if m != nil { + m.BodySignature = v + } +} + +// SetMetaSignature sets signature of the response meta. +func (m *ResponseVerificationHeader) SetMetaSignature(v *Signature) { + if m != nil { + m.MetaSignature = v + } +} + +// SetOriginSignature sets signature of the origin verification header of the response. +func (m *ResponseVerificationHeader) SetOriginSignature(v *Signature) { + if m != nil { + m.OriginSignature = v + } +} + +// SetOrigin sets origin verification header of the response. +func (m *ResponseVerificationHeader) SetOrigin(v *ResponseVerificationHeader) { + if m != nil { + m.Origin = v + } +} diff --git a/session/v2/service.go b/session/v2/service.go new file mode 100644 index 0000000..3c1b812 --- /dev/null +++ b/session/v2/service.go @@ -0,0 +1,76 @@ +package v2 + +import ( + refs "github.com/nspcc-dev/neofs-api-go/refs/v2" + service "github.com/nspcc-dev/neofs-api-go/service/v2" +) + +// SetOwnerId sets identifier of the session initiator. +func (m *CreateRequest_Body) SetOwnerId(v *refs.OwnerID) { + if m != nil { + m.OwnerId = v + } +} + +// SetLifetime sets lifetime of the session. +func (m *CreateRequest_Body) SetLifetime(v *service.TokenLifetime) { + if m != nil { + m.Lifetime = v + } +} + +// SetBody sets body of the request. +func (m *CreateRequest) SetBody(v *CreateRequest_Body) { + if m != nil { + m.Body = v + } +} + +// SetMetaHeader sets meta header of the request. +func (m *CreateRequest) SetMetaHeader(v *service.RequestMetaHeader) { + if m != nil { + m.MetaHeader = v + } +} + +// SetVerifyHeader sets verification header of the request. +func (m *CreateRequest) SetVerifyHeader(v *service.RequestVerificationHeader) { + if m != nil { + m.VerifyHeader = v + } +} + +// SetId sets identifier of the session token. +func (m *CreateResponse_Body) SetId(v []byte) { + if m != nil { + m.Id = v + } +} + +// SetSessionKey sets session public key in a binary format. +func (m *CreateResponse_Body) SetSessionKey(v []byte) { + if m != nil { + m.SessionKey = v + } +} + +// SetBody sets body of the response. +func (m *CreateResponse) SetBody(v *CreateResponse_Body) { + if m != nil { + m.Body = v + } +} + +// SetMetaHeader sets meta header of the response. +func (m *CreateResponse) SetMetaHeader(v *service.ResponseMetaHeader) { + if m != nil { + m.MetaHeader = v + } +} + +// SetVerifyHeader sets verification header of the response. +func (m *CreateResponse) SetVerifyHeader(v *service.ResponseVerificationHeader) { + if m != nil { + m.VerifyHeader = v + } +} diff --git a/storagegroup/v2/types.go b/storagegroup/v2/types.go new file mode 100644 index 0000000..a46acfb --- /dev/null +++ b/storagegroup/v2/types.go @@ -0,0 +1,33 @@ +package v2 + +import ( + refs "github.com/nspcc-dev/neofs-api-go/refs/v2" +) + +// SetValidationDataSize sets the total size of the payloads of the storage group. +func (m *StorageGroup) SetValidationDataSize(v uint64) { + if m != nil { + m.ValidationDataSize = v + } +} + +// SetValidationHash sets total homomorphic hash of the storage group payloads. +func (m *StorageGroup) SetValidationHash(v []byte) { + if m != nil { + m.ValidationHash = v + } +} + +// SetExpirationEpoch sets number of the last epoch of the storage group lifetime. +func (m *StorageGroup) SetExpirationEpoch(v uint64) { + if m != nil { + m.ExpirationEpoch = v + } +} + +// SetMembers sets list of the identifiers of the storage group members. +func (m *StorageGroup) SetMembers(v []*refs.ObjectID) { + if m != nil { + m.Members = v + } +}