diff --git a/OPENAPI_DOC.yml b/OPENAPI_DOC.yml index 0501d26..f98e6b6 100644 --- a/OPENAPI_DOC.yml +++ b/OPENAPI_DOC.yml @@ -194,6 +194,14 @@ paths: schema: type: integer format: Int32 + - name: recurrence + in: query + description: the recurring bookings index of the result set. Used to implement + pagination with recurring bookings + required: false + schema: + type: integer + format: Int32 - name: permission in: query description: 'filters bookings based on the permission level. Options: PRIVATE, @@ -520,97 +528,762 @@ paths: schema: type: integer format: Int64 - nullable: true - - name: created_after - in: query - description: filters bookings that were created after the unix epoch specified - example: "1661743123" - required: false + nullable: true + - name: created_after + in: query + description: filters bookings that were created after the unix epoch specified + example: "1661743123" + required: false + schema: + type: integer + format: Int64 + nullable: true + - name: approved + in: query + description: filters bookings that are approved or not + example: "true" + required: false + schema: + type: boolean + nullable: true + - name: rejected + in: query + description: filters bookings that are rejected or not + example: "true" + required: false + schema: + type: boolean + nullable: true + - name: extension_data + in: query + description: filters bookings with matching extension data entries + example: '{"entry1":"value to match","entry2":1234}' + required: false + schema: + type: string + nullable: true + - name: state + in: query + description: filters on the booking process state, a user defined value + example: pending-approval + required: false + schema: + type: string + nullable: true + - name: department + in: query + description: filters bookings owned by a department, a user defined value + example: accounting + required: false + schema: + type: string + nullable: true + - name: event_id + in: query + description: filters bookings associated with an event, such as an Office365 + Calendar event id + example: AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZe + required: false + schema: + type: string + nullable: true + - name: ical_uid + in: query + description: filters bookings associated with an event, such as an Office365 + Calendar event ical_uid + example: 19rh93h5t893h5v@calendar.iCloud.com + required: false + schema: + type: string + nullable: true + - name: limit + in: query + description: the maximum number of results to return + example: "10000" + required: false + schema: + type: integer + format: Int32 + - name: offset + in: query + description: the starting offset of the result set. Used to implement pagination + required: false + schema: + type: integer + format: Int32 + - name: permission + in: query + description: 'filters bookings based on the permission level. Options: PRIVATE, + OPEN, PUBLIC' + example: PUBLIC + required: false + schema: + type: string + nullable: true + responses: + 200: + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/String' + 429: + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 400: + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 401: + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 403: + description: Forbidden + 404: + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 511: + description: Network Authentication Required + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 406: + description: Not Acceptable + content: + application/json: + schema: + $ref: '#/components/schemas/Application__ContentError' + 415: + description: Unsupported Media Type + content: + application/json: + schema: + $ref: '#/components/schemas/Application__ContentError' + 422: + description: Unprocessable Entity + content: + application/json: + schema: + $ref: '#/components/schemas/Application__ValidationError' + 500: + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 405: + description: Method Not Allowed + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 409: + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Bookings__BookingError' + 410: + description: Gone + content: + application/json: + schema: + $ref: '#/components/schemas/Bookings__BookingError' + /api/staff/v1/bookings/{id}: + get: + summary: returns the booking requested + tags: + - Bookings + operationId: Bookings#show + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: Int64 + - name: instance + in: query + description: a recurring instance id + example: "1234567" + required: false + schema: + type: integer + format: Int64 + nullable: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PlaceOS__Model__Booking' + 429: + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 400: + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 401: + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 403: + description: Forbidden + 404: + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 511: + description: Network Authentication Required + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 406: + description: Not Acceptable + content: + application/json: + schema: + $ref: '#/components/schemas/Application__ContentError' + 415: + description: Unsupported Media Type + content: + application/json: + schema: + $ref: '#/components/schemas/Application__ContentError' + 422: + description: Unprocessable Entity + content: + application/json: + schema: + $ref: '#/components/schemas/Application__ValidationError' + 500: + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 405: + description: Method Not Allowed + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 409: + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Bookings__BookingError' + 410: + description: Gone + content: + application/json: + schema: + $ref: '#/components/schemas/Bookings__BookingError' + put: + summary: patches an existing booking with the changes provided + tags: + - Bookings + operationId: Bookings#update + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PlaceOS__Model__Booking' + required: true + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: Int64 + - name: limit_override + in: query + description: allows a client to override any limits imposed on bookings + example: "3" + required: false + schema: + type: integer + format: Int32 + nullable: true + - name: instance + in: query + description: a recurring instance + example: "1234567" + required: false + schema: + type: integer + format: Int64 + nullable: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PlaceOS__Model__Booking' + 429: + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 400: + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 401: + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 403: + description: Forbidden + 404: + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 511: + description: Network Authentication Required + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 406: + description: Not Acceptable + content: + application/json: + schema: + $ref: '#/components/schemas/Application__ContentError' + 415: + description: Unsupported Media Type + content: + application/json: + schema: + $ref: '#/components/schemas/Application__ContentError' + 422: + description: Unprocessable Entity + content: + application/json: + schema: + $ref: '#/components/schemas/Application__ValidationError' + 500: + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 405: + description: Method Not Allowed + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 409: + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Bookings__BookingError' + 410: + description: Gone + content: + application/json: + schema: + $ref: '#/components/schemas/Bookings__BookingError' + delete: + summary: marks the provided booking as deleted + tags: + - Bookings + operationId: Bookings#destroy + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: Int64 + - name: utm_source + in: query + description: provided for use with analytics + example: mobile + required: false + schema: + type: string + nullable: true + - name: instance + in: query + description: a recurring instance id + example: "1234567" + required: false + schema: + type: integer + format: Int64 + nullable: true + responses: + 202: + description: Accepted + 429: + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 400: + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 401: + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 403: + description: Forbidden + 404: + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 511: + description: Network Authentication Required + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 406: + description: Not Acceptable + content: + application/json: + schema: + $ref: '#/components/schemas/Application__ContentError' + 415: + description: Unsupported Media Type + content: + application/json: + schema: + $ref: '#/components/schemas/Application__ContentError' + 422: + description: Unprocessable Entity + content: + application/json: + schema: + $ref: '#/components/schemas/Application__ValidationError' + 500: + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 405: + description: Method Not Allowed + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 409: + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Bookings__BookingError' + 410: + description: Gone + content: + application/json: + schema: + $ref: '#/components/schemas/Bookings__BookingError' + patch: + summary: patches an existing booking with the changes provided + tags: + - Bookings + operationId: Bookings#update{3} + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PlaceOS__Model__Booking' + required: true + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: Int64 + - name: limit_override + in: query + description: allows a client to override any limits imposed on bookings + example: "3" + required: false + schema: + type: integer + format: Int32 + nullable: true + - name: instance + in: query + description: a recurring instance + example: "1234567" + required: false + schema: + type: integer + format: Int64 + nullable: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PlaceOS__Model__Booking' + 429: + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 400: + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 401: + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 403: + description: Forbidden + 404: + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 511: + description: Network Authentication Required + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 406: + description: Not Acceptable + content: + application/json: + schema: + $ref: '#/components/schemas/Application__ContentError' + 415: + description: Unsupported Media Type + content: + application/json: + schema: + $ref: '#/components/schemas/Application__ContentError' + 422: + description: Unprocessable Entity + content: + application/json: + schema: + $ref: '#/components/schemas/Application__ValidationError' + 500: + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 405: + description: Method Not Allowed + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 409: + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Bookings__BookingError' + 410: + description: Gone + content: + application/json: + schema: + $ref: '#/components/schemas/Bookings__BookingError' + /api/staff/v1/bookings/{id}/instance/{instance}: + get: + summary: returns the booking requested + tags: + - Bookings + operationId: Bookings#show{2} + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: Int64 + - name: instance + in: path + description: a recurring instance id + example: "1234567" + required: true + schema: + type: integer + format: Int64 + nullable: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PlaceOS__Model__Booking' + 429: + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 400: + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 401: + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 403: + description: Forbidden + 404: + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 511: + description: Network Authentication Required + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 406: + description: Not Acceptable + content: + application/json: + schema: + $ref: '#/components/schemas/Application__ContentError' + 415: + description: Unsupported Media Type + content: + application/json: + schema: + $ref: '#/components/schemas/Application__ContentError' + 422: + description: Unprocessable Entity + content: + application/json: + schema: + $ref: '#/components/schemas/Application__ValidationError' + 500: + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 405: + description: Method Not Allowed + content: + application/json: + schema: + $ref: '#/components/schemas/Application__CommonError' + 409: + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Bookings__BookingError' + 410: + description: Gone + content: + application/json: + schema: + $ref: '#/components/schemas/Bookings__BookingError' + put: + summary: patches an existing booking with the changes provided + tags: + - Bookings + operationId: Bookings#update{2} + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PlaceOS__Model__Booking' + required: true + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: Int64 + - name: instance + in: path + description: a recurring instance + example: "1234567" + required: true schema: type: integer format: Int64 nullable: true - - name: approved - in: query - description: filters bookings that are approved or not - example: "true" - required: false - schema: - type: boolean - nullable: true - - name: rejected - in: query - description: filters bookings that are rejected or not - example: "true" - required: false - schema: - type: boolean - nullable: true - - name: extension_data - in: query - description: filters bookings with matching extension data entries - example: '{"entry1":"value to match","entry2":1234}' - required: false - schema: - type: string - nullable: true - - name: state - in: query - description: filters on the booking process state, a user defined value - example: pending-approval - required: false - schema: - type: string - nullable: true - - name: department - in: query - description: filters bookings owned by a department, a user defined value - example: accounting - required: false - schema: - type: string - nullable: true - - name: event_id - in: query - description: filters bookings associated with an event, such as an Office365 - Calendar event id - example: AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZe - required: false - schema: - type: string - nullable: true - - name: ical_uid - in: query - description: filters bookings associated with an event, such as an Office365 - Calendar event ical_uid - example: 19rh93h5t893h5v@calendar.iCloud.com - required: false - schema: - type: string - nullable: true - - name: limit - in: query - description: the maximum number of results to return - example: "10000" - required: false - schema: - type: integer - format: Int32 - - name: offset + - name: limit_override in: query - description: the starting offset of the result set. Used to implement pagination + description: allows a client to override any limits imposed on bookings + example: "3" required: false schema: type: integer format: Int32 - - name: permission - in: query - description: 'filters bookings based on the permission level. Options: PRIVATE, - OPEN, PUBLIC' - example: PUBLIC - required: false - schema: - type: string nullable: true responses: 200: @@ -618,9 +1291,7 @@ paths: content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/String' + $ref: '#/components/schemas/PlaceOS__Model__Booking' 429: description: Too Many Requests content: @@ -695,12 +1366,11 @@ paths: application/json: schema: $ref: '#/components/schemas/Bookings__BookingError' - /api/staff/v1/bookings/{id}: - get: - summary: returns the booking requested + delete: + summary: marks the provided booking as deleted tags: - Bookings - operationId: Bookings#show + operationId: Bookings#destroy{2} parameters: - name: id in: path @@ -708,13 +1378,26 @@ paths: schema: type: integer format: Int64 + - name: instance + in: path + description: a recurring instance id + example: "1234567" + required: true + schema: + type: integer + format: Int64 + nullable: true + - name: utm_source + in: query + description: provided for use with analytics + example: mobile + required: false + schema: + type: string + nullable: true responses: - 200: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/PlaceOS__Model__Booking' + 202: + description: Accepted 429: description: Too Many Requests content: @@ -789,11 +1472,11 @@ paths: application/json: schema: $ref: '#/components/schemas/Bookings__BookingError' - put: + patch: summary: patches an existing booking with the changes provided tags: - Bookings - operationId: Bookings#update + operationId: Bookings#update{4} requestBody: content: application/json: @@ -807,6 +1490,15 @@ paths: schema: type: integer format: Int64 + - name: instance + in: path + description: a recurring instance + example: "1234567" + required: true + schema: + type: integer + format: Int64 + nullable: true - name: limit_override in: query description: allows a client to override any limits imposed on bookings @@ -897,11 +1589,12 @@ paths: application/json: schema: $ref: '#/components/schemas/Bookings__BookingError' - delete: - summary: marks the provided booking as deleted + /api/staff/v1/bookings/{id}/approve: + post: + summary: approves a booking (if booking approval is required in an organisation) tags: - Bookings - operationId: Bookings#destroy + operationId: Bookings#approve parameters: - name: id in: path @@ -918,8 +1611,12 @@ paths: type: string nullable: true responses: - 202: - description: Accepted + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PlaceOS__Model__Booking' 429: description: Too Many Requests content: @@ -994,17 +1691,12 @@ paths: application/json: schema: $ref: '#/components/schemas/Bookings__BookingError' - patch: - summary: patches an existing booking with the changes provided + /api/staff/v1/bookings/{id}/reject: + post: + summary: rejects a booking tags: - Bookings - operationId: Bookings#update{2} - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PlaceOS__Model__Booking' - required: true + operationId: Bookings#reject parameters: - name: id in: path @@ -1012,14 +1704,13 @@ paths: schema: type: integer format: Int64 - - name: limit_override + - name: utm_source in: query - description: allows a client to override any limits imposed on bookings - example: "3" + description: provided for use with analytics + example: mobile required: false schema: - type: integer - format: Int32 + type: string nullable: true responses: 200: @@ -1102,12 +1793,12 @@ paths: application/json: schema: $ref: '#/components/schemas/Bookings__BookingError' - /api/staff/v1/bookings/{id}/approve: + /api/staff/v1/bookings/{id}/check_in: post: - summary: approves a booking (if booking approval is required in an organisation) + summary: indicates that a booking has commenced tags: - Bookings - operationId: Bookings#approve + operationId: Bookings#check_in parameters: - name: id in: path @@ -1115,6 +1806,13 @@ paths: schema: type: integer format: Int64 + - name: state + in: query + description: the desired value of the booking checked-in flag + example: "false" + required: false + schema: + type: boolean - name: utm_source in: query description: provided for use with analytics @@ -1123,6 +1821,15 @@ paths: schema: type: string nullable: true + - name: instance + in: query + description: a recurring instance id + example: "1234567" + required: false + schema: + type: integer + format: Int64 + nullable: true responses: 200: description: OK @@ -1204,12 +1911,12 @@ paths: application/json: schema: $ref: '#/components/schemas/Bookings__BookingError' - /api/staff/v1/bookings/{id}/reject: + /api/staff/v1/bookings/{id}/checkin: post: - summary: rejects a booking + summary: indicates that a booking has commenced tags: - Bookings - operationId: Bookings#reject + operationId: Bookings#check_in{2} parameters: - name: id in: path @@ -1217,6 +1924,13 @@ paths: schema: type: integer format: Int64 + - name: state + in: query + description: the desired value of the booking checked-in flag + example: "false" + required: false + schema: + type: boolean - name: utm_source in: query description: provided for use with analytics @@ -1225,6 +1939,15 @@ paths: schema: type: string nullable: true + - name: instance + in: query + description: a recurring instance id + example: "1234567" + required: false + schema: + type: integer + format: Int64 + nullable: true responses: 200: description: OK @@ -1306,12 +2029,12 @@ paths: application/json: schema: $ref: '#/components/schemas/Bookings__BookingError' - /api/staff/v1/bookings/{id}/check_in: + /api/staff/v1/bookings/{id}/check_in/{instance}: post: summary: indicates that a booking has commenced tags: - Bookings - operationId: Bookings#check_in + operationId: Bookings#check_in{3} parameters: - name: id in: path @@ -1319,6 +2042,15 @@ paths: schema: type: integer format: Int64 + - name: instance + in: path + description: a recurring instance id + example: "1234567" + required: true + schema: + type: integer + format: Int64 + nullable: true - name: state in: query description: the desired value of the booking checked-in flag @@ -1415,12 +2147,12 @@ paths: application/json: schema: $ref: '#/components/schemas/Bookings__BookingError' - /api/staff/v1/bookings/{id}/checkin: + /api/staff/v1/bookings/{id}/checkin/{instance}: post: summary: indicates that a booking has commenced tags: - Bookings - operationId: Bookings#check_in{2} + operationId: Bookings#check_in{4} parameters: - name: id in: path @@ -1428,6 +2160,15 @@ paths: schema: type: integer format: Int64 + - name: instance + in: path + description: a recurring instance id + example: "1234567" + required: true + schema: + type: integer + format: Int64 + nullable: true - name: state in: query description: the desired value of the booking checked-in flag @@ -8492,6 +9233,11 @@ components: format: Int64 description: provided if this booking is associated with a calendar event nullable: true + instance: + type: integer + format: Int64 + description: provided when this booking is an instance of recurring booking + nullable: true attendees: type: array items: @@ -8568,6 +9314,39 @@ components: the same tenant can join. If set to public, the booking is open for everyone to join. nullable: true + recurrence_type: + type: string + enum: + - none + - daily + - weekly + - monthly + description: Is this a recurring booking. This field defines the type of + recurrence + nullable: true + recurrence_days: + type: integer + format: Int32 + description: a bitmap of valid days of the week for booking recurrences + to land on, defaults to weekdays + nullable: true + recurrence_nth_of_month: + type: integer + format: Int32 + description: which day index should a monthly recurrence land on. 1st Monday, + 2nd Monday (used in conjunction with the days bitmap). -1 == last Monday, + -2 Second last Monday etc + nullable: true + recurrence_interval: + type: integer + format: Int32 + description: 1 == every occurrence, 2 == every second occurrence, etc + nullable: true + recurrence_end: + type: integer + format: Int64 + description: an optional end date for booking recurrances + nullable: true tenant_id: type: integer format: Int64 @@ -10416,6 +11195,12 @@ components: description: provided if this booking is associated with a calendar event nullable: true + instance: + type: integer + format: Int64 + description: provided when this booking is an instance of recurring + booking + nullable: true attendees: type: array items: @@ -10492,6 +11277,40 @@ components: in the same tenant can join. If set to public, the booking is open for everyone to join. nullable: true + recurrence_type: + type: string + enum: + - none + - daily + - weekly + - monthly + description: Is this a recurring booking. This field defines the type + of recurrence + nullable: true + recurrence_days: + type: integer + format: Int32 + description: a bitmap of valid days of the week for booking recurrences + to land on, defaults to weekdays + nullable: true + recurrence_nth_of_month: + type: integer + format: Int32 + description: which day index should a monthly recurrence land on. + 1st Monday, 2nd Monday (used in conjunction with the days bitmap). + -1 == last Monday, -2 Second last Monday etc + nullable: true + recurrence_interval: + type: integer + format: Int32 + description: 1 == every occurrence, 2 == every second occurrence, + etc + nullable: true + recurrence_end: + type: integer + format: Int64 + description: an optional end date for booking recurrances + nullable: true tenant_id: type: integer format: Int64