-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
soap/src/main/java/com/zimbra/soap/mail/message/DeleteCalendarGroupRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// SPDX-FileCopyrightText: 2022 Synacor, Inc. | ||
// SPDX-FileCopyrightText: 2022 Zextras <https://www.zextras.com> | ||
// | ||
// SPDX-License-Identifier: GPL-2.0-only | ||
|
||
package com.zimbra.soap.mail.message; | ||
|
||
import com.zimbra.common.soap.MailConstants; | ||
|
||
import javax.xml.bind.annotation.XmlAttribute; | ||
import javax.xml.bind.annotation.XmlElement; | ||
import javax.xml.bind.annotation.XmlRootElement; | ||
import java.util.List; | ||
|
||
/** | ||
* @zm-api-command-auth-required true | ||
* @zm-api-command-admin-auth-required false | ||
* @zm-api-command-description Delete a new Calendar Group | ||
*/ | ||
@XmlRootElement(name = MailConstants.E_DELETE_CALENDAR_GROUP_REQUEST) | ||
public class DeleteCalendarGroupRequest { | ||
/** no-argument constructor wanted by JAXB */ | ||
public DeleteCalendarGroupRequest() {} | ||
|
||
/** | ||
* @zm-api-field-tag id | ||
* @zm-api-field-description Calendar Group id | ||
*/ | ||
@XmlAttribute(name = "id" /* id */, required = true) | ||
private String id; | ||
|
||
public String getId() { | ||
return id; | ||
} | ||
|
||
public void setId(String id) { | ||
this.id = id; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
soap/src/main/java/com/zimbra/soap/mail/message/DeleteCalendarGroupResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// SPDX-FileCopyrightText: 2022 Synacor, Inc. | ||
// SPDX-FileCopyrightText: 2022 Zextras <https://www.zextras.com> | ||
// | ||
// SPDX-License-Identifier: GPL-2.0-only | ||
|
||
package com.zimbra.soap.mail.message; | ||
|
||
import com.zimbra.common.soap.MailConstants; | ||
|
||
import javax.xml.bind.annotation.XmlAttribute; | ||
import javax.xml.bind.annotation.XmlRootElement; | ||
|
||
@XmlRootElement(name = MailConstants.E_DELETE_CALENDAR_GROUP_RESPONSE) | ||
public class DeleteCalendarGroupResponse { | ||
} |
30 changes: 30 additions & 0 deletions
30
store/src/main/java/com/zimbra/cs/service/mail/DeleteCalendarGroup.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.zimbra.cs.service.mail; | ||
|
||
import com.zimbra.common.service.ServiceException; | ||
import com.zimbra.common.soap.Element; | ||
import com.zimbra.common.soap.MailConstants; | ||
import com.zimbra.soap.mail.message.DeleteCalendarGroupRequest; | ||
|
||
import java.util.Map; | ||
|
||
public class DeleteCalendarGroup extends MailDocumentHandler { | ||
|
||
@Override | ||
public Element handle(Element request, Map<String, Object> context) throws ServiceException { | ||
final var zsc = getZimbraSoapContext(context); | ||
final var account = getRequestedAccount(zsc); | ||
|
||
if (!canAccessAccount(zsc, account)) | ||
throw ServiceException.PERM_DENIED("can not access account"); | ||
|
||
final var mbox = getRequestedMailbox(zsc); | ||
final var octxt = getOperationContext(zsc, context); | ||
|
||
DeleteCalendarGroupRequest req = zsc.elementToJaxb(request); | ||
|
||
mbox.deleteFolder(octxt, req.getId()); | ||
|
||
return zsc.createElement(MailConstants.DELETE_CALENDAR_GROUP_RESPONSE); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters