"""mindbodypublicapi.

This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
"""

# ruff: noqa: E501
from mindbodypublicapi.api_helper import APIHelper
from mindbodypublicapi.models.amenity import (
    Amenity,
)


class Location(object):
    """Implementation of the 'Location' model.

    Attributes:
        additional_image_ur_ls (List[str]): A list of URLs of any images associated
            with this location.
        address (str): The first line of the location’s street address.
        address_2 (str): A second address line for the location’s street address, if
            needed.
        amenities (List[Amenity]): A list of strings representing amenities available
            at the location.
        business_description (str): The business description for the location, as
            configured by the business owner.
        city (str): The location’s city.
        description (str): A description of the location.
        has_classes (bool): When `true`, indicates that classes are held at this
            location.<br />  When `false`, Indicates that classes are not held at
            this location.
        id (int): The ID assigned to this location.
        latitude (float): The location’s latitude.
        longitude (float): The location’s longitude.
        name (str): The name of this location.
        phone (str): The location’s phone number.
        phone_extension (str): The location’s phone extension.
        postal_code (str): The location’s postal code.
        site_id (int): The ID number assigned to this location.
        state_prov_code (str): The location’s state or province code.
        tax_1 (float): A decimal representation of the location’s first tax rate. Tax
            properties are provided to apply all taxes to the purchase price that the
            purchase is subject to. Use as many tax properties as needed to represent
            all the taxes that apply in the location. Enter a decimal number that
            represents the appropriate tax rate. For example, for an 8% sales tax,
            enter 0.08.
        tax_2 (float): A decimal representation of the location’s second tax rate.
            See the example in the description of Tax1.
        tax_3 (float): A decimal representation of the location’s third tax rate. See
            the example in the description of Tax1.
        tax_4 (float): A decimal representation of the location’s fourth tax rate.
            See the example in the description of Tax1.
        tax_5 (float): A decimal representation of the location’s fifth tax rate. See
            the example in the description of Tax1.
        total_number_of_ratings (int): The number of reviews that clients have left
            for this location.
        average_rating (float): The average rating for the location, out of five
            stars.
        total_number_of_deals (int): The number of distinct introductory pricing
            options available for purchase at this location.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "additional_image_ur_ls": "AdditionalImageURLs",
        "address": "Address",
        "address_2": "Address2",
        "amenities": "Amenities",
        "business_description": "BusinessDescription",
        "city": "City",
        "description": "Description",
        "has_classes": "HasClasses",
        "id": "Id",
        "latitude": "Latitude",
        "longitude": "Longitude",
        "name": "Name",
        "phone": "Phone",
        "phone_extension": "PhoneExtension",
        "postal_code": "PostalCode",
        "site_id": "SiteID",
        "state_prov_code": "StateProvCode",
        "tax_1": "Tax1",
        "tax_2": "Tax2",
        "tax_3": "Tax3",
        "tax_4": "Tax4",
        "tax_5": "Tax5",
        "total_number_of_ratings": "TotalNumberOfRatings",
        "average_rating": "AverageRating",
        "total_number_of_deals": "TotalNumberOfDeals",
    }

    _optionals = [
        "additional_image_ur_ls",
        "address",
        "address_2",
        "amenities",
        "business_description",
        "city",
        "description",
        "has_classes",
        "id",
        "latitude",
        "longitude",
        "name",
        "phone",
        "phone_extension",
        "postal_code",
        "site_id",
        "state_prov_code",
        "tax_1",
        "tax_2",
        "tax_3",
        "tax_4",
        "tax_5",
        "total_number_of_ratings",
        "average_rating",
        "total_number_of_deals",
    ]

    def __init__(
        self,
        additional_image_ur_ls=APIHelper.SKIP,
        address=APIHelper.SKIP,
        address_2=APIHelper.SKIP,
        amenities=APIHelper.SKIP,
        business_description=APIHelper.SKIP,
        city=APIHelper.SKIP,
        description=APIHelper.SKIP,
        has_classes=APIHelper.SKIP,
        id=APIHelper.SKIP,
        latitude=APIHelper.SKIP,
        longitude=APIHelper.SKIP,
        name=APIHelper.SKIP,
        phone=APIHelper.SKIP,
        phone_extension=APIHelper.SKIP,
        postal_code=APIHelper.SKIP,
        site_id=APIHelper.SKIP,
        state_prov_code=APIHelper.SKIP,
        tax_1=APIHelper.SKIP,
        tax_2=APIHelper.SKIP,
        tax_3=APIHelper.SKIP,
        tax_4=APIHelper.SKIP,
        tax_5=APIHelper.SKIP,
        total_number_of_ratings=APIHelper.SKIP,
        average_rating=APIHelper.SKIP,
        total_number_of_deals=APIHelper.SKIP):
        """Initialize a Location instance."""
        # Initialize members of the class
        if additional_image_ur_ls is not APIHelper.SKIP:
            self.additional_image_ur_ls = additional_image_ur_ls
        if address is not APIHelper.SKIP:
            self.address = address
        if address_2 is not APIHelper.SKIP:
            self.address_2 = address_2
        if amenities is not APIHelper.SKIP:
            self.amenities = amenities
        if business_description is not APIHelper.SKIP:
            self.business_description = business_description
        if city is not APIHelper.SKIP:
            self.city = city
        if description is not APIHelper.SKIP:
            self.description = description
        if has_classes is not APIHelper.SKIP:
            self.has_classes = has_classes
        if id is not APIHelper.SKIP:
            self.id = id
        if latitude is not APIHelper.SKIP:
            self.latitude = latitude
        if longitude is not APIHelper.SKIP:
            self.longitude = longitude
        if name is not APIHelper.SKIP:
            self.name = name
        if phone is not APIHelper.SKIP:
            self.phone = phone
        if phone_extension is not APIHelper.SKIP:
            self.phone_extension = phone_extension
        if postal_code is not APIHelper.SKIP:
            self.postal_code = postal_code
        if site_id is not APIHelper.SKIP:
            self.site_id = site_id
        if state_prov_code is not APIHelper.SKIP:
            self.state_prov_code = state_prov_code
        if tax_1 is not APIHelper.SKIP:
            self.tax_1 = tax_1
        if tax_2 is not APIHelper.SKIP:
            self.tax_2 = tax_2
        if tax_3 is not APIHelper.SKIP:
            self.tax_3 = tax_3
        if tax_4 is not APIHelper.SKIP:
            self.tax_4 = tax_4
        if tax_5 is not APIHelper.SKIP:
            self.tax_5 = tax_5
        if total_number_of_ratings is not APIHelper.SKIP:
            self.total_number_of_ratings = total_number_of_ratings
        if average_rating is not APIHelper.SKIP:
            self.average_rating = average_rating
        if total_number_of_deals is not APIHelper.SKIP:
            self.total_number_of_deals = total_number_of_deals

    @classmethod
    def from_dictionary(cls,
                        dictionary):
        """Create an instance of this model from a dictionary

        Args:
            dictionary (dictionary): A dictionary representation of the object
            as obtained from the deserialization of the server's response. The
            keys MUST match property names in the API description.

        Returns:
            object: An instance of this structure class.

        """
        if not isinstance(dictionary, dict) or dictionary is None:
            return None

        # Extract variables from the dictionary
        additional_image_ur_ls =\
            dictionary.get("AdditionalImageURLs")\
            if dictionary.get("AdditionalImageURLs")\
                else APIHelper.SKIP
        address =\
            dictionary.get("Address")\
            if dictionary.get("Address")\
                else APIHelper.SKIP
        address_2 =\
            dictionary.get("Address2")\
            if dictionary.get("Address2")\
                else APIHelper.SKIP
        amenities = None
        if dictionary.get("Amenities") is not None:
            amenities = [
                Amenity.from_dictionary(x)
                    for x in dictionary.get("Amenities")
            ]
        else:
            amenities = APIHelper.SKIP
        business_description =\
            dictionary.get("BusinessDescription")\
            if dictionary.get("BusinessDescription")\
                else APIHelper.SKIP
        city =\
            dictionary.get("City")\
            if dictionary.get("City")\
                else APIHelper.SKIP
        description =\
            dictionary.get("Description")\
            if dictionary.get("Description")\
                else APIHelper.SKIP
        has_classes =\
            dictionary.get("HasClasses")\
            if "HasClasses" in dictionary.keys()\
                else APIHelper.SKIP
        id =\
            dictionary.get("Id")\
            if dictionary.get("Id")\
                else APIHelper.SKIP
        latitude =\
            dictionary.get("Latitude")\
            if dictionary.get("Latitude")\
                else APIHelper.SKIP
        longitude =\
            dictionary.get("Longitude")\
            if dictionary.get("Longitude")\
                else APIHelper.SKIP
        name =\
            dictionary.get("Name")\
            if dictionary.get("Name")\
                else APIHelper.SKIP
        phone =\
            dictionary.get("Phone")\
            if dictionary.get("Phone")\
                else APIHelper.SKIP
        phone_extension =\
            dictionary.get("PhoneExtension")\
            if dictionary.get("PhoneExtension")\
                else APIHelper.SKIP
        postal_code =\
            dictionary.get("PostalCode")\
            if dictionary.get("PostalCode")\
                else APIHelper.SKIP
        site_id =\
            dictionary.get("SiteID")\
            if dictionary.get("SiteID")\
                else APIHelper.SKIP
        state_prov_code =\
            dictionary.get("StateProvCode")\
            if dictionary.get("StateProvCode")\
                else APIHelper.SKIP
        tax_1 =\
            dictionary.get("Tax1")\
            if dictionary.get("Tax1")\
                else APIHelper.SKIP
        tax_2 =\
            dictionary.get("Tax2")\
            if dictionary.get("Tax2")\
                else APIHelper.SKIP
        tax_3 =\
            dictionary.get("Tax3")\
            if dictionary.get("Tax3")\
                else APIHelper.SKIP
        tax_4 =\
            dictionary.get("Tax4")\
            if dictionary.get("Tax4")\
                else APIHelper.SKIP
        tax_5 =\
            dictionary.get("Tax5")\
            if dictionary.get("Tax5")\
                else APIHelper.SKIP
        total_number_of_ratings =\
            dictionary.get("TotalNumberOfRatings")\
            if dictionary.get("TotalNumberOfRatings")\
                else APIHelper.SKIP
        average_rating =\
            dictionary.get("AverageRating")\
            if dictionary.get("AverageRating")\
                else APIHelper.SKIP
        total_number_of_deals =\
            dictionary.get("TotalNumberOfDeals")\
            if dictionary.get("TotalNumberOfDeals")\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(additional_image_ur_ls,
                   address,
                   address_2,
                   amenities,
                   business_description,
                   city,
                   description,
                   has_classes,
                   id,
                   latitude,
                   longitude,
                   name,
                   phone,
                   phone_extension,
                   postal_code,
                   site_id,
                   state_prov_code,
                   tax_1,
                   tax_2,
                   tax_3,
                   tax_4,
                   tax_5,
                   total_number_of_ratings,
                   average_rating,
                   total_number_of_deals)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _additional_image_ur_ls=(
            self.additional_image_ur_ls
            if hasattr(self, "additional_image_ur_ls")
            else None
        )
        _address=(
            self.address
            if hasattr(self, "address")
            else None
        )
        _address_2=(
            self.address_2
            if hasattr(self, "address_2")
            else None
        )
        _amenities=(
            self.amenities
            if hasattr(self, "amenities")
            else None
        )
        _business_description=(
            self.business_description
            if hasattr(self, "business_description")
            else None
        )
        _city=(
            self.city
            if hasattr(self, "city")
            else None
        )
        _description=(
            self.description
            if hasattr(self, "description")
            else None
        )
        _has_classes=(
            self.has_classes
            if hasattr(self, "has_classes")
            else None
        )
        _id=(
            self.id
            if hasattr(self, "id")
            else None
        )
        _latitude=(
            self.latitude
            if hasattr(self, "latitude")
            else None
        )
        _longitude=(
            self.longitude
            if hasattr(self, "longitude")
            else None
        )
        _name=(
            self.name
            if hasattr(self, "name")
            else None
        )
        _phone=(
            self.phone
            if hasattr(self, "phone")
            else None
        )
        _phone_extension=(
            self.phone_extension
            if hasattr(self, "phone_extension")
            else None
        )
        _postal_code=(
            self.postal_code
            if hasattr(self, "postal_code")
            else None
        )
        _site_id=(
            self.site_id
            if hasattr(self, "site_id")
            else None
        )
        _state_prov_code=(
            self.state_prov_code
            if hasattr(self, "state_prov_code")
            else None
        )
        _tax_1=(
            self.tax_1
            if hasattr(self, "tax_1")
            else None
        )
        _tax_2=(
            self.tax_2
            if hasattr(self, "tax_2")
            else None
        )
        _tax_3=(
            self.tax_3
            if hasattr(self, "tax_3")
            else None
        )
        _tax_4=(
            self.tax_4
            if hasattr(self, "tax_4")
            else None
        )
        _tax_5=(
            self.tax_5
            if hasattr(self, "tax_5")
            else None
        )
        _total_number_of_ratings=(
            self.total_number_of_ratings
            if hasattr(self, "total_number_of_ratings")
            else None
        )
        _average_rating=(
            self.average_rating
            if hasattr(self, "average_rating")
            else None
        )
        _total_number_of_deals=(
            self.total_number_of_deals
            if hasattr(self, "total_number_of_deals")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"additional_image_ur_ls={_additional_image_ur_ls!r}, "
            f"address={_address!r}, "
            f"address_2={_address_2!r}, "
            f"amenities={_amenities!r}, "
            f"business_description={_business_description!r}, "
            f"city={_city!r}, "
            f"description={_description!r}, "
            f"has_classes={_has_classes!r}, "
            f"id={_id!r}, "
            f"latitude={_latitude!r}, "
            f"longitude={_longitude!r}, "
            f"name={_name!r}, "
            f"phone={_phone!r}, "
            f"phone_extension={_phone_extension!r}, "
            f"postal_code={_postal_code!r}, "
            f"site_id={_site_id!r}, "
            f"state_prov_code={_state_prov_code!r}, "
            f"tax_1={_tax_1!r}, "
            f"tax_2={_tax_2!r}, "
            f"tax_3={_tax_3!r}, "
            f"tax_4={_tax_4!r}, "
            f"tax_5={_tax_5!r}, "
            f"total_number_of_ratings={_total_number_of_ratings!r}, "
            f"average_rating={_average_rating!r}, "
            f"total_number_of_deals={_total_number_of_deals!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _additional_image_ur_ls=(
            self.additional_image_ur_ls
            if hasattr(self, "additional_image_ur_ls")
            else None
        )
        _address=(
            self.address
            if hasattr(self, "address")
            else None
        )
        _address_2=(
            self.address_2
            if hasattr(self, "address_2")
            else None
        )
        _amenities=(
            self.amenities
            if hasattr(self, "amenities")
            else None
        )
        _business_description=(
            self.business_description
            if hasattr(self, "business_description")
            else None
        )
        _city=(
            self.city
            if hasattr(self, "city")
            else None
        )
        _description=(
            self.description
            if hasattr(self, "description")
            else None
        )
        _has_classes=(
            self.has_classes
            if hasattr(self, "has_classes")
            else None
        )
        _id=(
            self.id
            if hasattr(self, "id")
            else None
        )
        _latitude=(
            self.latitude
            if hasattr(self, "latitude")
            else None
        )
        _longitude=(
            self.longitude
            if hasattr(self, "longitude")
            else None
        )
        _name=(
            self.name
            if hasattr(self, "name")
            else None
        )
        _phone=(
            self.phone
            if hasattr(self, "phone")
            else None
        )
        _phone_extension=(
            self.phone_extension
            if hasattr(self, "phone_extension")
            else None
        )
        _postal_code=(
            self.postal_code
            if hasattr(self, "postal_code")
            else None
        )
        _site_id=(
            self.site_id
            if hasattr(self, "site_id")
            else None
        )
        _state_prov_code=(
            self.state_prov_code
            if hasattr(self, "state_prov_code")
            else None
        )
        _tax_1=(
            self.tax_1
            if hasattr(self, "tax_1")
            else None
        )
        _tax_2=(
            self.tax_2
            if hasattr(self, "tax_2")
            else None
        )
        _tax_3=(
            self.tax_3
            if hasattr(self, "tax_3")
            else None
        )
        _tax_4=(
            self.tax_4
            if hasattr(self, "tax_4")
            else None
        )
        _tax_5=(
            self.tax_5
            if hasattr(self, "tax_5")
            else None
        )
        _total_number_of_ratings=(
            self.total_number_of_ratings
            if hasattr(self, "total_number_of_ratings")
            else None
        )
        _average_rating=(
            self.average_rating
            if hasattr(self, "average_rating")
            else None
        )
        _total_number_of_deals=(
            self.total_number_of_deals
            if hasattr(self, "total_number_of_deals")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"additional_image_ur_ls={_additional_image_ur_ls!s}, "
            f"address={_address!s}, "
            f"address_2={_address_2!s}, "
            f"amenities={_amenities!s}, "
            f"business_description={_business_description!s}, "
            f"city={_city!s}, "
            f"description={_description!s}, "
            f"has_classes={_has_classes!s}, "
            f"id={_id!s}, "
            f"latitude={_latitude!s}, "
            f"longitude={_longitude!s}, "
            f"name={_name!s}, "
            f"phone={_phone!s}, "
            f"phone_extension={_phone_extension!s}, "
            f"postal_code={_postal_code!s}, "
            f"site_id={_site_id!s}, "
            f"state_prov_code={_state_prov_code!s}, "
            f"tax_1={_tax_1!s}, "
            f"tax_2={_tax_2!s}, "
            f"tax_3={_tax_3!s}, "
            f"tax_4={_tax_4!s}, "
            f"tax_5={_tax_5!s}, "
            f"total_number_of_ratings={_total_number_of_ratings!s}, "
            f"average_rating={_average_rating!s}, "
            f"total_number_of_deals={_total_number_of_deals!s}, "
            f")"
        )
