-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathbreakdown_response.py
More file actions
88 lines (70 loc) · 1.84 KB
/
breakdown_response.py
File metadata and controls
88 lines (70 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
class BreakdownResponse(object):
"""
Represents one breakdown item for a given check
"""
def __init__(self, data):
"""
:param data: the data to parse
:type data: dict
"""
self.__sub_check = data.get("sub_check", None)
self.__result = data.get("result", None)
self.__process = data.get("process", None)
self.__details = [DetailsResponse(detail) for detail in data.get("details", [])]
@property
def sub_check(self):
"""
The sub check value for the breakdown
:return: the sub check value
:rtype: str or None
"""
return self.__sub_check
@property
def result(self):
"""
The result of the sub check
:return: the result
:rtype: str or None
"""
return self.__result
@property
def process(self):
"""
The process of the sub check
:return: the process
:rtype: str or None
"""
return self.__process
@property
def details(self):
"""
The details of the sub check
:return: the details
:rtype: list[DetailsResponse]
"""
return self.__details
class DetailsResponse(object):
"""
Represents a specific detail for a breakdown
"""
def __init__(self, data):
self.__name = data.get("name", None)
self.__value = data.get("value", None)
@property
def name(self):
"""
The name of the details item
:return: the name
:rtype: str or None
"""
return self.__name
@property
def value(self):
"""
The value of the details item
:return: the value
:rtype: str or None
"""
return self.__value