From dc17af6f3d06d6d669bdfef8ddbe1e9d7d4b78af Mon Sep 17 00:00:00 2001 From: pavelvais Date: Wed, 4 Sep 2024 10:34:51 +0200 Subject: [PATCH 1/4] Extend `EnvelopeRecipient` and `EnvelopeTemplateRecipient` resource --- CHANGELOG.md | 1 + src/Resource/EnvelopeRecipient.php | 6 ++++++ src/Resource/EnvelopeTemplateRecipient.php | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index de2ca12..9139280 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ All notable changes will be documented in this file. Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles. ## [Unreleased] +- Extend `EnvelopeRecipient` and `EnvelopeTemplateRecipient` resource - Add `Webhook oAuth properties` - Add `ForbiddenException` - Add `AccountBilling.productType` diff --git a/src/Resource/EnvelopeRecipient.php b/src/Resource/EnvelopeRecipient.php index 3be01c8..58f5278 100644 --- a/src/Resource/EnvelopeRecipient.php +++ b/src/Resource/EnvelopeRecipient.php @@ -25,6 +25,12 @@ class EnvelopeRecipient extends BaseResource public string $authenticationOnDownload; + public ?string $autoplacementTagPlaceholder = null; + + public ?string $autoplacementTagPositioning = null; + + public ?int $autoplacementTagSize = null; + public string $language; public string $channelForSigner; diff --git a/src/Resource/EnvelopeTemplateRecipient.php b/src/Resource/EnvelopeTemplateRecipient.php index 5c3921b..1e3a882 100644 --- a/src/Resource/EnvelopeTemplateRecipient.php +++ b/src/Resource/EnvelopeTemplateRecipient.php @@ -22,6 +22,12 @@ class EnvelopeTemplateRecipient extends BaseResource public string $authenticationOnDownload; + public ?string $autoplacementTagPlaceholder = null; + + public ?string $autoplacementTagPositioning = null; + + public ?int $autoplacementTagSize = null; + public ?string $name = null; public ?string $email = null; From 1099312153976b3fb66e0f37756c8fc1f3563ddb Mon Sep 17 00:00:00 2001 From: pavelvais Date: Thu, 5 Sep 2024 12:50:05 +0200 Subject: [PATCH 2/4] Add `EnvelopeDocument.createAutoplacementTags` endpoint --- CHANGELOG.md | 1 + src/Endpoint/EnvelopeDocumentsEndpoint.php | 11 +++++++++++ tests/Endpoint/EnvelopeDocumentsEndpointTest.php | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9139280..c55ba78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip ## [Unreleased] - Extend `EnvelopeRecipient` and `EnvelopeTemplateRecipient` resource +- Add `EnvelopeDocument.createAutoplacementTags` endpoint - Add `Webhook oAuth properties` - Add `ForbiddenException` - Add `AccountBilling.productType` diff --git a/src/Endpoint/EnvelopeDocumentsEndpoint.php b/src/Endpoint/EnvelopeDocumentsEndpoint.php index d0edcd7..187c50d 100644 --- a/src/Endpoint/EnvelopeDocumentsEndpoint.php +++ b/src/Endpoint/EnvelopeDocumentsEndpoint.php @@ -68,6 +68,17 @@ public function tags(string $id, array $query = []): ListResource ); } + /** + * @return ListResource + */ + public function createAutoplacementTags(string $document): ListResource + { + return $this->createListResource( + $this->postRequest('/{document}/tags/by-autoplacement', ['document' => $document]), + EnvelopeTag::class, + ); + } + /** * @param mixed[] $body */ diff --git a/tests/Endpoint/EnvelopeDocumentsEndpointTest.php b/tests/Endpoint/EnvelopeDocumentsEndpointTest.php index 3c837b8..c8a097a 100644 --- a/tests/Endpoint/EnvelopeDocumentsEndpointTest.php +++ b/tests/Endpoint/EnvelopeDocumentsEndpointTest.php @@ -43,6 +43,12 @@ public function testTags(): void self::assertLastRequest('GET', '/api/envelopes/bar/documents/foo/tags?foo=bar'); } + public function testAutoplacementTags(): void + { + self::endpoint()->createAutoplacementTags('foo'); + self::assertLastRequest('POST', '/api/envelopes/bar/documents/foo/tags/by-autoplacement'); + } + public function testReplaceFile(): void { self::endpoint()->replaceFile('foo', ['foo' => 'bar']); From 11b0dad21e0f2ce0eb7a999de4ee59483381a3bc Mon Sep 17 00:00:00 2001 From: pavelvais Date: Thu, 5 Sep 2024 13:30:03 +0200 Subject: [PATCH 3/4] renamed `createAutoplacementTags` function to `createTagsByAutoplacement` --- src/Endpoint/EnvelopeDocumentsEndpoint.php | 2 +- tests/Endpoint/EnvelopeDocumentsEndpointTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Endpoint/EnvelopeDocumentsEndpoint.php b/src/Endpoint/EnvelopeDocumentsEndpoint.php index 187c50d..2a09f66 100644 --- a/src/Endpoint/EnvelopeDocumentsEndpoint.php +++ b/src/Endpoint/EnvelopeDocumentsEndpoint.php @@ -71,7 +71,7 @@ public function tags(string $id, array $query = []): ListResource /** * @return ListResource */ - public function createAutoplacementTags(string $document): ListResource + public function createTagsByAutoplacement(string $document): ListResource { return $this->createListResource( $this->postRequest('/{document}/tags/by-autoplacement', ['document' => $document]), diff --git a/tests/Endpoint/EnvelopeDocumentsEndpointTest.php b/tests/Endpoint/EnvelopeDocumentsEndpointTest.php index c8a097a..cd922e1 100644 --- a/tests/Endpoint/EnvelopeDocumentsEndpointTest.php +++ b/tests/Endpoint/EnvelopeDocumentsEndpointTest.php @@ -43,9 +43,9 @@ public function testTags(): void self::assertLastRequest('GET', '/api/envelopes/bar/documents/foo/tags?foo=bar'); } - public function testAutoplacementTags(): void + public function testTagsByAutoplacement(): void { - self::endpoint()->createAutoplacementTags('foo'); + self::endpoint()->createTagsByAutoplacement('foo'); self::assertLastRequest('POST', '/api/envelopes/bar/documents/foo/tags/by-autoplacement'); } From 6a3081c8f4897e05460e5360ec2239442e40944a Mon Sep 17 00:00:00 2001 From: pavelvais Date: Thu, 5 Sep 2024 13:30:41 +0200 Subject: [PATCH 4/4] renamed `createAutoplacementTags` function to `createTagsByAutoplacement` --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c55ba78..33dfce9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip ## [Unreleased] - Extend `EnvelopeRecipient` and `EnvelopeTemplateRecipient` resource -- Add `EnvelopeDocument.createAutoplacementTags` endpoint +- Add `EnvelopeDocument.createTagsByAutoplacement` endpoint - Add `Webhook oAuth properties` - Add `ForbiddenException` - Add `AccountBilling.productType`