Implement field setters on all protobuf messages

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-08-12 22:06:10 +03:00 committed by Stanislav Bogatyrev
parent 2ccfe34a20
commit 0ee1c3653d
12 changed files with 1913 additions and 0 deletions

76
session/v2/service.go Normal file
View file

@ -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
}
}