Skip to content

Commit db0fac3

Browse files
feat(client): support raw responses
1 parent 4fcc712 commit db0fac3

31 files changed

Lines changed: 147 additions & 107 deletions

src/CasGenerator/CasGeneratorGenerateCasResponse.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@
1010

1111
/**
1212
* @phpstan-type cas_generator_generate_cas_response = array{
13-
* msg?: string|null, status?: string|null
13+
* msg?: string, status?: string
1414
* }
15+
* When used in a response, this type parameter can be used to define a $rawResponse property.
16+
* @template TRawResponse of object = object{}
17+
*
18+
* @mixin TRawResponse
1519
*/
1620
final class CasGeneratorGenerateCasResponse implements BaseModel
1721
{

src/CasParser/UnifiedResponse.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,17 @@
1616

1717
/**
1818
* @phpstan-type unified_response = array{
19-
* dematAccounts?: list<DematAccount>|null,
20-
* insurance?: Insurance|null,
21-
* investor?: Investor|null,
22-
* meta?: Meta|null,
23-
* mutualFunds?: list<MutualFund>|null,
24-
* summary?: Summary|null,
19+
* dematAccounts?: list<DematAccount>,
20+
* insurance?: Insurance,
21+
* investor?: Investor,
22+
* meta?: Meta,
23+
* mutualFunds?: list<MutualFund>,
24+
* summary?: Summary,
2525
* }
26+
* When used in a response, this type parameter can be used to define a $rawResponse property.
27+
* @template TRawResponse of object = object{}
28+
*
29+
* @mixin TRawResponse
2630
*/
2731
final class UnifiedResponse implements BaseModel
2832
{

src/CasParser/UnifiedResponse/DematAccount.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313

1414
/**
1515
* @phpstan-type demat_account = array{
16-
* additionalInfo?: AdditionalInfo|null,
17-
* boID?: string|null,
18-
* clientID?: string|null,
19-
* dematType?: value-of<DematType>|null,
20-
* dpID?: string|null,
21-
* dpName?: string|null,
22-
* holdings?: Holdings|null,
23-
* value?: float|null,
16+
* additionalInfo?: AdditionalInfo,
17+
* boID?: string,
18+
* clientID?: string,
19+
* dematType?: value-of<DematType>,
20+
* dpID?: string,
21+
* dpName?: string,
22+
* holdings?: Holdings,
23+
* value?: float,
2424
* }
2525
*/
2626
final class DematAccount implements BaseModel

src/CasParser/UnifiedResponse/DematAccount/AdditionalInfo.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
* Additional information specific to the demat account type.
1313
*
1414
* @phpstan-type additional_info = array{
15-
* boStatus?: string|null,
16-
* boSubStatus?: string|null,
17-
* boType?: string|null,
18-
* bsda?: string|null,
19-
* email?: string|null,
20-
* linkedPans?: list<string>|null,
21-
* nominee?: string|null,
22-
* status?: string|null,
15+
* boStatus?: string,
16+
* boSubStatus?: string,
17+
* boType?: string,
18+
* bsda?: string,
19+
* email?: string,
20+
* linkedPans?: list<string>,
21+
* nominee?: string,
22+
* status?: string,
2323
* }
2424
*/
2525
final class AdditionalInfo implements BaseModel

src/CasParser/UnifiedResponse/DematAccount/Holdings.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515

1616
/**
1717
* @phpstan-type holdings_alias = array{
18-
* aifs?: list<Aif>|null,
19-
* corporateBonds?: list<CorporateBond>|null,
20-
* dematMutualFunds?: list<DematMutualFund>|null,
21-
* equities?: list<Equity>|null,
22-
* governmentSecurities?: list<GovernmentSecurity>|null,
18+
* aifs?: list<Aif>,
19+
* corporateBonds?: list<CorporateBond>,
20+
* dematMutualFunds?: list<DematMutualFund>,
21+
* equities?: list<Equity>,
22+
* governmentSecurities?: list<GovernmentSecurity>,
2323
* }
2424
*/
2525
final class Holdings implements BaseModel

src/CasParser/UnifiedResponse/DematAccount/Holdings/Aif.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
/**
1212
* @phpstan-type aif_alias = array{
1313
* additionalInfo?: mixed,
14-
* isin?: string|null,
15-
* name?: string|null,
16-
* units?: float|null,
17-
* value?: float|null,
14+
* isin?: string,
15+
* name?: string,
16+
* units?: float,
17+
* value?: float,
1818
* }
1919
*/
2020
final class Aif implements BaseModel

src/CasParser/UnifiedResponse/DematAccount/Holdings/CorporateBond.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
/**
1212
* @phpstan-type corporate_bond = array{
1313
* additionalInfo?: mixed,
14-
* isin?: string|null,
15-
* name?: string|null,
16-
* units?: float|null,
17-
* value?: float|null,
14+
* isin?: string,
15+
* name?: string,
16+
* units?: float,
17+
* value?: float,
1818
* }
1919
*/
2020
final class CorporateBond implements BaseModel

src/CasParser/UnifiedResponse/DematAccount/Holdings/DematMutualFund.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
/**
1212
* @phpstan-type demat_mutual_fund = array{
1313
* additionalInfo?: mixed,
14-
* isin?: string|null,
15-
* name?: string|null,
16-
* units?: float|null,
17-
* value?: float|null,
14+
* isin?: string,
15+
* name?: string,
16+
* units?: float,
17+
* value?: float,
1818
* }
1919
*/
2020
final class DematMutualFund implements BaseModel

src/CasParser/UnifiedResponse/DematAccount/Holdings/Equity.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
/**
1212
* @phpstan-type equity_alias = array{
1313
* additionalInfo?: mixed,
14-
* isin?: string|null,
15-
* name?: string|null,
16-
* units?: float|null,
17-
* value?: float|null,
14+
* isin?: string,
15+
* name?: string,
16+
* units?: float,
17+
* value?: float,
1818
* }
1919
*/
2020
final class Equity implements BaseModel

src/CasParser/UnifiedResponse/DematAccount/Holdings/GovernmentSecurity.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
/**
1212
* @phpstan-type government_security = array{
1313
* additionalInfo?: mixed,
14-
* isin?: string|null,
15-
* name?: string|null,
16-
* units?: float|null,
17-
* value?: float|null,
14+
* isin?: string,
15+
* name?: string,
16+
* units?: float,
17+
* value?: float,
1818
* }
1919
*/
2020
final class GovernmentSecurity implements BaseModel

0 commit comments

Comments
 (0)