Nguyễn Việt Đức created JAMES-3355:
--------------------------------------

             Summary: Mailbox/set delete: simple implementation
                 Key: JAMES-3355
                 URL: https://issues.apache.org/jira/browse/JAMES-3355
             Project: James Server
          Issue Type: Improvement
            Reporter: Nguyễn Việt Đức


This should be a simple implementation of the deletion for `Mailbox/set`. It 
should follow the JMAP core specification section /set 
https://jmap.io/spec-core.html#set

**JSON request**

You will need to add to the existing `Mailbox/set` request the following 
property:
* **destroy**: `Id[]|null` A list of ids for Mailbox objects to permanently 
delete, or null if no objects are to be destroyed.

{code:java}
json
{
 "using": [ "urn:ietf:params:jmap:core", "urn:ietf:params:jmap:mail" ],
 "methodCalls": [
 [
 "Mailbox/set", 
 {
 "accountId": "JMAP-ID",
 "ifInState": "123",
 "create": null,
 "destroy": [ "0001", "0002" ]
 }
 ]
 ]
}
{code}

Notes:
* `onDestroyRemoveEmails` will be handled in #1741 . It should not be possible 
to delete a mailbox if it still has some emails in it for the moment, as it's 
the default behavior.
* we need to handle the case of deleting multiple mailboxes in one request

**JSON response**

The existing response should add the following property:
* **destroyed**: `Id[]|null` A list of Mailbox ids for records that were 
successfully destroyed, or null if none.

{code:java}json
{
 "methodResponses": [
 [
 "Mailbox/set", 
 {
 "accountId": "JMAP-ID", // the requested accountId
 "oldState": "123",
 "newState": "124",
 "created": null,
 "destroyed": [ "0001", "0002" ]
 }
 ]
 ], 
 "sessionState": "abc"
}
{code}

Note:
* `notDestroyed` and error handling will be handled in #1742

**DoD**: unit and integration tests (memory and distributed james) + proof of 
deletion of multiple objects in a single request



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org

Reply via email to