1 package org.oxerr.vividseats.client.rescu.resource; 2 3 import java.io.IOException; 4 5 import org.oxerr.vividseats.client.model.BrokerListing; 6 7 import io.github.poshjosh.ratelimiter.annotations.Rate; 8 import jakarta.ws.rs.Consumes; 9 import jakarta.ws.rs.DELETE; 10 import jakarta.ws.rs.GET; 11 import jakarta.ws.rs.POST; 12 import jakarta.ws.rs.PUT; 13 import jakarta.ws.rs.Path; 14 import jakarta.ws.rs.Produces; 15 import jakarta.ws.rs.QueryParam; 16 import jakarta.ws.rs.core.MediaType; 17 18 @Path("/listings/v2") 19 @Produces(MediaType.APPLICATION_JSON) 20 @Consumes(MediaType.APPLICATION_JSON) 21 public interface ListingResource { 22 23 /** 24 * Retrieves listings. 25 * 26 * Rate limit: 10 requests per second. 27 * 28 * @param fromEventDate The start date of the event. 29 * @param toEventDate The end date of the event. 30 * @param listingId The listing id. 31 * @param internalTicketId The internal ticket id. 32 * @param productionId The production id. 33 * @param headlinerId The headliner id. 34 * @param includeFiles Whether to include files. 35 * @return listings. 36 * @throws IOException if an I/O error occurs. 37 * @throws VividSeatsException if an error response is returned. 38 */ 39 @GET 40 @Path("/get") 41 @Rate(10) 42 ListingsResponse get( 43 @QueryParam("fromEventDate") String fromEventDate, 44 @QueryParam("toEventDate") String toEventDate, 45 @QueryParam("listingId") Long listingId, 46 @QueryParam("internalTicketId") String internalTicketId, 47 @QueryParam("productionId") Integer productionId, 48 @QueryParam("headlinerId") Integer headlinerId, 49 @QueryParam("includeFiles") Boolean includeFiles 50 ) throws IOException, VividSeatsException; 51 52 /** 53 * Creates a listing. 54 * 55 * Either productionId or eventName, venue, eventDate is required. If the 56 * eventName|venue|eventDate parameters are used, the create request may be sent 57 * to mapping. If the productionId is included in the request or our system can 58 * determine the productionId from the eventName|venue|eventDate parameters, the 59 * listing will be returned in the response. This method will only work if the 60 * Content-Type header is set to application/json. 61 * 62 * Rate limit: 50 requests per second. 63 * 64 * @param brokerListing The broker listing to create. 65 * @return the created listing. 66 * @throws IOException if an I/O error occurs. 67 * @throws VividSeatsException if an error response is returned. 68 */ 69 @POST 70 @Path("/create") 71 @Rate(50) 72 ListingResponse create(BrokerListing brokerListing) throws IOException, VividSeatsException; 73 74 /** 75 * Updates a listing. 76 * 77 * All the fields including attributes and tickets will be updated with the 78 * object passed in. This method will only work if the Content-Type header is 79 * set to application/json. An alternative version is /listings/v1/updateListing 80 * as it only requires you to supply your internal ticketID. If you want to use 81 * v2 and you only have a ticketId then you need to get the listing by ticket id 82 * first. 83 * 84 * Rate limit: 50 requests per second. 85 * 86 * @param brokerListing The broker listing to update. 87 * @throws IOException if an I/O error occurs. 88 * @throws VividSeatsException if an error response is returned. 89 */ 90 @PUT 91 @Path("/update") 92 @Rate(50) 93 Response update(BrokerListing brokerListing) throws IOException, VividSeatsException; 94 95 /** 96 * Deletes a listing. 97 * 98 * Either the ticketId or listingId is required. 99 * 100 * Rate limit: 50 requests per second. 101 * 102 * @param listingId The listing id. 103 * @param internalTicketId The internal ticket id. 104 * @return the response. 105 * @throws IOException if an I/O error occurs. 106 * @throws VividSeatsException if an error response is returned. 107 */ 108 @DELETE 109 @Path("/delete") 110 @Rate(50) 111 Response delete( 112 @QueryParam("listingId") Long listingId, 113 @QueryParam("internalTicketId") String internalTicketId 114 ) throws IOException, VividSeatsException; 115 116 }