Skip to content

Commit 475b401

Browse files
feat(api): api update
1 parent 679c13b commit 475b401

File tree

16 files changed

+595
-31
lines changed

16 files changed

+595
-31
lines changed

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 234
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-b42ffa447aa14da70d972676b1d5ad0c2720ff4e33a483037b2b1bb51190a69f.yml
3-
openapi_spec_hash: 0972cc54434c6c67218be04ab1ea1fc5
4-
config_hash: b7ec7f54fa76c1f8bde7a548710a1d38
1+
configured_endpoints: 236
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-f46fe8b546ee1a4ad24918ef0803f48e6586e061d5445ae1aeb6abc7b8cf64a3.yml
3+
openapi_spec_hash: 440b743a615d5ecc832affd6c3154809
4+
config_hash: dda988c5565c2f15cc708122984d7691
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Increase\BeneficialOwners;
6+
7+
use Increase\Core\Attributes\Optional;
8+
use Increase\Core\Attributes\Required;
9+
use Increase\Core\Concerns\SdkModel;
10+
use Increase\Core\Concerns\SdkParams;
11+
use Increase\Core\Contracts\BaseModel;
12+
13+
/**
14+
* List Beneficial Owners.
15+
*
16+
* @see Increase\Services\BeneficialOwnersService::list()
17+
*
18+
* @phpstan-type BeneficialOwnerListParamsShape = array{
19+
* entityID: string,
20+
* cursor?: string|null,
21+
* idempotencyKey?: string|null,
22+
* limit?: int|null,
23+
* }
24+
*/
25+
final class BeneficialOwnerListParams implements BaseModel
26+
{
27+
/** @use SdkModel<BeneficialOwnerListParamsShape> */
28+
use SdkModel;
29+
use SdkParams;
30+
31+
/**
32+
* The identifier of the Entity to list beneficial owners for. Only `corporation` entities have beneficial owners.
33+
*/
34+
#[Required]
35+
public string $entityID;
36+
37+
/**
38+
* Return the page of entries after this one.
39+
*/
40+
#[Optional]
41+
public ?string $cursor;
42+
43+
/**
44+
* Filter records to the one with the specified `idempotency_key` you chose for that object. This value is unique across Increase and is used to ensure that a request is only processed once. Learn more about [idempotency](https://increase.com/documentation/idempotency-keys).
45+
*/
46+
#[Optional]
47+
public ?string $idempotencyKey;
48+
49+
/**
50+
* Limit the size of the list that is returned. The default (and maximum) is 100 objects.
51+
*/
52+
#[Optional]
53+
public ?int $limit;
54+
55+
/**
56+
* `new BeneficialOwnerListParams()` is missing required properties by the API.
57+
*
58+
* To enforce required parameters use
59+
* ```
60+
* BeneficialOwnerListParams::with(entityID: ...)
61+
* ```
62+
*
63+
* Otherwise ensure the following setters are called
64+
*
65+
* ```
66+
* (new BeneficialOwnerListParams)->withEntityID(...)
67+
* ```
68+
*/
69+
public function __construct()
70+
{
71+
$this->initialize();
72+
}
73+
74+
/**
75+
* Construct an instance from the required parameters.
76+
*
77+
* You must use named parameters to construct any parameters with a default value.
78+
*/
79+
public static function with(
80+
string $entityID,
81+
?string $cursor = null,
82+
?string $idempotencyKey = null,
83+
?int $limit = null,
84+
): self {
85+
$self = new self;
86+
87+
$self['entityID'] = $entityID;
88+
89+
null !== $cursor && $self['cursor'] = $cursor;
90+
null !== $idempotencyKey && $self['idempotencyKey'] = $idempotencyKey;
91+
null !== $limit && $self['limit'] = $limit;
92+
93+
return $self;
94+
}
95+
96+
/**
97+
* The identifier of the Entity to list beneficial owners for. Only `corporation` entities have beneficial owners.
98+
*/
99+
public function withEntityID(string $entityID): self
100+
{
101+
$self = clone $this;
102+
$self['entityID'] = $entityID;
103+
104+
return $self;
105+
}
106+
107+
/**
108+
* Return the page of entries after this one.
109+
*/
110+
public function withCursor(string $cursor): self
111+
{
112+
$self = clone $this;
113+
$self['cursor'] = $cursor;
114+
115+
return $self;
116+
}
117+
118+
/**
119+
* Filter records to the one with the specified `idempotency_key` you chose for that object. This value is unique across Increase and is used to ensure that a request is only processed once. Learn more about [idempotency](https://increase.com/documentation/idempotency-keys).
120+
*/
121+
public function withIdempotencyKey(string $idempotencyKey): self
122+
{
123+
$self = clone $this;
124+
$self['idempotencyKey'] = $idempotencyKey;
125+
126+
return $self;
127+
}
128+
129+
/**
130+
* Limit the size of the list that is returned. The default (and maximum) is 100 objects.
131+
*/
132+
public function withLimit(int $limit): self
133+
{
134+
$self = clone $this;
135+
$self['limit'] = $limit;
136+
137+
return $self;
138+
}
139+
}

