pincer.objects.events.integration   A
last analyzed

Complexity

Total Complexity 0

Size/Duplication

Total Lines 77
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 0
eloc 23
dl 0
loc 77
rs 10
c 0
b 0
f 0
1
# Copyright Pincer 2021-Present
0 ignored issues
show
introduced by
Missing module docstring
Loading history...
2
# Full MIT License can be found in `LICENSE` at the project root.
3
4
from __future__ import annotations
5
6
from dataclasses import dataclass
7
from typing import TYPE_CHECKING
8
9
from ...utils.api_object import APIObject, GuildProperty
10
from ...utils.types import MISSING, APINullable
11
12
if TYPE_CHECKING:
13
    from ...utils.snowflake import Snowflake
14
15
16
@dataclass(repr=False)
17
class IntegrationDeleteEvent(APIObject, GuildProperty):
18
    """Sent when an integration is deleted.
19
20
    Attributes
21
    ----------
22
    id: :class:`~pincer.utils.snowflake.Snowflake`
23
        integration id
24
    guild_id: :class:`~pincer.utils.snowflake.Snowflake`
25
        id of the guild
26
    application_id: APINullable[:class:`~pincer.utils.snowflake.Snowflake`]
27
        id of the bot/OAuth2 application for this discord integration
28
    """
29
30
    id: Snowflake
31
    guild_id: Snowflake
32
    application_id: APINullable[Snowflake] = MISSING
33
34
35
@dataclass(repr=False)
36
class IntegrationCreateEvent(APIObject, GuildProperty):
37
    """
38
    Sent when an integration is created.
39
40
    Attributes
41
    ----------
42
    id : :class:`Snowflake`
43
        integration id
44
45
    guild_id : :class:`Snowflake`
46
        id of the guild
47
48
    application_id : APINullable[:class:`Snowflake`]
49
        id of the bot/OAuth2 application for this discord integration
50
    """
51
52
    id: Snowflake
53
    guild_id: Snowflake
54
    application_id: APINullable[Snowflake] = MISSING
55
56
57
@dataclass(repr=False)
58
class IntegrationUpdateEvent(APIObject, GuildProperty):
59
    """
60
    Sent when an integration is updated.
61
62
    Attributes
63
    ----------
64
    id : :class:`Snowflake`
65
        integration id
66
67
    guild_id : :class:`Snowflake`
68
        id of the guild
69
70
    application_id : APINullable[:class:`Snowflake`]
71
        id of the bot/OAuth2 application for this discord integration
72
    """
73
74
    id: Snowflake
75
    guild_id: Snowflake
76
    application_id: APINullable[Snowflake] = MISSING
77