-
Notifications
You must be signed in to change notification settings - Fork 301
/
gateway_services_json.pb.go
78 lines (72 loc) · 2.14 KB
/
gateway_services_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
// 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/gateway_services.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 PullGatewayConfigurationRequest message to JSON.
func (x *PullGatewayConfigurationRequest) MarshalProtoJSON(s *jsonplugin.MarshalState) {
if x == nil {
s.WriteNil()
return
}
s.WriteObjectStart()
var wroteField bool
if x.GatewayIds != nil || s.HasField("gateway_ids") {
s.WriteMoreIf(&wroteField)
s.WriteObjectField("gateway_ids")
x.GatewayIds.MarshalProtoJSON(s.WithField("gateway_ids"))
}
if x.FieldMask != nil || s.HasField("field_mask") {
s.WriteMoreIf(&wroteField)
s.WriteObjectField("field_mask")
if x.FieldMask == nil {
s.WriteNil()
} else {
golang.MarshalLegacyFieldMask(s, x.FieldMask)
}
}
s.WriteObjectEnd()
}
// MarshalJSON marshals the PullGatewayConfigurationRequest to JSON.
func (x *PullGatewayConfigurationRequest) MarshalJSON() ([]byte, error) {
return jsonplugin.DefaultMarshalerConfig.Marshal(x)
}
// UnmarshalProtoJSON unmarshals the PullGatewayConfigurationRequest message from JSON.
func (x *PullGatewayConfigurationRequest) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) {
if s.ReadNil() {
return
}
s.ReadObject(func(key string) {
switch key {
default:
s.ReadAny() // ignore unknown field
case "gateway_ids", "gatewayIds":
if s.ReadNil() {
x.GatewayIds = nil
return
}
x.GatewayIds = &GatewayIdentifiers{}
x.GatewayIds.UnmarshalProtoJSON(s.WithField("gateway_ids", true))
case "field_mask", "fieldMask":
s.AddField("field_mask")
if s.ReadNil() {
x.FieldMask = nil
return
}
v := golang.UnmarshalFieldMask(s)
if s.Err() != nil {
return
}
x.FieldMask = v
}
})
}
// UnmarshalJSON unmarshals the PullGatewayConfigurationRequest from JSON.
func (x *PullGatewayConfigurationRequest) UnmarshalJSON(b []byte) error {
return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x)
}