# This file was auto-generated by Fern from our API Definition.

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
from .error import Error
import pydantic
from .location import Location
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class CreateLocationResponse(UncheckedBaseModel):
    """
    The response object returned by the [CreateLocation](api-endpoint:Locations-CreateLocation) endpoint.
    """

    errors: typing.Optional[typing.List[Error]] = pydantic.Field(default=None)
    """
    Information about [errors](https://developer.squareup.com/docs/build-basics/handling-errors) encountered during the request.
    """

    location: typing.Optional[Location] = pydantic.Field(default=None)
    """
    The newly created `Location` object.
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
