Skip to content

Commit

Permalink
Add EnvelopeTagsEndpoint.updateValues endpoint (#232)
Browse files Browse the repository at this point in the history
* Add `EnvelopeTagsEndpoint.updateValues` endpoint

* Add assert for request body

* Fix double space

---------

Co-authored-by: David Kalianko <[email protected]>
Co-authored-by: Pavel Stejskal <[email protected]>
  • Loading branch information
3 people authored Apr 19, 2024
1 parent 197ec5c commit 39823f9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip
- Add `IdentificationResult` claims
- Add `IdentificationsEndpoint.updateResult`
- Add `SignatureScenarioVariant.signDocumentsAtOnce`
- Add `EnvelopeTagsEndpoint.updateValues` endpoint

## [2.3.0] - 2024-03-28
### Added
Expand Down
8 changes: 8 additions & 0 deletions src/Endpoint/EnvelopeTagsEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,12 @@ public function __construct(EnvelopesEndpoint $parent, Envelope|string $envelope
{
parent::__construct($parent, '/{envelope}/tags', EnvelopeTag::class, ['envelope' => $envelope]);
}

/**
* @param mixed[] $body
*/
public function updateValues(array $body): void
{
$this->putRequest('/values', ['json' => $body]);
}
}
6 changes: 6 additions & 0 deletions tests/Endpoint/EnvelopeTagsEndpointTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ public function testCRUD(): void
self::assertCrudRequests(self::endpoint(), '/api/envelopes/bar/tags');
}

public function testUpdateValues(): void
{
self::endpoint()->updateValues(['foo' => 'bar']);
self::assertLastRequest('PUT', '/api/envelopes/bar/tags/values', ['foo' => 'bar']);
}

protected static function endpoint(): EnvelopeTagsEndpoint
{
return self::dgs()->envelopes()->tags('bar');
Expand Down

0 comments on commit 39823f9

Please sign in to comment.