src/Entities/Entity/Corporation/BeneficialOwner.php renamed to src/BeneficialOwners/EntityBeneficialOwner.php

Lines changed: 65 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,30 @@
22

33
declare(strict_types=1);
44

5-
namespace Increase\Entities\Entity\Corporation;
5+
namespace Increase\BeneficialOwners;
66

7+
use Increase\BeneficialOwners\EntityBeneficialOwner\Individual;
8+
use Increase\BeneficialOwners\EntityBeneficialOwner\Prong;
9+
use Increase\BeneficialOwners\EntityBeneficialOwner\Type;
710
use Increase\Core\Attributes\Required;
811
use Increase\Core\Concerns\SdkModel;
912
use Increase\Core\Contracts\BaseModel;
10-
use Increase\Entities\Entity\Corporation\BeneficialOwner\Individual;
11-
use Increase\Entities\Entity\Corporation\BeneficialOwner\Prong;
1213

1314
/**
14-
* @phpstan-import-type IndividualShape from \Increase\Entities\Entity\Corporation\BeneficialOwner\Individual
15+
* @phpstan-import-type IndividualShape from \Increase\BeneficialOwners\EntityBeneficialOwner\Individual
1516
*
16-
* @phpstan-type BeneficialOwnerShape = array{
17+
* @phpstan-type EntityBeneficialOwnerShape = array{
1718
* id: string,
1819
* companyTitle: string|null,
20+
* createdAt: \DateTimeInterface,
1921
* individual: Individual|IndividualShape,
2022
* prongs: list<Prong|value-of<Prong>>,
23+
* type: Type|value-of<Type>,
2124
* }
2225
*/
23-
final class BeneficialOwner implements BaseModel
26+
final class EntityBeneficialOwner implements BaseModel
2427
{
25-
/** @use SdkModel<BeneficialOwnerShape> */
28+
/** @use SdkModel<EntityBeneficialOwnerShape> */
2629
use SdkModel;
2730

2831
/**
@@ -37,6 +40,12 @@ final class BeneficialOwner implements BaseModel
3740
#[Required('company_title')]
3841
public ?string $companyTitle;
3942

43+
/**
44+
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Beneficial Owner was created.
45+
*/
46+
#[Required('created_at')]
47+
public \DateTimeInterface $createdAt;
48+
4049
/**
4150
* Personal details for the beneficial owner.
4251
*/
@@ -52,21 +61,38 @@ final class BeneficialOwner implements BaseModel
5261
public array $prongs;
5362

5463
/**
55-
* `new BeneficialOwner()` is missing required properties by the API.
64+
* A constant representing the object's type. For this resource it will always be `entity_beneficial_owner`.
65+
*
66+
* @var value-of<Type> $type
67+
*/
68+
#[Required(enum: Type::class)]
69+
public string $type;
70+
71+
/**
72+
* `new EntityBeneficialOwner()` is missing required properties by the API.
5673
*
5774
* To enforce required parameters use
5875
* ```
59-
* BeneficialOwner::with(id: ..., companyTitle: ..., individual: ..., prongs: ...)
76+
* EntityBeneficialOwner::with(
77+
* id: ...,
78+
* companyTitle: ...,
79+
* createdAt: ...,
80+
* individual: ...,
81+
* prongs: ...,
82+
* type: ...,
83+
* )
6084
* ```
6185
*
6286
* Otherwise ensure the following setters are called
6387
*
6488
* ```
65-
* (new BeneficialOwner)
89+
* (new EntityBeneficialOwner)
6690
* ->withID(...)
6791
* ->withCompanyTitle(...)
92+
* ->withCreatedAt(...)
6893
* ->withIndividual(...)
6994
* ->withProngs(...)
95+
* ->withType(...)
7096
* ```
7197
*/
7298
public function __construct()
@@ -81,19 +107,24 @@ public function __construct()
81107
*
82108
* @param Individual|IndividualShape $individual
83109
* @param list<Prong|value-of<Prong>> $prongs
110+
* @param Type|value-of<Type> $type
84111
*/
85112
public static function with(
86113
string $id,
87114
?string $companyTitle,
115+
\DateTimeInterface $createdAt,
88116
Individual|array $individual,
89117
array $prongs,
118+
Type|string $type,
90119
): self {
91120
$self = new self;
92121

93122
$self['id'] = $id;
94123
$self['companyTitle'] = $companyTitle;
124+
$self['createdAt'] = $createdAt;
95125
$self['individual'] = $individual;
96126
$self['prongs'] = $prongs;
127+
$self['type'] = $type;
97128

98129
return $self;
99130
}
@@ -120,6 +151,17 @@ public function withCompanyTitle(?string $companyTitle): self
120151
return $self;
121152
}
122153

