2020-11-13 13:40:00 +00:00
|
|
|
package session
|
|
|
|
|
|
|
|
import (
|
2023-03-07 10:38:56 +00:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message"
|
|
|
|
session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc"
|
2020-11-13 13:40:00 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func (c *ObjectSessionContext) MarshalJSON() ([]byte, error) {
|
2021-03-12 12:57:23 +00:00
|
|
|
return message.MarshalJSON(c)
|
2020-11-13 13:40:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (c *ObjectSessionContext) UnmarshalJSON(data []byte) error {
|
2021-03-12 12:57:23 +00:00
|
|
|
return message.UnmarshalJSON(c, data, new(session.ObjectSessionContext))
|
2020-11-13 13:40:00 +00:00
|
|
|
}
|
2020-11-13 13:43:54 +00:00
|
|
|
|
|
|
|
func (l *TokenLifetime) MarshalJSON() ([]byte, error) {
|
2021-03-12 12:57:23 +00:00
|
|
|
return message.MarshalJSON(l)
|
2020-11-13 13:43:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (l *TokenLifetime) UnmarshalJSON(data []byte) error {
|
2021-03-12 12:57:23 +00:00
|
|
|
return message.UnmarshalJSON(l, data, new(session.SessionToken_Body_TokenLifetime))
|
2020-11-13 13:43:54 +00:00
|
|
|
}
|
2020-11-13 13:49:46 +00:00
|
|
|
|
2022-02-25 07:36:46 +00:00
|
|
|
func (t *TokenBody) MarshalJSON() ([]byte, error) {
|
2021-03-12 12:57:23 +00:00
|
|
|
return message.MarshalJSON(t)
|
2020-11-13 13:49:46 +00:00
|
|
|
}
|
|
|
|
|
2022-02-25 07:36:46 +00:00
|
|
|
func (t *TokenBody) UnmarshalJSON(data []byte) error {
|
[#72] session: Unify unmarshaling code
gopatch:
```
@@
var err, msg, data, t, protojson identifier
var obj expression
@@
+import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message"
-import protojson "google.golang.org/protobuf/encoding/protojson"
-msg := obj
-if err := protojson.Unmarshal(data, msg); err != nil {
-return err
-}
-return t.FromGRPCMessage(msg)
+return message.UnmarshalJSON(t, data, obj)
@@
var err, msg, data, t, goproto identifier
var obj expression
@@
+import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message"
-import goproto "google.golang.org/protobuf/proto"
-msg := obj
-if err := goproto.Unmarshal(data, msg); err != nil {
-return err
-}
-return t.FromGRPCMessage(msg)
+return message.Unmarshal(t, data, obj)
```
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-04-20 10:58:44 +00:00
|
|
|
return message.UnmarshalJSON(t, data, new(session.SessionToken_Body))
|
2020-11-13 13:49:46 +00:00
|
|
|
}
|
2020-11-13 13:53:42 +00:00
|
|
|
|
2022-02-25 07:36:46 +00:00
|
|
|
func (t *Token) MarshalJSON() ([]byte, error) {
|
2021-03-12 12:57:23 +00:00
|
|
|
return message.MarshalJSON(t)
|
2020-11-13 13:53:42 +00:00
|
|
|
}
|
|
|
|
|
2022-02-25 07:36:46 +00:00
|
|
|
func (t *Token) UnmarshalJSON(data []byte) error {
|
[#72] session: Unify unmarshaling code
gopatch:
```
@@
var err, msg, data, t, protojson identifier
var obj expression
@@
+import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message"
-import protojson "google.golang.org/protobuf/encoding/protojson"
-msg := obj
-if err := protojson.Unmarshal(data, msg); err != nil {
-return err
-}
-return t.FromGRPCMessage(msg)
+return message.UnmarshalJSON(t, data, obj)
@@
var err, msg, data, t, goproto identifier
var obj expression
@@
+import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message"
-import goproto "google.golang.org/protobuf/proto"
-msg := obj
-if err := goproto.Unmarshal(data, msg); err != nil {
-return err
-}
-return t.FromGRPCMessage(msg)
+return message.Unmarshal(t, data, obj)
```
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-04-20 10:58:44 +00:00
|
|
|
return message.UnmarshalJSON(t, data, new(session.SessionToken))
|
2020-11-13 13:53:42 +00:00
|
|
|
}
|
2020-11-13 13:58:08 +00:00
|
|
|
|
|
|
|
func (x *XHeader) MarshalJSON() ([]byte, error) {
|
2021-03-12 12:57:23 +00:00
|
|
|
return message.MarshalJSON(x)
|
2020-11-13 13:58:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (x *XHeader) UnmarshalJSON(data []byte) error {
|
[#72] session: Unify unmarshaling code
gopatch:
```
@@
var err, msg, data, t, protojson identifier
var obj expression
@@
+import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message"
-import protojson "google.golang.org/protobuf/encoding/protojson"
-msg := obj
-if err := protojson.Unmarshal(data, msg); err != nil {
-return err
-}
-return t.FromGRPCMessage(msg)
+return message.UnmarshalJSON(t, data, obj)
@@
var err, msg, data, t, goproto identifier
var obj expression
@@
+import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message"
-import goproto "google.golang.org/protobuf/proto"
-msg := obj
-if err := goproto.Unmarshal(data, msg); err != nil {
-return err
-}
-return t.FromGRPCMessage(msg)
+return message.Unmarshal(t, data, obj)
```
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-04-20 10:58:44 +00:00
|
|
|
return message.UnmarshalJSON(x, data, new(session.XHeader))
|
2020-11-13 13:58:08 +00:00
|
|
|
}
|
2020-11-13 14:02:30 +00:00
|
|
|
|
|
|
|
func (r *RequestMetaHeader) MarshalJSON() ([]byte, error) {
|
2021-03-12 12:57:23 +00:00
|
|
|
return message.MarshalJSON(r)
|
2020-11-13 14:02:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (r *RequestMetaHeader) UnmarshalJSON(data []byte) error {
|
[#72] session: Unify unmarshaling code
gopatch:
```
@@
var err, msg, data, t, protojson identifier
var obj expression
@@
+import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message"
-import protojson "google.golang.org/protobuf/encoding/protojson"
-msg := obj
-if err := protojson.Unmarshal(data, msg); err != nil {
-return err
-}
-return t.FromGRPCMessage(msg)
+return message.UnmarshalJSON(t, data, obj)
@@
var err, msg, data, t, goproto identifier
var obj expression
@@
+import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message"
-import goproto "google.golang.org/protobuf/proto"
-msg := obj
-if err := goproto.Unmarshal(data, msg); err != nil {
-return err
-}
-return t.FromGRPCMessage(msg)
+return message.Unmarshal(t, data, obj)
```
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-04-20 10:58:44 +00:00
|
|
|
return message.UnmarshalJSON(r, data, new(session.RequestMetaHeader))
|
2020-11-13 14:02:30 +00:00
|
|
|
}
|
2020-11-13 14:07:49 +00:00
|
|
|
|
|
|
|
func (r *RequestVerificationHeader) MarshalJSON() ([]byte, error) {
|
2021-03-12 12:57:23 +00:00
|
|
|
return message.MarshalJSON(r)
|
2020-11-13 14:07:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (r *RequestVerificationHeader) UnmarshalJSON(data []byte) error {
|
[#72] session: Unify unmarshaling code
gopatch:
```
@@
var err, msg, data, t, protojson identifier
var obj expression
@@
+import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message"
-import protojson "google.golang.org/protobuf/encoding/protojson"
-msg := obj
-if err := protojson.Unmarshal(data, msg); err != nil {
-return err
-}
-return t.FromGRPCMessage(msg)
+return message.UnmarshalJSON(t, data, obj)
@@
var err, msg, data, t, goproto identifier
var obj expression
@@
+import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message"
-import goproto "google.golang.org/protobuf/proto"
-msg := obj
-if err := goproto.Unmarshal(data, msg); err != nil {
-return err
-}
-return t.FromGRPCMessage(msg)
+return message.Unmarshal(t, data, obj)
```
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-04-20 10:58:44 +00:00
|
|
|
return message.UnmarshalJSON(r, data, new(session.RequestVerificationHeader))
|
2020-11-13 14:07:49 +00:00
|
|
|
}
|
2020-11-13 14:11:09 +00:00
|
|
|
|
|
|
|
func (r *ResponseMetaHeader) MarshalJSON() ([]byte, error) {
|
2021-03-12 12:57:23 +00:00
|
|
|
return message.MarshalJSON(r)
|
2020-11-13 14:11:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (r *ResponseMetaHeader) UnmarshalJSON(data []byte) error {
|
[#72] session: Unify unmarshaling code
gopatch:
```
@@
var err, msg, data, t, protojson identifier
var obj expression
@@
+import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message"
-import protojson "google.golang.org/protobuf/encoding/protojson"
-msg := obj
-if err := protojson.Unmarshal(data, msg); err != nil {
-return err
-}
-return t.FromGRPCMessage(msg)
+return message.UnmarshalJSON(t, data, obj)
@@
var err, msg, data, t, goproto identifier
var obj expression
@@
+import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message"
-import goproto "google.golang.org/protobuf/proto"
-msg := obj
-if err := goproto.Unmarshal(data, msg); err != nil {
-return err
-}
-return t.FromGRPCMessage(msg)
+return message.Unmarshal(t, data, obj)
```
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-04-20 10:58:44 +00:00
|
|
|
return message.UnmarshalJSON(r, data, new(session.ResponseMetaHeader))
|
2020-11-13 14:11:09 +00:00
|
|
|
}
|
2020-11-13 14:14:43 +00:00
|
|
|
|
|
|
|
func (r *ResponseVerificationHeader) MarshalJSON() ([]byte, error) {
|
2021-03-12 12:57:23 +00:00
|
|
|
return message.MarshalJSON(r)
|
2020-11-13 14:14:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (r *ResponseVerificationHeader) UnmarshalJSON(data []byte) error {
|
[#72] session: Unify unmarshaling code
gopatch:
```
@@
var err, msg, data, t, protojson identifier
var obj expression
@@
+import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message"
-import protojson "google.golang.org/protobuf/encoding/protojson"
-msg := obj
-if err := protojson.Unmarshal(data, msg); err != nil {
-return err
-}
-return t.FromGRPCMessage(msg)
+return message.UnmarshalJSON(t, data, obj)
@@
var err, msg, data, t, goproto identifier
var obj expression
@@
+import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message"
-import goproto "google.golang.org/protobuf/proto"
-msg := obj
-if err := goproto.Unmarshal(data, msg); err != nil {
-return err
-}
-return t.FromGRPCMessage(msg)
+return message.Unmarshal(t, data, obj)
```
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-04-20 10:58:44 +00:00
|
|
|
return message.UnmarshalJSON(r, data, new(session.ResponseVerificationHeader))
|
2020-11-13 14:14:43 +00:00
|
|
|
}
|
2021-05-24 14:46:39 +00:00
|
|
|
|
|
|
|
func (x *ContainerSessionContext) MarshalJSON() ([]byte, error) {
|
|
|
|
return message.MarshalJSON(x)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (x *ContainerSessionContext) UnmarshalJSON(data []byte) error {
|
|
|
|
return message.UnmarshalJSON(x, data, new(session.ContainerSessionContext))
|
|
|
|
}
|