Skip to content

Commit

Permalink
Add EnvelopeDocument.createAutoplacementTags endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelvais committed Sep 5, 2024
1 parent dc17af6 commit 1099312
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
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 createAutoplacementTags(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 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 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']);
Expand Down

0 comments on commit 1099312

Please sign in to comment.