# DO NOT EDIT! This file is automatically generated
import datetime
import typing

from commercetools.types._abstract import _BaseType
from commercetools.types._common import (
    BaseResource,
    KeyReference,
    Reference,
    ReferenceTypeId,
    ResourceIdentifier,
)

if typing.TYPE_CHECKING:
    from ._channel import ChannelReference, ChannelResourceIdentifier
    from ._common import CreatedBy, LastModifiedBy, LocalizedString
__all__ = [
    "Store",
    "StoreDraft",
    "StoreKeyReference",
    "StorePagedQueryResponse",
    "StoreReference",
    "StoreResourceIdentifier",
    "StoreSetLanguagesAction",
    "StoreSetNameAction",
    "StoreUpdate",
    "StoreUpdateAction",
    "StoresAddDistributionChannelsAction",
    "StoresAddSupplyChannelsAction",
    "StoresRemoveDistributionChannelsAction",
    "StoresRemoveSupplyChannelsAction",
    "StoresSetDistributionChannelsAction",
    "StoresSetSupplyChannelsAction",
]


class Store(BaseResource):
    #: :class:`str`
    id: str
    #: :class:`int`
    version: int
    #: :class:`datetime.datetime` `(Named` ``createdAt`` `in Commercetools)`
    created_at: datetime.datetime
    #: :class:`datetime.datetime` `(Named` ``lastModifiedAt`` `in Commercetools)`
    last_modified_at: datetime.datetime
    #: Optional :class:`commercetools.types.LastModifiedBy` `(Named` ``lastModifiedBy`` `in Commercetools)`
    last_modified_by: typing.Optional["LastModifiedBy"]
    #: Optional :class:`commercetools.types.CreatedBy` `(Named` ``createdBy`` `in Commercetools)`
    created_by: typing.Optional["CreatedBy"]
    #: :class:`str`
    key: str
    #: Optional :class:`commercetools.types.LocalizedString`
    name: typing.Optional["LocalizedString"]
    #: Optional list of :class:`str`
    languages: typing.Optional[typing.List[str]]
    #: List of :class:`commercetools.types.ChannelReference` `(Named` ``distributionChannels`` `in Commercetools)`
    distribution_channels: typing.List["ChannelReference"]
    #: Optional list of :class:`commercetools.types.ChannelResourceIdentifier` `(Named` ``supplyChannels`` `in Commercetools)`
    supply_channels: typing.Optional[typing.List["ChannelResourceIdentifier"]]

    def __init__(
        self,
        *,
        id: str,
        version: int,
        created_at: datetime.datetime,
        last_modified_at: datetime.datetime,
        key: str,
        distribution_channels: typing.List["ChannelReference"],
        last_modified_by: typing.Optional["LastModifiedBy"] = None,
        created_by: typing.Optional["CreatedBy"] = None,
        name: typing.Optional["LocalizedString"] = None,
        languages: typing.Optional[typing.List[str]] = None,
        supply_channels: typing.Optional[
            typing.List["ChannelResourceIdentifier"]
        ] = None
    ) -> None:
        self.id = id
        self.version = version
        self.created_at = created_at
        self.last_modified_at = last_modified_at
        self.last_modified_by = last_modified_by
        self.created_by = created_by
        self.key = key
        self.name = name
        self.languages = languages
        self.distribution_channels = distribution_channels
        self.supply_channels = supply_channels
        super().__init__(
            id=id,
            version=version,
            created_at=created_at,
            last_modified_at=last_modified_at,
        )

    def __repr__(self) -> str:
        return (
            "Store(id=%r, version=%r, created_at=%r, last_modified_at=%r, last_modified_by=%r, created_by=%r, key=%r, name=%r, languages=%r, distribution_channels=%r, supply_channels=%r)"
            % (
                self.id,
                self.version,
                self.created_at,
                self.last_modified_at,
                self.last_modified_by,
                self.created_by,
                self.key,
                self.name,
                self.languages,
                self.distribution_channels,
                self.supply_channels,
            )
        )


