From 2248d7069f2aa2bc35f8e55b006cbde102f76177 Mon Sep 17 00:00:00 2001 From: Syed Ali Shahbaz <52925846+alishaz-polymath@users.noreply.github.com> Date: Thu, 9 Feb 2023 05:46:32 +0530 Subject: [PATCH] Improves Destination Calendar docs in swagger (#235) Adds swagger definition to `destination-calendar` endpoint --- pages/api/destination-calendars/[id].ts | 60 ++++++++++++++++++++++-- pages/api/destination-calendars/index.ts | 41 +++++++++++++++- 2 files changed, 94 insertions(+), 7 deletions(-) diff --git a/pages/api/destination-calendars/[id].ts b/pages/api/destination-calendars/[id].ts index 61daae15c8..1f521c40d7 100644 --- a/pages/api/destination-calendars/[id].ts +++ b/pages/api/destination-calendars/[id].ts @@ -40,8 +40,14 @@ export async function destionationCalendarById( * type: integer * required: true * description: ID of the destination calendar to get + * - in: query + * name: apiKey + * required: true + * schema: + * type: string + * description: Your API key * tags: - * - destination-calendars + * - destination-calendars * responses: * 200: * description: OK @@ -58,8 +64,34 @@ export async function destionationCalendarById( * type: integer * required: true * description: ID of the destination calendar to edit + * - in: query + * name: apiKey + * required: true + * schema: + * type: string + * description: Your API key + * requestBody: + * description: Create a new booking related to one of your event-types + * required: true + * content: + * application/json: + * schema: + * type: object + * properties: + * integration: + * type: string + * description: 'The integration' + * externalId: + * type: string + * description: 'The external ID of the integration' + * eventTypeId: + * type: integer + * description: 'The ID of the eventType it is associated with' + * bookingId: + * type: integer + * description: 'The booking ID it is associated with' * tags: - * - destination-calendars + * - destination-calendars * responses: * 201: * description: OK, destinationCalendar edited successfuly @@ -76,8 +108,14 @@ export async function destionationCalendarById( * type: integer * required: true * description: ID of the destination calendar to delete + * - in: query + * name: apiKey + * required: true + * schema: + * type: string + * description: Your API key * tags: - * - destination-calendars + * - destination-calendars * responses: * 201: * description: OK, destinationCalendar removed successfuly @@ -110,8 +148,14 @@ export async function destionationCalendarById( * type: integer * required: true * description: ID of the destination calendar to edit + * - in: query + * name: apiKey + * required: true + * schema: + * type: string + * description: Your API key * tags: - * - destination-calendars + * - destination-calendars * responses: * 201: * description: OK, destinationCalendar edited successfuly @@ -150,8 +194,14 @@ export async function destionationCalendarById( * type: integer * required: true * description: ID of the destination calendar to delete + * - in: query + * name: apiKey + * required: true + * schema: + * type: string + * description: Your API key * tags: - * - destination-calendars + * - destination-calendars * responses: * 201: * description: OK, destinationCalendar removed successfuly diff --git a/pages/api/destination-calendars/index.ts b/pages/api/destination-calendars/index.ts index 3690dfa359..2143ba0d0a 100644 --- a/pages/api/destination-calendars/index.ts +++ b/pages/api/destination-calendars/index.ts @@ -16,9 +16,16 @@ async function createOrlistAllDestinationCalendars( * @swagger * /destination-calendars: * get: + * parameters: + * - in: query + * name: apiKey + * required: true + * schema: + * type: string + * description: Your API key * summary: Find all destination calendars * tags: - * - destination-calendars + * - destination-calendars * responses: * 200: * description: OK @@ -43,9 +50,39 @@ async function createOrlistAllDestinationCalendars( * @swagger * /destination-calendars: * post: + * parameters: + * - in: query + * name: apiKey + * required: true + * schema: + * type: string + * description: Your API key * summary: Creates a new destination calendar + * requestBody: + * description: Create a new destination calendar for your events + * required: true + * content: + * application/json: + * schema: + * type: object + * required: + * - integration + * - externalId + * properties: + * integration: + * type: string + * description: 'The integration' + * externalId: + * type: string + * description: 'The external ID of the integration' + * eventTypeId: + * type: integer + * description: 'The ID of the eventType it is associated with' + * bookingId: + * type: integer + * description: 'The booking ID it is associated with' * tags: - * - destination-calendars + * - destination-calendars * responses: * 201: * description: OK, destination calendar created