# coding: utf-8

"""
    Wink Payment API

    A programmatic way to create bookings, receive payment and disburse funds globally.  ## APIs Not every integrator needs every APIs. For that reason, we have separated APIs into context.  - [Affiliate](/affiliate): All APIs related to selling travel inventory as an affiliate. - [Analytics](/analytics): All APIs related to tracking metrics across a wide variety of data source segments including, more entertaining, leaderboard metrics. - [Booking](/booking): All APIs related to creating platform bookings. - [Channel Manager](/channel-manager): All APIs related to channel managers who want to integrate with our platform. - [Extranet](/extranet): All APIs related to managing travel inventory and suppliers. - [Inventory](/inventory): All APIs related to retrieve known travel inventory as it was found using the Lookup API.. - [Lookup](/lookup): All APIs related to locating inventory by region, locale and property flags. - [Reference](/reference): All APIs related to retrieving platform-supported taxonomies. - [TripPay](/payment): All APIs related to TripPay account management, booking, mapping and integration features.  ## SDKs We are actively working on supporting the most used languages out there. If you don't see your language here, reach out to us with a request to officially add your language. In the meantime, if you want to roll your own SDK, you can do so by downloading the OpenAPI spec and using one of the many available OpenAPI generators available: [https://openapi-generator.tech/docs/generators](https://openapi-generator.tech/docs/generators).  - Java SDK [https://github.com/wink-travel/trip-pay-sdk-java](https://github.com/wink-travel/trip-pay-sdk-java)  # Usage These features are made available to you via a [REST API](https://en.wikipedia.org/wiki/Representational_state_transfer). This API is language agnostic. We will link to SDKs for the most popular programming languages on this page as they become available.  ## Versioning We chose to version our endpoints in a way that we hope affects your integration with us the least. You request the version of our API you wish to work with via the `Wink-Version` header. When it's time for you to upgrade, you only have to change the version number to get access to our updated endpoints.  ## Release history - Follow updates on Github: https://github.com/wink-travel/wink-sdk-java/blob/master/CHANGELOG.md 

    The version of the OpenAPI document: 30.20.0
    Contact: bjorn@wink.travel
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


from __future__ import annotations
import pprint
import re  # noqa: F401
import json

from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional, Union
from typing import Optional, Set
from typing_extensions import Self

class CountryLightweight(BaseModel):
    """
    Country
    """ # noqa: E501
    iso: Optional[StrictStr] = Field(default=None, description="ISO code")
    iso3: Optional[StrictStr] = Field(default=None, description="3 character ISO code")
    iso_numeric: Optional[StrictInt] = Field(default=None, description="Numeric ISO code", alias="isoNumeric")
    fips: Optional[StrictStr] = Field(default=None, description="FIPS country code")
    name: Optional[StrictStr] = Field(default=None, description="Country name")
    capital: Optional[StrictStr] = Field(default=None, description="Country capital")
    area: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Area in square kilometers")
    population: Optional[StrictInt] = Field(default=None, description="Country population")
    continent: Optional[StrictStr] = Field(default=None, description="Continent code")
    top_level_domain: Optional[StrictStr] = Field(default=None, description="Country TLD", alias="topLevelDomain")
    currency_code: Optional[StrictStr] = Field(default=None, description="Currency code", alias="currencyCode")
    currency_name: Optional[StrictStr] = Field(default=None, description="Currency name", alias="currencyName")
    phone: Optional[StrictStr] = Field(default=None, description="Calling code")
    postal_code_format: Optional[StrictStr] = Field(default=None, description="Postal code format", alias="postalCodeFormat")
    postal_code_reg_ex: Optional[StrictStr] = Field(default=None, description="Postal code regular expression", alias="postalCodeRegEx")
    languages: Optional[List[Any]] = None
    geo_name_id: Optional[StrictStr] = Field(default=None, description="Country GeoNames identifier", alias="geoNameId")
    neighbors: Optional[List[Any]] = None
    __properties: ClassVar[List[str]] = ["iso", "iso3", "isoNumeric", "fips", "name", "capital", "area", "population", "continent", "topLevelDomain", "currencyCode", "currencyName", "phone", "postalCodeFormat", "postalCodeRegEx", "languages", "geoNameId", "neighbors"]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of CountryLightweight from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of CountryLightweight from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "iso": obj.get("iso"),
            "iso3": obj.get("iso3"),
            "isoNumeric": obj.get("isoNumeric"),
            "fips": obj.get("fips"),
            "name": obj.get("name"),
            "capital": obj.get("capital"),
            "area": obj.get("area"),
            "population": obj.get("population"),
            "continent": obj.get("continent"),
            "topLevelDomain": obj.get("topLevelDomain"),
            "currencyCode": obj.get("currencyCode"),
            "currencyName": obj.get("currencyName"),
            "phone": obj.get("phone"),
            "postalCodeFormat": obj.get("postalCodeFormat"),
            "postalCodeRegEx": obj.get("postalCodeRegEx"),
            "languages": obj.get("languages"),
            "geoNameId": obj.get("geoNameId"),
            "neighbors": obj.get("neighbors")
        })
        return _obj


