File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -264,6 +264,7 @@ func (a *AndroidNotification) UnmarshalJSON(b []byte) error {
264
264
EventTimestamp string `json:"event_time,omitempty"`
265
265
Priority string `json:"notification_priority,omitempty"`
266
266
Visibility string `json:"visibility,omitempty"`
267
+ Proxy string `json:"proxy,omitempty"`
267
268
VibrateTimings []string `json:"vibrate_timings,omitempty"`
268
269
* androidInternal
269
270
}{
@@ -301,6 +302,19 @@ func (a *AndroidNotification) UnmarshalJSON(b []byte) error {
301
302
}
302
303
}
303
304
305
+ if temp .Proxy != "" {
306
+ proxies := map [string ]AndroidNotificationProxy {
307
+ "ALLOW" : ProxyAllow ,
308
+ "DENY" : ProxyDeny ,
309
+ "IF_PRIORITY_LOWERED" : ProxyIfPriorityLowered ,
310
+ }
311
+ if prox , ok := proxies [temp .Proxy ]; ok {
312
+ a .Proxy = prox
313
+ } else {
314
+ return fmt .Errorf ("unknown proxy value: %q" , temp .Proxy )
315
+ }
316
+ }
317
+
304
318
if temp .EventTimestamp != "" {
305
319
ts , err := time .Parse (rfc3339Zulu , temp .EventTimestamp )
306
320
if err != nil {
You can’t perform that action at this time.
0 commit comments