class StoreDraft(_BaseType):
    #: :class:`str`
    key: str
    #: :class:`commercetools.types.LocalizedString`
    name: "LocalizedString"
    #: Optional list of :class:`str`
    languages: typing.Optional[typing.List[str]]
    #: Optional list of :class:`commercetools.types.ChannelResourceIdentifier` `(Named` ``distributionChannels`` `in Commercetools)`
    distribution_channels: typing.Optional[typing.List["ChannelResourceIdentifier"]]
    #: Optional list of :class:`commercetools.types.ChannelResourceIdentifier` `(Named` ``supplyChannels`` `in Commercetools)`
    supply_channels: typing.Optional[typing.List["ChannelResourceIdentifier"]]

    def __init__(
        self,
        *,
        key: str,
        name: "LocalizedString",
        languages: typing.Optional[typing.List[str]] = None,
        distribution_channels: typing.Optional[
            typing.List["ChannelResourceIdentifier"]
        ] = None,
        supply_channels: typing.Optional[
            typing.List["ChannelResourceIdentifier"]
        ] = None
    ) -> None:
        self.key = key
        self.name = name
        self.languages = languages
        self.distribution_channels = distribution_channels
        self.supply_channels = supply_channels
        super().__init__()

    def __repr__(self) -> str:
        return (
            "StoreDraft(key=%r, name=%r, languages=%r, distribution_channels=%r, supply_channels=%r)"
            % (
                self.key,
                self.name,
                self.languages,
                self.distribution_channels,
                self.supply_channels,
            )
        )


class StoreKeyReference(KeyReference):
    def __init__(self, *, key: str) -> None:
        super().__init__(type_id=ReferenceTypeId.STORE, key=key)

    def __repr__(self) -> str:
        return "StoreKeyReference(type_id=%r, key=%r)" % (self.type_id, self.key)


class StorePagedQueryResponse(_BaseType):
    #: :class:`int`
    limit: int
    #: :class:`int`
    count: int
    #: Optional :class:`int`
    total: typing.Optional[int]
    #: :class:`int`
    offset: int
    #: List of :class:`commercetools.types.Store`
    results: typing.Sequence["Store"]

    def __init__(
        self,
        *,
        limit: int,
        count: int,
        offset: int,
        results: typing.Sequence["Store"],
        total: typing.Optional[int] = None
    ) -> None:
        self.limit = limit
        self.count = count
        self.total = total
        self.offset = offset
        self.results = results
        super().__init__()

    def __repr__(self) -> str:
        return (
            "StorePagedQueryResponse(limit=%r, count=%r, total=%r, offset=%r, results=%r)"
            % (self.limit, self.count, self.total, self.offset, self.results)
        )


class StoreReference(Reference):
    #: Optional :class:`commercetools.types.Store`
    obj: typing.Optional["Store"]

    def __init__(self, *, id: str, obj: typing.Optional["Store"] = None) -> None:
        self.obj = obj
        super().__init__(type_id=ReferenceTypeId.STORE, id=id)

    def __repr__(self) -> str:
        return "StoreReference(type_id=%r, id=%r, obj=%r)" % (
            self.type_id,
            self.id,
            self.obj,
        )


class StoreResourceIdentifier(ResourceIdentifier):
    def __init__(
        self, *, id: typing.Optional[str] = None, key: typing.Optional[str] = None
    ) -> None:
        super().__init__(type_id=ReferenceTypeId.STORE, id=id, key=key)

    def __repr__(self) -> str:
        return "StoreResourceIdentifier(type_id=%r, id=%r, key=%r)" % (
            self.type_id,
            self.id,
            self.key,
        )


class StoreUpdate(_BaseType):
    #: :class:`int`
    version: int
    #: :class:`list`
    actions: list

    def __init__(self, *, version: int, actions: list) -> None:
        self.version = version
        self.actions = actions
        super().__init__()

    def __repr__(self) -> str:
        return "StoreUpdate(version=%r, actions=%r)" % (self.version, self.actions)


class StoreUpdateAction(_BaseType):
    #: :class:`str`
    action: str

    def __init__(self, *, action: str) -> None:
        self.action = action
        super().__init__()

    def __repr__(self) -> str:
        return "StoreUpdateAction(action=%r)" % (self.action,)


class StoreSetLanguagesAction(StoreUpdateAction):
    #: Optional list of :class:`str`
    languages: typing.Optional[typing.List[str]]

    def __init__(self, *, languages: typing.Optional[typing.List[str]] = None) -> None:
        self.languages = languages
        super().__init__(action="setLanguages")

    def __repr__(self) -> str:
        return "StoreSetLanguagesAction(action=%r, languages=%r)" % (
            self.action,
            self.languages,
        )


