ebook_homebrew.models.rest_models   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Test Coverage

Coverage 95%

Importance

Changes 0
Metric Value
wmc 5
eloc 21
dl 0
loc 44
ccs 19
cts 20
cp 0.95
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A StatusModel.__init__() 0 3 1
A UploadModel.__init__() 0 3 1
A FileNotFoundModel.__init__() 0 3 1
A ErrorModel.__init__() 0 3 1
A ListUploadFiles.__init__() 0 2 1
1
"""Provides Rest API models
2
"""
3
4 1
import datetime
5
6
7 1
class StatusModel:
8
    """Status Model"""
9
10 1
    def __init__(self, status, version):
11 1
        self.status = status
12 1
        self.version = version
13
14
15 1
class ListUploadFiles:
16
    """ListUploadFiles Model"""
17
18 1
    def __init__(self, file_list):
19
        self.fileList = file_list
20
21
22 1
class UploadModel:
23
    """Upload_id Model"""
24
25 1
    def __init__(self, upload_id):
26 1
        self.upload_id = str(upload_id)
27 1
        self.release_date = datetime.datetime.now()
28
29
30 1
class ErrorModel:
31
    """Error Model"""
32
33 1
    def __init__(self, error):
34 1
        self.error = str(error)
35 1
        self.errorDate = datetime.datetime.now()
36
37
38 1
class FileNotFoundModel:
39
    """FileNotFound Model"""
40
41 1
    def __init__(self, reason):
42 1
        self.reason = reason
43
        self.errorDate = datetime.datetime.now()
44