Feature/RM-7178 Event apis swagger (#1572)

* Added Events Management Section in Swagger

* Removed Events Management Section in Swagger

* RM-7178 swagger implementation for event APIs.

* RM-7178 event API swagger header description .

* RM-7178 event API swagger header description .

* RM-7178 updated create event API description .

* Updated Swagger for Event Management

* RM-7178 updated put and create event API description and body.

* Added /event-type endpoint

* Addressed review comments

* RM-7178 updated swagger for review comments.

* RM-7178 updated swagger for review comments.

* RM-7178 updated swagger for review comments.

* Addressed review comments

* Addressed review comments

* RM-7178 added changes for swagger review comments.

* RM-7178 added changes for swagger review comments.

* RM-7178 added changes for pagination in event and event type.

* Addressed review comments

* Addressed review comments

* Addressed review comments (Added 400 response code for paging GET APIs)

* Addressed review comments

* Addressed review comments

* Addressed review comments

* Addressed review comments

* Addressed review comments

* Addressed review comments

Co-authored-by: suneet-gupta <Suneet.Gupta@contractor.alfresco.com>
Co-authored-by: suneet-gupta <suneet.gupta@hyland.com>
This commit is contained in:
brijmohan1
2022-11-28 21:45:56 +05:30
committed by GitHub
parent 008b340851
commit 1eebb8ec12

View File

@@ -38,6 +38,9 @@ tags:
description: Retrieve and manage unfiled records containers
- name: unfiled-record-folders
description: Retrieve and manage unfiled record folders
- name: events
description: Retrieve and manage retention events
paths:
## GS sites
'/gs-sites':
@@ -2091,7 +2094,172 @@ paths:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
'/events':
get:
tags:
- events
summary: List all available retention events
description: |
Gets the list of events that can be used by retention steps
operationId: getAllEvents
produces:
- application/json
parameters:
- $ref: '#/parameters/skipCountParam'
- $ref: '#/parameters/maxItemsParam'
responses:
'200':
description: Successful response
schema:
$ref: '#/definitions/EventPaging'
'400':
description: |
Invalid parameter: value of **maxItems** or **skipCount** is invalid
'401':
description: Authentication failed
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
post:
tags:
- events
summary: Create a new retention event
description: |
Creates a new event that can be used by retention schedules.
operationId: createEvent
parameters:
- in: body
name: eventBodyCreate
description: The new event.
required: true
schema:
$ref: '#/definitions/EventBody'
consumes:
- application/json
produces:
- application/json
responses:
'201':
description: Successful response
schema:
$ref: '#/definitions/EventEntry'
'400':
description: |
Invalid parameter: **name** or **type** is invalid
'401':
description: Authentication failed
'403':
description: Current user does not have permission to create event
'409':
description: Cannot create event. An event with the name **name** already exists
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
'/events/{eventId}':
get:
tags:
- events
summary: Return event for given eventId
description: |
Gets information about the retention event with id **eventId**.
operationId: getEvent
produces:
- application/json
parameters:
- $ref: '#/parameters/eventIdParam'
responses:
'200':
description: Successful response
schema:
$ref: '#/definitions/EventEntry'
'400':
description: |
Invalid parameter: **eventId** is invalid
'401':
description: Authentication failed
'404':
description: "**eventId** does not exist"
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
put:
tags:
- events
summary: Update event for given eventId
operationId: updateEvent
description: |
Updates retention event with id **eventId**.
produces:
- application/json
parameters:
- $ref: '#/parameters/eventIdParam'
- in: body
name: eventBodyUpdate
description: The event information to update.
required: true
schema:
$ref: '#/definitions/EventBody'
responses:
'200':
description: Successful response
schema:
$ref: '#/definitions/EventEntry'
'400':
description: |
Invalid parameter: The update request is invalid or **eventId** is not a valid format or **eventBodyUpdate** is invalid
'401':
description: Authentication failed
'403':
description: Current user does not have permission to update events
'404':
description: "**eventId** does not exist"
'409':
description: Cannot update event. An event with the name **name** already exists
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
'/event-types':
get:
tags:
- events
summary: List all the retention event types
description: |
Gets a list of all the retention event types.
operationId: getAllEventTypes
produces:
- application/json
parameters:
- $ref: '#/parameters/skipCountParam'
- $ref: '#/parameters/maxItemsParam'
responses:
'200':
description: Successful response
schema:
$ref: '#/definitions/EventTypePaging'
'400':
description: |
Invalid parameter: value of **maxItems** or **skipCount** is invalid
'401':
description: Authentication failed
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
parameters:
## event
eventIdParam:
name: eventId
in: path
description: The identifier of an event.
required: true
type: string
## File plans
filePlanEntryIncludeParam:
name: include
@@ -3760,3 +3928,91 @@ definitions:
- SiteCollaborator
- SiteContributor
- SiteManager
EventPaging:
type: object
properties:
list:
type: object
properties:
pagination:
$ref: '#/definitions/Pagination'
entries:
type: array
items:
$ref: '#/definitions/EventEntry'
EventEntry:
type: object
required:
- entry
properties:
entry:
$ref: '#/definitions/Event'
Event:
type: object
required:
- id
- name
- type
properties:
id:
type: string
description: this is the id of the event
name:
type: string
description: This is the unique display label of the event
type:
type: string
description: this is event type
EventBody:
type: object
required:
- name
properties:
name:
type: string
description: This is the unique display label of the event
type:
type: string
description: this is event type
default: Simple
EventTypePaging:
type: object
properties:
list:
type: object
properties:
pagination:
$ref: '#/definitions/Pagination'
entries:
type: array
items:
$ref: '#/definitions/EventTypeEntry'
EventTypeEntry:
type: object
required:
- entry
properties:
entry:
$ref: '#/definitions/EventType'
EventType:
type: object
required:
- id
- name
properties:
id:
type: string
description: this is the event type id
name:
type: string
description: this is event type name
isAutomatic:
type: boolean
description: Whether events of this type need completing manually or can be completed automatically
default: true
associationName:
type: string
description: The association used to determine whether automatic events of this type are complete
actionOnAssociatedNode:
type: string
description: If an association name is set for this event type then it is possible to require an action to be completed on the associated node