-
Notifications
You must be signed in to change notification settings - Fork 148
/
phonenumber.pb.go
396 lines (359 loc) · 17.1 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
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
//
// Copyright (C) 2009 The Libphonenumber Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Definition of protocol buffer for representing international telephone numbers.
// @author Shaopeng Jia
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0-devel
// protoc v3.14.0
// source: phonenumber.proto
package phonenumbers
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// 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
)
// Enum value maps for PhoneNumber_CountryCodeSource.
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",
}
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 protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (PhoneNumber_CountryCodeSource) Descriptor() protoreflect.EnumDescriptor {
return file_phonenumber_proto_enumTypes[0].Descriptor()
}
func (PhoneNumber_CountryCodeSource) Type() protoreflect.EnumType {
return &file_phonenumber_proto_enumTypes[0]
}
func (x PhoneNumber_CountryCodeSource) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Do not use.
func (x *PhoneNumber_CountryCodeSource) UnmarshalJSON(b []byte) error {
num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b)
if err != nil {
return err
}
*x = PhoneNumber_CountryCodeSource(num)
return nil
}
// Deprecated: Use PhoneNumber_CountryCodeSource.Descriptor instead.
func (PhoneNumber_CountryCodeSource) EnumDescriptor() ([]byte, []int) {
return file_phonenumber_proto_rawDescGZIP(), []int{0, 0}
}
type PhoneNumber struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// 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"`
}
// Default values for PhoneNumber fields.
const (
Default_PhoneNumber_NumberOfLeadingZeros = int32(1)
)
func (x *PhoneNumber) Reset() {
*x = PhoneNumber{}
if protoimpl.UnsafeEnabled {
mi := &file_phonenumber_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PhoneNumber) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PhoneNumber) ProtoMessage() {}
func (x *PhoneNumber) ProtoReflect() protoreflect.Message {
mi := &file_phonenumber_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use PhoneNumber.ProtoReflect.Descriptor instead.
func (*PhoneNumber) Descriptor() ([]byte, []int) {
return file_phonenumber_proto_rawDescGZIP(), []int{0}
}
func (x *PhoneNumber) GetCountryCode() int32 {
if x != nil && x.CountryCode != nil {
return *x.CountryCode
}
return 0
}
func (x *PhoneNumber) GetNationalNumber() uint64 {
if x != nil && x.NationalNumber != nil {
return *x.NationalNumber
}
return 0
}
func (x *PhoneNumber) GetExtension() string {
if x != nil && x.Extension != nil {
return *x.Extension
}
return ""
}
func (x *PhoneNumber) GetItalianLeadingZero() bool {
if x != nil && x.ItalianLeadingZero != nil {
return *x.ItalianLeadingZero
}
return false
}
func (x *PhoneNumber) GetNumberOfLeadingZeros() int32 {
if x != nil && x.NumberOfLeadingZeros != nil {
return *x.NumberOfLeadingZeros
}
return Default_PhoneNumber_NumberOfLeadingZeros
}
func (x *PhoneNumber) GetRawInput() string {
if x != nil && x.RawInput != nil {
return *x.RawInput
}
return ""
}
func (x *PhoneNumber) GetCountryCodeSource() PhoneNumber_CountryCodeSource {
if x != nil && x.CountryCodeSource != nil {
return *x.CountryCodeSource
}
return PhoneNumber_UNSPECIFIED
}
func (x *PhoneNumber) GetPreferredDomesticCarrierCode() string {
if x != nil && x.PreferredDomesticCarrierCode != nil {
return *x.PreferredDomesticCarrierCode
}
return ""
}
var File_phonenumber_proto protoreflect.FileDescriptor
var file_phonenumber_proto_rawDesc = []byte{
0x0a, 0x11, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72,
0x73, 0x22, 0xc2, 0x04, 0x0a, 0x0b, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65,
0x72, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x63, 0x6f, 0x64,
0x65, 0x18, 0x01, 0x20, 0x02, 0x28, 0x05, 0x52, 0x0b, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79,
0x43, 0x6f, 0x64, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c,
0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x02, 0x28, 0x04, 0x52, 0x0e, 0x6e,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1c, 0x0a,
0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
0x52, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x0a, 0x14, 0x69,
0x74, 0x61, 0x6c, 0x69, 0x61, 0x6e, 0x5f, 0x6c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x7a,
0x65, 0x72, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x69, 0x74, 0x61, 0x6c, 0x69,
0x61, 0x6e, 0x4c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x5a, 0x65, 0x72, 0x6f, 0x12, 0x38, 0x0a,
0x17, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x6f, 0x66, 0x5f, 0x6c, 0x65, 0x61, 0x64, 0x69,
0x6e, 0x67, 0x5f, 0x7a, 0x65, 0x72, 0x6f, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x3a, 0x01,
0x31, 0x52, 0x14, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x4f, 0x66, 0x4c, 0x65, 0x61, 0x64, 0x69,
0x6e, 0x67, 0x5a, 0x65, 0x72, 0x6f, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x61, 0x77, 0x5f, 0x69,
0x6e, 0x70, 0x75, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x61, 0x77, 0x49,
0x6e, 0x70, 0x75, 0x74, 0x12, 0x5b, 0x0a, 0x13, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x5f,
0x63, 0x6f, 0x64, 0x65, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28,
0x0e, 0x32, 0x2b, 0x2e, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73,
0x2e, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x75,
0x6e, 0x74, 0x72, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x11,
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63,
0x65, 0x12, 0x45, 0x0a, 0x1f, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x5f, 0x64,
0x6f, 0x6d, 0x65, 0x73, 0x74, 0x69, 0x63, 0x5f, 0x63, 0x61, 0x72, 0x72, 0x69, 0x65, 0x72, 0x5f,
0x63, 0x6f, 0x64, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x1c, 0x70, 0x72, 0x65, 0x66,
0x65, 0x72, 0x72, 0x65, 0x64, 0x44, 0x6f, 0x6d, 0x65, 0x73, 0x74, 0x69, 0x63, 0x43, 0x61, 0x72,
0x72, 0x69, 0x65, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x9b, 0x01, 0x0a, 0x11, 0x43, 0x6f, 0x75,
0x6e, 0x74, 0x72, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x0f,
0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12,
0x1e, 0x0a, 0x1a, 0x46, 0x52, 0x4f, 0x4d, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x5f, 0x57,
0x49, 0x54, 0x48, 0x5f, 0x50, 0x4c, 0x55, 0x53, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x10, 0x01, 0x12,
0x18, 0x0a, 0x14, 0x46, 0x52, 0x4f, 0x4d, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x5f, 0x57,
0x49, 0x54, 0x48, 0x5f, 0x49, 0x44, 0x44, 0x10, 0x05, 0x12, 0x21, 0x0a, 0x1d, 0x46, 0x52, 0x4f,
0x4d, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x4f, 0x55, 0x54,
0x5f, 0x50, 0x4c, 0x55, 0x53, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x10, 0x0a, 0x12, 0x18, 0x0a, 0x14,
0x46, 0x52, 0x4f, 0x4d, 0x5f, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x5f, 0x43, 0x4f, 0x55,
0x4e, 0x54, 0x52, 0x59, 0x10, 0x14, 0x42, 0x20, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x31, 0x38, 0x6e, 0x2e, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x6e,
0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x48, 0x03,
}
var (
file_phonenumber_proto_rawDescOnce sync.Once
file_phonenumber_proto_rawDescData = file_phonenumber_proto_rawDesc
)
func file_phonenumber_proto_rawDescGZIP() []byte {
file_phonenumber_proto_rawDescOnce.Do(func() {
file_phonenumber_proto_rawDescData = protoimpl.X.CompressGZIP(file_phonenumber_proto_rawDescData)
})
return file_phonenumber_proto_rawDescData
}
var file_phonenumber_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_phonenumber_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_phonenumber_proto_goTypes = []interface{}{
(PhoneNumber_CountryCodeSource)(0), // 0: phonenumbers.PhoneNumber.CountryCodeSource
(*PhoneNumber)(nil), // 1: phonenumbers.PhoneNumber
}
var file_phonenumber_proto_depIdxs = []int32{
0, // 0: phonenumbers.PhoneNumber.country_code_source:type_name -> phonenumbers.PhoneNumber.CountryCodeSource
1, // [1:1] is the sub-list for method output_type
1, // [1:1] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_phonenumber_proto_init() }
func file_phonenumber_proto_init() {
if File_phonenumber_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_phonenumber_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PhoneNumber); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_phonenumber_proto_rawDesc,
NumEnums: 1,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_phonenumber_proto_goTypes,
DependencyIndexes: file_phonenumber_proto_depIdxs,
EnumInfos: file_phonenumber_proto_enumTypes,
MessageInfos: file_phonenumber_proto_msgTypes,
}.Build()
File_phonenumber_proto = out.File
file_phonenumber_proto_rawDesc = nil
file_phonenumber_proto_goTypes = nil
file_phonenumber_proto_depIdxs = nil
}