-
Notifications
You must be signed in to change notification settings - Fork 302
/
applicationserver_integrations_alcsync_json.pb.go
140 lines (127 loc) · 4.43 KB
/
applicationserver_integrations_alcsync_json.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
// Code generated by protoc-gen-go-json. DO NOT EDIT.
// versions:
// - protoc-gen-go-json v1.5.1
// - protoc v4.22.2
// source: lorawan-stack/api/applicationserver_integrations_alcsync.proto
package ttnpb
import (
golang "github.com/TheThingsIndustries/protoc-gen-go-json/golang"
jsonplugin "github.com/TheThingsIndustries/protoc-gen-go-json/jsonplugin"
)
// MarshalProtoJSON marshals the ALCSyncCommandIdentifier to JSON.
func (x ALCSyncCommandIdentifier) MarshalProtoJSON(s *jsonplugin.MarshalState) {
s.WriteEnumString(int32(x), ALCSyncCommandIdentifier_name)
}
// MarshalText marshals the ALCSyncCommandIdentifier to text.
func (x ALCSyncCommandIdentifier) MarshalText() ([]byte, error) {
return []byte(jsonplugin.GetEnumString(int32(x), ALCSyncCommandIdentifier_name)), nil
}
// MarshalJSON marshals the ALCSyncCommandIdentifier to JSON.
func (x ALCSyncCommandIdentifier) MarshalJSON() ([]byte, error) {
return jsonplugin.DefaultMarshalerConfig.Marshal(x)
}
// ALCSyncCommandIdentifier_customvalue contains custom string values that extend ALCSyncCommandIdentifier_value.
var ALCSyncCommandIdentifier_customvalue = map[string]int32{
"PKG_VERSION": 0,
"APP_TIME": 1,
"APP_DEV_TIME_PERIODICITY": 2,
"FORCE_DEV_RESYNC": 3,
}
// UnmarshalProtoJSON unmarshals the ALCSyncCommandIdentifier from JSON.
func (x *ALCSyncCommandIdentifier) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) {
v := s.ReadEnum(ALCSyncCommandIdentifier_value, ALCSyncCommandIdentifier_customvalue)
if err := s.Err(); err != nil {
s.SetErrorf("could not read ALCSyncCommandIdentifier enum: %v", err)
return
}
*x = ALCSyncCommandIdentifier(v)
}
// UnmarshalText unmarshals the ALCSyncCommandIdentifier from text.
func (x *ALCSyncCommandIdentifier) UnmarshalText(b []byte) error {
i, err := jsonplugin.ParseEnumString(string(b), ALCSyncCommandIdentifier_customvalue, ALCSyncCommandIdentifier_value)
if err != nil {
return err
}
*x = ALCSyncCommandIdentifier(i)
return nil
}
// UnmarshalJSON unmarshals the ALCSyncCommandIdentifier from JSON.
func (x *ALCSyncCommandIdentifier) UnmarshalJSON(b []byte) error {
return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x)
}
// MarshalProtoJSON marshals the ALCSyncCommand message to JSON.
func (x *ALCSyncCommand) MarshalProtoJSON(s *jsonplugin.MarshalState) {
if x == nil {
s.WriteNil()
return
}
s.WriteObjectStart()
var wroteField bool
if x.Cid != 0 || s.HasField("cid") {
s.WriteMoreIf(&wroteField)
s.WriteObjectField("cid")
x.Cid.MarshalProtoJSON(s)
}
if x.Payload != nil {
switch ov := x.Payload.(type) {
case *ALCSyncCommand_AppTimeReq_:
s.WriteMoreIf(&wroteField)
s.WriteObjectField("app_time_req")
// NOTE: ALCSyncCommand_AppTimeReq does not seem to implement MarshalProtoJSON.
golang.MarshalMessage(s, ov.AppTimeReq)
case *ALCSyncCommand_AppTimeAns_:
s.WriteMoreIf(&wroteField)
s.WriteObjectField("app_time_ans")
// NOTE: ALCSyncCommand_AppTimeAns does not seem to implement MarshalProtoJSON.
golang.MarshalMessage(s, ov.AppTimeAns)
}
}
s.WriteObjectEnd()
}
// MarshalJSON marshals the ALCSyncCommand to JSON.
func (x *ALCSyncCommand) MarshalJSON() ([]byte, error) {
return jsonplugin.DefaultMarshalerConfig.Marshal(x)
}
// UnmarshalProtoJSON unmarshals the ALCSyncCommand message from JSON.
func (x *ALCSyncCommand) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) {
if s.ReadNil() {
return
}
s.ReadObject(func(key string) {
switch key {
default:
s.ReadAny() // ignore unknown field
case "cid":
s.AddField("cid")
x.Cid.UnmarshalProtoJSON(s)
case "app_time_req", "appTimeReq":
s.AddField("app_time_req")
ov := &ALCSyncCommand_AppTimeReq_{}
x.Payload = ov
if s.ReadNil() {
ov.AppTimeReq = nil
return
}
// NOTE: ALCSyncCommand_AppTimeReq does not seem to implement UnmarshalProtoJSON.
var v ALCSyncCommand_AppTimeReq
golang.UnmarshalMessage(s, &v)
ov.AppTimeReq = &v
case "app_time_ans", "appTimeAns":
s.AddField("app_time_ans")
ov := &ALCSyncCommand_AppTimeAns_{}
x.Payload = ov
if s.ReadNil() {
ov.AppTimeAns = nil
return
}
// NOTE: ALCSyncCommand_AppTimeAns does not seem to implement UnmarshalProtoJSON.
var v ALCSyncCommand_AppTimeAns
golang.UnmarshalMessage(s, &v)
ov.AppTimeAns = &v
}
})
}
// UnmarshalJSON unmarshals the ALCSyncCommand from JSON.
func (x *ALCSyncCommand) UnmarshalJSON(b []byte) error {
return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x)
}