-
Notifications
You must be signed in to change notification settings - Fork 4
/
metadata.go
39 lines (31 loc) · 929 Bytes
/
metadata.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
package phone
// Identifies type of phone
type Type uint8
const (
TypeUnknown Type = iota
TypeMobile
TypeVoip
TypeLandline
)
// Metadata provides additional information regarding a phone number. Information
// is provided on a best-effort basis as provided by third party solutions. This
// can be used for antispam and fraud measures.
type Metadata struct {
// The phone number associated with the set of metadata
PhoneNumber string
// The type of phone. Currently, this is always expected to be a mobile type.
Type *Type
// Identifies the country and MNO
// https://www.twilio.com/docs/iot/supersim/api/network-resource#the-identifiers-property
MobileCountryCode *int
MobileNetworkCode *int
}
func (m *Metadata) SetType(t Type) {
m.Type = &t
}
func (m *Metadata) SetMobileCountryCode(mcc int) {
m.MobileCountryCode = &mcc
}
func (m *Metadata) SetMobileNetworkCode(mnc int) {
m.MobileNetworkCode = &mnc
}