PostalAddress

struct PostalAddress
extension PostalAddress : AutomationValue, Decodable, Encodable, Equatable, Hashable, Sendable, StructDataRepresentable

Represents a postal address, such as for postal delivery or payments addresses.

  • The schema revision of the PostalAddress. This must be set to 0, which is the latest revision.

    Declaration

    Swift

    let revision: Int32
  • Required. CLDR region code of the country/region of the address.

    Declaration

    Swift

    let regionCode: String
  • BCP-47 language code of the contents of this address (if known).

    Declaration

    Swift

    let languageCode: String
  • Postal code of the address.

    Declaration

    Swift

    let postalCode: String
  • Additional, country-specific, sorting code.

    Declaration

    Swift

    let sortingCode: String
  • Highest administrative subdivision which is used for postal addresses of a country or region.

    Declaration

    Swift

    let administrativeArea: String
  • Generally refers to the city or town portion of the address.

    Declaration

    Swift

    let locality: String
  • Sublocality of the address.

    Declaration

    Swift

    let sublocality: String
  • Unstructured address lines describing the lower levels of an address.

    Declaration

    Swift

    let addressLines: [String]
  • The recipient at the address.

    Declaration

    Swift

    let recipients: [String]
  • The name of the organization at the address.

    Declaration

    Swift

    let organization: String
  • Initializes the postal address with the given properties.

    Declaration

    Swift

    init(revision: Int32 = 0, regionCode: String, languageCode: String = "", postalCode: String = "", sortingCode: String = "", administrativeArea: String = "", locality: String = "", sublocality: String = "", addressLines: [String] = [], recipients: [String] = [], organization: String = "")
  • Initializes PostalAddress with the trait decoder.

    Declaration

    Swift

    init(decoder: TraitDecoder) throws

    Parameters

    decoder

    The trait decoder to decode the postal address.

  • Encodes PostalAddress to the trait encoder.

    Declaration

    Swift

    func encode(with encoder: TraitEncoder) throws
  • Creates a new instance by decoding from the given decoder.

    This initializer throws an error if reading from the decoder fails, or if the data read is corrupted or otherwise invalid.

    Declaration

    Swift

    init(from decoder: any Decoder) throws