Benoit Tellier created JAMES-3359:
-------------------------------------

             Summary: Mailbox/set update: name implementation
                 Key: JAMES-3359
                 URL: https://issues.apache.org/jira/browse/JAMES-3359
             Project: James Server
          Issue Type: Improvement
            Reporter: Benoit Tellier


This is a first simple implementation of the update part of Mailbox/set. It 
should follow the JMAP core specification section /set 
https://jmap.io/spec-core.html#set

For this time, we just focus here on being able to update the name of a 
mailbox. The rest will follow up in other tickets.

**JSON request**

You will need to add to the existing `Mailbox/set` request the following 
property:
* **update**: `Id[PatchObject]|null` A map of an id to a Patch object to apply 
to the current Foo object with that id, or null if no objects are to be updated.

For now, only the `name` property is allowed to be updated.

{code:json}
{
   "using": [ "urn:ietf:params:jmap:core", "urn:ietf:params:jmap:mail" ],
   "methodCalls": [
       [
           "Mailbox/set", 
           {
                "accountId": "JMAP-ID",
                "ifInState": "123",
                "create": null,
                "update": {
                    "001": {
                        "name": "new mailbox"
                    }
                },
                "destroy": null
           }
       ]
   ]
}
{code}


**JSON response**

The existing response should add the following property:
* **updated**: `Id[Mailbox|null]|null` The keys in this map are the ids of all 
Mailboxes that were successfully updated.

The value for each id is a Mailbox object containing any property that changed 
in a way not explicitly requested by the PatchObject sent to the server, or 
null if none. This lets the client know of any changes to server-set or 
computed properties.

This argument is null if no Mailbox objects were successfully updated.

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

Notes:
* `notUpdated` and errors will be handled in #1747 

**DoD**: unit and integration tests (memory and distributed james)



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to