-
Notifications
You must be signed in to change notification settings - Fork 105
/
phonenumber.pb.go
242 lines (221 loc) · 11.9 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
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google_libphonenumber/resources/phonenumber.proto
package libphonenumber
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
// 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 fileDescriptor1, []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=i18n.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_unrecognized []byte `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 fileDescriptor1, []int{0} }
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), "i18n.phonenumbers.PhoneNumber")
proto.RegisterEnum("i18n.phonenumbers.PhoneNumber_CountryCodeSource", PhoneNumber_CountryCodeSource_name, PhoneNumber_CountryCodeSource_value)
}
func init() { proto.RegisterFile("google_libphonenumber/resources/phonenumber.proto", fileDescriptor1) }
var fileDescriptor1 = []byte{
// 428 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x92, 0xd1, 0x6f, 0xd2, 0x50,
0x14, 0xc6, 0x2d, 0x03, 0x85, 0x83, 0xd9, 0xe0, 0x4a, 0x62, 0xa3, 0xa8, 0xdd, 0x5e, 0xec, 0x53,
0x37, 0x7c, 0x5a, 0x7c, 0x73, 0x6d, 0x71, 0x4d, 0x58, 0x21, 0x17, 0x1a, 0xa3, 0x2f, 0xd7, 0xae,
0x3d, 0xe0, 0x4d, 0xca, 0x3d, 0xe4, 0xb6, 0x64, 0xea, 0xbf, 0xe2, 0x1f, 0xe4, 0xbf, 0x65, 0xa0,
0xb8, 0x75, 0xf0, 0xd8, 0xdf, 0xf7, 0x7d, 0xe7, 0x9c, 0x7e, 0xb9, 0x30, 0x58, 0x10, 0x2d, 0x32,
0x14, 0x99, 0xbc, 0x5d, 0xfd, 0x20, 0x85, 0x6a, 0xbd, 0xbc, 0x45, 0x7d, 0xae, 0x31, 0xa7, 0xb5,
0x4e, 0x30, 0x3f, 0xaf, 0x50, 0x67, 0xa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