diff --git a/sinch/domains/verification/__init__.py b/sinch/domains/verification/__init__.py index 8a6ed6b..e32a8b2 100644 --- a/sinch/domains/verification/__init__.py +++ b/sinch/domains/verification/__init__.py @@ -1,34 +1,34 @@ from sinch.domains.verification.endpoints.start_verification import StartVerificationEndpoint from sinch.domains.verification.endpoints.report_verification_using_identity import ( - ReportVerificationUsingIdentityEndpoint + ReportVerificationByIdentityEndpoint ) from sinch.domains.verification.endpoints.report_verification_using_id import ( - ReportVerificationUsingIdEndpoint + ReportVerificationByIdEndpoint ) from sinch.domains.verification.endpoints.get_verification_by_id import ( - GetVerificationByIdEndpoint + GetVerificationStatusByIdEndpoint ) from sinch.domains.verification.endpoints.get_verification_by_identity import ( - GetVerificationByIdentityEndpoint + GetVerificationStatusByIdentityEndpoint ) from sinch.domains.verification.endpoints.get_verification_by_reference import ( - GetVerificationByReferenceEndpoint + GetVerificationStatusByReferenceEndpoint ) from sinch.domains.verification.models.responses import ( StartVerificationResponse, - ReportVerificationUsingIdentityResponse, - ReportVerificationUsingIdResponse, - GetVerificationByIdentityResponse, - GetVerificationByIdResponse, - GetVerificationByReferenceResponse + ReportVerificationByIdentityResponse, + ReportVerificationByIdResponse, + GetVerificationStatusByIdentityResponse, + GetVerificationStatusByIdResponse, + GetVerificationStatusByReferenceResponse ) from sinch.domains.verification.models.requests import ( StartVerificationRequest, - ReportVerificationUsingIdentityRequest, - ReportVerificationUsingIdRequest, - GetVerificationByIdentityRequest, - GetVerificationByIdRequest, - GetVerificationByReferenceRequest + ReportVerificationByIdentityRequest, + ReportVerificationByIdRequest, + GetVerificationStatusByIdRequest, + GetVerificationStatusByIdentityRequest, + GetVerificationStatusByReferenceRequest ) from sinch.domains.verification.enums import VerificationMethod @@ -62,10 +62,10 @@ def report_by_id( self, id: str, verification_report_request: dict - ) -> ReportVerificationUsingIdResponse: + ) -> ReportVerificationByIdResponse: return self._sinch.configuration.transport.request( - ReportVerificationUsingIdEndpoint( - request_data=ReportVerificationUsingIdRequest( + ReportVerificationByIdEndpoint( + request_data=ReportVerificationByIdRequest( id, verification_report_request ) @@ -76,10 +76,10 @@ def report_by_identity( self, endpoint, verification_report_request - ) -> ReportVerificationUsingIdentityResponse: + ) -> ReportVerificationByIdentityResponse: return self._sinch.configuration.transport.request( - ReportVerificationUsingIdentityEndpoint( - request_data=ReportVerificationUsingIdentityRequest( + ReportVerificationByIdentityEndpoint( + request_data=ReportVerificationByIdentityRequest( endpoint, verification_report_request ) @@ -91,28 +91,28 @@ class VerificationStatus: def __init__(self, sinch): self._sinch = sinch - def get_by_reference(self, reference) -> GetVerificationByReferenceResponse: + def get_by_reference(self, reference) -> GetVerificationStatusByReferenceResponse: return self._sinch.configuration.transport.request( - GetVerificationByReferenceEndpoint( - request_data=GetVerificationByReferenceRequest( + GetVerificationStatusByReferenceEndpoint( + request_data=GetVerificationStatusByReferenceRequest( reference=reference ) ) ) - def get_by_id(self, id) -> GetVerificationByIdResponse: + def get_by_id(self, id) -> GetVerificationStatusByIdResponse: return self._sinch.configuration.transport.request( - GetVerificationByIdEndpoint( - request_data=GetVerificationByIdRequest( + GetVerificationStatusByIdEndpoint( + request_data=GetVerificationStatusByIdRequest( id=id ) ) ) - def get_by_identity(self, endpoint, method) -> GetVerificationByIdentityResponse: + def get_by_identity(self, endpoint, method) -> GetVerificationStatusByIdentityResponse: return self._sinch.configuration.transport.request( - GetVerificationByIdentityEndpoint( - request_data=GetVerificationByIdentityRequest( + GetVerificationStatusByIdentityEndpoint( + request_data=GetVerificationStatusByIdentityRequest( endpoint=endpoint, method=method ) diff --git a/sinch/domains/verification/endpoints/get_verification_by_id.py b/sinch/domains/verification/endpoints/get_verification_by_id.py index 4a4bee6..4dd2a2c 100644 --- a/sinch/domains/verification/endpoints/get_verification_by_id.py +++ b/sinch/domains/verification/endpoints/get_verification_by_id.py @@ -1,16 +1,16 @@ from sinch.core.models.http_response import HTTPResponse from sinch.domains.verification.endpoints.verification_endpoint import VerificationEndpoint from sinch.core.enums import HTTPAuthentication, HTTPMethods -from sinch.domains.verification.models.requests import GetVerificationByIdRequest -from sinch.domains.verification.models.responses import GetVerificationByIdResponse +from sinch.domains.verification.models.requests import GetVerificationStatusByIdRequest +from sinch.domains.verification.models.responses import GetVerificationStatusByIdResponse -class GetVerificationByIdEndpoint(VerificationEndpoint): +class GetVerificationStatusByIdEndpoint(VerificationEndpoint): ENDPOINT_URL = "{origin}/verification/v1/verifications/id/{id}" HTTP_METHOD = HTTPMethods.GET.value HTTP_AUTHENTICATION = HTTPAuthentication.SIGNED.value - def __init__(self, request_data: GetVerificationByIdRequest): + def __init__(self, request_data: GetVerificationStatusByIdRequest): self.request_data = request_data def build_url(self, sinch): @@ -19,8 +19,8 @@ def build_url(self, sinch): id=self.request_data.id ) - def handle_response(self, response: HTTPResponse) -> GetVerificationByIdResponse: + def handle_response(self, response: HTTPResponse) -> GetVerificationStatusByIdResponse: super().handle_response(response) - return GetVerificationByIdResponse( + return GetVerificationStatusByIdResponse( **response.body ) diff --git a/sinch/domains/verification/endpoints/get_verification_by_identity.py b/sinch/domains/verification/endpoints/get_verification_by_identity.py index 0f3c7d7..3612efb 100644 --- a/sinch/domains/verification/endpoints/get_verification_by_identity.py +++ b/sinch/domains/verification/endpoints/get_verification_by_identity.py @@ -1,16 +1,16 @@ from sinch.core.models.http_response import HTTPResponse from sinch.domains.verification.endpoints.verification_endpoint import VerificationEndpoint from sinch.core.enums import HTTPAuthentication, HTTPMethods -from sinch.domains.verification.models.requests import GetVerificationByIdentityRequest -from sinch.domains.verification.models.responses import GetVerificationByIdentityResponse +from sinch.domains.verification.models.requests import GetVerificationStatusByIdentityRequest +from sinch.domains.verification.models.responses import GetVerificationStatusByIdentityResponse -class GetVerificationByIdentityEndpoint(VerificationEndpoint): +class GetVerificationStatusByIdentityEndpoint(VerificationEndpoint): ENDPOINT_URL = "{origin}/verification/v1/verifications/{method}/number/{endpoint}" HTTP_METHOD = HTTPMethods.GET.value HTTP_AUTHENTICATION = HTTPAuthentication.SIGNED.value - def __init__(self, request_data: GetVerificationByIdentityRequest): + def __init__(self, request_data: GetVerificationStatusByIdentityRequest): self.request_data = request_data def build_url(self, sinch): @@ -20,8 +20,8 @@ def build_url(self, sinch): endpoint=self.request_data.endpoint ) - def handle_response(self, response: HTTPResponse) -> GetVerificationByIdentityResponse: + def handle_response(self, response: HTTPResponse) -> GetVerificationStatusByIdentityResponse: super().handle_response(response) - return GetVerificationByIdentityResponse( + return GetVerificationStatusByIdentityResponse( **response.body ) diff --git a/sinch/domains/verification/endpoints/get_verification_by_reference.py b/sinch/domains/verification/endpoints/get_verification_by_reference.py index d5796ca..944b417 100644 --- a/sinch/domains/verification/endpoints/get_verification_by_reference.py +++ b/sinch/domains/verification/endpoints/get_verification_by_reference.py @@ -1,16 +1,16 @@ from sinch.core.models.http_response import HTTPResponse from sinch.domains.verification.endpoints.verification_endpoint import VerificationEndpoint from sinch.core.enums import HTTPAuthentication, HTTPMethods -from sinch.domains.verification.models.requests import GetVerificationByReferenceRequest -from sinch.domains.verification.models.responses import GetVerificationByReferenceResponse +from sinch.domains.verification.models.requests import GetVerificationStatusByReferenceRequest +from sinch.domains.verification.models.responses import GetVerificationStatusByReferenceResponse -class GetVerificationByReferenceEndpoint(VerificationEndpoint): +class GetVerificationStatusByReferenceEndpoint(VerificationEndpoint): ENDPOINT_URL = "{origin}/verification/v1/verifications/reference/{reference}" HTTP_METHOD = HTTPMethods.GET.value HTTP_AUTHENTICATION = HTTPAuthentication.SIGNED.value - def __init__(self, request_data: GetVerificationByReferenceRequest): + def __init__(self, request_data: GetVerificationStatusByReferenceRequest): self.request_data = request_data def build_url(self, sinch): @@ -19,8 +19,8 @@ def build_url(self, sinch): reference=self.request_data.reference ) - def handle_response(self, response: HTTPResponse) -> GetVerificationByReferenceResponse: + def handle_response(self, response: HTTPResponse) -> GetVerificationStatusByReferenceResponse: super().handle_response(response) - return GetVerificationByReferenceResponse( + return GetVerificationStatusByReferenceResponse( **response.body ) diff --git a/sinch/domains/verification/endpoints/report_verification_using_id.py b/sinch/domains/verification/endpoints/report_verification_using_id.py index d1c2e55..88043b6 100644 --- a/sinch/domains/verification/endpoints/report_verification_using_id.py +++ b/sinch/domains/verification/endpoints/report_verification_using_id.py @@ -2,16 +2,16 @@ from sinch.core.models.http_response import HTTPResponse from sinch.domains.verification.endpoints.verification_endpoint import VerificationEndpoint from sinch.core.enums import HTTPAuthentication, HTTPMethods -from sinch.domains.verification.models.requests import ReportVerificationUsingIdRequest -from sinch.domains.verification.models.responses import ReportVerificationUsingIdResponse +from sinch.domains.verification.models.requests import ReportVerificationByIdRequest +from sinch.domains.verification.models.responses import ReportVerificationByIdResponse -class ReportVerificationUsingIdEndpoint(VerificationEndpoint): +class ReportVerificationByIdEndpoint(VerificationEndpoint): ENDPOINT_URL = "{origin}/verification/v1/verifications/id/{id}" HTTP_METHOD = HTTPMethods.PUT.value HTTP_AUTHENTICATION = HTTPAuthentication.SIGNED.value - def __init__(self, request_data: ReportVerificationUsingIdRequest): + def __init__(self, request_data: ReportVerificationByIdRequest): self.request_data = request_data def build_url(self, sinch): @@ -23,8 +23,8 @@ def build_url(self, sinch): def request_body(self): return json.dumps(self.request_data.verification_report_request) - def handle_response(self, response: HTTPResponse) -> ReportVerificationUsingIdResponse: + def handle_response(self, response: HTTPResponse) -> ReportVerificationByIdResponse: super().handle_response(response) - return ReportVerificationUsingIdResponse( + return ReportVerificationByIdResponse( **response.body ) diff --git a/sinch/domains/verification/endpoints/report_verification_using_identity.py b/sinch/domains/verification/endpoints/report_verification_using_identity.py index f2d3638..6ddd069 100644 --- a/sinch/domains/verification/endpoints/report_verification_using_identity.py +++ b/sinch/domains/verification/endpoints/report_verification_using_identity.py @@ -2,16 +2,16 @@ from sinch.core.models.http_response import HTTPResponse from sinch.domains.verification.endpoints.verification_endpoint import VerificationEndpoint from sinch.core.enums import HTTPAuthentication, HTTPMethods -from sinch.domains.verification.models.requests import ReportVerificationUsingIdentityRequest -from sinch.domains.verification.models.responses import ReportVerificationUsingIdentityResponse +from sinch.domains.verification.models.requests import ReportVerificationByIdentityRequest +from sinch.domains.verification.models.responses import ReportVerificationByIdentityResponse -class ReportVerificationUsingIdentityEndpoint(VerificationEndpoint): +class ReportVerificationByIdentityEndpoint(VerificationEndpoint): ENDPOINT_URL = "{origin}/verification/v1/verifications/number/{endpoint}" HTTP_METHOD = HTTPMethods.PUT.value HTTP_AUTHENTICATION = HTTPAuthentication.SIGNED.value - def __init__(self, request_data: ReportVerificationUsingIdentityRequest): + def __init__(self, request_data: ReportVerificationByIdentityRequest): self.request_data = request_data def build_url(self, sinch): @@ -23,8 +23,8 @@ def build_url(self, sinch): def request_body(self): return json.dumps(self.request_data.verification_report_request) - def handle_response(self, response: HTTPResponse) -> ReportVerificationUsingIdentityResponse: + def handle_response(self, response: HTTPResponse) -> ReportVerificationByIdentityResponse: super().handle_response(response) - return ReportVerificationUsingIdentityResponse( + return ReportVerificationByIdentityResponse( **response.body ) diff --git a/sinch/domains/verification/models/requests.py b/sinch/domains/verification/models/requests.py index f13120a..91e15ad 100644 --- a/sinch/domains/verification/models/requests.py +++ b/sinch/domains/verification/models/requests.py @@ -13,28 +13,28 @@ class StartVerificationRequest(SinchRequestBaseModel): @dataclass -class ReportVerificationUsingIdentityRequest(SinchRequestBaseModel): +class ReportVerificationByIdentityRequest(SinchRequestBaseModel): endpoint: str verification_report_request: dict @dataclass -class ReportVerificationUsingIdRequest(SinchRequestBaseModel): +class ReportVerificationByIdRequest(SinchRequestBaseModel): id: str verification_report_request: dict @dataclass -class GetVerificationByReferenceRequest(SinchRequestBaseModel): +class GetVerificationStatusByReferenceRequest(SinchRequestBaseModel): reference: str @dataclass -class GetVerificationByIdRequest(SinchRequestBaseModel): +class GetVerificationStatusByIdRequest(SinchRequestBaseModel): id: str @dataclass -class GetVerificationByIdentityRequest(SinchRequestBaseModel): +class GetVerificationStatusByIdentityRequest(SinchRequestBaseModel): endpoint: str method: str diff --git a/sinch/domains/verification/models/responses.py b/sinch/domains/verification/models/responses.py index 83baf48..982daf3 100644 --- a/sinch/domains/verification/models/responses.py +++ b/sinch/domains/verification/models/responses.py @@ -31,25 +31,25 @@ class ReportVerificationResponse(SinchBaseModel): @dataclass -class ReportVerificationUsingIdentityResponse(ReportVerificationResponse): +class ReportVerificationByIdentityResponse(ReportVerificationResponse): pass @dataclass -class ReportVerificationUsingIdResponse(ReportVerificationResponse): +class ReportVerificationByIdResponse(ReportVerificationResponse): pass @dataclass -class GetVerificationByReferenceResponse(VerificationResponse): +class GetVerificationStatusByReferenceResponse(VerificationResponse): pass @dataclass -class GetVerificationByIdResponse(VerificationResponse): +class GetVerificationStatusByIdResponse(VerificationResponse): pass @dataclass -class GetVerificationByIdentityResponse(VerificationResponse): +class GetVerificationStatusByIdentityResponse(VerificationResponse): pass diff --git a/tests/e2e/verification/test_get_report_using_id.py b/tests/e2e/verification/test_get_report_using_id.py index 9058aef..6896290 100644 --- a/tests/e2e/verification/test_get_report_using_id.py +++ b/tests/e2e/verification/test_get_report_using_id.py @@ -1,4 +1,4 @@ -from sinch.domains.verification.models.responses import GetVerificationByIdResponse +from sinch.domains.verification.models.responses import GetVerificationStatusByIdResponse def test_get_report_verification_using_id( @@ -9,7 +9,7 @@ def test_get_report_verification_using_id( verification_response = sinch_client_sync.verification.verification_status.get_by_id( id=verification_id ) - assert isinstance(verification_response, GetVerificationByIdResponse) + assert isinstance(verification_response, GetVerificationStatusByIdResponse) async def test_get_report_verification_using_id_async( @@ -20,4 +20,4 @@ async def test_get_report_verification_using_id_async( verification_response = await sinch_client_async.verification.verification_status.get_by_id( id=verification_id ) - assert isinstance(verification_response, GetVerificationByIdResponse) + assert isinstance(verification_response, GetVerificationStatusByIdResponse) diff --git a/tests/e2e/verification/test_get_report_using_identity.py b/tests/e2e/verification/test_get_report_using_identity.py index 3e197bf..569369f 100644 --- a/tests/e2e/verification/test_get_report_using_identity.py +++ b/tests/e2e/verification/test_get_report_using_identity.py @@ -1,4 +1,4 @@ -from sinch.domains.verification.models.responses import GetVerificationByIdentityResponse +from sinch.domains.verification.models.responses import GetVerificationStatusByIdentityResponse def test_get_report_verification_using_identity( @@ -9,7 +9,7 @@ def test_get_report_verification_using_identity( endpoint=phone_number, method="sms" ) - assert isinstance(verification_response, GetVerificationByIdentityResponse) + assert isinstance(verification_response, GetVerificationStatusByIdentityResponse) async def test_get_report_verification_using_identity_async( @@ -20,4 +20,4 @@ async def test_get_report_verification_using_identity_async( endpoint=phone_number, method="sms" ) - assert isinstance(verification_response, GetVerificationByIdentityResponse) + assert isinstance(verification_response, GetVerificationStatusByIdentityResponse) diff --git a/tests/e2e/verification/test_get_report_using_reference.py b/tests/e2e/verification/test_get_report_using_reference.py index f368b35..b2443f1 100644 --- a/tests/e2e/verification/test_get_report_using_reference.py +++ b/tests/e2e/verification/test_get_report_using_reference.py @@ -1,4 +1,4 @@ -from sinch.domains.verification.models.responses import GetVerificationByReferenceResponse +from sinch.domains.verification.models.responses import GetVerificationStatusByReferenceResponse def test_get_report_verification_using_reference( @@ -7,7 +7,7 @@ def test_get_report_verification_using_reference( verification_response = sinch_client_sync.verification.verification_status.get_by_reference( reference="random" ) - assert isinstance(verification_response, GetVerificationByReferenceResponse) + assert isinstance(verification_response, GetVerificationStatusByReferenceResponse) async def test_get_report_verification_using_reference_async( @@ -16,4 +16,4 @@ async def test_get_report_verification_using_reference_async( verification_response = await sinch_client_async.verification.verification_status.get_by_reference( reference="random" ) - assert isinstance(verification_response, GetVerificationByReferenceResponse) + assert isinstance(verification_response, GetVerificationStatusByReferenceResponse) diff --git a/tests/e2e/verification/test_report_verification_using_id.py b/tests/e2e/verification/test_report_verification_using_id.py index f197e2e..67381db 100644 --- a/tests/e2e/verification/test_report_verification_using_id.py +++ b/tests/e2e/verification/test_report_verification_using_id.py @@ -1,4 +1,4 @@ -from sinch.domains.verification.models.responses import ReportVerificationUsingIdResponse +from sinch.domains.verification.models.responses import ReportVerificationByIdResponse def test_report_verification_using_id_and_sms( @@ -15,7 +15,7 @@ def test_report_verification_using_id_and_sms( } } ) - assert isinstance(verification_response, ReportVerificationUsingIdResponse) + assert isinstance(verification_response, ReportVerificationByIdResponse) async def test_report_verification_using_id_and_sms_async( @@ -32,4 +32,4 @@ async def test_report_verification_using_id_and_sms_async( } } ) - assert isinstance(verification_response, ReportVerificationUsingIdResponse) + assert isinstance(verification_response, ReportVerificationByIdResponse) diff --git a/tests/e2e/verification/test_report_verification_using_identity.py b/tests/e2e/verification/test_report_verification_using_identity.py index 6071d2f..816c6a6 100644 --- a/tests/e2e/verification/test_report_verification_using_identity.py +++ b/tests/e2e/verification/test_report_verification_using_identity.py @@ -1,4 +1,4 @@ -from sinch.domains.verification.models.responses import ReportVerificationUsingIdentityResponse +from sinch.domains.verification.models.responses import ReportVerificationByIdentityResponse def test_report_verification_using_identity_and_sms( @@ -14,7 +14,7 @@ def test_report_verification_using_identity_and_sms( } } ) - assert isinstance(verification_response, ReportVerificationUsingIdentityResponse) + assert isinstance(verification_response, ReportVerificationByIdentityResponse) async def test_report_verification_using_identity_and_sms_async( @@ -30,4 +30,4 @@ async def test_report_verification_using_identity_and_sms_async( } } ) - assert isinstance(verification_response, ReportVerificationUsingIdentityResponse) + assert isinstance(verification_response, ReportVerificationByIdentityResponse)