use of org.killbill.billing.jaxrs.json.InvoiceEmailJson in project killbill by killbill.
the class AccountResource method getEmailNotificationsForAccount.
/*
* ************************** EMAIL NOTIFICATIONS FOR INVOICES ********************************
*/
@TimedResource
@GET
@Path("/{accountId:" + UUID_PATTERN + "}/" + EMAIL_NOTIFICATIONS)
@Produces(APPLICATION_JSON)
@ApiOperation(value = "Retrieve account email notification", response = InvoiceEmailJson.class)
@ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid account id supplied"), @ApiResponse(code = 404, message = "Account not found") })
public Response getEmailNotificationsForAccount(@PathParam("accountId") final String accountId, @javax.ws.rs.core.Context final HttpServletRequest request) throws AccountApiException {
final Account account = accountUserApi.getAccountById(UUID.fromString(accountId), context.createContext(request));
final InvoiceEmailJson invoiceEmailJson = new InvoiceEmailJson(accountId, account.isNotifiedForInvoices());
return Response.status(Status.OK).entity(invoiceEmailJson).build();
}
Aggregations