154+
/**
155+
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Beneficial Owner was created.
156+
*/
157+
public function withCreatedAt(\DateTimeInterface $createdAt): self
158+
{
159+
$self = clone $this;
160+
$self['createdAt'] = $createdAt;
161+
162+
return $self;
163+
}
164+
123165
/**
124166
* Personal details for the beneficial owner.
125167
*
@@ -145,4 +187,17 @@ public function withProngs(array $prongs): self
145187

146188
return $self;
147189
}
190+
191+
/**
192+
* A constant representing the object's type. For this resource it will always be `entity_beneficial_owner`.
193+
*
194+
* @param Type|value-of<Type> $type
195+
*/
196+
public function withType(Type|string $type): self
197+
{
198+
$self = clone $this;
199+
$self['type'] = $type;
200+
201+
return $self;
202+
}
148203
}

src/Entities/Entity/Corporation/BeneficialOwner/Individual.php renamed to src/BeneficialOwners/EntityBeneficialOwner/Individual.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22

33
declare(strict_types=1);
44

5-
namespace Increase\Entities\Entity\Corporation\BeneficialOwner;
5+
namespace Increase\BeneficialOwners\EntityBeneficialOwner;
66

7+
use Increase\BeneficialOwners\EntityBeneficialOwner\Individual\Address;
8+
use Increase\BeneficialOwners\EntityBeneficialOwner\Individual\Identification;
79
use Increase\Core\Attributes\Required;
810
use Increase\Core\Concerns\SdkModel;
911
use Increase\Core\Contracts\BaseModel;
10-
use Increase\Entities\Entity\Corporation\BeneficialOwner\Individual\Address;
11-
use Increase\Entities\Entity\Corporation\BeneficialOwner\Individual\Identification;
1212

1313
/**
1414
* Personal details for the beneficial owner.
1515
*
16-
* @phpstan-import-type AddressShape from \Increase\Entities\Entity\Corporation\BeneficialOwner\Individual\Address
17-
* @phpstan-import-type IdentificationShape from \Increase\Entities\Entity\Corporation\BeneficialOwner\Individual\Identification
16+
* @phpstan-import-type AddressShape from \Increase\BeneficialOwners\EntityBeneficialOwner\Individual\Address
17+
* @phpstan-import-type IdentificationShape from \Increase\BeneficialOwners\EntityBeneficialOwner\Individual\Identification
1818
*
1919
* @phpstan-type IndividualShape = array{
2020
* address: Address|AddressShape,

src/Entities/Entity/Corporation/BeneficialOwner/Individual/Address.php renamed to src/BeneficialOwners/EntityBeneficialOwner/Individual/Address.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Increase\Entities\Entity\Corporation\BeneficialOwner\Individual;
5+
namespace Increase\BeneficialOwners\EntityBeneficialOwner\Individual;
66

77
use Increase\Core\Attributes\Required;
88
use Increase\Core\Concerns\SdkModel;

src/Entities/Entity/Corporation/BeneficialOwner/Individual/Identification.php renamed to src/BeneficialOwners/EntityBeneficialOwner/Individual/Identification.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
declare(strict_types=1);
44

5-
namespace Increase\Entities\Entity\Corporation\BeneficialOwner\Individual;
5+
namespace Increase\BeneficialOwners\EntityBeneficialOwner\Individual;
66

7+
use Increase\BeneficialOwners\EntityBeneficialOwner\Individual\Identification\Method;
78
use Increase\Core\Attributes\Required;
89
use Increase\Core\Concerns\SdkModel;
910
use Increase\Core\Contracts\BaseModel;
10-
use Increase\Entities\Entity\Corporation\BeneficialOwner\Individual\Identification\Method;
1111

1212
/**
1313
* A means of verifying the person's identity.

src/Entities/Entity/Corporation/BeneficialOwner/Individual/Identification/Method.php renamed to src/BeneficialOwners/EntityBeneficialOwner/Individual/Identification/Method.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Increase\Entities\Entity\Corporation\BeneficialOwner\Individual\Identification;
5+
namespace Increase\BeneficialOwners\EntityBeneficialOwner\Individual\Identification;
66

77
/**
88
* A method that can be used to verify the individual's identity.

src/Entities/Entity/Corporation/BeneficialOwner/Prong.php renamed to src/BeneficialOwners/EntityBeneficialOwner/Prong.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Increase\Entities\Entity\Corporation\BeneficialOwner;
5+
namespace Increase\BeneficialOwners\EntityBeneficialOwner;
66

77
enum Prong: string
88
{
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Increase\BeneficialOwners\EntityBeneficialOwner;
6+
7+
/**
8+
* A constant representing the object's type. For this resource it will always be `entity_beneficial_owner`.
9+
*/
10+
enum Type: string
11+
{
12+
case ENTITY_BENEFICIAL_OWNER = 'entity_beneficial_owner';
13+
}

0 commit comments

Comments
 (0)