public sealed class PhoneNumber.Types.ShortCode : IMessage<PhoneNumber.Types.ShortCode>, IEquatable<PhoneNumber.Types.ShortCode>, IDeepCloneable<PhoneNumber.Types.ShortCode>, IBufferMessage, IMessage
An object representing a short code, which is a phone number that is typically much shorter than regular phone numbers and can be used to address messages in MMS and SMS systems, as well as for abbreviated dialing (e.g. "Text 611 to see how many minutes you have remaining on your plan.").
Short codes are restricted to a region and are not internationally dialable, which means the same short code can exist in different regions, with different usage and pricing, even if those regions share the same country calling code (e.g. US and CA).
Implements
IMessagePhoneNumberTypesShortCode, IEquatablePhoneNumberTypesShortCode, IDeepCloneablePhoneNumberTypesShortCode, IBufferMessage, IMessageNamespace
Google.TypeAssembly
Google.Api.CommonProtos.dll
Constructors
ShortCode()
public ShortCode()
ShortCode(ShortCode)
public ShortCode(PhoneNumber.Types.ShortCode other)
Parameter | |
---|---|
Name | Description |
other |
PhoneNumberTypesShortCode |
Fields
NumberFieldNumber
public const int NumberFieldNumber = 2
Field number for the "number" field.
Field Value | |
---|---|
Type | Description |
int |
RegionCodeFieldNumber
public const int RegionCodeFieldNumber = 1
Field number for the "region_code" field.
Field Value | |
---|---|
Type | Description |
int |
Properties
Descriptor
public static MessageDescriptor Descriptor { get; }
Property Value | |
---|---|
Type | Description |
MessageDescriptor |
Number
public string Number { get; set; }
Required. The short code digits, without a leading plus ('+') or country calling code, e.g. "611".
Property Value | |
---|---|
Type | Description |
string |
Parser
public static MessageParser<PhoneNumber.Types.ShortCode> Parser { get; }
Property Value | |
---|---|
Type | Description |
MessageParserPhoneNumberTypesShortCode |
RegionCode
public string RegionCode { get; set; }
Required. The BCP-47 region code of the location where calls to this short code can be made, such as "US" and "BB".
Reference(s):
Property Value | |
---|---|
Type | Description |
string |
Methods
CalculateSize()
public int CalculateSize()
Calculates the size of this message in Protocol Buffer wire format, in bytes.
Returns | |
---|---|
Type | Description |
int |
The number of bytes required to write this message to a coded output stream. |
Clone()
public PhoneNumber.Types.ShortCode Clone()
Creates a deep clone of this object.
Returns | |
---|---|
Type | Description |
PhoneNumberTypesShortCode |
A deep clone of this object. |
Equals(ShortCode)
public bool Equals(PhoneNumber.Types.ShortCode other)
Parameter | |
---|---|
Name | Description |
other |
PhoneNumberTypesShortCode |
Returns | |
---|---|
Type | Description |
bool |
Equals(object)
public override bool Equals(object other)
Parameter | |
---|---|
Name | Description |
other |
object |
Returns | |
---|---|
Type | Description |
bool |
GetHashCode()
public override int GetHashCode()
Returns | |
---|---|
Type | Description |
int |
MergeFrom(CodedInputStream)
public void MergeFrom(CodedInputStream input)
Merges the data from the specified coded input stream with the current message.
Parameter | |
---|---|
Name | Description |
input |
CodedInputStream |
See the user guide for precise merge semantics.
MergeFrom(ShortCode)
public void MergeFrom(PhoneNumber.Types.ShortCode other)
Merges the given message into this one.
Parameter | |
---|---|
Name | Description |
other |
PhoneNumberTypesShortCode |
See the user guide for precise merge semantics.
ToString()
public override string ToString()
Returns | |
---|---|
Type | Description |
string |
WriteTo(CodedOutputStream)
public void WriteTo(CodedOutputStream output)
Writes the data to the given coded output stream.
Parameter | |
---|---|
Name | Description |
output |
CodedOutputStream Coded output stream to write the data to. Must not be null. |