Passed
Pull Request — master (#69)
by
unknown
01:36
created

nextcloud.codes   A

Complexity

Total Complexity 0

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 0
eloc 42
dl 0
loc 62
rs 10
c 0
b 0
f 0
1
# -*- coding: utf-8 -*-
2
"""
3
Define all known return code from OwnCloud/NextCloud API
4
"""
5
import enum
6
7
8
class ShareType(enum.IntEnum):
9
    USER = 0
10
    GROUP = 1
11
    PUBLIC_LINK = 3
12
    FEDERATED_CLOUD_SHARE = 6
13
14
15
class Permission(enum.IntEnum):
16
    """ Permission for Share have to be sum of selected permissions """
17
    READ = 1
18
    UPDATE = 2
19
    CREATE = 4
20
    DELETE = 8
21
    SHARE = 16
22
    ALL = 31
23
24
25
class ExternalApiCodes(enum.IntEnum):
26
    SUCCESS = 100
27
    SERVER_ERROR = 996
28
    NOT_AUTHORIZED = 997
29
    NOT_FOUND = 998
30
    UNKNOWN_ERROR = 999
31
32
33
class ProvisioningCode(enum.IntEnum):
34
    SUCCESS = 100
35
    INVALID_INPUT_DATA = 101
36
    FAILED = 102
37
    CREATION_FAILED = 103
38
    INSUFFICENT_PRIVILIEGES = 104
39
    CHANGE_FAILED = 105
40
41
42
class OCSCode(enum.IntEnum):
43
    SUCCESS_V1 = 100
44
    SUCCESS_V2 = 200
45
    FAILURE = 400
46
    NOT_FOUND = 404
47
    SYNC_CONFLICT = 409
48
49
50
class WebDAVCode(enum.IntEnum):
51
    """ DAV constants """
52
    CREATED = 201
53
    NO_CONTENT = 204
54
    MULTISTATUS = 207
55
    NOT_AUTHENTICATED = 401
56
    ALREADY_EXISTS = 405
57
    CONFLICT = 409
58
    PRECONDITION_FAILED = 412
59
60
61
QUOTA_UNLIMITED = -3
62