1
|
|
|
# Copyright Pincer 2021-Present |
|
|
|
|
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, MISSING |
7
|
|
|
from typing import TYPE_CHECKING |
8
|
|
|
|
9
|
|
|
from ...utils.api_object import APIObject |
10
|
|
|
|
11
|
|
|
if TYPE_CHECKING: |
12
|
|
|
from typing import List |
13
|
|
|
|
14
|
|
|
from .user import VisibilityType |
15
|
|
|
from .integration import Integration |
16
|
|
|
from ...utils.types import APINullable |
17
|
|
|
|
18
|
|
|
|
19
|
|
|
@dataclass(repr=False) |
20
|
|
|
class Connection(APIObject): |
|
|
|
|
21
|
|
|
"""The connection object that the user has attached. |
22
|
|
|
|
23
|
|
|
Attributes |
24
|
|
|
---------- |
25
|
|
|
id: :class:`str` |
26
|
|
|
Id of the connection account |
27
|
|
|
name: :class:`str` |
28
|
|
|
The username of the connection account |
29
|
|
|
type: :class:`str` |
30
|
|
|
The service of the connection (twitch, YouTube) |
31
|
|
|
verified: :class:`bool` |
32
|
|
|
Whether the connection is verified |
33
|
|
|
friend_sync: :class:`bool` |
34
|
|
|
Whether friend sync is enabled for this connection |
35
|
|
|
show_activity: :class:`bool` |
36
|
|
|
Whether activities related to this connection |
37
|
|
|
will be shown in presence updates |
38
|
|
|
visibility: :class:`~pincer.objects.user.user.VisibilityType` |
39
|
|
|
If the connection is visible |
40
|
|
|
revoked: APINullable[:class:`bool`] |
41
|
|
|
Whether the connection is revoked |
42
|
|
|
integrations: APINullable[List[:class:`~pincer.objects.user.integration.Integration`]] |
43
|
|
|
An array of partial server integrations |
44
|
|
|
""" |
45
|
|
|
|
46
|
|
|
# noqa: E501 |
47
|
|
|
|
48
|
|
|
id: str |
49
|
|
|
name: str |
50
|
|
|
type: str |
51
|
|
|
verified: bool |
52
|
|
|
friend_sync: bool |
53
|
|
|
show_activity: bool |
54
|
|
|
visibility: VisibilityType |
55
|
|
|
|
56
|
|
|
revoked: APINullable[bool] = MISSING |
57
|
|
|
integrations: APINullable[List[Integration]] = MISSING |
58
|
|
|
|