use of javax.ws.rs.DELETE in project killbill by killbill.
the class PaymentResource method cancelScheduledPaymentTransactionByExternalKey.
@TimedResource(name = "cancelScheduledPaymentTransaction")
@DELETE
@Path("/" + CANCEL_SCHEDULED_PAYMENT_TRANSACTION)
@Consumes(APPLICATION_JSON)
@Produces(APPLICATION_JSON)
@ApiOperation(value = "Cancels a scheduled payment attempt retry")
@ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid paymentTransactionExternalKey supplied") })
public Response cancelScheduledPaymentTransactionByExternalKey(@QueryParam(QUERY_TRANSACTION_EXTERNAL_KEY) final String paymentTransactionExternalKey, @HeaderParam(HDR_CREATED_BY) final String createdBy, @HeaderParam(HDR_REASON) final String reason, @HeaderParam(HDR_COMMENT) final String comment, @javax.ws.rs.core.Context final UriInfo uriInfo, @javax.ws.rs.core.Context final HttpServletRequest request) throws PaymentApiException, AccountApiException {
final CallContext callContext = context.createContext(createdBy, reason, comment, request);
paymentApi.cancelScheduledPaymentTransaction(paymentTransactionExternalKey, callContext);
return Response.status(Status.OK).build();
}
use of javax.ws.rs.DELETE in project killbill by killbill.
the class PaymentMethodResource method deletePaymentMethod.
@TimedResource
@DELETE
@Produces(APPLICATION_JSON)
@Path("/{paymentMethodId:" + UUID_PATTERN + "}")
@ApiOperation(value = "Delete a payment method")
@ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid paymentMethodId supplied"), @ApiResponse(code = 404, message = "Account or payment method not found") })
public Response deletePaymentMethod(@PathParam("paymentMethodId") final String paymentMethodId, @QueryParam(QUERY_DELETE_DEFAULT_PM_WITH_AUTO_PAY_OFF) @DefaultValue("false") final Boolean deleteDefaultPaymentMethodWithAutoPayOff, @QueryParam(QUERY_FORCE_DEFAULT_PM_DELETION) @DefaultValue("false") final Boolean forceDefaultPaymentMethodDeletion, @QueryParam(QUERY_PLUGIN_PROPERTY) final List<String> pluginPropertiesString, @HeaderParam(HDR_CREATED_BY) final String createdBy, @HeaderParam(HDR_REASON) final String reason, @HeaderParam(HDR_COMMENT) final String comment, @javax.ws.rs.core.Context final HttpServletRequest request) throws PaymentApiException, AccountApiException {
final Iterable<PluginProperty> pluginProperties = extractPluginProperties(pluginPropertiesString);
final CallContext callContext = context.createContext(createdBy, reason, comment, request);
final PaymentMethod paymentMethod = paymentApi.getPaymentMethodById(UUID.fromString(paymentMethodId), false, false, pluginProperties, callContext);
final Account account = accountUserApi.getAccountById(paymentMethod.getAccountId(), callContext);
paymentApi.deletePaymentMethod(account, UUID.fromString(paymentMethodId), deleteDefaultPaymentMethodWithAutoPayOff, forceDefaultPaymentMethodDeletion, pluginProperties, callContext);
return Response.status(Status.OK).build();
}
use of javax.ws.rs.DELETE in project presto by prestodb.
the class TaskResource method deleteTask.
@DELETE
@Path("{taskId}")
@Produces(MediaType.APPLICATION_JSON)
public TaskInfo deleteTask(@PathParam("taskId") TaskId taskId, @QueryParam("abort") @DefaultValue("true") boolean abort, @Context UriInfo uriInfo) {
requireNonNull(taskId, "taskId is null");
TaskInfo taskInfo;
if (abort) {
taskInfo = taskManager.abortTask(taskId);
} else {
taskInfo = taskManager.cancelTask(taskId);
}
if (shouldSummarize(uriInfo)) {
taskInfo = taskInfo.summarize();
}
return taskInfo;
}
use of javax.ws.rs.DELETE in project exhibitor by soabase.
the class IndexResource method deleteIndex.
@Path("{index-name}")
@DELETE
@Produces(MediaType.APPLICATION_JSON)
public Response deleteIndex(@PathParam("index-name") String indexName) {
File indexFile = getLogFile(indexName);
context.getExhibitor().getIndexCache().markForDeletion(indexFile);
return Response.ok(new Result("OK", true)).build();
}
use of javax.ws.rs.DELETE in project keywhiz by square.
the class GroupResource method deleteGroup.
/**
* Delete a group
*
* @excludeParams automationClient
* @param name Group name to delete
*
* @responseMessage 204 Group deleted
* @responseMessage 404 Group not found
*/
@Timed
@ExceptionMetered
@DELETE
@Path("{name}")
public Response deleteGroup(@Auth AutomationClient automationClient, @PathParam("name") String name) {
Group group = groupDAOReadWrite.getGroup(name).orElseThrow(NotFoundException::new);
// Group memberships are deleted automatically by DB cascading.
groupDAOReadWrite.deleteGroup(group);
auditLog.recordEvent(new Event(Instant.now(), EventTag.GROUP_DELETE, automationClient.getName(), group.getName()));
return Response.noContent().build();
}
Aggregations