[#283] v2/session/grpc: Implement setters on container session messages

Implement `SessionToken_Body.SetContainerSessionContext` method. Implement
field setters on `ContainerSessionContext`.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-05-24 15:54:49 +03:00 committed by Alex Vanin
parent 8d60b2cdd5
commit f2be7509d3

View file

@ -77,6 +77,15 @@ func (m *SessionToken_Body) SetObjectSessionContext(v *ObjectSessionContext) {
} }
} }
// SetContainerSessionContext sets container context of the session token.
func (m *SessionToken_Body) SetContainerSessionContext(v *ContainerSessionContext) {
if m != nil {
m.Context = &SessionToken_Body_Container{
Container: v,
}
}
}
// SetAddress sets address of the object related to the session. // SetAddress sets address of the object related to the session.
func (m *ObjectSessionContext) SetAddress(v *refs.Address) { func (m *ObjectSessionContext) SetAddress(v *refs.Address) {
if m != nil { if m != nil {
@ -91,6 +100,27 @@ func (m *ObjectSessionContext) SetVerb(v ObjectSessionContext_Verb) {
} }
} }
// SetVerb sets type of request for which the token is issued.
func (x *ContainerSessionContext) SetVerb(v ContainerSessionContext_Verb) {
if x != nil {
x.Verb = v
}
}
// SetWildcard sets wildcard flag of the container session.
func (x *ContainerSessionContext) SetWildcard(v bool) {
if x != nil {
x.Wildcard = v
}
}
// SetContainerId sets identifier of the container related to the session.
func (x *ContainerSessionContext) SetContainerId(v *refs.ContainerID) {
if x != nil {
x.ContainerId = v
}
}
// SetBody sets session token body. // SetBody sets session token body.
func (m *SessionToken) SetBody(v *SessionToken_Body) { func (m *SessionToken) SetBody(v *SessionToken_Body) {
if m != nil { if m != nil {