class StoreSetNameAction(StoreUpdateAction):
    #: Optional :class:`commercetools.types.LocalizedString`
    name: typing.Optional["LocalizedString"]

    def __init__(self, *, name: typing.Optional["LocalizedString"] = None) -> None:
        self.name = name
        super().__init__(action="setName")

    def __repr__(self) -> str:
        return "StoreSetNameAction(action=%r, name=%r)" % (self.action, self.name)


class StoresAddDistributionChannelsAction(StoreUpdateAction):
    #: :class:`commercetools.types.ChannelResourceIdentifier` `(Named` ``distributionChannel`` `in Commercetools)`
    distribution_channel: "ChannelResourceIdentifier"

    def __init__(self, *, distribution_channel: "ChannelResourceIdentifier") -> None:
        self.distribution_channel = distribution_channel
        super().__init__(action="addDistributionChannel")

    def __repr__(self) -> str:
        return (
            "StoresAddDistributionChannelsAction(action=%r, distribution_channel=%r)"
            % (self.action, self.distribution_channel)
        )


class StoresAddSupplyChannelsAction(StoreUpdateAction):
    #: :class:`commercetools.types.ChannelResourceIdentifier` `(Named` ``supplyChannel`` `in Commercetools)`
    supply_channel: "ChannelResourceIdentifier"

    def __init__(self, *, supply_channel: "ChannelResourceIdentifier") -> None:
        self.supply_channel = supply_channel
        super().__init__(action="addSupplyChannel")

    def __repr__(self) -> str:
        return "StoresAddSupplyChannelsAction(action=%r, supply_channel=%r)" % (
            self.action,
            self.supply_channel,
        )


class StoresRemoveDistributionChannelsAction(StoreUpdateAction):
    #: :class:`commercetools.types.ChannelResourceIdentifier` `(Named` ``distributionChannel`` `in Commercetools)`
    distribution_channel: "ChannelResourceIdentifier"

    def __init__(self, *, distribution_channel: "ChannelResourceIdentifier") -> None:
        self.distribution_channel = distribution_channel
        super().__init__(action="removeDistributionChannel")

    def __repr__(self) -> str:
        return (
            "StoresRemoveDistributionChannelsAction(action=%r, distribution_channel=%r)"
            % (self.action, self.distribution_channel)
        )


class StoresRemoveSupplyChannelsAction(StoreUpdateAction):
    #: :class:`commercetools.types.ChannelResourceIdentifier` `(Named` ``supplyChannel`` `in Commercetools)`
    supply_channel: "ChannelResourceIdentifier"

    def __init__(self, *, supply_channel: "ChannelResourceIdentifier") -> None:
        self.supply_channel = supply_channel
        super().__init__(action="removeSupplyChannel")

    def __repr__(self) -> str:
        return "StoresRemoveSupplyChannelsAction(action=%r, supply_channel=%r)" % (
            self.action,
            self.supply_channel,
        )


class StoresSetDistributionChannelsAction(StoreUpdateAction):
    #: Optional list of :class:`commercetools.types.ChannelResourceIdentifier` `(Named` ``distributionChannels`` `in Commercetools)`
    distribution_channels: typing.Optional[typing.List["ChannelResourceIdentifier"]]

    def __init__(
        self,
        *,
        distribution_channels: typing.Optional[
            typing.List["ChannelResourceIdentifier"]
        ] = None
    ) -> None:
        self.distribution_channels = distribution_channels
        super().__init__(action="setDistributionChannels")

    def __repr__(self) -> str:
        return (
            "StoresSetDistributionChannelsAction(action=%r, distribution_channels=%r)"
            % (self.action, self.distribution_channels)
        )


class StoresSetSupplyChannelsAction(StoreUpdateAction):
    #: Optional list of :class:`commercetools.types.ChannelResourceIdentifier` `(Named` ``supplyChannels`` `in Commercetools)`
    supply_channels: typing.Optional[typing.List["ChannelResourceIdentifier"]]

    def __init__(
        self,
        *,
        supply_channels: typing.Optional[
            typing.List["ChannelResourceIdentifier"]
        ] = None
    ) -> None:
        self.supply_channels = supply_channels
        super().__init__(action="setSupplyChannels")

    def __repr__(self) -> str:
        return "StoresSetSupplyChannelsAction(action=%r, supply_channels=%r)" % (
            self.action,
            self.supply_channels,
        )
