
scalapb.fs2.pubsub.grpc.internal.PostalAddress.scala Maven / Gradle / Ivy
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO3
package fs2.pubsub.grpc.internal
/** Represents a postal address, e.g. for postal delivery or payments addresses.
* Given a postal address, a postal service can deliver items to a premise, P.O.
* Box or similar.
* It is not intended to model geographical locations (roads, towns,
* mountains).
*
* In typical usage an address would be created via user input or from importing
* existing data, depending on the type of process.
*
* Advice on address input / editing:
* - Use an i18n-ready address widget such as
* https://github.com/google/libaddressinput)
* - Users should not be presented with UI elements for input or editing of
* fields outside countries where that field is used.
*
* For more guidance on how to use this schema, please see:
* https://support.google.com/business/answer/6397478
*
* @param revision
* The schema revision of the `PostalAddress`. This must be set to 0, which is
* the latest revision.
*
* All new revisions **must** be backward compatible with old revisions.
* @param regionCode
* Required. CLDR region code of the country/region of the address. This
* is never inferred and it is up to the user to ensure the value is
* correct. See http://cldr.unicode.org/ and
* http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html
* for details. Example: "CH" for Switzerland.
* @param languageCode
* Optional. BCP-47 language code of the contents of this address (if
* known). This is often the UI language of the input form or is expected
* to match one of the languages used in the address' country/region, or their
* transliterated equivalents.
* This can affect formatting in certain countries, but is not critical
* to the correctness of the data and will never affect any validation or
* other non-formatting related operations.
*
* If this value is not known, it should be omitted (rather than specifying a
* possibly incorrect default).
*
* Examples: "zh-Hant", "ja", "ja-Latn", "en".
* @param postalCode
* Optional. Postal code of the address. Not all countries use or require
* postal codes to be present, but where they are used, they may trigger
* additional validation with other parts of the address (e.g. state/zip
* validation in the U.S.A.).
* @param sortingCode
* Optional. Additional, country-specific, sorting code. This is not used
* in most regions. Where it is used, the value is either a string like
* "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a number
* alone, representing the "sector code" (Jamaica), "delivery area indicator"
* (Malawi) or "post office indicator" (e.g. Côte d'Ivoire).
* @param administrativeArea
* Optional. Highest administrative subdivision which is used for postal
* addresses of a country or region.
* For example, this can be a state, a province, an oblast, or a prefecture.
* Specifically, for Spain this is the province and not the autonomous
* community (e.g. "Barcelona" and not "Catalonia").
* Many countries don't use an administrative area in postal addresses. E.g.
* in Switzerland this should be left unpopulated.
* @param locality
* Optional. Generally refers to the city/town portion of the address.
* Examples: US city, IT comune, UK post town.
* In regions of the world where localities are not well defined or do not fit
* into this structure well, leave locality empty and use address_lines.
* @param sublocality
* Optional. Sublocality of the address.
* For example, this can be neighborhoods, boroughs, districts.
* @param addressLines
* Unstructured address lines describing the lower levels of an address.
*
* Because values in address_lines do not have type information and may
* sometimes contain multiple values in a single field (e.g.
* "Austin, TX"), it is important that the line order is clear. The order of
* address lines should be "envelope order" for the country/region of the
* address. In places where this can vary (e.g. Japan), address_language is
* used to make it explicit (e.g. "ja" for large-to-small ordering and
* "ja-Latn" or "en" for small-to-large). This way, the most specific line of
* an address can be selected based on the language.
*
* The minimum permitted structural representation of an address consists
* of a region_code with all remaining information placed in the
* address_lines. It would be possible to format such an address very
* approximately without geocoding, but no semantic reasoning could be
* made about any of the address components until it was at least
* partially resolved.
*
* Creating an address only containing a region_code and address_lines, and
* then geocoding is the recommended way to handle completely unstructured
* addresses (as opposed to guessing which parts of the address should be
* localities or administrative areas).
* @param recipients
* Optional. The recipient at the address.
* This field may, under certain circumstances, contain multiline information.
* For example, it might contain "care of" information.
* @param organization
* Optional. The name of the organization at the address.
*/
@SerialVersionUID(0L)
@scala.annotation.nowarn private[grpc]
final case class PostalAddress(
revision: _root_.scala.Int = 0,
regionCode: _root_.scala.Predef.String = "",
languageCode: _root_.scala.Predef.String = "",
postalCode: _root_.scala.Predef.String = "",
sortingCode: _root_.scala.Predef.String = "",
administrativeArea: _root_.scala.Predef.String = "",
locality: _root_.scala.Predef.String = "",
sublocality: _root_.scala.Predef.String = "",
addressLines: _root_.scala.Seq[_root_.scala.Predef.String] = _root_.scala.Seq.empty,
recipients: _root_.scala.Seq[_root_.scala.Predef.String] = _root_.scala.Seq.empty,
organization: _root_.scala.Predef.String = "",
unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[PostalAddress] {
@transient
private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
private[this] def __computeSerializedSize(): _root_.scala.Int = {
var __size = 0
{
val __value = revision
if (__value != 0) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeInt32Size(1, __value)
}
};
{
val __value = regionCode
if (!__value.isEmpty) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(2, __value)
}
};
{
val __value = languageCode
if (!__value.isEmpty) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(3, __value)
}
};
{
val __value = postalCode
if (!__value.isEmpty) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(4, __value)
}
};
{
val __value = sortingCode
if (!__value.isEmpty) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(5, __value)
}
};
{
val __value = administrativeArea
if (!__value.isEmpty) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(6, __value)
}
};
{
val __value = locality
if (!__value.isEmpty) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(7, __value)
}
};
{
val __value = sublocality
if (!__value.isEmpty) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(8, __value)
}
};
addressLines.foreach { __item =>
val __value = __item
__size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(9, __value)
}
recipients.foreach { __item =>
val __value = __item
__size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(10, __value)
}
{
val __value = organization
if (!__value.isEmpty) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(11, __value)
}
};
__size += unknownFields.serializedSize
__size
}
override def serializedSize: _root_.scala.Int = {
var __size = __serializedSizeMemoized
if (__size == 0) {
__size = __computeSerializedSize() + 1
__serializedSizeMemoized = __size
}
__size - 1
}
def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = {
{
val __v = revision
if (__v != 0) {
_output__.writeInt32(1, __v)
}
};
{
val __v = regionCode
if (!__v.isEmpty) {
_output__.writeString(2, __v)
}
};
{
val __v = languageCode
if (!__v.isEmpty) {
_output__.writeString(3, __v)
}
};
{
val __v = postalCode
if (!__v.isEmpty) {
_output__.writeString(4, __v)
}
};
{
val __v = sortingCode
if (!__v.isEmpty) {
_output__.writeString(5, __v)
}
};
{
val __v = administrativeArea
if (!__v.isEmpty) {
_output__.writeString(6, __v)
}
};
{
val __v = locality
if (!__v.isEmpty) {
_output__.writeString(7, __v)
}
};
{
val __v = sublocality
if (!__v.isEmpty) {
_output__.writeString(8, __v)
}
};
addressLines.foreach { __v =>
val __m = __v
_output__.writeString(9, __m)
};
recipients.foreach { __v =>
val __m = __v
_output__.writeString(10, __m)
};
{
val __v = organization
if (!__v.isEmpty) {
_output__.writeString(11, __v)
}
};
unknownFields.writeTo(_output__)
}
def withRevision(__v: _root_.scala.Int): PostalAddress = copy(revision = __v)
def withRegionCode(__v: _root_.scala.Predef.String): PostalAddress = copy(regionCode = __v)
def withLanguageCode(__v: _root_.scala.Predef.String): PostalAddress = copy(languageCode = __v)
def withPostalCode(__v: _root_.scala.Predef.String): PostalAddress = copy(postalCode = __v)
def withSortingCode(__v: _root_.scala.Predef.String): PostalAddress = copy(sortingCode = __v)
def withAdministrativeArea(__v: _root_.scala.Predef.String): PostalAddress = copy(administrativeArea = __v)
def withLocality(__v: _root_.scala.Predef.String): PostalAddress = copy(locality = __v)
def withSublocality(__v: _root_.scala.Predef.String): PostalAddress = copy(sublocality = __v)
def clearAddressLines = copy(addressLines = _root_.scala.Seq.empty)
def addAddressLines(__vs: _root_.scala.Predef.String *): PostalAddress = addAllAddressLines(__vs)
def addAllAddressLines(__vs: Iterable[_root_.scala.Predef.String]): PostalAddress = copy(addressLines = addressLines ++ __vs)
def withAddressLines(__v: _root_.scala.Seq[_root_.scala.Predef.String]): PostalAddress = copy(addressLines = __v)
def clearRecipients = copy(recipients = _root_.scala.Seq.empty)
def addRecipients(__vs: _root_.scala.Predef.String *): PostalAddress = addAllRecipients(__vs)
def addAllRecipients(__vs: Iterable[_root_.scala.Predef.String]): PostalAddress = copy(recipients = recipients ++ __vs)
def withRecipients(__v: _root_.scala.Seq[_root_.scala.Predef.String]): PostalAddress = copy(recipients = __v)
def withOrganization(__v: _root_.scala.Predef.String): PostalAddress = copy(organization = __v)
def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v)
def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty)
def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = {
(__fieldNumber: @_root_.scala.unchecked) match {
case 1 => {
val __t = revision
if (__t != 0) __t else null
}
case 2 => {
val __t = regionCode
if (__t != "") __t else null
}
case 3 => {
val __t = languageCode
if (__t != "") __t else null
}
case 4 => {
val __t = postalCode
if (__t != "") __t else null
}
case 5 => {
val __t = sortingCode
if (__t != "") __t else null
}
case 6 => {
val __t = administrativeArea
if (__t != "") __t else null
}
case 7 => {
val __t = locality
if (__t != "") __t else null
}
case 8 => {
val __t = sublocality
if (__t != "") __t else null
}
case 9 => addressLines
case 10 => recipients
case 11 => {
val __t = organization
if (__t != "") __t else null
}
}
}
def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = {
_root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor)
(__field.number: @_root_.scala.unchecked) match {
case 1 => _root_.scalapb.descriptors.PInt(revision)
case 2 => _root_.scalapb.descriptors.PString(regionCode)
case 3 => _root_.scalapb.descriptors.PString(languageCode)
case 4 => _root_.scalapb.descriptors.PString(postalCode)
case 5 => _root_.scalapb.descriptors.PString(sortingCode)
case 6 => _root_.scalapb.descriptors.PString(administrativeArea)
case 7 => _root_.scalapb.descriptors.PString(locality)
case 8 => _root_.scalapb.descriptors.PString(sublocality)
case 9 => _root_.scalapb.descriptors.PRepeated(addressLines.iterator.map(_root_.scalapb.descriptors.PString(_)).toVector)
case 10 => _root_.scalapb.descriptors.PRepeated(recipients.iterator.map(_root_.scalapb.descriptors.PString(_)).toVector)
case 11 => _root_.scalapb.descriptors.PString(organization)
}
}
def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
def companion: fs2.pubsub.grpc.internal.PostalAddress.type = fs2.pubsub.grpc.internal.PostalAddress
// @@protoc_insertion_point(GeneratedMessage[google.type.PostalAddress])
}
@scala.annotation.nowarn private[grpc]
object PostalAddress extends scalapb.GeneratedMessageCompanion[fs2.pubsub.grpc.internal.PostalAddress] {
implicit def messageCompanion: scalapb.GeneratedMessageCompanion[fs2.pubsub.grpc.internal.PostalAddress] = this
def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): fs2.pubsub.grpc.internal.PostalAddress = {
var __revision: _root_.scala.Int = 0
var __regionCode: _root_.scala.Predef.String = ""
var __languageCode: _root_.scala.Predef.String = ""
var __postalCode: _root_.scala.Predef.String = ""
var __sortingCode: _root_.scala.Predef.String = ""
var __administrativeArea: _root_.scala.Predef.String = ""
var __locality: _root_.scala.Predef.String = ""
var __sublocality: _root_.scala.Predef.String = ""
val __addressLines: _root_.scala.collection.immutable.VectorBuilder[_root_.scala.Predef.String] = new _root_.scala.collection.immutable.VectorBuilder[_root_.scala.Predef.String]
val __recipients: _root_.scala.collection.immutable.VectorBuilder[_root_.scala.Predef.String] = new _root_.scala.collection.immutable.VectorBuilder[_root_.scala.Predef.String]
var __organization: _root_.scala.Predef.String = ""
var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null
var _done__ = false
while (!_done__) {
val _tag__ = _input__.readTag()
_tag__ match {
case 0 => _done__ = true
case 8 =>
__revision = _input__.readInt32()
case 18 =>
__regionCode = _input__.readStringRequireUtf8()
case 26 =>
__languageCode = _input__.readStringRequireUtf8()
case 34 =>
__postalCode = _input__.readStringRequireUtf8()
case 42 =>
__sortingCode = _input__.readStringRequireUtf8()
case 50 =>
__administrativeArea = _input__.readStringRequireUtf8()
case 58 =>
__locality = _input__.readStringRequireUtf8()
case 66 =>
__sublocality = _input__.readStringRequireUtf8()
case 74 =>
__addressLines += _input__.readStringRequireUtf8()
case 82 =>
__recipients += _input__.readStringRequireUtf8()
case 90 =>
__organization = _input__.readStringRequireUtf8()
case tag =>
if (_unknownFields__ == null) {
_unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
}
_unknownFields__.parseField(tag, _input__)
}
}
fs2.pubsub.grpc.internal.PostalAddress(
revision = __revision,
regionCode = __regionCode,
languageCode = __languageCode,
postalCode = __postalCode,
sortingCode = __sortingCode,
administrativeArea = __administrativeArea,
locality = __locality,
sublocality = __sublocality,
addressLines = __addressLines.result(),
recipients = __recipients.result(),
organization = __organization,
unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
)
}
implicit def messageReads: _root_.scalapb.descriptors.Reads[fs2.pubsub.grpc.internal.PostalAddress] = _root_.scalapb.descriptors.Reads{
case _root_.scalapb.descriptors.PMessage(__fieldsMap) =>
_root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.")
fs2.pubsub.grpc.internal.PostalAddress(
revision = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Int]).getOrElse(0),
regionCode = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
languageCode = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
postalCode = __fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
sortingCode = __fieldsMap.get(scalaDescriptor.findFieldByNumber(5).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
administrativeArea = __fieldsMap.get(scalaDescriptor.findFieldByNumber(6).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
locality = __fieldsMap.get(scalaDescriptor.findFieldByNumber(7).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
sublocality = __fieldsMap.get(scalaDescriptor.findFieldByNumber(8).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
addressLines = __fieldsMap.get(scalaDescriptor.findFieldByNumber(9).get).map(_.as[_root_.scala.Seq[_root_.scala.Predef.String]]).getOrElse(_root_.scala.Seq.empty),
recipients = __fieldsMap.get(scalaDescriptor.findFieldByNumber(10).get).map(_.as[_root_.scala.Seq[_root_.scala.Predef.String]]).getOrElse(_root_.scala.Seq.empty),
organization = __fieldsMap.get(scalaDescriptor.findFieldByNumber(11).get).map(_.as[_root_.scala.Predef.String]).getOrElse("")
)
case _ => throw new RuntimeException("Expected PMessage")
}
def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = PostalAddressProto.javaDescriptor.getMessageTypes().get(0)
def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = PostalAddressProto.scalaDescriptor.messages(0)
def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__number)
lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty
def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber)
lazy val defaultInstance = fs2.pubsub.grpc.internal.PostalAddress(
revision = 0,
regionCode = "",
languageCode = "",
postalCode = "",
sortingCode = "",
administrativeArea = "",
locality = "",
sublocality = "",
addressLines = _root_.scala.Seq.empty,
recipients = _root_.scala.Seq.empty,
organization = ""
)
implicit class PostalAddressLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, fs2.pubsub.grpc.internal.PostalAddress]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, fs2.pubsub.grpc.internal.PostalAddress](_l) {
def revision: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = field(_.revision)((c_, f_) => c_.copy(revision = f_))
def regionCode: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.regionCode)((c_, f_) => c_.copy(regionCode = f_))
def languageCode: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.languageCode)((c_, f_) => c_.copy(languageCode = f_))
def postalCode: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.postalCode)((c_, f_) => c_.copy(postalCode = f_))
def sortingCode: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.sortingCode)((c_, f_) => c_.copy(sortingCode = f_))
def administrativeArea: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.administrativeArea)((c_, f_) => c_.copy(administrativeArea = f_))
def locality: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.locality)((c_, f_) => c_.copy(locality = f_))
def sublocality: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.sublocality)((c_, f_) => c_.copy(sublocality = f_))
def addressLines: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[_root_.scala.Predef.String]] = field(_.addressLines)((c_, f_) => c_.copy(addressLines = f_))
def recipients: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[_root_.scala.Predef.String]] = field(_.recipients)((c_, f_) => c_.copy(recipients = f_))
def organization: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.organization)((c_, f_) => c_.copy(organization = f_))
}
final val REVISION_FIELD_NUMBER = 1
final val REGION_CODE_FIELD_NUMBER = 2
final val LANGUAGE_CODE_FIELD_NUMBER = 3
final val POSTAL_CODE_FIELD_NUMBER = 4
final val SORTING_CODE_FIELD_NUMBER = 5
final val ADMINISTRATIVE_AREA_FIELD_NUMBER = 6
final val LOCALITY_FIELD_NUMBER = 7
final val SUBLOCALITY_FIELD_NUMBER = 8
final val ADDRESS_LINES_FIELD_NUMBER = 9
final val RECIPIENTS_FIELD_NUMBER = 10
final val ORGANIZATION_FIELD_NUMBER = 11
def of(
revision: _root_.scala.Int,
regionCode: _root_.scala.Predef.String,
languageCode: _root_.scala.Predef.String,
postalCode: _root_.scala.Predef.String,
sortingCode: _root_.scala.Predef.String,
administrativeArea: _root_.scala.Predef.String,
locality: _root_.scala.Predef.String,
sublocality: _root_.scala.Predef.String,
addressLines: _root_.scala.Seq[_root_.scala.Predef.String],
recipients: _root_.scala.Seq[_root_.scala.Predef.String],
organization: _root_.scala.Predef.String
): _root_.fs2.pubsub.grpc.internal.PostalAddress = _root_.fs2.pubsub.grpc.internal.PostalAddress(
revision,
regionCode,
languageCode,
postalCode,
sortingCode,
administrativeArea,
locality,
sublocality,
addressLines,
recipients,
organization
)
// @@protoc_insertion_point(GeneratedMessageCompanion[google.type.PostalAddress])
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy