-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add more core logic, refactoring and tests
- Loading branch information
Showing
19 changed files
with
139 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from errors import VonageError | ||
|
||
|
||
class NumberInsightV2Error(VonageError): | ||
"""Indicates an error with the Number Insight v2 Package.""" |
43 changes: 43 additions & 0 deletions
43
number_insight_v2/src/number_insight_v2/number_insight_v2.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
from dataclasses import dataclass | ||
from pydantic import BaseModel | ||
from http_client.http_client import HttpClient | ||
from number_insight_v2.errors import NumberInsightV2Error | ||
from copy import deepcopy | ||
|
||
from typing import List, Union | ||
|
||
|
||
class FraudCheckRequest(BaseModel): | ||
"""""" | ||
|
||
number: str | ||
insights: Union[str, List[str]] | ||
|
||
|
||
@dataclass | ||
class FraudCheckResponse: ... | ||
|
||
|
||
# phone: Phone | ||
# sim: SimSwap | ||
|
||
|
||
class NumberInsightv2: | ||
"""Number Insight API V2.""" | ||
|
||
def __init__(self, http_client: HttpClient) -> None: | ||
self._http_client = deepcopy(http_client) | ||
self._http_client._parse_response = self.response_parser | ||
self._auth_type = 'header' | ||
|
||
def fraud_check(self, number: str, insights: Union[str, List[str]]): | ||
"""""" | ||
|
||
def fraud_check(self, request: FraudCheckRequest) -> FraudCheckResponse: | ||
"""""" | ||
response = self._http_client.post('/ni/fraud', request.model_dump()) | ||
return FraudCheckResponse(response) | ||
|
||
def response_parser(self, response): | ||
"""""" | ||
pass |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.