1
|
|
|
# -*- coding: utf-8 -*- |
|
|
|
|
2
|
|
|
# MIT License |
3
|
|
|
# |
4
|
|
|
# Copyright (c) 2021 Pincer |
5
|
|
|
# |
6
|
|
|
# Permission is hereby granted, free of charge, to any person obtaining |
7
|
|
|
# a copy of this software and associated documentation files |
8
|
|
|
# (the "Software"), to deal in the Software without restriction, |
9
|
|
|
# including without limitation the rights to use, copy, modify, merge, |
10
|
|
|
# publish, distribute, sublicense, and/or sell copies of the Software, |
11
|
|
|
# and to permit persons to whom the Software is furnished to do so, |
12
|
|
|
# subject to the following conditions: |
13
|
|
|
# |
14
|
|
|
# The above copyright notice and this permission notice shall be |
15
|
|
|
# included in all copies or substantial portions of the Software. |
16
|
|
|
# |
17
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
18
|
|
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
19
|
|
|
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
20
|
|
|
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
21
|
|
|
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
22
|
|
|
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
23
|
|
|
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
24
|
|
|
from dataclasses import dataclass, MISSING |
25
|
|
|
from typing import List |
26
|
|
|
|
27
|
|
|
from pincer.objects import Integration |
28
|
|
|
from pincer.objects.user import VisibilityType |
29
|
|
|
from pincer.utils import APIObject, APINullable |
30
|
|
|
|
31
|
|
|
|
32
|
|
|
@dataclass |
|
|
|
|
33
|
|
|
class Connection(APIObject): |
34
|
|
|
""" |
35
|
|
|
The connection object that the user has attached. |
36
|
|
|
|
37
|
|
|
:param id: |
38
|
|
|
id of the connection account |
39
|
|
|
|
40
|
|
|
:param name: |
41
|
|
|
the username of the connection account |
42
|
|
|
|
43
|
|
|
:param type: |
44
|
|
|
the service of the connection (twitch, youtube) |
45
|
|
|
|
46
|
|
|
:param revoked: |
47
|
|
|
whether the connection is revoked |
48
|
|
|
|
49
|
|
|
:param integrations: |
50
|
|
|
an array of partial server integrations |
51
|
|
|
|
52
|
|
|
:param verified: |
53
|
|
|
whether the connection is verified |
54
|
|
|
|
55
|
|
|
:param friend_sync: |
56
|
|
|
whether friend sync is enabled for this connection |
57
|
|
|
|
58
|
|
|
:param show_activity: |
59
|
|
|
whether activities related to this connection |
60
|
|
|
will be shown in presence updates |
61
|
|
|
""" |
62
|
|
|
id: str |
63
|
|
|
name: str |
64
|
|
|
type: str |
65
|
|
|
verified: bool |
66
|
|
|
friend_sync: bool |
67
|
|
|
show_activity: bool |
68
|
|
|
visibility: VisibilityType |
69
|
|
|
|
70
|
|
|
revoked: APINullable[bool] = MISSING |
71
|
|
|
integrations: APINullable[List[Integration]] = MISSING |
72
|
|
|
|