Skip to content

Commit

Permalink
feat(Verification): report verification methods added
Browse files Browse the repository at this point in the history
  • Loading branch information
650elx committed Aug 14, 2024
1 parent 8a3895f commit c8f6372
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 23 deletions.
10 changes: 6 additions & 4 deletions sinch/domains/verification/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
StartFlashCallVerificationRequest,
StartPhoneCallVerificationRequest,
StartDataVerificationRequest,
ReportVerificationByIdentityRequest,
ReportVerificationByIdentityAndSMSRequest,
ReportVerificationByIdentityAndFlashCallRequest,
ReportVerificationByIdentityAndPhoneCallRequest,
ReportVerificationByIdAndSMSRequest,
ReportVerificationByIdAndFlashCallRequest,
ReportVerificationByIdAndPhoneCallRequest,
Expand Down Expand Up @@ -160,7 +162,7 @@ def report_sms_by_identity(
) -> ReportVerificationByIdentityResponse:
return self._sinch.configuration.transport.request(
ReportVerificationByIdentityEndpoint(
request_data=ReportVerificationByIdentityRequest(
request_data=ReportVerificationByIdentityAndSMSRequest(
endpoint,
code,
cli
Expand All @@ -176,7 +178,7 @@ def report_flash_call_by_identity(
) -> ReportVerificationByIdentityResponse:
return self._sinch.configuration.transport.request(
ReportVerificationByIdentityEndpoint(
request_data=ReportVerificationByIdentityRequest(
request_data=ReportVerificationByIdentityAndFlashCallRequest(
endpoint,
cli
)
Expand All @@ -191,7 +193,7 @@ def report_phone_call_by_identity (
) -> ReportVerificationByIdentityResponse:
return self._sinch.configuration.transport.request(
ReportVerificationByIdentityEndpoint(
request_data=ReportVerificationByIdentityRequest(
request_data=ReportVerificationByIdentityAndPhoneCallRequest(
endpoint,
code
)
Expand Down
17 changes: 16 additions & 1 deletion sinch/domains/verification/models/requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,22 @@ class StartDataVerificationRequest(StartVerificationRequest):
@dataclass
class ReportVerificationByIdentityRequest(SinchRequestBaseModel):
endpoint: str
verification_report_request: dict


@dataclass
class ReportVerificationByIdentityAndSMSRequest(ReportVerificationByIdentityRequest):
code: str
cli: str


@dataclass
class ReportVerificationByIdentityAndFlashCallRequest(ReportVerificationByIdentityRequest):
cli: str


@dataclass
class ReportVerificationByIdentityAndPhoneCallRequest(ReportVerificationByIdentityRequest):
code: str


@dataclass
Expand Down
21 changes: 3 additions & 18 deletions tests/e2e/verification/test_report_verification_using_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@ def test_report_verification_using_id_and_sms(
):
verification_response = sinch_client_sync.verification.verifications.report_sms_by_id(
id=verification_id,
verification_report_request={
"method": "sms",
"sms": {
"code": "2302"
}
}
code="2302"
)
assert isinstance(verification_response, ReportVerificationByIdResponse)

Expand All @@ -25,12 +20,7 @@ def test_report_verification_using_id_and_flash_call(
):
verification_response = sinch_client_sync.verification.verifications.report_flash_call_by_id(
id=verification_id,
verification_report_request={
"method": "sms",
"sms": {
"code": "2302"
}
}
cli="2332"
)
assert isinstance(verification_response, ReportVerificationByIdResponse)

Expand All @@ -42,12 +32,7 @@ def test_report_verification_using_id_and_and_phone_call(
):
verification_response = sinch_client_sync.verification.verifications.report_phone_call_by_id(
id=verification_id,
verification_report_request={
"method": "sms",
"sms": {
"code": "2302"
}
}
code="2302"
)
assert isinstance(verification_response, ReportVerificationByIdResponse)

Expand Down

0 comments on commit c8f6372

Please sign in to comment.