# This file was generated by liblab | https://liblab.com/

from .utils.json_map import JsonMap
from .base import BaseModel


@JsonMap({"street_address": "streetAddress", "postal_code": "postalCode"})
class Address(BaseModel):
    """Address

    :param street_address: Street and number., defaults to None
    :type street_address: str, optional
    :param locality: Locality name., defaults to None
    :type locality: str, optional
    :param region: Region code., defaults to None
    :type region: str, optional
    :param postal_code: Postal code., defaults to None
    :type postal_code: str, optional
    :param country: Country code., defaults to None
    :type country: str, optional
    """

    def __init__(
        self,
        street_address: str = None,
        locality: str = None,
        region: str = None,
        postal_code: str = None,
        country: str = None,
    ):
        if street_address is not None:
            self.street_address = street_address
        if locality is not None:
            self.locality = locality
        if region is not None:
            self.region = region
        if postal_code is not None:
            self.postal_code = postal_code
        if country is not None:
            self.country = self._pattern_matching(country, "^[A-Z]{2}$", "country")
