Skip to content

Commit a4d6336

Browse files
feat(api): manual updates
1 parent 8a5eeaa commit a4d6336

31 files changed

+2960
-36
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 12
1+
configured_endpoints: 21
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser%2Fcas-parser-d9763d006969b49a1473851069fdfa429eb13133b64103a62963bb70ddb22305.yml
33
openapi_spec_hash: 6aee689b7a759b12c85c088c15e29bc0
4-
config_hash: 41c337f5cda03b13880617490f82bad0
4+
config_hash: d54f39abb185904495bef7c5f8702746

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ client = CasParser(
4343
environment="environment_1",
4444
)
4545

46-
unified_response = client.cams_kfintech.parse()
47-
print(unified_response.demat_accounts)
46+
response = client.credits.check()
47+
print(response.enabled_features)
4848
```
4949

5050
While you can provide an `api_key` keyword argument,
@@ -69,8 +69,8 @@ client = AsyncCasParser(
6969

7070

7171
async def main() -> None:
72-
unified_response = await client.cams_kfintech.parse()
73-
print(unified_response.demat_accounts)
72+
response = await client.credits.check()
73+
print(response.enabled_features)
7474

7575

7676
asyncio.run(main())
@@ -103,8 +103,8 @@ async def main() -> None:
103103
api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted
104104
http_client=DefaultAioHttpClient(),
105105
) as client:
106-
unified_response = await client.cams_kfintech.parse()
107-
print(unified_response.demat_accounts)
106+
response = await client.credits.check()
107+
print(response.enabled_features)
108108

109109

110110
asyncio.run(main())
@@ -135,7 +135,7 @@ from cas_parser import CasParser
135135
client = CasParser()
136136

137137
try:
138-
client.cams_kfintech.parse()
138+
client.credits.check()
139139
except cas_parser.APIConnectionError as e:
140140
print("The server could not be reached")
141141
print(e.__cause__) # an underlying Exception, likely raised within httpx.
@@ -178,7 +178,7 @@ client = CasParser(
178178
)
179179

180180
# Or, configure per-request:
181-
client.with_options(max_retries=5).cams_kfintech.parse()
181+
client.with_options(max_retries=5).credits.check()
182182
```
183183

184184
### Timeouts
@@ -201,7 +201,7 @@ client = CasParser(
201201
)
202202

203203
# Override per-request:
204-
client.with_options(timeout=5.0).cams_kfintech.parse()
204+
client.with_options(timeout=5.0).credits.check()
205205
```
206206

207207
On timeout, an `APITimeoutError` is thrown.
@@ -242,11 +242,11 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
242242
from cas_parser import CasParser
243243

244244
client = CasParser()
245-
response = client.cams_kfintech.with_raw_response.parse()
245+
response = client.credits.with_raw_response.check()
246246
print(response.headers.get('X-My-Header'))
247247

248-
cams_kfintech = response.parse() # get the object that `cams_kfintech.parse()` would have returned
249-
print(cams_kfintech.demat_accounts)
248+
credit = response.parse() # get the object that `credits.check()` would have returned
249+
print(credit.enabled_features)
250250
```
251251

