-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathplatform.go
44 lines (40 loc) · 1.01 KB
/
platform.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
package notificationhubs
// GetContentType returns Content-Type
// associated with NotificationFormat
func (f NotificationFormat) GetContentType() string {
switch f {
case Template,
AppleFormat,
GcmFormat,
KindleFormat,
BaiduFormat:
return "application/json"
}
return "application/xml"
}
// IsValid identifies whether notification format is valid
func (f NotificationFormat) IsValid() bool {
return f == Template ||
f == GcmFormat ||
f == AppleFormat ||
f == BaiduFormat ||
f == KindleFormat ||
f == WindowsFormat ||
f == WindowsPhoneFormat
}
// IsValid identifies whether target is valid
func (f TargetPlatform) IsValid() bool {
return f == AdmPlatform ||
f == AdmTemplatePlatform ||
f == ApplePlatform ||
f == AppleTemplatePlatform ||
f == BaiduPlatform ||
f == BaiduTemplatePlatform ||
f == GcmPlatform ||
f == GcmTemplatePlatform ||
f == TemplatePlatform ||
f == WindowsphonePlatform ||
f == WindowsphoneTemplatePlatform ||
f == WindowsPlatform ||
f == WindowsTemplatePlatform
}