Skip to content

Commit 5543b33

Browse files
feat(api): api update
1 parent 8af506c commit 5543b33

File tree

12 files changed

+675
-3
lines changed

12 files changed

+675
-3
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 236
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-456b3255914e823b9e463f97ff81124dfabefae6f102e0f295bf33b7cfb1b780.yml
3-
openapi_spec_hash: ccbeda7ba9b61f9a8c2f9f4cf7a65dce
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-d5ad75c7a80acd1cb3ff0483fa0b5b2eb9d73287f107f53a8fb3a3a0b6a32ed8.yml
3+
openapi_spec_hash: da73faf476df3eddcf0ac51c38dd1b17
44
config_hash: 25d7d7aa4882db6189b4b53e8e249e80

src/Entities/Entity.php

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@
1818
use Increase\Entities\Entity\ThirdPartyVerification;
1919
use Increase\Entities\Entity\Trust;
2020
use Increase\Entities\Entity\Type;
21+
use Increase\Entities\Entity\Validation;
2122
use Increase\SupplementalDocuments\EntitySupplementalDocument;
2223

2324
/**
24-
* Entities are the legal entities that own accounts. They can be people, corporations, partnerships, government authorities, or trusts.
25+
* Entities are the legal entities that own accounts. They can be people, corporations, partnerships, government authorities, or trusts. To learn more, see [Entities](/documentation/entities).
2526
*
2627
* @phpstan-import-type CorporationShape from \Increase\Entities\Entity\Corporation
2728
* @phpstan-import-type GovernmentAuthorityShape from \Increase\Entities\Entity\GovernmentAuthority
@@ -32,6 +33,7 @@
3233
* @phpstan-import-type TermsAgreementShape from \Increase\Entities\Entity\TermsAgreement
3334
* @phpstan-import-type ThirdPartyVerificationShape from \Increase\Entities\Entity\ThirdPartyVerification
3435
* @phpstan-import-type TrustShape from \Increase\Entities\Entity\Trust
36+
* @phpstan-import-type ValidationShape from \Increase\Entities\Entity\Validation
3537
*
3638
* @phpstan-type EntityShape = array{
3739
* id: string,
@@ -51,6 +53,7 @@
5153
* thirdPartyVerification: null|ThirdPartyVerification|ThirdPartyVerificationShape,
5254
* trust: null|Trust|TrustShape,
5355
* type: Type|value-of<Type>,
56+
* validation: null|Validation|ValidationShape,
5457
* }
5558
*/
5659
final class Entity implements BaseModel
@@ -170,6 +173,12 @@ final class Entity implements BaseModel
170173
#[Required(enum: Type::class)]
171174
public string $type;
172175

176+
/**
177+
* The validation results for the entity.
178+
*/
179+
#[Required]
180+
public ?Validation $validation;
181+
173182
/**
174183
* `new Entity()` is missing required properties by the API.
175184
*
@@ -193,6 +202,7 @@ final class Entity implements BaseModel
193202
* thirdPartyVerification: ...,
194203
* trust: ...,
195204
* type: ...,
205+
* validation: ...,
196206
* )
197207
* ```
198208
*
@@ -217,6 +227,7 @@ final class Entity implements BaseModel
217227
* ->withThirdPartyVerification(...)
218228
* ->withTrust(...)
219229
* ->withType(...)
230+
* ->withValidation(...)
220231
* ```
221232
*/
222233
public function __construct()
@@ -241,6 +252,7 @@ public function __construct()
241252
* @param ThirdPartyVerification|ThirdPartyVerificationShape|null $thirdPartyVerification
242253
* @param Trust|TrustShape|null $trust
243254
* @param Type|value-of<Type> $type
255+
* @param Validation|ValidationShape|null $validation
244256
*/
245257
public static function with(
246258
string $id,
@@ -260,6 +272,7 @@ public static function with(
260272
ThirdPartyVerification|array|null $thirdPartyVerification,
261273
Trust|array|null $trust,
262274
Type|string $type,
275+
Validation|array|null $validation,
263276
): self {
264277
$self = new self;
265278

@@ -280,6 +293,7 @@ public static function with(
280293
$self['thirdPartyVerification'] = $thirdPartyVerification;
281294
$self['trust'] = $trust;
282295
$self['type'] = $type;
296+
$self['validation'] = $validation;
283297

284298
return $self;
285299
}
@@ -499,4 +513,17 @@ public function withType(Type|string $type): self
499513

500514
return $self;
501515
}
516+
517+
/**
518+
* The validation results for the entity.
519+
*
520+
* @param Validation|ValidationShape|null $validation
521+
*/
522+
public function withValidation(Validation|array|null $validation): self
523+
{
524+
$self = clone $this;
525+
$self['validation'] = $validation;
526+
527+
return $self;
528+
}
502529
}

