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