Skip to content

Commit 73b4b69

Browse files
feat(api): api update
1 parent ba1708a commit 73b4b69

File tree

9 files changed

+209
-23
lines changed

9 files changed

+209
-23
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-5a342683774b79b3ee013a195d77a651ea053be4ec6a314e92ab08b62f62517b.yml
3-
openapi_spec_hash: 2c87b069a3c3e1c647251016452c0b28
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-4d9e8a8a1909ef7c96fe28293ab07720938ce09be84687c57e3cf95890a78205.yml
3+
openapi_spec_hash: 4b3867a81a8429bf6ab119f910e72865
44
config_hash: e73b1147c039cb3d6a2c56ae5926bca8

src/CheckTransfers/CheckTransfer/PhysicalCheck.php

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Increase\CheckTransfers\CheckTransfer\PhysicalCheck\Payer;
99
use Increase\CheckTransfers\CheckTransfer\PhysicalCheck\ReturnAddress;
1010
use Increase\CheckTransfers\CheckTransfer\PhysicalCheck\ShippingMethod;
11+
use Increase\CheckTransfers\CheckTransfer\PhysicalCheck\Signature;
1112
use Increase\CheckTransfers\CheckTransfer\PhysicalCheck\TrackingUpdate;
1213
use Increase\Core\Attributes\Required;
1314
use Increase\Core\Concerns\SdkModel;
@@ -19,6 +20,7 @@
1920
* @phpstan-import-type MailingAddressShape from \Increase\CheckTransfers\CheckTransfer\PhysicalCheck\MailingAddress
2021
* @phpstan-import-type PayerShape from \Increase\CheckTransfers\CheckTransfer\PhysicalCheck\Payer
2122
* @phpstan-import-type ReturnAddressShape from \Increase\CheckTransfers\CheckTransfer\PhysicalCheck\ReturnAddress
23+
* @phpstan-import-type SignatureShape from \Increase\CheckTransfers\CheckTransfer\PhysicalCheck\Signature
2224
* @phpstan-import-type TrackingUpdateShape from \Increase\CheckTransfers\CheckTransfer\PhysicalCheck\TrackingUpdate
2325
*
2426
* @phpstan-type PhysicalCheckShape = array{
@@ -31,7 +33,7 @@
3133
* recipientName: string,
3234
* returnAddress: null|ReturnAddress|ReturnAddressShape,
3335
* shippingMethod: null|ShippingMethod|value-of<ShippingMethod>,
34-
* signatureText: string|null,
36+
* signature: Signature|SignatureShape,
3537
* trackingUpdates: list<TrackingUpdate|TrackingUpdateShape>,
3638
* }
3739
*/
@@ -99,10 +101,10 @@ final class PhysicalCheck implements BaseModel
99101
public ?string $shippingMethod;
100102

101103
/**
102-
* The text that will appear as the signature on the check in cursive font. If blank, the check will be printed with 'No signature required'.
104+
* The signature that will appear on the check.
103105
*/
104-
#[Required('signature_text')]
105-
public ?string $signatureText;
106+
#[Required]
107+
public Signature $signature;
106108

