summaryrefslogtreecommitdiff
path: root/phonemetadata.proto
diff options
context:
space:
mode:
Diffstat (limited to 'phonemetadata.proto')
-rw-r--r--phonemetadata.proto54
1 files changed, 33 insertions, 21 deletions
diff --git a/phonemetadata.proto b/phonemetadata.proto
index ecd3ba2..2246a92 100644
--- a/phonemetadata.proto
+++ b/phonemetadata.proto
@@ -16,14 +16,14 @@
// Definition of protocol buffer for holding metadata for international
// telephone numbers. The fields here correspond exactly to those in
-// resources/PhoneNumberMetaData.xml.
+// resources/PhoneNumberMetadata.xml.
// @author Shaopeng Jia
syntax = "proto2";
-option java_package = "com.google.i18n.phonenumbers";
option optimize_for = LITE_RUNTIME;
+option java_package = "com.google.i18n.phonenumbers";
package i18n.phonenumbers;
message NumberFormat {
@@ -118,25 +118,31 @@ message PhoneMetadata {
// for all types of phone numbers. If any element is missing in the
// description of a specific type in the XML file, the element will inherit
// from its counterpart in the general_desc. Every locale is assumed to have
- // fixed line and mobile numbers - if these types are missing in the XML
- // file, they will inherit all fields from the general_desc. For all other
- // types, if the whole type is missing in the xml file, it will be given a
- // national_number_pattern of "NA" and a possible_number_pattern of "NA".
- required PhoneNumberDesc general_desc = 1;
- required PhoneNumberDesc fixed_line = 2;
- required PhoneNumberDesc mobile = 3;
- required PhoneNumberDesc toll_free = 4;
- required PhoneNumberDesc premium_rate = 5;
- required PhoneNumberDesc shared_cost = 6;
- required PhoneNumberDesc personal_number = 7;
- required PhoneNumberDesc voip = 8;
- required PhoneNumberDesc pager = 21;
- required PhoneNumberDesc uan = 25;
- required PhoneNumberDesc emergency = 27;
- required PhoneNumberDesc voicemail = 28;
+ // fixed line and mobile numbers - if these types are missing in the
+ // PhoneNumberMetadata XML file, they will inherit all fields from the
+ // general_desc. For all other types that are generally relevant to normal
+ // phone numbers, if the whole type is missing in the PhoneNumberMetadata XML
+ // file, it will be given a national_number_pattern of "NA" and a
+ // possible_number_pattern of "NA".
+ optional PhoneNumberDesc general_desc = 1;
+ optional PhoneNumberDesc fixed_line = 2;
+ optional PhoneNumberDesc mobile = 3;
+ optional PhoneNumberDesc toll_free = 4;
+ optional PhoneNumberDesc premium_rate = 5;
+ optional PhoneNumberDesc shared_cost = 6;
+ optional PhoneNumberDesc personal_number = 7;
+ optional PhoneNumberDesc voip = 8;
+ optional PhoneNumberDesc pager = 21;
+ optional PhoneNumberDesc uan = 25;
+ optional PhoneNumberDesc emergency = 27;
+ optional PhoneNumberDesc voicemail = 28;
+ optional PhoneNumberDesc short_code = 29;
+ optional PhoneNumberDesc standard_rate = 30;
+ optional PhoneNumberDesc carrier_specific = 31;
+
// The rules here distinguish the numbers that are only able to be dialled
// nationally.
- required PhoneNumberDesc no_international_dialling = 24;
+ optional PhoneNumberDesc no_international_dialling = 24;
// The ISO 3166-1 alpha-2 representation of a country/region, with the
// exception of "country calling codes" used for non-geographical entities,
@@ -148,14 +154,14 @@ message PhoneMetadata {
// The country calling code that one would dial from overseas when trying to
// dial a phone number in this country. For example, this would be "64" for
// New Zealand.
- required int32 country_code = 10;
+ optional int32 country_code = 10;
// The international_prefix of country A is the number that needs to be
// dialled from country A to another country (country B). This is followed
// by the country code for country B. Note that some countries may have more
// than one international prefix, and for those cases, a regular expression
// matching the international prefixes will be stored in this field.
- required string international_prefix = 11;
+ optional string international_prefix = 11;
// If more than one international prefix is present, a preferred prefix can
// be specified here for out-of-country formatting purposes. If this field is
@@ -263,6 +269,12 @@ message PhoneMetadata {
// and all regions associated with that calling code will use the same
// setting.
optional bool leading_zero_possible = 26 [default=false];
+
+ // This field is set when this country has implemented mobile number
+ // portability. This means that transferring mobile numbers between carriers
+ // is allowed. A consequence of this is that phone prefix to carrier mapping
+ // is less reliable.
+ optional bool mobile_number_portable_region = 32 [default=false];
}
message PhoneMetadataCollection {