Debian Codegraph @

googleapis/type/phone_number/phone_number.pb.go

raw symbols SCIP
1 // Copyright 2026 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 // Code generated by protoc-gen-go. DO NOT EDIT.
16 // versions:
17 // protoc-gen-go v1.26.0
18 // protoc v4.24.4
19 // source: google/type/phone_number.proto
20
21 package phone_number
22
23 import (
24 reflect "reflect"
25 sync "sync"
26
27 protoreflect "google.golang.org/protobuf/reflect/protoreflect"
28 protoimpl "google.golang.org/protobuf/runtime/protoimpl"
29 )
30
31 const (
32 // Verify that this generated code is sufficiently up-to-date.
33 _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
34 // Verify that runtime/protoimpl is sufficiently up-to-date.
35 _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
36 )
37
38 // An object representing a phone number, suitable as an API wire format.
39 //
40 // This representation:
41 //
42 // - should not be used for locale-specific formatting of a phone number, such
43 // as "+1 (650) 253-0000 ext. 123"
44 //
45 // - is not designed for efficient storage
46 //
47 // - may not be suitable for dialing - specialized libraries (see references)
48 // should be used to parse the number for that purpose
49 //
50 // To do something meaningful with this number, such as format it for various
51 // use-cases, convert it to an `i18n.phonenumbers.PhoneNumber` object first.
52 //
53 // For instance, in Java this would be:
54 //
55 // com.google.type.PhoneNumber wireProto =
56 // com.google.type.PhoneNumber.newBuilder().build();
57 // com.google.i18n.phonenumbers.Phonenumber.PhoneNumber phoneNumber =
58 // PhoneNumberUtil.getInstance().parse(wireProto.getE164Number(), "ZZ");
59 // if (!wireProto.getExtension().isEmpty()) {
60 // phoneNumber.setExtension(wireProto.getExtension());
61 // }
62 //
63 // Reference(s):
64 // - https://github.com/google/libphonenumber
65 type PhoneNumber struct {
66 state protoimpl.MessageState
67 sizeCache protoimpl.SizeCache
68 unknownFields protoimpl.UnknownFields
69
70 // Required. Either a regular number, or a short code. New fields may be
71 // added to the oneof below in the future, so clients should ignore phone
72 // numbers for which none of the fields they coded against are set.
73 //
74 // Types that are assignable to Kind:
75 //
76 // *PhoneNumber_E164Number
77 // *PhoneNumber_ShortCode_
78 Kind isPhoneNumber_Kind `protobuf_oneof:"kind"`
79 // The phone number's extension. The extension is not standardized in ITU
80 // recommendations, except for being defined as a series of numbers with a
81 // maximum length of 40 digits. Other than digits, some other dialing
82 // characters such as ',' (indicating a wait) or '#' may be stored here.
83 //
84 // Note that no regions currently use extensions with short codes, so this
85 // field is normally only set in conjunction with an E.164 number. It is held
86 // separately from the E.164 number to allow for short code extensions in the
87 // future.
88 Extension string `protobuf:"bytes,3,opt,name=extension,proto3" json:"extension,omitempty"`
89 }
90
91 func (x *PhoneNumber) Reset() {
92 *x = PhoneNumber{}
93 if protoimpl.UnsafeEnabled {
94 mi := &file_google_type_phone_number_proto_msgTypes[0]
95 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
96 ms.StoreMessageInfo(mi)
97 }
98 }
99
100 func (x *PhoneNumber) String() string {
101 return protoimpl.X.MessageStringOf(x)
102 }
103
104 func (*PhoneNumber) ProtoMessage() {}
105
106 func (x *PhoneNumber) ProtoReflect() protoreflect.Message {
107 mi := &file_google_type_phone_number_proto_msgTypes[0]
108 if protoimpl.UnsafeEnabled && x != nil {
109 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
110 if ms.LoadMessageInfo() == nil {
111 ms.StoreMessageInfo(mi)
112 }
113 return ms
114 }
115 return mi.MessageOf(x)
116 }
117
118 // Deprecated: Use PhoneNumber.ProtoReflect.Descriptor instead.
119 func (*PhoneNumber) Descriptor() ([]byte, []int) {
120 return file_google_type_phone_number_proto_rawDescGZIP(), []int{0}
121 }
122
123 func (m *PhoneNumber) GetKind() isPhoneNumber_Kind {
124 if m != nil {
125 return m.Kind
126 }
127 return nil
128 }
129
130 func (x *PhoneNumber) GetE164Number() string {
131 if x, ok := x.GetKind().(*PhoneNumber_E164Number); ok {
132 return x.E164Number
133 }
134 return ""
135 }
136
137 func (x *PhoneNumber) GetShortCode() *PhoneNumber_ShortCode {
138 if x, ok := x.GetKind().(*PhoneNumber_ShortCode_); ok {
139 return x.ShortCode
140 }
141 return nil
142 }
143
144 func (x *PhoneNumber) GetExtension() string {
145 if x != nil {
146 return x.Extension
147 }
148 return ""
149 }
150
151 type isPhoneNumber_Kind interface {
152 isPhoneNumber_Kind()
153 }
154
155 type PhoneNumber_E164Number struct {
156 // The phone number, represented as a leading plus sign ('+'), followed by a
157 // phone number that uses a relaxed ITU E.164 format consisting of the
158 // country calling code (1 to 3 digits) and the subscriber number, with no
159 // additional spaces or formatting. For example:
160 //
161 // - correct: "+15552220123"
162 //
163 // - incorrect: "+1 (555) 222-01234 x123"
164 //
165 // The ITU E.164 format limits the latter to 12 digits, but in practice not
166 // all countries respect that, so we relax that restriction here.
167 // National-only numbers are not allowed.
168 //
169 // References:
170 //
171 // - https://www.itu.int/rec/T-REC-E.164-201011-I
172 //
173 // - https://en.wikipedia.org/wiki/E.164.
174 //
175 // - https://en.wikipedia.org/wiki/List_of_country_calling_codes
176 E164Number string `protobuf:"bytes,1,opt,name=e164_number,json=e164Number,proto3,oneof"`
177 }
178
179 type PhoneNumber_ShortCode_ struct {
180 // A short code.
181 //
182 // Reference(s):
183 // - https://wikipedia.org/wiki/Short_code
184 ShortCode *PhoneNumber_ShortCode `protobuf:"bytes,2,opt,name=short_code,json=shortCode,proto3,oneof"`
185 }
186
187 func (*PhoneNumber_E164Number) isPhoneNumber_Kind() {}
188
189 func (*PhoneNumber_ShortCode_) isPhoneNumber_Kind() {}
190
191 // An object representing a short code, which is a phone number that is
192 // typically much shorter than regular phone numbers and can be used to
193 // address messages in MMS and SMS systems, as well as for abbreviated dialing
194 // (For example "Text 611 to see how many minutes you have remaining on your
195 // plan.").
196 //
197 // Short codes are restricted to a region and are not internationally
198 // dialable, which means the same short code can exist in different regions,
199 // with different usage and pricing, even if those regions share the same
200 // country calling code (For example: US and CA).
201 type PhoneNumber_ShortCode struct {
202 state protoimpl.MessageState
203 sizeCache protoimpl.SizeCache
204 unknownFields protoimpl.UnknownFields
205
206 // Required. The BCP-47 region code of the location where calls to this
207 // short code can be made, such as "US" and "BB".
208 //
209 // Reference(s):
210 // - http://www.unicode.org/reports/tr35/#unicode_region_subtag
211 RegionCode string `protobuf:"bytes,1,opt,name=region_code,json=regionCode,proto3" json:"region_code,omitempty"`
212 // Required. The short code digits, without a leading plus ('+') or country
213 // calling code. For example "611".
214 Number string `protobuf:"bytes,2,opt,name=number,proto3" json:"number,omitempty"`
215 }
216
217 func (x *PhoneNumber_ShortCode) Reset() {
218 *x = PhoneNumber_ShortCode{}
219 if protoimpl.UnsafeEnabled {
220 mi := &file_google_type_phone_number_proto_msgTypes[1]
221 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
222 ms.StoreMessageInfo(mi)
223 }
224 }
225
226 func (x *PhoneNumber_ShortCode) String() string {
227 return protoimpl.X.MessageStringOf(x)
228 }
229
230 func (*PhoneNumber_ShortCode) ProtoMessage() {}
231
232 func (x *PhoneNumber_ShortCode) ProtoReflect() protoreflect.Message {
233 mi := &file_google_type_phone_number_proto_msgTypes[1]
234 if protoimpl.UnsafeEnabled && x != nil {
235 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
236 if ms.LoadMessageInfo() == nil {
237 ms.StoreMessageInfo(mi)
238 }
239 return ms
240 }
241 return mi.MessageOf(x)
242 }
243
244 // Deprecated: Use PhoneNumber_ShortCode.ProtoReflect.Descriptor instead.
245 func (*PhoneNumber_ShortCode) Descriptor() ([]byte, []int) {
246 return file_google_type_phone_number_proto_rawDescGZIP(), []int{0, 0}
247 }
248
249 func (x *PhoneNumber_ShortCode) GetRegionCode() string {
250 if x != nil {
251 return x.RegionCode
252 }
253 return ""
254 }
255
256 func (x *PhoneNumber_ShortCode) GetNumber() string {
257 if x != nil {
258 return x.Number
259 }
260 return ""
261 }
262
263 var File_google_type_phone_number_proto protoreflect.FileDescriptor
264
265 var file_google_type_phone_number_proto_rawDesc = []byte{
266 0x0a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x70, 0x68,
267 0x6f, 0x6e, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
268 0x12, 0x0b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x22, 0xe1, 0x01,
269 0x0a, 0x0b, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x21, 0x0a,
270 0x0b, 0x65, 0x31, 0x36, 0x34, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01,
271 0x28, 0x09, 0x48, 0x00, 0x52, 0x0a, 0x65, 0x31, 0x36, 0x34, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72,
272 0x12, 0x43, 0x0a, 0x0a, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02,
273 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79,
274 0x70, 0x65, 0x2e, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x2e, 0x53,
275 0x68, 0x6f, 0x72, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x48, 0x00, 0x52, 0x09, 0x73, 0x68, 0x6f, 0x72,
276 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69,
277 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73,
278 0x69, 0x6f, 0x6e, 0x1a, 0x44, 0x0a, 0x09, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x43, 0x6f, 0x64, 0x65,
279 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18,
280 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64,
281 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28,
282 0x09, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x42, 0x06, 0x0a, 0x04, 0x6b, 0x69, 0x6e,
283 0x64, 0x42, 0x71, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
284 0x74, 0x79, 0x70, 0x65, 0x42, 0x10, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65,
285 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x44, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
286 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70,
287 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f,
288 0x74, 0x79, 0x70, 0x65, 0x2f, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65,
289 0x72, 0x3b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0xa2, 0x02,
290 0x03, 0x47, 0x54, 0x50, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
291 }
292
293 var (
294 file_google_type_phone_number_proto_rawDescOnce sync.Once
295 file_google_type_phone_number_proto_rawDescData = file_google_type_phone_number_proto_rawDesc
296 )
297
298 func file_google_type_phone_number_proto_rawDescGZIP() []byte {
299 file_google_type_phone_number_proto_rawDescOnce.Do(func() {
300 file_google_type_phone_number_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_type_phone_number_proto_rawDescData)
301 })
302 return file_google_type_phone_number_proto_rawDescData
303 }
304
305 var file_google_type_phone_number_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
306 var file_google_type_phone_number_proto_goTypes = []interface{}{
307 (*PhoneNumber)(nil), // 0: google.type.PhoneNumber
308 (*PhoneNumber_ShortCode)(nil), // 1: google.type.PhoneNumber.ShortCode
309 }
310 var file_google_type_phone_number_proto_depIdxs = []int32{
311 1, // 0: google.type.PhoneNumber.short_code:type_name -> google.type.PhoneNumber.ShortCode
312 1, // [1:1] is the sub-list for method output_type
313 1, // [1:1] is the sub-list for method input_type
314 1, // [1:1] is the sub-list for extension type_name
315 1, // [1:1] is the sub-list for extension extendee
316 0, // [0:1] is the sub-list for field type_name
317 }
318
319 func init() { file_google_type_phone_number_proto_init() }
320 func file_google_type_phone_number_proto_init() {
321 if File_google_type_phone_number_proto != nil {
322 return
323 }
324 if !protoimpl.UnsafeEnabled {
325 file_google_type_phone_number_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
326 switch v := v.(*PhoneNumber); i {
327 case 0:
328 return &v.state
329 case 1:
330 return &v.sizeCache
331 case 2:
332 return &v.unknownFields
333 default:
334 return nil
335 }
336 }
337 file_google_type_phone_number_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
338 switch v := v.(*PhoneNumber_ShortCode); i {
339 case 0:
340 return &v.state
341 case 1:
342 return &v.sizeCache
343 case 2:
344 return &v.unknownFields
345 default:
346 return nil
347 }
348 }
349 }
350 file_google_type_phone_number_proto_msgTypes[0].OneofWrappers = []interface{}{
351 (*PhoneNumber_E164Number)(nil),
352 (*PhoneNumber_ShortCode_)(nil),
353 }
354 type x struct{}
355 out := protoimpl.TypeBuilder{
356 File: protoimpl.DescBuilder{
357 GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
358 RawDescriptor: file_google_type_phone_number_proto_rawDesc,
359 NumEnums: 0,
360 NumMessages: 2,
361 NumExtensions: 0,
362 NumServices: 0,
363 },
364 GoTypes: file_google_type_phone_number_proto_goTypes,
365 DependencyIndexes: file_google_type_phone_number_proto_depIdxs,
366 MessageInfos: file_google_type_phone_number_proto_msgTypes,
367 }.Build()
368 File_google_type_phone_number_proto = out.File
369 file_google_type_phone_number_proto_rawDesc = nil
370 file_google_type_phone_number_proto_goTypes = nil
371 file_google_type_phone_number_proto_depIdxs = nil
372 }