107109
/**
108110
* Tracking updates relating to the physical check's delivery.
@@ -127,7 +129,7 @@ final class PhysicalCheck implements BaseModel
127129
* recipientName: ...,
128130
* returnAddress: ...,
129131
* shippingMethod: ...,
130-
* signatureText: ...,
132+
* signature: ...,
131133
* trackingUpdates: ...,
132134
* )
133135
* ```
@@ -145,7 +147,7 @@ final class PhysicalCheck implements BaseModel
145147
* ->withRecipientName(...)
146148
* ->withReturnAddress(...)
147149
* ->withShippingMethod(...)
148-
* ->withSignatureText(...)
150+
* ->withSignature(...)
149151
* ->withTrackingUpdates(...)
150152
* ```
151153
*/
@@ -163,6 +165,7 @@ public function __construct()
163165
* @param list<Payer|PayerShape> $payer
164166
* @param ReturnAddress|ReturnAddressShape|null $returnAddress
165167
* @param ShippingMethod|value-of<ShippingMethod>|null $shippingMethod
168+
* @param Signature|SignatureShape $signature
166169
* @param list<TrackingUpdate|TrackingUpdateShape> $trackingUpdates
167170
*/
168171
public static function with(
@@ -175,7 +178,7 @@ public static function with(
175178
string $recipientName,
176179
ReturnAddress|array|null $returnAddress,
177180
ShippingMethod|string|null $shippingMethod,
178-
?string $signatureText,
181+
Signature|array $signature,
179182
array $trackingUpdates,
180183
): self {
181184
$self = new self;
@@ -189,7 +192,7 @@ public static function with(
189192
$self['recipientName'] = $recipientName;
190193
$self['returnAddress'] = $returnAddress;
191194
$self['shippingMethod'] = $shippingMethod;
192-
$self['signatureText'] = $signatureText;
195+
$self['signature'] = $signature;
193196
$self['trackingUpdates'] = $trackingUpdates;
194197

195198
return $self;
@@ -307,12 +310,14 @@ public function withShippingMethod(
307310
}
308311

309312
/**
310-
* The text that will appear as the signature on the check in cursive font. If blank, the check will be printed with 'No signature required'.
313+
* The signature that will appear on the check.
314+
*
315+
* @param Signature|SignatureShape $signature
311316
*/
312-
public function withSignatureText(?string $signatureText): self
317+
public function withSignature(Signature|array $signature): self
313318
{
314319
$self = clone $this;
315-
$self['signatureText'] = $signatureText;
320+
$self['signature'] = $signature;
316321

317322
return $self;
318323
}
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\CheckTransfers\CheckTransfer\PhysicalCheck;
6+
7+
use Increase\Core\Attributes\Required;
8+
use Increase\Core\Concerns\SdkModel;
9+
use Increase\Core\Contracts\BaseModel;
10+
11+
/**
12+
* The signature that will appear on the check.
13+
*
14+
* @phpstan-type SignatureShape = array{
15+
* imageFileID: string|null, text: string|null
16+
* }
17+
*/
18+
final class Signature implements BaseModel
19+
{
20+
/** @use SdkModel<SignatureShape> */
21+
use SdkModel;
22+
23+
/**
24+
* The ID of a File containing a PNG of the signature.
25+
*/
26+
#[Required('image_file_id')]
27+
public ?string $imageFileID;
28+
29+
/**
30+
* The text that will appear as the signature on the check in cursive font.
31+
*/
32+
#[Required]
33+
public ?string $text;
34+
35+
/**
36+
* `new Signature()` is missing required properties by the API.
37+
*
38+
* To enforce required parameters use
39+
* ```
40+
* Signature::with(imageFileID: ..., text: ...)
41+
* ```
42+
*
43+
* Otherwise ensure the following setters are called
44+
*
45+
* ```
46+
* (new Signature)->withImageFileID(...)->withText(...)
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 $imageFileID, ?string $text): self
60+
{
61+
$self = new self;
62+
63+
$self['imageFileID'] = $imageFileID;
64+
$self['text'] = $text;
65+
66+
return $self;
67+
}
68+
69+
/**
70+
* The ID of a File containing a PNG of the signature.
71+
*/
72+
public function withImageFileID(?string $imageFileID): self
73+
{
74+
$self = clone $this;
75+
$self['imageFileID'] = $imageFileID;
76+
77+
return $self;
78+
}
79+
80+
/**
81+
* The text that will appear as the signature on the check in cursive font.
82+
*/
83+
public function withText(?string $text): self
84+
{
85+
$self = clone $this;
86+
$self['text'] = $text;
87+
88+
return $self;
89+
}
90+
}

src/CheckTransfers/CheckTransferCreateParams/PhysicalCheck.php

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Increase\CheckTransfers\CheckTransferCreateParams\PhysicalCheck\Payer;
99
use Increase\CheckTransfers\CheckTransferCreateParams\PhysicalCheck\ReturnAddress;
1010
use Increase\CheckTransfers\CheckTransferCreateParams\PhysicalCheck\ShippingMethod;
11+
use Increase\CheckTransfers\CheckTransferCreateParams\PhysicalCheck\Signature;
1112
use Increase\Core\Attributes\Optional;
1213
use Increase\Core\Attributes\Required;
1314
use Increase\Core\Concerns\SdkModel;
@@ -19,6 +20,7 @@
1920
* @phpstan-import-type MailingAddressShape from \Increase\CheckTransfers\CheckTransferCreateParams\PhysicalCheck\MailingAddress
2021
* @phpstan-import-type PayerShape from \Increase\CheckTransfers\CheckTransferCreateParams\PhysicalCheck\Payer
2122
* @phpstan-import-type ReturnAddressShape from \Increase\CheckTransfers\CheckTransferCreateParams\PhysicalCheck\ReturnAddress
23+
* @phpstan-import-type SignatureShape from \Increase\CheckTransfers\CheckTransferCreateParams\PhysicalCheck\Signature
2224
*
2325
* @phpstan-type PhysicalCheckShape = array{
2426
* mailingAddress: MailingAddress|MailingAddressShape,
@@ -30,7 +32,7 @@
3032
* payer?: list<Payer|PayerShape>|null,
3133
* returnAddress?: null|ReturnAddress|ReturnAddressShape,
3234
* shippingMethod?: null|ShippingMethod|value-of<ShippingMethod>,
33-
* signatureText?: string|null,
35+
* signature?: null|Signature|SignatureShape,
3436
* }
3537
*/
3638
final class PhysicalCheck implements BaseModel
@@ -97,10 +99,10 @@ final class PhysicalCheck implements BaseModel
9799
public ?string $shippingMethod;
98100

99101
/**
100-
* The text that will appear as the signature on the check in cursive font. If not provided, the check will be printed with 'No signature required'.
102+
* The signature that will appear on the check. If not provided, the check will be printed with 'No Signature Required'. At most one of `text` and `image_file_id` may be provided.
101103
*/
102-
#[Optional('signature_text')]
103-
public ?string $signatureText;
104+
#[Optional]
105+
public ?Signature $signature;
104106

105107
/**
106108
* `new PhysicalCheck()` is missing required properties by the API.
@@ -133,6 +135,7 @@ public function __construct()
133135
* @param list<Payer|PayerShape>|null $payer
134136
* @param ReturnAddress|ReturnAddressShape|null $returnAddress
135137
* @param ShippingMethod|value-of<ShippingMethod>|null $shippingMethod
138+
* @param Signature|SignatureShape|null $signature
136139
*/
137140
public static function with(
138141
MailingAddress|array $mailingAddress,
@@ -144,7 +147,7 @@ public static function with(
144147
?array $payer = null,
145148
ReturnAddress|array|null $returnAddress = null,
146149
ShippingMethod|string|null $shippingMethod = null,
147-
?string $signatureText = null,
150+
Signature|array|null $signature = null,
148151
): self {
149152
$self = new self;
150153

@@ -158,7 +161,7 @@ public static function with(
158161
null !== $payer && $self['payer'] = $payer;
159162
null !== $returnAddress && $self['returnAddress'] = $returnAddress;
160163
null !== $shippingMethod && $self['shippingMethod'] = $shippingMethod;
161-
null !== $signatureText && $self['signatureText'] = $signatureText;
164+
null !== $signature && $self['signature'] = $signature;
162165

163166
return $self;
164167
}
@@ -274,12 +277,14 @@ public function withShippingMethod(
274277
}
275278

276279
/**
277-
* The text that will appear as the signature on the check in cursive font. If not provided, the check will be printed with 'No signature required'.
280+
* The signature that will appear on the check. If not provided, the check will be printed with 'No Signature Required'. At most one of `text` and `image_file_id` may be provided.
281+
*
282+
* @param Signature|SignatureShape $signature
278283
*/
279-
public function withSignatureText(string $signatureText): self
284+
public function withSignature(Signature|array $signature): self
280285
{
281286
$self = clone $this;
282-
$self['signatureText'] = $signatureText;
287+
$self['signature'] = $signature;
283288

284289
return $self;
285290
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Increase\CheckTransfers\CheckTransferCreateParams\PhysicalCheck;
6+
7+
use Increase\Core\Attributes\Optional;
8+
use Increase\Core\Concerns\SdkModel;
9+
use Increase\Core\Contracts\BaseModel;
10+
11+
/**
12+
* The signature that will appear on the check. If not provided, the check will be printed with 'No Signature Required'. At most one of `text` and `image_file_id` may be provided.
13+
*
14+
* @phpstan-type SignatureShape = array{
15+
* imageFileID?: string|null, text?: string|null
16+
* }
17+
*/
18+
final class Signature implements BaseModel
19+
{
20+
/** @use SdkModel<SignatureShape> */
21+
use SdkModel;
22+
23+
/**
24+
* The ID of a File containing a PNG of the signature. This must have `purpose: check_signature` and be a 1320x120 pixel PNG.
25+
*/
26+
#[Optional('image_file_id')]
27+
public ?string $imageFileID;
28+
29+
/**
30+
* The text that will appear as the signature on the check in cursive font.
31+
*/
32+
#[Optional]
33+
public ?string $text;
34+
35+
public function __construct()
36+
{
37+
$this->initialize();
38+
}
39+
40+
/**
41+
* Construct an instance from the required parameters.
42+
*
43+
* You must use named parameters to construct any parameters with a default value.
44+
*/
45+
public static function with(
46+
?string $imageFileID = null,
47+
?string $text = null
48+
): self {
49+
$self = new self;
50+
51+
null !== $imageFileID && $self['imageFileID'] = $imageFileID;
52+
null !== $text && $self['text'] = $text;
53+
54+
return $self;
55+
}
56+
57+
/**
58+
* The ID of a File containing a PNG of the signature. This must have `purpose: check_signature` and be a 1320x120 pixel PNG.
59+
*/
60+
public function withImageFileID(string $imageFileID): self
61+
{
62+
$self = clone $this;
63+
$self['imageFileID'] = $imageFileID;
64+
65+
return $self;
66+
}
67+
68+
/**
69+
* The text that will appear as the signature on the check in cursive font.
70+
*/
71+
public function withText(string $text): self
72+
{
73+
$self = clone $this;
74+
$self['text'] = $text;
75+
76+
return $self;
77+
}
78+
}

src/Files/File/Purpose.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ enum Purpose: string
2525

2626
case CHECK_VOUCHER_IMAGE = 'check_voucher_image';
2727

28+
case CHECK_SIGNATURE = 'check_signature';
29+
2830
case INBOUND_MAIL_ITEM = 'inbound_mail_item';
2931

3032
case FORM_1099_INT = 'form_1099_int';

src/Files/FileCreateParams/Purpose.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ enum Purpose: string
2121

2222
case CHECK_VOUCHER_IMAGE = 'check_voucher_image';
2323

24+
case CHECK_SIGNATURE = 'check_signature';
25+
2426
case FORM_SS_4 = 'form_ss_4';
2527

2628
case IDENTITY_DOCUMENT = 'identity_document';

src/Files/FileListParams/Purpose/In.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ enum In: string
2222

2323
case CHECK_VOUCHER_IMAGE = 'check_voucher_image';
2424

25+
case CHECK_SIGNATURE = 'check_signature';
26+
2527
case INBOUND_MAIL_ITEM = 'inbound_mail_item';
2628

2729
case FORM_1099_INT = 'form_1099_int';

tests/Services/CheckTransfersTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ public function testCreateWithOptionalParams(): void
7878
'phone' => 'x',
7979
],
8080
'shippingMethod' => 'usps_first_class',
81-
'signatureText' => 'Ian Crease',
81+
'signature' => [
82+
'imageFileID' => 'image_file_id', 'text' => 'Ian Crease',
83+
],
8284
],
8385
requireApproval: true,
8486
thirdParty: ['recipientName' => 'x'],

0 commit comments

Comments
 (0)