src/Entities/Entity/Validation.php

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Increase\Entities\Entity;
6+
7+
use Increase\Core\Attributes\Required;
8+
use Increase\Core\Concerns\SdkModel;
9+
use Increase\Core\Contracts\BaseModel;
10+
use Increase\Entities\Entity\Validation\Issue;
11+
use Increase\Entities\Entity\Validation\Status;
12+
13+
/**
14+
* The validation results for the entity.
15+
*
16+
* @phpstan-import-type IssueShape from \Increase\Entities\Entity\Validation\Issue
17+
*
18+
* @phpstan-type ValidationShape = array{
19+
* issues: list<Issue|IssueShape>,
20+
* status: \Increase\Entities\Entity\Validation\Status|value-of<\Increase\Entities\Entity\Validation\Status>,
21+
* }
22+
*/
23+
final class Validation implements BaseModel
24+
{
25+
/** @use SdkModel<ValidationShape> */
26+
use SdkModel;
27+
28+
/**
29+
* The list of issues that need to be addressed.
30+
*
31+
* @var list<Issue> $issues
32+
*/
33+
#[Required(list: Issue::class)]
34+
public array $issues;
35+
36+
/**
37+
* The validation status for the entity. If the status is `invalid`, the `issues` array will be populated.
38+
*
39+
* @var value-of<Status> $status
40+
*/
41+
#[Required(enum: Status::class)]
42+
public string $status;
43+
44+
/**
45+
* `new Validation()` is missing required properties by the API.
46+
*
47+
* To enforce required parameters use
48+
* ```
49+
* Validation::with(issues: ..., status: ...)
50+
* ```
51+
*
52+
* Otherwise ensure the following setters are called
53+
*
54+
* ```
55+
* (new Validation)->withIssues(...)->withStatus(...)
56+
* ```
57+
*/
58+
public function __construct()
59+
{
60+
$this->initialize();
61+
}
62+
63+
/**
64+
* Construct an instance from the required parameters.
65+
*
66+
* You must use named parameters to construct any parameters with a default value.
67+
*
68+
* @param list<Issue|IssueShape> $issues
69+
* @param Status|value-of<Status> $status
70+
*/
71+
public static function with(
72+
array $issues,
73+
Status|string $status
74+
): self {
75+
$self = new self;
76+
77+
$self['issues'] = $issues;
78+
$self['status'] = $status;
79+
80+
return $self;
81+
}
82+
83+
/**
84+
* The list of issues that need to be addressed.
85+
*
86+
* @param list<Issue|IssueShape> $issues
87+
*/
88+
public function withIssues(array $issues): self
89+
{
90+
$self = clone $this;
91+
$self['issues'] = $issues;
92+
93+
return $self;
94+
}
95+
96+
/**
97+
* The validation status for the entity. If the status is `invalid`, the `issues` array will be populated.
98+
*
99+
* @param Status|value-of<Status> $status
100+
*/
101+
public function withStatus(
102+
Status|string $status
103+
): self {
104+
$self = clone $this;
105+
$self['status'] = $status;
106+
107+
return $self;
108+
}
109+
}

0 commit comments

Comments
 (0)