From f8b551ccaee3d4eaf03f3b4ecf2cd4a86aa85433 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 24 Jul 2026 12:17:57 +0000 Subject: [PATCH 1/3] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 20f0c84..68d6bf8 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 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser/cas-parser-577a6deca47142224dbf0b3888cc02d21a87205cc9f3aac94a3837e758ef586e.yml +openapi_spec_hash: b6b37700433fb0205b5550bc86d3d4ae config_hash: 5509bb7a961ae2e79114b24c381606d4 From 74ea13048096a010f9127891ab0281fc56ca1401 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 26 Jul 2026 05:17:39 +0000 Subject: [PATCH 2/3] feat(api): api update --- .stats.yml | 6 +- src/Kfintech/KfintechGenerateCasParams.php | 168 ------------------- src/Kfintech/KfintechGenerateCasResponse.php | 62 ------- src/ServiceContracts/KfintechContract.php | 31 +--- src/ServiceContracts/KfintechRawContract.php | 27 +-- src/Services/KfintechRawService.php | 50 ------ src/Services/KfintechService.php | 51 +----- tests/Services/KfintechTest.php | 67 -------- 8 files changed, 6 insertions(+), 456 deletions(-) delete mode 100644 src/Kfintech/KfintechGenerateCasParams.php delete mode 100644 src/Kfintech/KfintechGenerateCasResponse.php delete mode 100644 tests/Services/KfintechTest.php diff --git a/.stats.yml b/.stats.yml index 68d6bf8..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-577a6deca47142224dbf0b3888cc02d21a87205cc9f3aac94a3837e758ef586e.yml -openapi_spec_hash: b6b37700433fb0205b5550bc86d3d4ae +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/src/Kfintech/KfintechGenerateCasParams.php b/src/Kfintech/KfintechGenerateCasParams.php deleted file mode 100644 index 658e42e..0000000 --- a/src/Kfintech/KfintechGenerateCasParams.php +++ /dev/null @@ -1,168 +0,0 @@ - */ - use SdkModel; - use SdkParams; - - /** - * Email address to receive the CAS document. - */ - #[Required] - public string $email; - - /** - * Start date (YYYY-MM-DD). - */ - #[Required('from_date')] - public string $fromDate; - - /** - * Password for the PDF. - */ - #[Required] - public string $password; - - /** - * End date (YYYY-MM-DD). - */ - #[Required('to_date')] - public string $toDate; - - /** - * PAN number (optional). - */ - #[Optional('pan_no')] - public ?string $panNo; - - /** - * `new KfintechGenerateCasParams()` is missing required properties by the API. - * - * To enforce required parameters use - * ``` - * KfintechGenerateCasParams::with( - * email: ..., fromDate: ..., password: ..., toDate: ... - * ) - * ``` - * - * Otherwise ensure the following setters are called - * - * ``` - * (new KfintechGenerateCasParams) - * ->withEmail(...) - * ->withFromDate(...) - * ->withPassword(...) - * ->withToDate(...) - * ``` - */ - public function __construct() - { - $this->initialize(); - } - - /** - * Construct an instance from the required parameters. - * - * You must use named parameters to construct any parameters with a default value. - */ - public static function with( - string $email, - string $fromDate, - string $password, - string $toDate, - ?string $panNo = null, - ): self { - $self = new self; - - $self['email'] = $email; - $self['fromDate'] = $fromDate; - $self['password'] = $password; - $self['toDate'] = $toDate; - - null !== $panNo && $self['panNo'] = $panNo; - - return $self; - } - - /** - * Email address to receive the CAS document. - */ - public function withEmail(string $email): self - { - $self = clone $this; - $self['email'] = $email; - - return $self; - } - - /** - * Start date (YYYY-MM-DD). - */ - public function withFromDate(string $fromDate): self - { - $self = clone $this; - $self['fromDate'] = $fromDate; - - return $self; - } - - /** - * Password for the PDF. - */ - public function withPassword(string $password): self - { - $self = clone $this; - $self['password'] = $password; - - return $self; - } - - /** - * End date (YYYY-MM-DD). - */ - public function withToDate(string $toDate): self - { - $self = clone $this; - $self['toDate'] = $toDate; - - return $self; - } - - /** - * PAN number (optional). - */ - public function withPanNo(string $panNo): self - { - $self = clone $this; - $self['panNo'] = $panNo; - - return $self; - } -} diff --git a/src/Kfintech/KfintechGenerateCasResponse.php b/src/Kfintech/KfintechGenerateCasResponse.php deleted file mode 100644 index 2933b4b..0000000 --- a/src/Kfintech/KfintechGenerateCasResponse.php +++ /dev/null @@ -1,62 +0,0 @@ - */ - use SdkModel; - - #[Optional] - public ?string $msg; - - #[Optional] - public ?string $status; - - public function __construct() - { - $this->initialize(); - } - - /** - * Construct an instance from the required parameters. - * - * You must use named parameters to construct any parameters with a default value. - */ - public static function with(?string $msg = null, ?string $status = null): self - { - $self = new self; - - null !== $msg && $self['msg'] = $msg; - null !== $status && $self['status'] = $status; - - return $self; - } - - public function withMsg(string $msg): self - { - $self = clone $this; - $self['msg'] = $msg; - - return $self; - } - - public function withStatus(string $status): self - { - $self = clone $this; - $self['status'] = $status; - - return $self; - } -} diff --git a/src/ServiceContracts/KfintechContract.php b/src/ServiceContracts/KfintechContract.php index cb380d7..44728d7 100644 --- a/src/ServiceContracts/KfintechContract.php +++ b/src/ServiceContracts/KfintechContract.php @@ -4,33 +4,4 @@ namespace CasParser\ServiceContracts; -use CasParser\Core\Exceptions\APIException; -use CasParser\Kfintech\KfintechGenerateCasResponse; -use CasParser\RequestOptions; - -/** - * @phpstan-import-type RequestOpts from \CasParser\RequestOptions - */ -interface KfintechContract -{ - /** - * @api - * - * @param string $email Email address to receive the CAS document - * @param string $fromDate Start date (YYYY-MM-DD) - * @param string $password Password for the PDF - * @param string $toDate End date (YYYY-MM-DD) - * @param string $panNo PAN number (optional) - * @param RequestOpts|null $requestOptions - * - * @throws APIException - */ - public function generateCas( - string $email, - string $fromDate, - string $password, - string $toDate, - ?string $panNo = null, - RequestOptions|array|null $requestOptions = null, - ): KfintechGenerateCasResponse; -} +interface KfintechContract {} diff --git a/src/ServiceContracts/KfintechRawContract.php b/src/ServiceContracts/KfintechRawContract.php index ceb2a6a..53f02f8 100644 --- a/src/ServiceContracts/KfintechRawContract.php +++ b/src/ServiceContracts/KfintechRawContract.php @@ -4,29 +4,4 @@ namespace CasParser\ServiceContracts; -use CasParser\Core\Contracts\BaseResponse; -use CasParser\Core\Exceptions\APIException; -use CasParser\Kfintech\KfintechGenerateCasParams; -use CasParser\Kfintech\KfintechGenerateCasResponse; -use CasParser\RequestOptions; - -/** - * @phpstan-import-type RequestOpts from \CasParser\RequestOptions - */ -interface KfintechRawContract -{ - /** - * @api - * - * @param array|KfintechGenerateCasParams $params - * @param RequestOpts|null $requestOptions - * - * @return BaseResponse - * - * @throws APIException - */ - public function generateCas( - array|KfintechGenerateCasParams $params, - RequestOptions|array|null $requestOptions = null, - ): BaseResponse; -} +interface KfintechRawContract {} diff --git a/src/Services/KfintechRawService.php b/src/Services/KfintechRawService.php index 3503bd3..59fd247 100644 --- a/src/Services/KfintechRawService.php +++ b/src/Services/KfintechRawService.php @@ -5,18 +5,8 @@ namespace CasParser\Services; use CasParser\Client; -use CasParser\Core\Contracts\BaseResponse; -use CasParser\Core\Exceptions\APIException; -use CasParser\Kfintech\KfintechGenerateCasParams; -use CasParser\Kfintech\KfintechGenerateCasResponse; -use CasParser\RequestOptions; use CasParser\ServiceContracts\KfintechRawContract; -/** - * Endpoints for generating new CAS documents via email mailback (KFintech). - * - * @phpstan-import-type RequestOpts from \CasParser\RequestOptions - */ final class KfintechRawService implements KfintechRawContract { // @phpstan-ignore-next-line @@ -24,44 +14,4 @@ final class KfintechRawService implements KfintechRawContract * @internal */ public function __construct(private Client $client) {} - - /** - * @api - * - * 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`). - * - * @param array{ - * email: string, - * fromDate: string, - * password: string, - * toDate: string, - * panNo?: string, - * }|KfintechGenerateCasParams $params - * @param RequestOpts|null $requestOptions - * - * @return BaseResponse - * - * @throws APIException - */ - public function generateCas( - array|KfintechGenerateCasParams $params, - RequestOptions|array|null $requestOptions = null, - ): BaseResponse { - [$parsed, $options] = KfintechGenerateCasParams::parseRequest( - $params, - $requestOptions, - ); - - // @phpstan-ignore-next-line return.type - return $this->client->request( - method: 'post', - path: 'v4/kfintech/generate', - body: (object) $parsed, - options: $options, - convert: KfintechGenerateCasResponse::class, - ); - } } diff --git a/src/Services/KfintechService.php b/src/Services/KfintechService.php index 9966677..3178dd7 100644 --- a/src/Services/KfintechService.php +++ b/src/Services/KfintechService.php @@ -5,17 +5,8 @@ namespace CasParser\Services; use CasParser\Client; -use CasParser\Core\Exceptions\APIException; -use CasParser\Core\Util; -use CasParser\Kfintech\KfintechGenerateCasResponse; -use CasParser\RequestOptions; use CasParser\ServiceContracts\KfintechContract; -/** - * Endpoints for generating new CAS documents via email mailback (KFintech). - * - * @phpstan-import-type RequestOpts from \CasParser\RequestOptions - */ final class KfintechService implements KfintechContract { /** @@ -23,6 +14,7 @@ final class KfintechService implements KfintechContract */ public KfintechRawService $raw; + // @phpstan-ignore-next-line /** * @internal */ @@ -30,45 +22,4 @@ public function __construct(private Client $client) { $this->raw = new KfintechRawService($client); } - - /** - * @api - * - * 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`). - * - * @param string $email Email address to receive the CAS document - * @param string $fromDate Start date (YYYY-MM-DD) - * @param string $password Password for the PDF - * @param string $toDate End date (YYYY-MM-DD) - * @param string $panNo PAN number (optional) - * @param RequestOpts|null $requestOptions - * - * @throws APIException - */ - public function generateCas( - string $email, - string $fromDate, - string $password, - string $toDate, - ?string $panNo = null, - RequestOptions|array|null $requestOptions = null, - ): KfintechGenerateCasResponse { - $params = Util::removeNulls( - [ - 'email' => $email, - 'fromDate' => $fromDate, - 'password' => $password, - 'toDate' => $toDate, - 'panNo' => $panNo, - ], - ); - - // @phpstan-ignore-next-line argument.type - $response = $this->raw->generateCas(params: $params, requestOptions: $requestOptions); - - return $response->parse(); - } } diff --git a/tests/Services/KfintechTest.php b/tests/Services/KfintechTest.php deleted file mode 100644 index 934dd0d..0000000 --- a/tests/Services/KfintechTest.php +++ /dev/null @@ -1,67 +0,0 @@ -client = $client; - } - - #[Test] - public function testGenerateCas(): void - { - if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Mock server tests are disabled'); - } - - $result = $this->client->kfintech->generateCas( - email: 'user@example.com', - fromDate: '2023-01-01', - password: 'Abcdefghi12$', - toDate: '2023-12-31', - ); - - // @phpstan-ignore-next-line method.alreadyNarrowedType - $this->assertInstanceOf(KfintechGenerateCasResponse::class, $result); - } - - #[Test] - public function testGenerateCasWithOptionalParams(): void - { - if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Mock server tests are disabled'); - } - - $result = $this->client->kfintech->generateCas( - email: 'user@example.com', - fromDate: '2023-01-01', - password: 'Abcdefghi12$', - toDate: '2023-12-31', - panNo: 'ABCDE1234F', - ); - - // @phpstan-ignore-next-line method.alreadyNarrowedType - $this->assertInstanceOf(KfintechGenerateCasResponse::class, $result); - } -} From 298ee7970b75e4a39303884f7f64f672372bda3c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 26 Jul 2026 05:18:00 +0000 Subject: [PATCH 3/3] release: 0.9.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ src/Version.php | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 6538ca9..6d78745 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.8.0" + ".": "0.9.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index c720566..0396d31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.9.0 (2026-07-26) + +Full Changelog: [v0.8.0...v0.9.0](https://github.com/CASParser/cas-parser-php/compare/v0.8.0...v0.9.0) + +### Features + +* **api:** api update ([74ea130](https://github.com/CASParser/cas-parser-php/commit/74ea13048096a010f9127891ab0281fc56ca1401)) + ## 0.8.0 (2026-07-18) Full Changelog: [v0.7.0...v0.8.0](https://github.com/CASParser/cas-parser-php/compare/v0.7.0...v0.8.0) diff --git a/src/Version.php b/src/Version.php index 1c12b5e..4a479e3 100644 --- a/src/Version.php +++ b/src/Version.php @@ -5,5 +5,5 @@ namespace CasParser; // x-release-please-start-version -const VERSION = '0.8.0'; +const VERSION = '0.9.0'; // x-release-please-end