{"openapi":"3.0.0","info":{"description":"AAA-Airlines Travel Agency API\n","version":"1.0.0","title":"AAA-Airlines Travel Agency API","termsOfService":"http://swagger.io/terms/","contact":{"email":"apiteam@swagger.io"},"license":{"name":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"}},"servers":[{"description":"SwaggerHub API Auto Mocking","url":"https://virtserver.swaggerhub.com/alandchang-smoothstack/AAA-Airlines_3.0.0/1.0.0"}],"tags":[{"name":"agency","description":"Everything about your Agencies"},{"name":"flight","description":"Everything about your Flights"},{"name":"airport","description":"Everything about your Airports"},{"name":"ticket","description":"Everything about your Tickets"}],"paths":{"/agent/agencies":{"get":{"tags":["agency"],"summary":"Get all agencies","operationId":"getAllAgencies","parameters":[{"name":"name","in":"query","description":"agency name (optional)","required":false,"explode":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Agency"}}},"application/xml":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Agency"}}}}}}}},"/agent/agencies/{agencyId}":{"get":{"tags":["agency"],"summary":"Find agency by ID","description":"Returns a single agency","operationId":"getAgencyById","parameters":[{"name":"agencyId","in":"path","description":"ID of agency to return","required":true,"explode":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agency"}},"application/xml":{"schema":{"$ref":"#/components/schemas/Agency"}}}},"400":{"description":"Invalid ID supplied"},"404":{"description":"agency not found"}}}},"/agent/flights":{"get":{"tags":["flight"],"summary":"Get all flights","operationId":"getAllFlights","parameters":[{"name":"origin","in":"query","description":"origin airport code","required":false,"explode":false,"schema":{"type":"string","format":"XXX"}},{"name":"destination","in":"query","description":"destination airport code","required":false,"explode":false,"schema":{"type":"string","format":"XXX"}},{"name":"departing","in":"query","description":"flight departure date","required":false,"explode":false,"schema":{"type":"string","format":"XX/XX/XX"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Flight"}}},"application/xml":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Flight"}}}}}}}},"/agent/flights/{flightId}":{"get":{"tags":["flight"],"summary":"Find flight by ID","description":"Returns a single flight","operationId":"getFlightById","parameters":[{"name":"flightId","in":"path","description":"ID of flight to return","required":true,"explode":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Flight"}},"application/xml":{"schema":{"$ref":"#/components/schemas/Flight"}}}},"400":{"description":"Invalid ID supplied"},"404":{"description":"flight not found"}}}},"/agent/airports":{"get":{"tags":["airport"],"summary":"Get all airports","operationId":"getAllAirports","parameters":[{"in":"query","name":"name","description":"airport name (optional)","required":false,"explode":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Airport"}}},"application/xml":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Airport"}}}}}}}},"/agent/airports/{airportId}":{"get":{"tags":["airport"],"summary":"Find airport by ID","description":"Returns a single airport","operationId":"getAirportByID","parameters":[{"name":"airportId","in":"path","description":"ID of airport to return","required":true,"explode":false,"schema":{"type":"string","minLength":3,"maxLength":3}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Airport"}},"application/xml":{"schema":{"$ref":"#/components/schemas/Airport"}}}},"400":{"description":"Invalid ID supplied"},"404":{"description":"airport not found"}}}},"/agent/tickets":{"post":{"tags":["ticket"],"summary":"Book a flight for a customer","operationId":"bookFlight","requestBody":{"$ref":"#/components/requestBodies/Ticket"},"responses":{"201":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ticket"}}}},"400":{"description":"Invalid Ticket"}}}},"/agent/tickets/{ticketId}":{"delete":{"tags":["ticket"],"summary":"Cancel a reservation for a customer","operationId":"cancelReservation","parameters":[{"name":"ticketId","in":"path","description":"ID of the ticket that needs to be deleted","required":true,"explode":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"204":{"description":"successful operation"},"400":{"description":"Invalid ID supplied"}}}}},"externalDocs":{"description":"Find out more about Swagger","url":"http://swagger.io"},"components":{"schemas":{"Agency":{"type":"object","properties":{"agencyId":{"type":"integer","format":"int64"},"agencyName":{"type":"string"},"agencyAddress":{"type":"string"},"agencyPhone":{"type":"string"}},"xml":{"name":"Agency"}},"Flight":{"type":"object","properties":{"flightId":{"type":"integer","format":"int64"},"sourceAirport":{"type":"string","minLength":3,"maxLength":3},"destinationAirport":{"type":"string","minLength":3,"maxLength":3},"destinationTime":{"type":"string","format":"date-time"},"arrivalTime":{"type":"string","format":"date-time"},"cost":{"type":"number","format":"double"},"seatsAvailable":{"type":"integer","format":"int32"}},"xml":{"name":"Flight"}},"Airport":{"type":"object","properties":{"airportCode":{"type":"string","minLength":3,"maxLength":3},"airportName":{"type":"string"},"airportLocation":{"type":"string"}},"xml":{"name":"Airport"}},"Ticket":{"type":"object","properties":{"customerId":{"type":"integer","format":"int64"},"agencyId":{"type":"integer","format":"int64"},"flightId":{"type":"integer","format":"int64"}},"xml":{"name":"Ticket"}}},"requestBodies":{"Ticket":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ticket"}},"application/xml":{"schema":{"$ref":"#/components/schemas/Ticket"}}},"description":"Ticket object to be added","required":true}}}}