From f2be7509d3fcabbd10f3619780f70bf9637aeec1 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 24 May 2021 15:54:49 +0300 Subject: [PATCH] [#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 --- v2/session/grpc/types.go | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/v2/session/grpc/types.go b/v2/session/grpc/types.go index a184c04e..20f9ee76 100644 --- a/v2/session/grpc/types.go +++ b/v2/session/grpc/types.go @@ -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. func (m *ObjectSessionContext) SetAddress(v *refs.Address) { 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. func (m *SessionToken) SetBody(v *SessionToken_Body) { if m != nil {