Skip to content

Commit fccdd68

Browse files
committed
feat:added shahkar api
1 parent a9e819e commit fccdd68

File tree

4 files changed

+40
-0
lines changed

4 files changed

+40
-0
lines changed

examples/shahkar.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from zohal_sdk import Client
2+
from os import getenv
3+
4+
token = getenv("TOKEN")
5+
client = Client(token)
6+
7+
matched = client.shahkar(
8+
"0123456789",
9+
"09000000000",
10+
)
11+
12+
print(matched.response_body.data.matched)

zohal_sdk/client.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
from .types import RequestData, ResponseData
1010
from .types.national_identity import NationalIdentity
11+
from .types.shahkar import Shahkar
12+
13+
from .models.shahkar import ShahkarRequest
1114
from .models.national_identity_inquery import NationalIdentityInqueryRequest
1215
from .exceptions import HTTPError, TimeoutError, ZohalError
1316

@@ -73,3 +76,10 @@ def national_identity_inquiry(self,
7376
data,
7477
method="POST")
7578
return ResponseData.serialize(NationalIdentity, response)
79+
80+
def shahkar(self, national_code: str, mobile: str):
81+
data = ShahkarRequest(national_code=national_code, mobile=mobile)
82+
response = self._request(f"{BASE_URL}/v0/services/inquiry/shahkar",
83+
data,
84+
method="POST")
85+
return ResponseData.serialize(Shahkar, response)

zohal_sdk/models/shahkar.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from dataclasses_json import dataclass_json
2+
from dataclasses import dataclass
3+
from ..types import RequestData
4+
5+
6+
@dataclass_json
7+
@dataclass
8+
class ShahkarRequest(RequestData):
9+
national_code: str
10+
mobile: str

zohal_sdk/types/shahkar.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from dataclasses import dataclass
2+
from dataclasses_json import dataclass_json
3+
4+
5+
@dataclass_json
6+
@dataclass
7+
class Shahkar:
8+
matched: bool

0 commit comments

Comments
 (0)