forked from nyaruka/phonenumbers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
phonenumber.pb.go
268 lines (245 loc) · 12.8 KB
/
phonenumber.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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: phonenumber.proto
package phonenumbers
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
// The source from which the country_code is derived. This is not set in the
// general parsing method, but in the method that parses and keeps raw_input.
// New fields could be added upon request.
type PhoneNumber_CountryCodeSource int32
const (
// Default value returned if this is not set, because the phone number was
// created using parse, not parseAndKeepRawInput. hasCountryCodeSource will
// return false if this is the case.
PhoneNumber_UNSPECIFIED PhoneNumber_CountryCodeSource = 0
// The country_code is derived based on a phone number with a leading "+",
// e.g. the French number "+33 1 42 68 53 00".
PhoneNumber_FROM_NUMBER_WITH_PLUS_SIGN PhoneNumber_CountryCodeSource = 1
// The country_code is derived based on a phone number with a leading IDD,
// e.g. the French number "011 33 1 42 68 53 00", as it is dialled from US.
PhoneNumber_FROM_NUMBER_WITH_IDD PhoneNumber_CountryCodeSource = 5
// The country_code is derived based on a phone number without a leading
// "+", e.g. the French number "33 1 42 68 53 00" when defaultCountry is
// supplied as France.
PhoneNumber_FROM_NUMBER_WITHOUT_PLUS_SIGN PhoneNumber_CountryCodeSource = 10
// The country_code is derived NOT based on the phone number itself, but
// from the defaultCountry parameter provided in the parsing function by the
// clients. This happens mostly for numbers written in the national format
// (without country code). For example, this would be set when parsing the
// French number "01 42 68 53 00", when defaultCountry is supplied as
// France.
PhoneNumber_FROM_DEFAULT_COUNTRY PhoneNumber_CountryCodeSource = 20
)
var PhoneNumber_CountryCodeSource_name = map[int32]string{
0: "UNSPECIFIED",
1: "FROM_NUMBER_WITH_PLUS_SIGN",
5: "FROM_NUMBER_WITH_IDD",
10: "FROM_NUMBER_WITHOUT_PLUS_SIGN",
20: "FROM_DEFAULT_COUNTRY",
}
var PhoneNumber_CountryCodeSource_value = map[string]int32{
"UNSPECIFIED": 0,
"FROM_NUMBER_WITH_PLUS_SIGN": 1,
"FROM_NUMBER_WITH_IDD": 5,
"FROM_NUMBER_WITHOUT_PLUS_SIGN": 10,
"FROM_DEFAULT_COUNTRY": 20,
}
func (x PhoneNumber_CountryCodeSource) Enum() *PhoneNumber_CountryCodeSource {
p := new(PhoneNumber_CountryCodeSource)
*p = x
return p
}
func (x PhoneNumber_CountryCodeSource) String() string {
return proto.EnumName(PhoneNumber_CountryCodeSource_name, int32(x))
}
func (x *PhoneNumber_CountryCodeSource) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(PhoneNumber_CountryCodeSource_value, data, "PhoneNumber_CountryCodeSource")
if err != nil {
return err
}
*x = PhoneNumber_CountryCodeSource(value)
return nil
}
func (PhoneNumber_CountryCodeSource) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_phonenumber_2c745f30989ef8a6, []int{0, 0}
}
type PhoneNumber struct {
// The country calling code for this number, as defined by the International
// Telecommunication Union (ITU). For example, this would be 1 for NANPA
// countries, and 33 for France.
CountryCode *int32 `protobuf:"varint,1,req,name=country_code,json=countryCode" json:"country_code,omitempty"`
// The National (significant) Number, as defined in International
// Telecommunication Union (ITU) Recommendation E.164, without any leading
// zero. The leading-zero is stored separately if required, since this is an
// uint64 and hence cannot store such information. Do not use this field
// directly: if you want the national significant number, call the
// getNationalSignificantNumber method of PhoneNumberUtil.
//
// For countries which have the concept of an "area code" or "national
// destination code", this is included in the National (significant) Number.
// Although the ITU says the maximum length should be 15, we have found longer
// numbers in some countries e.g. Germany.
// Note that the National (significant) Number does not contain the National
// (trunk) prefix. Obviously, as a uint64, it will never contain any
// formatting (hyphens, spaces, parentheses), nor any alphanumeric spellings.
NationalNumber *uint64 `protobuf:"varint,2,req,name=national_number,json=nationalNumber" json:"national_number,omitempty"`
// Extension is not standardized in ITU recommendations, except for being
// defined as a series of numbers with a maximum length of 40 digits. It is
// defined as a string here to accommodate for the possible use of a leading
// zero in the extension (organizations have complete freedom to do so, as
// there is no standard defined). Other than digits, some other dialling
// characters such as "," (indicating a wait) may be stored here.
Extension *string `protobuf:"bytes,3,opt,name=extension" json:"extension,omitempty"`
// In some countries, the national (significant) number starts with one or
// more "0"s without this being a national prefix or trunk code of some kind.
// For example, the leading zero in the national (significant) number of an
// Italian phone number indicates the number is a fixed-line number. There
// have been plans to migrate fixed-line numbers to start with the digit two
// since December 2000, but it has not happened yet. See
// http://en.wikipedia.org/wiki/%2B39 for more details.
//
// These fields can be safely ignored (there is no need to set them) for most
// countries. Some limited number of countries behave like Italy - for these
// cases, if the leading zero(s) of a number would be retained even when
// dialling internationally, set this flag to true, and also set the number of
// leading zeros.
//
// Clients who use the parsing functionality of the i18n phone
// number libraries will have these fields set if necessary automatically.
ItalianLeadingZero *bool `protobuf:"varint,4,opt,name=italian_leading_zero,json=italianLeadingZero" json:"italian_leading_zero,omitempty"`
NumberOfLeadingZeros *int32 `protobuf:"varint,8,opt,name=number_of_leading_zeros,json=numberOfLeadingZeros,def=1" json:"number_of_leading_zeros,omitempty"`
// This field is used to store the raw input string containing phone numbers
// before it was canonicalized by the library. For example, it could be used
// to store alphanumerical numbers such as "1-800-GOOG-411".
RawInput *string `protobuf:"bytes,5,opt,name=raw_input,json=rawInput" json:"raw_input,omitempty"`
// The source from which the country_code is derived.
CountryCodeSource *PhoneNumber_CountryCodeSource `protobuf:"varint,6,opt,name=country_code_source,json=countryCodeSource,enum=phonenumbers.PhoneNumber_CountryCodeSource" json:"country_code_source,omitempty"`
// The carrier selection code that is preferred when calling this phone number
// domestically. This also includes codes that need to be dialed in some
// countries when calling from landlines to mobiles or vice versa. For
// example, in Columbia, a "3" needs to be dialed before the phone number
// itself when calling from a mobile phone to a domestic landline phone and
// vice versa.
//
// Note this is the "preferred" code, which means other codes may work as
// well.
PreferredDomesticCarrierCode *string `protobuf:"bytes,7,opt,name=preferred_domestic_carrier_code,json=preferredDomesticCarrierCode" json:"preferred_domestic_carrier_code,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *PhoneNumber) Reset() { *m = PhoneNumber{} }
func (m *PhoneNumber) String() string { return proto.CompactTextString(m) }
func (*PhoneNumber) ProtoMessage() {}
func (*PhoneNumber) Descriptor() ([]byte, []int) {
return fileDescriptor_phonenumber_2c745f30989ef8a6, []int{0}
}
func (m *PhoneNumber) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PhoneNumber.Unmarshal(m, b)
}
func (m *PhoneNumber) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_PhoneNumber.Marshal(b, m, deterministic)
}
func (dst *PhoneNumber) XXX_Merge(src proto.Message) {
xxx_messageInfo_PhoneNumber.Merge(dst, src)
}
func (m *PhoneNumber) XXX_Size() int {
return xxx_messageInfo_PhoneNumber.Size(m)
}
func (m *PhoneNumber) XXX_DiscardUnknown() {
xxx_messageInfo_PhoneNumber.DiscardUnknown(m)
}
var xxx_messageInfo_PhoneNumber proto.InternalMessageInfo
const Default_PhoneNumber_NumberOfLeadingZeros int32 = 1
func (m *PhoneNumber) GetCountryCode() int32 {
if m != nil && m.CountryCode != nil {
return *m.CountryCode
}
return 0
}
func (m *PhoneNumber) GetNationalNumber() uint64 {
if m != nil && m.NationalNumber != nil {
return *m.NationalNumber
}
return 0
}
func (m *PhoneNumber) GetExtension() string {
if m != nil && m.Extension != nil {
return *m.Extension
}
return ""
}
func (m *PhoneNumber) GetItalianLeadingZero() bool {
if m != nil && m.ItalianLeadingZero != nil {
return *m.ItalianLeadingZero
}
return false
}
func (m *PhoneNumber) GetNumberOfLeadingZeros() int32 {
if m != nil && m.NumberOfLeadingZeros != nil {
return *m.NumberOfLeadingZeros
}
return Default_PhoneNumber_NumberOfLeadingZeros
}
func (m *PhoneNumber) GetRawInput() string {
if m != nil && m.RawInput != nil {
return *m.RawInput
}
return ""
}
func (m *PhoneNumber) GetCountryCodeSource() PhoneNumber_CountryCodeSource {
if m != nil && m.CountryCodeSource != nil {
return *m.CountryCodeSource
}
return PhoneNumber_UNSPECIFIED
}
func (m *PhoneNumber) GetPreferredDomesticCarrierCode() string {
if m != nil && m.PreferredDomesticCarrierCode != nil {
return *m.PreferredDomesticCarrierCode
}
return ""
}
func init() {
proto.RegisterType((*PhoneNumber)(nil), "phonenumbers.PhoneNumber")
proto.RegisterEnum("phonenumbers.PhoneNumber_CountryCodeSource", PhoneNumber_CountryCodeSource_name, PhoneNumber_CountryCodeSource_value)
}
func init() { proto.RegisterFile("phonenumber.proto", fileDescriptor_phonenumber_2c745f30989ef8a6) }
var fileDescriptor_phonenumber_2c745f30989ef8a6 = []byte{
// 416 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x90, 0x41, 0x6f, 0xd3, 0x40,
0x10, 0x85, 0x71, 0x9a, 0x40, 0x32, 0xa9, 0xda, 0x64, 0x89, 0x84, 0x05, 0x01, 0xdc, 0x5e, 0xb0,
0x84, 0x64, 0x51, 0x4e, 0x15, 0x37, 0x6a, 0x3b, 0xd4, 0x52, 0xea, 0x44, 0x9b, 0x58, 0x08, 0x38,
0xac, 0x16, 0x7b, 0x12, 0x56, 0x4a, 0x76, 0xa2, 0xb5, 0xa3, 0x02, 0x7f, 0x85, 0x7f, 0xc3, 0x2f,
0x43, 0x89, 0x4d, 0xeb, 0xb6, 0xc7, 0xfd, 0xde, 0x7b, 0x33, 0xb3, 0x0f, 0xfa, 0x9b, 0x1f, 0xa4,
0x51, 0x6f, 0xd7, 0xdf, 0xd1, 0x78, 0x1b, 0x43, 0x05, 0xb1, 0xc3, 0x1a, 0xca, 0x4f, 0xff, 0x36,
0xa1, 0x3b, 0xdd, 0x81, 0x78, 0x0f, 0xd8, 0x09, 0x1c, 0xa6, 0xb4, 0xd5, 0x85, 0xf9, 0x25, 0x52,
0xca, 0xd0, 0xb6, 0x9c, 0x86, 0xdb, 0xe2, 0xdd, 0x8a, 0xf9, 0x94, 0x21, 0x7b, 0x03, 0xc7, 0x5a,
0x16, 0x8a, 0xb4, 0x5c, 0x89, 0x72, 0x8c, 0xdd, 0x70, 0x1a, 0x6e, 0x93, 0x1f, 0xfd, 0xc7, 0xd5,
0xac, 0x21, 0x74, 0xf0, 0x67, 0x81, 0x3a, 0x57, 0xa4, 0xed, 0x03, 0xc7, 0x72, 0x3b, 0xfc, 0x16,
0xb0, 0x77, 0x30, 0x50, 0x85, 0x5c, 0x29, 0xa9, 0xc5, 0x0a, 0x65, 0xa6, 0xf4, 0x52, 0xfc, 0x46,
0x43, 0x76, 0xd3, 0xb1, 0xdc, 0x36,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