Search in sources :

Example 1 with InvoiceEmailJson

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();
}
Also used : Account(org.killbill.billing.account.api.Account) InvoiceEmailJson(org.killbill.billing.jaxrs.json.InvoiceEmailJson) Path(javax.ws.rs.Path) TimedResource(org.killbill.commons.metrics.TimedResource) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) ApiOperation(io.swagger.annotations.ApiOperation) ApiResponses(io.swagger.annotations.ApiResponses)

Aggregations

ApiOperation (io.swagger.annotations.ApiOperation)1 ApiResponses (io.swagger.annotations.ApiResponses)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1 Account (org.killbill.billing.account.api.Account)1 InvoiceEmailJson (org.killbill.billing.jaxrs.json.InvoiceEmailJson)1 TimedResource (org.killbill.commons.metrics.TimedResource)1