diff --git a/.release-please-manifest.json b/.release-please-manifest.json index de0960a..f94eeca 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.12.0" + ".": "1.13.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 20f0c84..93de6b1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 21 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser/cas-parser-902b4d5af31c8c6bab33a08d9cea10f3444be221abf735466eb9fd58a14e0a87.yml -openapi_spec_hash: e333f46097f3a3a452cb4d6564a3db67 +configured_endpoints: 20 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser/cas-parser-26d0931f3488af784c16303683cbf24225c727615fd32ee071144974e7c59670.yml +openapi_spec_hash: 242a5f4d982645a25e0d66ef088940a5 config_hash: 5509bb7a961ae2e79114b24c381606d4 diff --git a/CHANGELOG.md b/CHANGELOG.md index e4f29d8..2b5539f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 1.13.0 (2026-07-26) + +Full Changelog: [v1.12.0...v1.13.0](https://github.com/CASParser/cas-parser-python/compare/v1.12.0...v1.13.0) + +### Features + +* **api:** api update ([44ff1a8](https://github.com/CASParser/cas-parser-python/commit/44ff1a82b8d15013bd67c3a189bc5dbe0f4b44c8)) + ## 1.12.0 (2026-07-18) Full Changelog: [v1.11.0...v1.12.0](https://github.com/CASParser/cas-parser-python/compare/v1.11.0...v1.12.0) diff --git a/api.md b/api.md index 164b61d..cc7f243 100644 --- a/api.md +++ b/api.md @@ -110,18 +110,6 @@ Methods: - client.inbox.disconnect_email() -> InboxDisconnectEmailResponse - client.inbox.list_cas_files(\*\*params) -> InboxListCasFilesResponse -# Kfintech - -Types: - -```python -from cas_parser.types import KfintechGenerateCasResponse -``` - -Methods: - -- client.kfintech.generate_cas(\*\*params) -> KfintechGenerateCasResponse - # Nsdl Methods: diff --git a/pyproject.toml b/pyproject.toml index a32d15e..28599ce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "cas-parser-python" -version = "1.12.0" +version = "1.13.0" description = "The official Python library for the cas-parser API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/cas_parser/_client.py b/src/cas_parser/_client.py index b04d428..03568c5 100644 --- a/src/cas_parser/_client.py +++ b/src/cas_parser/_client.py @@ -43,7 +43,6 @@ inbox, smart, credits, - kfintech, access_token, verify_token, cams_kfintech, @@ -55,7 +54,6 @@ from .resources.inbox import InboxResource, AsyncInboxResource from .resources.smart import SmartResource, AsyncSmartResource from .resources.credits import CreditsResource, AsyncCreditsResource - from .resources.kfintech import KfintechResource, AsyncKfintechResource from .resources.cdsl.cdsl import CdslResource, AsyncCdslResource from .resources.access_token import AccessTokenResource, AsyncAccessTokenResource from .resources.verify_token import VerifyTokenResource, AsyncVerifyTokenResource @@ -226,13 +224,6 @@ def inbox(self) -> InboxResource: return InboxResource(self) - @cached_property - def kfintech(self) -> KfintechResource: - """Endpoints for generating new CAS documents via email mailback (KFintech).""" - from .resources.kfintech import KfintechResource - - return KfintechResource(self) - @cached_property def nsdl(self) -> NsdlResource: """Endpoints for parsing CAS PDF files from different sources.""" @@ -546,13 +537,6 @@ def inbox(self) -> AsyncInboxResource: return AsyncInboxResource(self) - @cached_property - def kfintech(self) -> AsyncKfintechResource: - """Endpoints for generating new CAS documents via email mailback (KFintech).""" - from .resources.kfintech import AsyncKfintechResource - - return AsyncKfintechResource(self) - @cached_property def nsdl(self) -> AsyncNsdlResource: """Endpoints for parsing CAS PDF files from different sources.""" @@ -808,13 +792,6 @@ def inbox(self) -> inbox.InboxResourceWithRawResponse: return InboxResourceWithRawResponse(self._client.inbox) - @cached_property - def kfintech(self) -> kfintech.KfintechResourceWithRawResponse: - """Endpoints for generating new CAS documents via email mailback (KFintech).""" - from .resources.kfintech import KfintechResourceWithRawResponse - - return KfintechResourceWithRawResponse(self._client.kfintech) - @cached_property def nsdl(self) -> nsdl.NsdlResourceWithRawResponse: """Endpoints for parsing CAS PDF files from different sources.""" @@ -951,13 +928,6 @@ def inbox(self) -> inbox.AsyncInboxResourceWithRawResponse: return AsyncInboxResourceWithRawResponse(self._client.inbox) - @cached_property - def kfintech(self) -> kfintech.AsyncKfintechResourceWithRawResponse: - """Endpoints for generating new CAS documents via email mailback (KFintech).""" - from .resources.kfintech import AsyncKfintechResourceWithRawResponse - - return AsyncKfintechResourceWithRawResponse(self._client.kfintech) - @cached_property def nsdl(self) -> nsdl.AsyncNsdlResourceWithRawResponse: """Endpoints for parsing CAS PDF files from different sources.""" @@ -1094,13 +1064,6 @@ def inbox(self) -> inbox.InboxResourceWithStreamingResponse: return InboxResourceWithStreamingResponse(self._client.inbox) - @cached_property - def kfintech(self) -> kfintech.KfintechResourceWithStreamingResponse: - """Endpoints for generating new CAS documents via email mailback (KFintech).""" - from .resources.kfintech import KfintechResourceWithStreamingResponse - - return KfintechResourceWithStreamingResponse(self._client.kfintech) - @cached_property def nsdl(self) -> nsdl.NsdlResourceWithStreamingResponse: """Endpoints for parsing CAS PDF files from different sources.""" @@ -1237,13 +1200,6 @@ def inbox(self) -> inbox.AsyncInboxResourceWithStreamingResponse: return AsyncInboxResourceWithStreamingResponse(self._client.inbox) - @cached_property - def kfintech(self) -> kfintech.AsyncKfintechResourceWithStreamingResponse: - """Endpoints for generating new CAS documents via email mailback (KFintech).""" - from .resources.kfintech import AsyncKfintechResourceWithStreamingResponse - - return AsyncKfintechResourceWithStreamingResponse(self._client.kfintech) - @cached_property def nsdl(self) -> nsdl.AsyncNsdlResourceWithStreamingResponse: """Endpoints for parsing CAS PDF files from different sources.""" diff --git a/src/cas_parser/_version.py b/src/cas_parser/_version.py index 31399d1..633f414 100644 --- a/src/cas_parser/_version.py +++ b/src/cas_parser/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "cas_parser" -__version__ = "1.12.0" # x-release-please-version +__version__ = "1.13.0" # x-release-please-version diff --git a/src/cas_parser/resources/__init__.py b/src/cas_parser/resources/__init__.py index 34f05f7..6b86f9e 100644 --- a/src/cas_parser/resources/__init__.py +++ b/src/cas_parser/resources/__init__.py @@ -48,14 +48,6 @@ CreditsResourceWithStreamingResponse, AsyncCreditsResourceWithStreamingResponse, ) -from .kfintech import ( - KfintechResource, - AsyncKfintechResource, - KfintechResourceWithRawResponse, - AsyncKfintechResourceWithRawResponse, - KfintechResourceWithStreamingResponse, - AsyncKfintechResourceWithStreamingResponse, -) from .access_token import ( AccessTokenResource, AsyncAccessTokenResource, @@ -146,12 +138,6 @@ "AsyncInboxResourceWithRawResponse", "InboxResourceWithStreamingResponse", "AsyncInboxResourceWithStreamingResponse", - "KfintechResource", - "AsyncKfintechResource", - "KfintechResourceWithRawResponse", - "AsyncKfintechResourceWithRawResponse", - "KfintechResourceWithStreamingResponse", - "AsyncKfintechResourceWithStreamingResponse", "NsdlResource", "AsyncNsdlResource", "NsdlResourceWithRawResponse", diff --git a/src/cas_parser/resources/kfintech.py b/src/cas_parser/resources/kfintech.py deleted file mode 100644 index 358f415..0000000 --- a/src/cas_parser/resources/kfintech.py +++ /dev/null @@ -1,223 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..types import kfintech_generate_cas_params -from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from .._utils import maybe_transform, async_maybe_transform -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from .._base_client import make_request_options -from ..types.kfintech_generate_cas_response import KfintechGenerateCasResponse - -__all__ = ["KfintechResource", "AsyncKfintechResource"] - - -class KfintechResource(SyncAPIResource): - """Endpoints for generating new CAS documents via email mailback (KFintech).""" - - @cached_property - def with_raw_response(self) -> KfintechResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/CASParser/cas-parser-python#accessing-raw-response-data-eg-headers - """ - return KfintechResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> KfintechResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/CASParser/cas-parser-python#with_streaming_response - """ - return KfintechResourceWithStreamingResponse(self) - - def generate_cas( - self, - *, - email: str, - from_date: str, - password: str, - to_date: str, - pan_no: str | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> KfintechGenerateCasResponse: - """Generate CAS via KFintech mailback. - - The CAS PDF will be sent to the investor's - email. - - This is an async operation - the investor receives the CAS via email within a - few minutes. For instant CAS retrieval, use CDSL Fetch (`/v4/cdsl/fetch`). - - Args: - email: Email address to receive the CAS document - - from_date: Start date (YYYY-MM-DD) - - password: Password for the PDF - - to_date: End date (YYYY-MM-DD) - - pan_no: PAN number (optional) - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return self._post( - "/v4/kfintech/generate", - body=maybe_transform( - { - "email": email, - "from_date": from_date, - "password": password, - "to_date": to_date, - "pan_no": pan_no, - }, - kfintech_generate_cas_params.KfintechGenerateCasParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=KfintechGenerateCasResponse, - ) - - -class AsyncKfintechResource(AsyncAPIResource): - """Endpoints for generating new CAS documents via email mailback (KFintech).""" - - @cached_property - def with_raw_response(self) -> AsyncKfintechResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/CASParser/cas-parser-python#accessing-raw-response-data-eg-headers - """ - return AsyncKfintechResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncKfintechResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/CASParser/cas-parser-python#with_streaming_response - """ - return AsyncKfintechResourceWithStreamingResponse(self) - - async def generate_cas( - self, - *, - email: str, - from_date: str, - password: str, - to_date: str, - pan_no: str | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> KfintechGenerateCasResponse: - """Generate CAS via KFintech mailback. - - The CAS PDF will be sent to the investor's - email. - - This is an async operation - the investor receives the CAS via email within a - few minutes. For instant CAS retrieval, use CDSL Fetch (`/v4/cdsl/fetch`). - - Args: - email: Email address to receive the CAS document - - from_date: Start date (YYYY-MM-DD) - - password: Password for the PDF - - to_date: End date (YYYY-MM-DD) - - pan_no: PAN number (optional) - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return await self._post( - "/v4/kfintech/generate", - body=await async_maybe_transform( - { - "email": email, - "from_date": from_date, - "password": password, - "to_date": to_date, - "pan_no": pan_no, - }, - kfintech_generate_cas_params.KfintechGenerateCasParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=KfintechGenerateCasResponse, - ) - - -class KfintechResourceWithRawResponse: - def __init__(self, kfintech: KfintechResource) -> None: - self._kfintech = kfintech - - self.generate_cas = to_raw_response_wrapper( - kfintech.generate_cas, - ) - - -class AsyncKfintechResourceWithRawResponse: - def __init__(self, kfintech: AsyncKfintechResource) -> None: - self._kfintech = kfintech - - self.generate_cas = async_to_raw_response_wrapper( - kfintech.generate_cas, - ) - - -class KfintechResourceWithStreamingResponse: - def __init__(self, kfintech: KfintechResource) -> None: - self._kfintech = kfintech - - self.generate_cas = to_streamed_response_wrapper( - kfintech.generate_cas, - ) - - -class AsyncKfintechResourceWithStreamingResponse: - def __init__(self, kfintech: AsyncKfintechResource) -> None: - self._kfintech = kfintech - - self.generate_cas = async_to_streamed_response_wrapper( - kfintech.generate_cas, - ) diff --git a/src/cas_parser/types/__init__.py b/src/cas_parser/types/__init__.py index 269b048..3643e2e 100644 --- a/src/cas_parser/types/__init__.py +++ b/src/cas_parser/types/__init__.py @@ -24,12 +24,10 @@ from .access_token_create_response import AccessTokenCreateResponse as AccessTokenCreateResponse from .contract_note_parse_response import ContractNoteParseResponse as ContractNoteParseResponse from .inbox_connect_email_response import InboxConnectEmailResponse as InboxConnectEmailResponse -from .kfintech_generate_cas_params import KfintechGenerateCasParams as KfintechGenerateCasParams from .verify_token_verify_response import VerifyTokenVerifyResponse as VerifyTokenVerifyResponse from .inbound_email_create_response import InboundEmailCreateResponse as InboundEmailCreateResponse from .inbound_email_delete_response import InboundEmailDeleteResponse as InboundEmailDeleteResponse from .inbox_list_cas_files_response import InboxListCasFilesResponse as InboxListCasFilesResponse -from .kfintech_generate_cas_response import KfintechGenerateCasResponse as KfintechGenerateCasResponse from .inbound_email_retrieve_response import InboundEmailRetrieveResponse as InboundEmailRetrieveResponse from .inbox_disconnect_email_response import InboxDisconnectEmailResponse as InboxDisconnectEmailResponse from .inbox_check_connection_status_response import ( diff --git a/src/cas_parser/types/kfintech_generate_cas_params.py b/src/cas_parser/types/kfintech_generate_cas_params.py deleted file mode 100644 index 7c16d71..0000000 --- a/src/cas_parser/types/kfintech_generate_cas_params.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["KfintechGenerateCasParams"] - - -class KfintechGenerateCasParams(TypedDict, total=False): - email: Required[str] - """Email address to receive the CAS document""" - - from_date: Required[str] - """Start date (YYYY-MM-DD)""" - - password: Required[str] - """Password for the PDF""" - - to_date: Required[str] - """End date (YYYY-MM-DD)""" - - pan_no: str - """PAN number (optional)""" diff --git a/src/cas_parser/types/kfintech_generate_cas_response.py b/src/cas_parser/types/kfintech_generate_cas_response.py deleted file mode 100644 index 9d281ef..0000000 --- a/src/cas_parser/types/kfintech_generate_cas_response.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from .._models import BaseModel - -__all__ = ["KfintechGenerateCasResponse"] - - -class KfintechGenerateCasResponse(BaseModel): - msg: Optional[str] = None - - status: Optional[str] = None diff --git a/tests/api_resources/test_kfintech.py b/tests/api_resources/test_kfintech.py deleted file mode 100644 index 1ad3779..0000000 --- a/tests/api_resources/test_kfintech.py +++ /dev/null @@ -1,134 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from cas_parser import CasParser, AsyncCasParser -from tests.utils import assert_matches_type -from cas_parser.types import KfintechGenerateCasResponse - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestKfintech: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip(reason="Mock server tests are disabled") - @parametrize - def test_method_generate_cas(self, client: CasParser) -> None: - kfintech = client.kfintech.generate_cas( - email="user@example.com", - from_date="2023-01-01", - password="Abcdefghi12$", - to_date="2023-12-31", - ) - assert_matches_type(KfintechGenerateCasResponse, kfintech, path=["response"]) - - @pytest.mark.skip(reason="Mock server tests are disabled") - @parametrize - def test_method_generate_cas_with_all_params(self, client: CasParser) -> None: - kfintech = client.kfintech.generate_cas( - email="user@example.com", - from_date="2023-01-01", - password="Abcdefghi12$", - to_date="2023-12-31", - pan_no="ABCDE1234F", - ) - assert_matches_type(KfintechGenerateCasResponse, kfintech, path=["response"]) - - @pytest.mark.skip(reason="Mock server tests are disabled") - @parametrize - def test_raw_response_generate_cas(self, client: CasParser) -> None: - response = client.kfintech.with_raw_response.generate_cas( - email="user@example.com", - from_date="2023-01-01", - password="Abcdefghi12$", - to_date="2023-12-31", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - kfintech = response.parse() - assert_matches_type(KfintechGenerateCasResponse, kfintech, path=["response"]) - - @pytest.mark.skip(reason="Mock server tests are disabled") - @parametrize - def test_streaming_response_generate_cas(self, client: CasParser) -> None: - with client.kfintech.with_streaming_response.generate_cas( - email="user@example.com", - from_date="2023-01-01", - password="Abcdefghi12$", - to_date="2023-12-31", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - kfintech = response.parse() - assert_matches_type(KfintechGenerateCasResponse, kfintech, path=["response"]) - - assert cast(Any, response.is_closed) is True - - -class TestAsyncKfintech: - parametrize = pytest.mark.parametrize( - "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] - ) - - @pytest.mark.skip(reason="Mock server tests are disabled") - @parametrize - async def test_method_generate_cas(self, async_client: AsyncCasParser) -> None: - kfintech = await async_client.kfintech.generate_cas( - email="user@example.com", - from_date="2023-01-01", - password="Abcdefghi12$", - to_date="2023-12-31", - ) - assert_matches_type(KfintechGenerateCasResponse, kfintech, path=["response"]) - - @pytest.mark.skip(reason="Mock server tests are disabled") - @parametrize - async def test_method_generate_cas_with_all_params(self, async_client: AsyncCasParser) -> None: - kfintech = await async_client.kfintech.generate_cas( - email="user@example.com", - from_date="2023-01-01", - password="Abcdefghi12$", - to_date="2023-12-31", - pan_no="ABCDE1234F", - ) - assert_matches_type(KfintechGenerateCasResponse, kfintech, path=["response"]) - - @pytest.mark.skip(reason="Mock server tests are disabled") - @parametrize - async def test_raw_response_generate_cas(self, async_client: AsyncCasParser) -> None: - response = await async_client.kfintech.with_raw_response.generate_cas( - email="user@example.com", - from_date="2023-01-01", - password="Abcdefghi12$", - to_date="2023-12-31", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - kfintech = await response.parse() - assert_matches_type(KfintechGenerateCasResponse, kfintech, path=["response"]) - - @pytest.mark.skip(reason="Mock server tests are disabled") - @parametrize - async def test_streaming_response_generate_cas(self, async_client: AsyncCasParser) -> None: - async with async_client.kfintech.with_streaming_response.generate_cas( - email="user@example.com", - from_date="2023-01-01", - password="Abcdefghi12$", - to_date="2023-12-31", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - kfintech = await response.parse() - assert_matches_type(KfintechGenerateCasResponse, kfintech, path=["response"]) - - assert cast(Any, response.is_closed) is True