View Javadoc
1   package org.oxerr.seatgeek.client.rescu;
2   
3   import java.io.IOException;
4   
5   import org.oxerr.seatgeek.client.model.request.CreateListingRequest;
6   import org.oxerr.seatgeek.client.model.request.UpdateListingRequest;
7   import org.oxerr.seatgeek.client.model.response.MultipleListingsResponse;
8   import org.oxerr.seatgeek.client.model.response.Response;
9   import org.oxerr.seatgeek.client.model.response.SingleListingResponse;
10  
11  import jakarta.ws.rs.Consumes;
12  import jakarta.ws.rs.DELETE;
13  import jakarta.ws.rs.GET;
14  import jakarta.ws.rs.PATCH;
15  import jakarta.ws.rs.PUT;
16  import jakarta.ws.rs.Path;
17  import jakarta.ws.rs.PathParam;
18  import jakarta.ws.rs.Produces;
19  import jakarta.ws.rs.QueryParam;
20  import jakarta.ws.rs.core.MediaType;
21  
22  @Path("/")
23  public interface ListingResource {
24  
25  	@PUT
26  	@Path("/listings/single/{ticket_id}")
27  	@Produces(MediaType.APPLICATION_JSON)
28  	@Consumes(MediaType.APPLICATION_JSON)
29  	Response createListing(
30  		@PathParam("ticket_id") String ticketId,
31  		CreateListingRequest r
32  	) throws IOException;
33  
34  	@PATCH
35  	@Path("/listings/single/{ticket_id}")
36  	@Produces(MediaType.APPLICATION_JSON)
37  	@Consumes(MediaType.APPLICATION_JSON)
38  	UpdateListingRequest updateListing(
39  		@PathParam("ticket_id") String ticketId,
40  		UpdateListingRequest r
41  	) throws IOException;
42  
43  	@GET
44  	@Path("/listings/single/{ticket_id}")
45  	SingleListingResponse getListing(
46  		@PathParam("ticket_id") String ticketId
47  	) throws IOException;
48  
49  	/**
50  	 * Retrieves multiple listings at once.
51  	 *
52  	 * @param listingIds Comma-separated ticket_ids.
53  	 * @param onlyBarcode Defaults to 0. If 1, only return listings that require barcodes.
54  	 * @param page Which page of results?
55  	 * @param perPage Default 500. How many orders per page?
56  	 * @return multiple listings.
57  	 * @throws IOException indicates any I/O exception.
58  	 */
59  	@GET
60  	@Path("/listings")
61  	MultipleListingsResponse getListings(
62  		@QueryParam("listing_ids") String listingIds,
63  		@QueryParam("only_barcode") Integer onlyBarcode,
64  		@QueryParam("page") Integer page,
65  		@QueryParam("per_page") Integer perPage
66  	) throws IOException;
67  
68  	@DELETE
69  	@Path("/listing")
70  	Response deleteListing(@QueryParam("id") String ticketId) throws IOException;
71  
72  }