5
5
from sinch .domains .verification .endpoints .report_verification_using_id import (
6
6
ReportVerificationByIdEndpoint
7
7
)
8
- from sinch .domains .verification .endpoints .get_verification_by_id import (
9
- GetVerificationStatusByIdEndpoint
10
- )
11
8
from sinch .domains .verification .endpoints .get_verification_by_identity import (
12
9
GetVerificationStatusByIdentityEndpoint
13
10
)
14
11
from sinch .domains .verification .endpoints .get_verification_by_reference import (
15
12
GetVerificationStatusByReferenceEndpoint
16
13
)
14
+ from sinch .domains .verification .endpoints .get_verification_by_id import (
15
+ GetVerificationStatusByIdEndpoint
16
+ )
17
17
from sinch .domains .verification .models .responses import (
18
18
StartVerificationResponse ,
19
19
ReportVerificationByIdentityResponse ,
20
20
ReportVerificationByIdResponse ,
21
21
GetVerificationStatusByIdentityResponse ,
22
- GetVerificationStatusByIdResponse ,
23
- GetVerificationStatusByReferenceResponse
22
+ GetVerificationStatusByReferenceResponse ,
23
+ GetVerificationStatusByIdResponse
24
24
)
25
25
from sinch .domains .verification .models .requests import (
26
26
StartSMSVerificationRequest ,
27
27
StartFlashCallVerificationRequest ,
28
+ StartPhoneCallVerificationRequest ,
28
29
StartCalloutVerificationRequest ,
29
- StartSeamlessVerificationRequest ,
30
- ReportVerificationByIdentityRequest ,
31
- ReportVerificationByIdRequest ,
32
- GetVerificationStatusByIdRequest ,
30
+ StartDataVerificationRequest ,
31
+ ReportVerificationByIdentityRequestLegacy ,
32
+ ReportVerificationByIdRequestLegacy ,
33
+ ReportVerificationByIdentityAndSMSRequest ,
34
+ ReportVerificationByIdentityAndFlashCallRequest ,
35
+ ReportVerificationByIdentityAndPhoneCallRequest ,
36
+ ReportVerificationByIdAndSMSRequest ,
37
+ ReportVerificationByIdAndFlashCallRequest ,
38
+ ReportVerificationByIdAndPhoneCallRequest ,
33
39
GetVerificationStatusByIdentityRequest ,
34
- GetVerificationStatusByReferenceRequest
40
+ GetVerificationStatusByReferenceRequest ,
41
+ GetVerificationStatusByIdRequest
35
42
)
36
43
from sinch .domains .verification .models import VerificationIdentity
37
44
@@ -66,16 +73,32 @@ def start_flash_call(
66
73
self ,
67
74
identity : VerificationIdentity ,
68
75
reference : str = None ,
69
- custom : str = None ,
70
- dial_timeout : int = None
76
+ dial_timeout : int = None ,
77
+ custom : str = None
71
78
) -> StartVerificationResponse :
72
79
return self ._sinch .configuration .transport .request (
73
80
StartVerificationEndpoint (
74
81
request_data = StartFlashCallVerificationRequest (
75
82
identity = identity ,
76
83
reference = reference ,
77
- custom = custom ,
78
- dial_timeout = dial_timeout
84
+ dial_timeout = dial_timeout ,
85
+ custom = custom
86
+ )
87
+ )
88
+ )
89
+
90
+ def start_phone_call (
91
+ self ,
92
+ identity : VerificationIdentity ,
93
+ reference : str = None ,
94
+ custom : str = None
95
+ ) -> StartVerificationResponse :
96
+ return self ._sinch .configuration .transport .request (
97
+ StartVerificationEndpoint (
98
+ request_data = StartPhoneCallVerificationRequest (
99
+ identity = identity ,
100
+ reference = reference ,
101
+ custom = custom
79
102
)
80
103
)
81
104
)
@@ -87,6 +110,11 @@ def start_callout(
87
110
custom : str = None ,
88
111
speech_locale : str = None
89
112
) -> StartVerificationResponse :
113
+ """
114
+ This method is not supported anymore.
115
+ It should be used only for backward compatibility reasons.
116
+ Use start_phone_call method instead.
117
+ """
90
118
return self ._sinch .configuration .transport .request (
91
119
StartVerificationEndpoint (
92
120
request_data = StartCalloutVerificationRequest (
@@ -103,25 +131,138 @@ def start_seamless(
103
131
identity : VerificationIdentity ,
104
132
reference : str = None ,
105
133
custom : str = None
134
+ ) -> StartVerificationResponse :
135
+ """
136
+ This method is not supported anymore.
137
+ It should be used only for backward compatibility reasons.
138
+ Use start_data method instead.
139
+ """
140
+ return self ._sinch .configuration .transport .request (
141
+ StartVerificationEndpoint (
142
+ request_data = StartDataVerificationRequest (
143
+ identity = identity ,
144
+ reference = reference ,
145
+ custom = custom
146
+ )
147
+ )
148
+ )
149
+
150
+ def start_data (
151
+ self ,
152
+ identity : VerificationIdentity ,
153
+ reference : str = None ,
154
+ custom : str = None
106
155
) -> StartVerificationResponse :
107
156
return self ._sinch .configuration .transport .request (
108
157
StartVerificationEndpoint (
109
- request_data = StartSeamlessVerificationRequest (
158
+ request_data = StartDataVerificationRequest (
110
159
identity = identity ,
111
160
reference = reference ,
112
161
custom = custom
113
162
)
114
163
)
115
164
)
116
165
166
+ def report_sms_by_id (
167
+ self ,
168
+ id : str ,
169
+ code : str ,
170
+ cli : str = None
171
+ ) -> ReportVerificationByIdResponse :
172
+ return self ._sinch .configuration .transport .request (
173
+ ReportVerificationByIdEndpoint (
174
+ request_data = ReportVerificationByIdAndSMSRequest (
175
+ id ,
176
+ code ,
177
+ cli
178
+ )
179
+ )
180
+ )
181
+
182
+ def report_flash_call_by_id (
183
+ self ,
184
+ id : str ,
185
+ cli : str
186
+ ) -> ReportVerificationByIdResponse :
187
+ return self ._sinch .configuration .transport .request (
188
+ ReportVerificationByIdEndpoint (
189
+ request_data = ReportVerificationByIdAndFlashCallRequest (
190
+ id ,
191
+ cli
192
+ )
193
+ )
194
+ )
195
+
196
+ def report_phone_call_by_id (
197
+ self ,
198
+ id : str ,
199
+ code : str = None
200
+ ) -> ReportVerificationByIdResponse :
201
+ return self ._sinch .configuration .transport .request (
202
+ ReportVerificationByIdEndpoint (
203
+ request_data = ReportVerificationByIdAndPhoneCallRequest (
204
+ id ,
205
+ code
206
+ )
207
+ )
208
+ )
209
+
210
+ def report_sms_by_identity (
211
+ self ,
212
+ endpoint : str ,
213
+ code : str ,
214
+ cli : str = None
215
+ ) -> ReportVerificationByIdentityResponse :
216
+ return self ._sinch .configuration .transport .request (
217
+ ReportVerificationByIdentityEndpoint (
218
+ request_data = ReportVerificationByIdentityAndSMSRequest (
219
+ endpoint ,
220
+ code ,
221
+ cli
222
+ )
223
+ )
224
+ )
225
+
226
+ def report_flash_call_by_identity (
227
+ self ,
228
+ endpoint : str ,
229
+ cli : str = None
230
+ ) -> ReportVerificationByIdentityResponse :
231
+ return self ._sinch .configuration .transport .request (
232
+ ReportVerificationByIdentityEndpoint (
233
+ request_data = ReportVerificationByIdentityAndFlashCallRequest (
234
+ endpoint ,
235
+ cli
236
+ )
237
+ )
238
+ )
239
+
240
+ def report_phone_call_by_identity (
241
+ self ,
242
+ endpoint : str ,
243
+ code : str
244
+ ) -> ReportVerificationByIdentityResponse :
245
+ return self ._sinch .configuration .transport .request (
246
+ ReportVerificationByIdentityEndpoint (
247
+ request_data = ReportVerificationByIdentityAndPhoneCallRequest (
248
+ endpoint ,
249
+ code
250
+ )
251
+ )
252
+ )
253
+
117
254
def report_by_id (
118
255
self ,
119
256
id : str ,
120
257
verification_report_request : dict
121
258
) -> ReportVerificationByIdResponse :
259
+ """
260
+ This method is not supported anymore.
261
+ It should be used only for backward compatibility reasons.
262
+ """
122
263
return self ._sinch .configuration .transport .request (
123
264
ReportVerificationByIdEndpoint (
124
- request_data = ReportVerificationByIdRequest (
265
+ request_data = ReportVerificationByIdRequestLegacy (
125
266
id ,
126
267
verification_report_request
127
268
)
@@ -133,9 +274,13 @@ def report_by_identity(
133
274
endpoint ,
134
275
verification_report_request
135
276
) -> ReportVerificationByIdentityResponse :
277
+ """
278
+ This method is not supported anymore.
279
+ It should be used only for backward compatibility reasons.
280
+ """
136
281
return self ._sinch .configuration .transport .request (
137
282
ReportVerificationByIdentityEndpoint (
138
- request_data = ReportVerificationByIdentityRequest (
283
+ request_data = ReportVerificationByIdentityRequestLegacy (
139
284
endpoint ,
140
285
verification_report_request
141
286
)
@@ -147,25 +292,29 @@ class VerificationStatus:
147
292
def __init__ (self , sinch ):
148
293
self ._sinch = sinch
149
294
150
- def get_by_reference (self , reference ) -> GetVerificationStatusByReferenceResponse :
295
+ def get_by_id (self , id : str ) -> GetVerificationStatusByIdResponse :
151
296
return self ._sinch .configuration .transport .request (
152
- GetVerificationStatusByReferenceEndpoint (
153
- request_data = GetVerificationStatusByReferenceRequest (
154
- reference = reference
297
+ GetVerificationStatusByIdEndpoint (
298
+ request_data = GetVerificationStatusByIdRequest (
299
+ id = id
155
300
)
156
301
)
157
302
)
158
303
159
- def get_by_id (self , id ) -> GetVerificationStatusByIdResponse :
304
+ def get_by_reference (self , reference : str ) -> GetVerificationStatusByReferenceResponse :
160
305
return self ._sinch .configuration .transport .request (
161
- GetVerificationStatusByIdEndpoint (
162
- request_data = GetVerificationStatusByIdRequest (
163
- id = id
306
+ GetVerificationStatusByReferenceEndpoint (
307
+ request_data = GetVerificationStatusByReferenceRequest (
308
+ reference = reference
164
309
)
165
310
)
166
311
)
167
312
168
- def get_by_identity (self , endpoint , method ) -> GetVerificationStatusByIdentityResponse :
313
+ def get_by_identity (
314
+ self ,
315
+ endpoint : str ,
316
+ method : str
317
+ ) -> GetVerificationStatusByIdentityResponse :
169
318
return self ._sinch .configuration .transport .request (
170
319
GetVerificationStatusByIdentityEndpoint (
171
320
request_data = GetVerificationStatusByIdentityRequest (
0 commit comments