1
1
# -*- coding: utf-8 -*-
2
2
from __future__ import unicode_literals
3
3
4
- from yoti_python_sdk .doc_scan . constants import ID_DOCUMENT_AUTHENTICITY
4
+ from yoti_python_sdk .doc_scan import constants
5
5
from yoti_python_sdk .utils import YotiSerializable , remove_null_values
6
6
from .requested_check import RequestedCheck
7
7
@@ -11,8 +11,26 @@ class RequestedDocumentAuthenticityCheckConfig(YotiSerializable):
11
11
The configuration applied when creating a Document Authenticity Check
12
12
"""
13
13
14
+ def __init__ (self , manual_check = None ):
15
+ """
16
+ :param manual_check: the manual check value
17
+ :type manual_check: str
18
+ """
19
+ self .__manual_check = manual_check
20
+
21
+ @property
22
+ def manual_check (self ):
23
+ """
24
+ Returns a value for a manual check for a given
25
+ Authenticity Check
26
+
27
+ :return: the manual check value
28
+ :rtype: str
29
+ """
30
+ return self .__manual_check
31
+
14
32
def to_json (self ):
15
- return remove_null_values ({})
33
+ return remove_null_values ({"manual_check" : self . manual_check })
16
34
17
35
18
36
class RequestedDocumentAuthenticityCheck (RequestedCheck ):
@@ -29,19 +47,50 @@ def __init__(self, config):
29
47
30
48
@property
31
49
def type (self ):
32
- return ID_DOCUMENT_AUTHENTICITY
50
+ return constants . ID_DOCUMENT_AUTHENTICITY
33
51
34
52
@property
35
53
def config (self ):
36
54
return self .__config
37
55
38
56
39
- class RequestedDocumentAuthenticityCheckBuilder ( object ) :
57
+ class RequestedDocumentAuthenticityCheckBuilder :
40
58
"""
41
59
Builder to assist creation of :class:`RequestedDocumentAuthenticityCheck`
42
60
"""
43
61
44
- @staticmethod
45
- def build ():
46
- config = RequestedDocumentAuthenticityCheckConfig ()
62
+ def __init__ (self ):
63
+ self .__manual_check = None
64
+
65
+ def with_manual_check_always (self ):
66
+ """
67
+ :return: the builder
68
+ :rtype: RequestedDocumentAuthenticityCheckBuilder
69
+ """
70
+ self .__manual_check = constants .ALWAYS
71
+ return self
72
+
73
+ def with_manual_check_fallback (self ):
74
+ """
75
+ :return: the builder
76
+ :rtype: RequestedDocumentAuthenticityCheckBuilder
77
+ """
78
+ self .__manual_check = constants .FALLBACK
79
+ return self
80
+
81
+ def with_manual_check_never (self ):
82
+ """
83
+ :return: the builder
84
+ :rtype: RequestedDocumentAuthenticityCheckBuilder
85
+ """
86
+ self .__manual_check = constants .NEVER
87
+ return self
88
+
89
+ def build (self = None ):
90
+ if self is None :
91
+ manual_check = None
92
+ else :
93
+ manual_check = self .__manual_check
94
+
95
+ config = RequestedDocumentAuthenticityCheckConfig (manual_check )
47
96
return RequestedDocumentAuthenticityCheck (config )
0 commit comments