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

import typing_extensions
from ..types.catalog_custom_attribute_definition_type import CatalogCustomAttributeDefinitionType
import typing_extensions
import typing
from .source_application import SourceApplicationParams
from ..types.catalog_object_type import CatalogObjectType
from ..types.catalog_custom_attribute_definition_seller_visibility import (
    CatalogCustomAttributeDefinitionSellerVisibility,
)
from ..types.catalog_custom_attribute_definition_app_visibility import CatalogCustomAttributeDefinitionAppVisibility
from .catalog_custom_attribute_definition_string_config import CatalogCustomAttributeDefinitionStringConfigParams
from .catalog_custom_attribute_definition_number_config import CatalogCustomAttributeDefinitionNumberConfigParams
from .catalog_custom_attribute_definition_selection_config import CatalogCustomAttributeDefinitionSelectionConfigParams


class CatalogCustomAttributeDefinitionParams(typing_extensions.TypedDict):
    """
    Contains information defining a custom attribute. Custom attributes are
    intended to store additional information about a catalog object or to associate a
    catalog object with an entity in another system. Do not use custom attributes
    to store any sensitive information (personally identifiable information, card details, etc.).
    [Read more about custom attributes](https://developer.squareup.com/docs/catalog-api/add-custom-attributes)
    """

    type: CatalogCustomAttributeDefinitionType
    """
    The type of this custom attribute. Cannot be modified after creation.
    Required.
    See [CatalogCustomAttributeDefinitionType](#type-catalogcustomattributedefinitiontype) for possible values
    """

    name: str
    """
     The name of this definition for API and seller-facing UI purposes.
    The name must be unique within the (merchant, application) pair. Required.
    May not be empty and may not exceed 255 characters. Can be modified after creation.
    """

    description: typing_extensions.NotRequired[typing.Optional[str]]
    """
    Seller-oriented description of the meaning of this Custom Attribute,
    any constraints that the seller should observe, etc. May be displayed as a tooltip in Square UIs.
    """

    source_application: typing_extensions.NotRequired[SourceApplicationParams]
    """
    __Read only.__ Contains information about the application that
    created this custom attribute definition.
    """

    allowed_object_types: typing.Sequence[CatalogObjectType]
    """
    The set of `CatalogObject` types that this custom atttribute may be applied to.
    Currently, only `ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, and `CATEGORY` are allowed. At least one type must be included.
    See [CatalogObjectType](#type-catalogobjecttype) for possible values
    """

    seller_visibility: typing_extensions.NotRequired[CatalogCustomAttributeDefinitionSellerVisibility]
    """
    The visibility of a custom attribute in seller-facing UIs (including Square Point
    of Sale applications and Square Dashboard). May be modified.
    See [CatalogCustomAttributeDefinitionSellerVisibility](#type-catalogcustomattributedefinitionsellervisibility) for possible values
    """

    app_visibility: typing_extensions.NotRequired[CatalogCustomAttributeDefinitionAppVisibility]
    """
    The visibility of a custom attribute to applications other than the application
    that created the attribute.
    See [CatalogCustomAttributeDefinitionAppVisibility](#type-catalogcustomattributedefinitionappvisibility) for possible values
    """

    string_config: typing_extensions.NotRequired[CatalogCustomAttributeDefinitionStringConfigParams]
    """
    Optionally, populated when `type` = `STRING`, unset otherwise.
    """

    number_config: typing_extensions.NotRequired[CatalogCustomAttributeDefinitionNumberConfigParams]
    """
    Optionally, populated when `type` = `NUMBER`, unset otherwise.
    """

    selection_config: typing_extensions.NotRequired[CatalogCustomAttributeDefinitionSelectionConfigParams]
    """
    Populated when `type` is set to `SELECTION`, unset otherwise.
    """

    custom_attribute_usage_count: typing_extensions.NotRequired[int]
    """
    The number of custom attributes that reference this
    custom attribute definition. Set by the server in response to a ListCatalog
    request with `include_counts` set to `true`.  If the actual count is greater
    than 100, `custom_attribute_usage_count` will be set to `100`.
    """

    key: typing_extensions.NotRequired[typing.Optional[str]]
    """
    The name of the desired custom attribute key that can be used to access
    the custom attribute value on catalog objects. Cannot be modified after the
    custom attribute definition has been created.
    Must be between 1 and 60 characters, and may only contain the characters `[a-zA-Z0-9_-]`.
    """