252252
These methods return an [`APIResponse`](https://github.com/CASParser/cas-parser-python/tree/main/src/cas_parser/_response.py) object.
@@ -260,7 +260,7 @@ The above interface eagerly reads the full response body when you make the reque
260260
To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
261261

262262
```python
263-
with client.cams_kfintech.with_streaming_response.parse() as response:
263+
with client.credits.with_streaming_response.check() as response:
264264
print(response.headers.get("X-My-Header"))
265265

266266
for line in response.iter_lines():

api.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,52 @@
1+
# Credits
2+
3+
Types:
4+
5+
```python
6+
from cas_parser.types import CreditCheckResponse
7+
```
8+
9+
Methods:
10+
11+
- <code title="post /v1/credits">client.credits.<a href="./src/cas_parser/resources/credits.py">check</a>() -> <a href="./src/cas_parser/types/credit_check_response.py">CreditCheckResponse</a></code>
12+
13+
# Logs
14+
15+
Types:
16+
17+
```python
18+
from cas_parser.types import LogCreateResponse, LogGetSummaryResponse
19+
```
20+
21+
Methods:
22+
23+
- <code title="post /v1/usage">client.logs.<a href="./src/cas_parser/resources/logs.py">create</a>(\*\*<a href="src/cas_parser/types/log_create_params.py">params</a>) -> <a href="./src/cas_parser/types/log_create_response.py">LogCreateResponse</a></code>
24+
- <code title="post /v1/usage/summary">client.logs.<a href="./src/cas_parser/resources/logs.py">get_summary</a>(\*\*<a href="src/cas_parser/types/log_get_summary_params.py">params</a>) -> <a href="./src/cas_parser/types/log_get_summary_response.py">LogGetSummaryResponse</a></code>
25+
26+
# AccessToken
27+
28+
Types:
29+
30+
```python
31+
from cas_parser.types import AccessTokenCreateResponse
32+
```
33+
34+
Methods:
35+
36+
- <code title="post /v1/token">client.access_token.<a href="./src/cas_parser/resources/access_token.py">create</a>(\*\*<a href="src/cas_parser/types/access_token_create_params.py">params</a>) -> <a href="./src/cas_parser/types/access_token_create_response.py">AccessTokenCreateResponse</a></code>
37+
38+
# VerifyToken
39+
40+
Types:
41+
42+
```python
43+
from cas_parser.types import VerifyTokenVerifyResponse
44+
```
45+
46+
Methods:
47+
48+
- <code title="post /v1/token/verify">client.verify_token.<a href="./src/cas_parser/resources/verify_token.py">verify</a>() -> <a href="./src/cas_parser/types/verify_token_verify_response.py">VerifyTokenVerifyResponse</a></code>
49+
150
# CamsKfintech
251

352
Types:
@@ -84,3 +133,23 @@ Methods:
84133
Methods:
85134

86135
- <code title="post /v4/smart/parse">client.smart.<a href="./src/cas_parser/resources/smart.py">parse_cas_pdf</a>(\*\*<a href="src/cas_parser/types/smart_parse_cas_pdf_params.py">params</a>) -> <a href="./src/cas_parser/types/unified_response.py">UnifiedResponse</a></code>
136+
137+
# InboundEmail
138+
139+
Types:
140+
141+
```python
142+
from cas_parser.types import (
143+
InboundEmailCreateResponse,
144+
InboundEmailRetrieveResponse,
145+
InboundEmailListResponse,
146+
InboundEmailDeleteResponse,
147+
)
148+
```
149+
150+
Methods:
151+
152+
- <code title="post /v4/inbound-email">client.inbound_email.<a href="./src/cas_parser/resources/inbound_email.py">create</a>(\*\*<a href="src/cas_parser/types/inbound_email_create_params.py">params</a>) -> <a href="./src/cas_parser/types/inbound_email_create_response.py">InboundEmailCreateResponse</a></code>
153+
- <code title="get /v4/inbound-email/{inbound_email_id}">client.inbound_email.<a href="./src/cas_parser/resources/inbound_email.py">retrieve</a>(inbound_email_id) -> <a href="./src/cas_parser/types/inbound_email_retrieve_response.py">InboundEmailRetrieveResponse</a></code>
154+
- <code title="get /v4/inbound-email">client.inbound_email.<a href="./src/cas_parser/resources/inbound_email.py">list</a>(\*\*<a href="src/cas_parser/types/inbound_email_list_params.py">params</a>) -> <a href="./src/cas_parser/types/inbound_email_list_response.py">InboundEmailListResponse</a></code>
155+
- <code title="delete /v4/inbound-email/{inbound_email_id}">client.inbound_email.<a href="./src/cas_parser/resources/inbound_email.py">delete</a>(inbound_email_id) -> <a href="./src/cas_parser/types/inbound_email_delete_response.py">InboundEmailDeleteResponse</a></code>

0 commit comments

Comments
 (0)