diff --git a/CHANGELOG.md b/CHANGELOG.md index 460e5a1..ed811ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes will be documented in this file. Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles. +## [Unreleased] +### Added +- Add `envelopeAnonymizeRetention` and `envelopeAnonymizeGroups` to `AccountSecurity` +- Add `anonymizeAt` and `anonymizedAt` to `Envelope` +- Add anonymize action to `Envelope` + ## [2.1.0] - 2023-07-12 ### Added - Add `AccountSecurity.auditLogDownloadDefaultUnchecked` diff --git a/src/Endpoint/EnvelopesEndpoint.php b/src/Endpoint/EnvelopesEndpoint.php index 78c2166..d3f0a7f 100644 --- a/src/Endpoint/EnvelopesEndpoint.php +++ b/src/Endpoint/EnvelopesEndpoint.php @@ -122,6 +122,14 @@ public function discard(Envelope|string $id, array $body = []): Envelope return $this->makeResource($this->postRequest('/{id}/discard', ['id' => $id, 'json' => $body])); } + /** + * @param mixed[] $body + */ + public function anonymize(Envelope|string $id, array $body = []): Envelope + { + return $this->makeResource($this->postRequest('/{id}/anonymize', ['id' => $id, 'json' => $body])); + } + public function restore(Envelope|string $id): Envelope { return $this->makeResource($this->postRequest('/{id}/restore', ['id' => $id])); diff --git a/src/Resource/AccountSecurity.php b/src/Resource/AccountSecurity.php index 7f9bd5e..02d1a76 100644 --- a/src/Resource/AccountSecurity.php +++ b/src/Resource/AccountSecurity.php @@ -20,6 +20,13 @@ class AccountSecurity extends BaseResource public int $discardedEnvelopeRetention; + public ?int $envelopeAnonymizeRetention; + + /** + * @var array + */ + public array $envelopeAnonymizeGroups; + public bool $continuousSigning; public bool $auditLogDownloadDefaultUnchecked; diff --git a/src/Resource/Envelope.php b/src/Resource/Envelope.php index 5a78a54..5cc1c1e 100644 --- a/src/Resource/Envelope.php +++ b/src/Resource/Envelope.php @@ -57,6 +57,10 @@ class Envelope extends BaseResource public ?DateTime $discardedAt = null; + public ?DateTime $anonymizeAt = null; + + public ?DateTime $anonymizedAt = null; + /** @var Collection */ public Collection $recipients; diff --git a/tests/Endpoint/EnvelopesEndpointTest.php b/tests/Endpoint/EnvelopesEndpointTest.php index 329b5ae..6206927 100644 --- a/tests/Endpoint/EnvelopesEndpointTest.php +++ b/tests/Endpoint/EnvelopesEndpointTest.php @@ -89,6 +89,12 @@ public function testDiscard(): void self::assertLastRequest('POST', '/api/envelopes/foo/discard'); } + public function testAnonymize(): void + { + self::endpoint()->anonymize('foo', ['foo' => 'bar']); + self::assertLastRequest('POST', '/api/envelopes/foo/anonymize'); + } + public function testValidate(): void { self::endpoint()->validate('foo');