Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend EnvelopeRecipient and EnvelopeTemplateRecipient resources #258

Merged
merged 4 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ 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 `EnvelopeDocument.createTagsByAutoplacement` endpoint
- Add `Webhook oAuth properties`
- Add `ForbiddenException`
- Add `AccountBilling.productType`
Expand Down
11 changes: 11 additions & 0 deletions src/Endpoint/EnvelopeDocumentsEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,17 @@ public function tags(string $id, array $query = []): ListResource
);
}

/**
* @return ListResource<EnvelopeTag>
*/
public function createTagsByAutoplacement(string $document): ListResource
{
return $this->createListResource(
$this->postRequest('/{document}/tags/by-autoplacement', ['document' => $document]),
EnvelopeTag::class,
);
}

/**
* @param mixed[] $body
*/
Expand Down
6 changes: 6 additions & 0 deletions src/Resource/EnvelopeRecipient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions src/Resource/EnvelopeTemplateRecipient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions tests/Endpoint/EnvelopeDocumentsEndpointTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ public function testTags(): void
self::assertLastRequest('GET', '/api/envelopes/bar/documents/foo/tags?foo=bar');
}

public function testTagsByAutoplacement(): void
{
self::endpoint()->createTagsByAutoplacement('foo');
self::assertLastRequest('POST', '/api/envelopes/bar/documents/foo/tags/by-autoplacement');
}

public function testReplaceFile(): void
{
self::endpoint()->replaceFile('foo', ['foo' => 'bar']);
Expand Down