Passed
Push — main ( a6ab1a...8a4d95 )
by
unknown
05:38
created

pincer.objects.connection   A

Complexity

Total Complexity 0

Size/Duplication

Total Lines 72
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 0
eloc 17
dl 0
loc 72
rs 10
c 0
b 0
f 0
1
# -*- coding: utf-8 -*-
0 ignored issues
show
introduced by
Missing module docstring
Loading history...
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
0 ignored issues
show
best-practice introduced by
Too many instance attributes (9/7)
Loading history...
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