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

Add anonymize action and property values to AccountSecurity.php and E… #175

Merged
merged 2 commits into from
Sep 6, 2023
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
8 changes: 8 additions & 0 deletions src/Endpoint/EnvelopesEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]));
Expand Down
7 changes: 7 additions & 0 deletions src/Resource/AccountSecurity.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ class AccountSecurity extends BaseResource

public int $discardedEnvelopeRetention;

public ?int $envelopeAnonymizeRetention;

/**
* @var array<string>
*/
public array $envelopeAnonymizeGroups;

public bool $continuousSigning;

public bool $auditLogDownloadDefaultUnchecked;
Expand Down
4 changes: 4 additions & 0 deletions src/Resource/Envelope.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ class Envelope extends BaseResource

public ?DateTime $discardedAt = null;

public ?DateTime $anonymizeAt = null;

public ?DateTime $anonymizedAt = null;

/** @var Collection<EnvelopeRecipient> */
public Collection $recipients;

Expand Down
6 changes: 6 additions & 0 deletions tests/Endpoint/EnvelopesEndpointTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down