"""The MIT License (MIT)Copyright (c) 2021-present Pycord DevelopmentPermission is hereby granted, free of charge, to any person obtaining acopy of this software and associated documentation files (the "Software"),to deal in the Software without restriction, including without limitationthe rights to use, copy, modify, merge, publish, distribute, sublicense,and/or sell copies of the Software, and to permit persons to whom theSoftware is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISINGFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHERDEALINGS IN THE SOFTWARE."""fromtypingimportAnyfromtyping_extensionsimportSelf,overridefromdiscord.types.monetizationimportEntitlementasEntitlementPayloadfrom..app.event_emitterimportEventfrom..app.stateimportConnectionStatefrom..monetizationimportEntitlement
[docs]classEntitlementCreate(Event,Entitlement):"""Called when a user subscribes to an SKU. This event inherits from :class:`Entitlement`. """__event_name__:str="ENTITLEMENT_CREATE"def__init__(self)->None:pass@classmethod@overrideasyncdef__load__(cls,data:Any,state:ConnectionState)->Self:self=cls()self.__dict__.update(Entitlement(data=data,state=state).__dict__)returnself
[docs]classEntitlementUpdate(Event,Entitlement):"""Called when a user's subscription to an Entitlement is cancelled. .. note:: Before October 1, 2024, this event was called when a user's subscription was renewed. Entitlements that no longer follow this behavior will have a type of :attr:`EntitlementType.purchase`. Those that follow the old behavior will have a type of :attr:`EntitlementType.application_subscription`. This event inherits from :class:`Entitlement`. """__event_name__:str="ENTITLEMENT_UPDATE"def__init__(self)->None:pass@classmethod@overrideasyncdef__load__(cls,data:Any,state:ConnectionState)->Self:self=cls()self.__dict__.update(Entitlement(data=data,state=state).__dict__)returnself
[docs]classEntitlementDelete(Event,Entitlement):"""Called when a user's entitlement is deleted. Entitlements are usually only deleted when Discord issues a refund for a subscription, or manually removes an entitlement from a user. .. note:: This is not called when a user's subscription is cancelled. This event inherits from :class:`Entitlement`. """__event_name__:str="ENTITLEMENT_DELETE"def__init__(self)->None:pass@classmethod@overrideasyncdef__load__(cls,data:Any,state:ConnectionState)->Self:self=cls()self.__dict__.update(Entitlement(data=data,state=state).__dict__)returnself