File tree Expand file tree Collapse file tree 4 files changed +40
-0
lines changed Expand file tree Collapse file tree 4 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 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 )
Original file line number Diff line number Diff line change 88
99from .types import RequestData , ResponseData
1010from .types .national_identity import NationalIdentity
11+ from .types .shahkar import Shahkar
12+
13+ from .models .shahkar import ShahkarRequest
1114from .models .national_identity_inquery import NationalIdentityInqueryRequest
1215from .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 )
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments