Skip to content

Commit 64ac6da

Browse files
feat(api): api update
1 parent fc1da98 commit 64ac6da

File tree

3 files changed

+120
-2
lines changed

3 files changed

+120
-2
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: 232
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-cc66158bcd1307d07051dcfd43d73dad380a7d8eb637620b21ff4a59e6073b68.yml
3-
openapi_spec_hash: add50aa92e44e568b1efa8dba7bdb2d5
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-df015666c8d57cf91d4239bffeb549736581af5653e0ec2cd94357c434975e31.yml
3+
openapi_spec_hash: fceca44f4bd5f5f8fdbbaa6c80fc0410
44
config_hash: 27e44ed36b9c5617b580ead7231a594a

src/DigitalWalletTokens/DigitalWalletToken.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Increase\Core\Contracts\BaseModel;
1010
use Increase\DigitalWalletTokens\DigitalWalletToken\Cardholder;
1111
use Increase\DigitalWalletTokens\DigitalWalletToken\Device;
12+
use Increase\DigitalWalletTokens\DigitalWalletToken\DynamicPrimaryAccountNumber;
1213
use Increase\DigitalWalletTokens\DigitalWalletToken\Status;
1314
use Increase\DigitalWalletTokens\DigitalWalletToken\TokenRequestor;
1415
use Increase\DigitalWalletTokens\DigitalWalletToken\Type;
@@ -19,6 +20,7 @@
1920
*
2021
* @phpstan-import-type CardholderShape from \Increase\DigitalWalletTokens\DigitalWalletToken\Cardholder
2122
* @phpstan-import-type DeviceShape from \Increase\DigitalWalletTokens\DigitalWalletToken\Device
23+
* @phpstan-import-type DynamicPrimaryAccountNumberShape from \Increase\DigitalWalletTokens\DigitalWalletToken\DynamicPrimaryAccountNumber
2224
* @phpstan-import-type UpdateShape from \Increase\DigitalWalletTokens\DigitalWalletToken\Update
2325
*
2426
* @phpstan-type DigitalWalletTokenShape = array{
@@ -27,6 +29,7 @@
2729
* cardholder: Cardholder|CardholderShape,
2830
* createdAt: \DateTimeInterface,
2931
* device: Device|DeviceShape,
32+
* dynamicPrimaryAccountNumber: null|DynamicPrimaryAccountNumber|DynamicPrimaryAccountNumberShape,
3033
* status: Status|value-of<Status>,
3134
* tokenRequestor: TokenRequestor|value-of<TokenRequestor>,
3235
* type: Type|value-of<Type>,
@@ -68,6 +71,12 @@ final class DigitalWalletToken implements BaseModel
6871
#[Required]
6972
public Device $device;
7073

74+
/**
75+
* The redacted Dynamic Primary Account Number.
76+
*/
77+
#[Required('dynamic_primary_account_number')]
78+
public ?DynamicPrimaryAccountNumber $dynamicPrimaryAccountNumber;
79+
7180
/**
7281
* This indicates if payments can be made with the Digital Wallet Token.
7382
*
@@ -111,6 +120,7 @@ final class DigitalWalletToken implements BaseModel
111120
* cardholder: ...,
112121
* createdAt: ...,
113122
* device: ...,
123+
* dynamicPrimaryAccountNumber: ...,
114124
* status: ...,
115125
* tokenRequestor: ...,
116126
* type: ...,
@@ -127,6 +137,7 @@ final class DigitalWalletToken implements BaseModel
127137
* ->withCardholder(...)
128138
* ->withCreatedAt(...)
129139
* ->withDevice(...)
140+
* ->withDynamicPrimaryAccountNumber(...)
130141
* ->withStatus(...)
131142
* ->withTokenRequestor(...)
132143
* ->withType(...)
@@ -145,6 +156,7 @@ public function __construct()
145156
*
146157
* @param Cardholder|CardholderShape $cardholder
147158
* @param Device|DeviceShape $device
159+
* @param DynamicPrimaryAccountNumber|DynamicPrimaryAccountNumberShape|null $dynamicPrimaryAccountNumber
148160
* @param Status|value-of<Status> $status
149161
* @param TokenRequestor|value-of<TokenRequestor> $tokenRequestor
150162
* @param Type|value-of<Type> $type
@@ -156,6 +168,7 @@ public static function with(
156168
Cardholder|array $cardholder,
157169
\DateTimeInterface $createdAt,
158170
Device|array $device,
171+
DynamicPrimaryAccountNumber|array|null $dynamicPrimaryAccountNumber,
159172
Status|string $status,
160173
TokenRequestor|string $tokenRequestor,
161174
Type|string $type,
@@ -168,6 +181,7 @@ public static function with(
168181
$self['cardholder'] = $cardholder;
169182
$self['createdAt'] = $createdAt;
170183
$self['device'] = $device;
184+
$self['dynamicPrimaryAccountNumber'] = $dynamicPrimaryAccountNumber;
171185
$self['status'] = $status;
172186
$self['tokenRequestor'] = $tokenRequestor;
173187
$self['type'] = $type;
@@ -235,6 +249,20 @@ public function withDevice(Device|array $device): self
235249
return $self;
236250
}
237251

252+
/**
253+
* The redacted Dynamic Primary Account Number.
254+
*
255+
* @param DynamicPrimaryAccountNumber|DynamicPrimaryAccountNumberShape|null $dynamicPrimaryAccountNumber
256+
*/
257+
public function withDynamicPrimaryAccountNumber(
258+
DynamicPrimaryAccountNumber|array|null $dynamicPrimaryAccountNumber
259+
): self {
260+
$self = clone $this;
261+
$self['dynamicPrimaryAccountNumber'] = $dynamicPrimaryAccountNumber;
262+
263+
return $self;
264+
}
265+
238266
/**
239267
* This indicates if payments can be made with the Digital Wallet Token.
240268
*
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Increase\DigitalWalletTokens\DigitalWalletToken;
6+
7+
use Increase\Core\Attributes\Required;
8+
use Increase\Core\Concerns\SdkModel;
9+
use Increase\Core\Contracts\BaseModel;
10+
11+
/**
12+
* The redacted Dynamic Primary Account Number.
13+
*
14+
* @phpstan-type DynamicPrimaryAccountNumberShape = array{
15+
* first6: string, last4: string
16+
* }
17+
*/
18+
final class DynamicPrimaryAccountNumber implements BaseModel
19+
{
20+
/** @use SdkModel<DynamicPrimaryAccountNumberShape> */
21+
use SdkModel;
22+
23+
/**
24+
* The first 6 digits of the token's Dynamic Primary Account Number.
25+
*/
26+
#[Required]
27+
public string $first6;
28+
29+
/**
30+
* The last 4 digits of the token's Dynamic Primary Account Number.
31+
*/
32+
#[Required]
33+
public string $last4;
34+
35+
/**
36+
* `new DynamicPrimaryAccountNumber()` is missing required properties by the API.
37+
*
38+
* To enforce required parameters use
39+
* ```
40+
* DynamicPrimaryAccountNumber::with(first6: ..., last4: ...)
41+
* ```
42+
*
43+
* Otherwise ensure the following setters are called
44+
*
45+
* ```
46+
* (new DynamicPrimaryAccountNumber)->withFirst6(...)->withLast4(...)
47+
* ```
48+
*/
49+
public function __construct()
50+
{
51+
$this->initialize();
52+
}
53+
54+
/**
55+
* Construct an instance from the required parameters.
56+
*
57+
* You must use named parameters to construct any parameters with a default value.
58+
*/
59+
public static function with(string $first6, string $last4): self
60+
{
61+
$self = new self;
62+
63+
$self['first6'] = $first6;
64+
$self['last4'] = $last4;
65+
66+
return $self;
67+
}
68+
69+
/**
70+
* The first 6 digits of the token's Dynamic Primary Account Number.
71+
*/
72+
public function withFirst6(string $first6): self
73+
{
74+
$self = clone $this;
75+
$self['first6'] = $first6;
76+
77+
return $self;
78+
}
79+
80+
/**
81+
* The last 4 digits of the token's Dynamic Primary Account Number.
82+
*/
83+
public function withLast4(string $last4): self
84+
{
85+
$self = clone $this;
86+
$self['last4'] = $last4;
87+
88+
return $self;
89+
}
90+
}

0 commit comments

Comments
 (0)