diff --git a/CHANGELOG.md b/CHANGELOG.md index 03371b9..d7e1d9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ All notable changes will be documented in this file. Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles. ## [Unreleased] +- Add `MyEndpoint.updatePreferences` endpoint and `MyPreferences` resource - Add `SignatureScenarioVersionInfo.role` - Add `BatchSendingsEndpoint.send` endpoint - Add `BatchSendingsEndpoint.list` endpoint diff --git a/src/Endpoint/MyEndpoint.php b/src/Endpoint/MyEndpoint.php index 8ad11cb..c054799 100644 --- a/src/Endpoint/MyEndpoint.php +++ b/src/Endpoint/MyEndpoint.php @@ -7,6 +7,7 @@ use DigitalCz\DigiSign\DigiSign; use DigitalCz\DigiSign\Resource\BaseResource; use DigitalCz\DigiSign\Resource\MyInfo; +use DigitalCz\DigiSign\Resource\MyPreferences; /** * @extends ResourceEndpoint @@ -47,4 +48,15 @@ public function identifications(): MyIdentificationsEndpoint { return new MyIdentificationsEndpoint($this); } + + /** + * @param mixed[] $body + */ + public function updatePreferences(array $body): MyPreferences + { + return $this->createResource( + $this->putRequest('/preferences', ['json' => $body]), + MyPreferences::class, + ); + } } diff --git a/src/Resource/MyInfo.php b/src/Resource/MyInfo.php index e20c5d1..9321636 100644 --- a/src/Resource/MyInfo.php +++ b/src/Resource/MyInfo.php @@ -13,4 +13,5 @@ class MyInfo extends BaseResource /** @var string[] */ public array $permissions; public ?MyAccount $account; + public MyPreferences $preferences; } diff --git a/src/Resource/MyPreferences.php b/src/Resource/MyPreferences.php new file mode 100644 index 0000000..07fca78 --- /dev/null +++ b/src/Resource/MyPreferences.php @@ -0,0 +1,13 @@ +updatePreferences(['foo' => 'bar']); + self::assertLastRequest('PUT', '/api/my/preferences', ['foo' => 'bar']); + } + private static function endpoint(): MyEndpoint { return self::dgs()->my();