Skip to content

Commit

Permalink
Merge pull request #2 from mconf/HOOK-33/create-route
Browse files Browse the repository at this point in the history
Added `/hooks/enable` route
  • Loading branch information
akahenry authored Apr 28, 2022
2 parents 72bfcda + bffa7fb commit 5fc02b6
Show file tree
Hide file tree
Showing 11 changed files with 137 additions and 0 deletions.
7 changes: 7 additions & 0 deletions openapi/components/examples/enableHook/checksumError.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
fail:
value: |-
<response>
<returncode>FAILED</returncode>
<messageKey>checksumError</messageKey>
<message>You did not pass the checksum security check</message>
</response>
7 changes: 7 additions & 0 deletions openapi/components/examples/enableHook/enableError.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
fail:
value: |-
<response>
<returncode>FAILED</returncode>
<messageKey>enableHookError</messageKey>
<message>An error happened while enabling your hook. Please contact the system's administrators.</message>
</response>
7 changes: 7 additions & 0 deletions openapi/components/examples/enableHook/hookNotFoundError.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
fail:
value: |-
<response>
<returncode>FAILED</returncode>
<messageKey>enableMissingHook</messageKey>
<message>The hook informed was not found or the shared secret didn't match the hook's.</message>
</response>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
fail:
value: |-
<response>
<returncode>FAILED</returncode>
<messageKey>invalidParamHookID</messageKey>
<message>You must specify a valid hookID in the parameters.</message>
</response>
7 changes: 7 additions & 0 deletions openapi/components/examples/enableHook/missingParamError.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
fail:
value: |-
<response>
<returncode>FAILED</returncode>
<messageKey>missingParamHookID</messageKey>
<message>You must specify a hookID in the parameters.</message>
</response>
6 changes: 6 additions & 0 deletions openapi/components/examples/enableHook/success.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
success:
value: |-
<response>
<returncode>SUCCESS</returncode>
<enabled>true</enabled>
</response>
5 changes: 5 additions & 0 deletions openapi/components/parameters/sharedSecretGUID.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name: sharedSecretGUID
in: query
description: The GUID used to created the secret.
schema:
type: string
14 changes: 14 additions & 0 deletions openapi/components/schemas/responses/enableHook.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
type: object
required:
- response
properties:
response:
type: object
required:
- returncode
- hookID
properties:
returncode:
type: string
hookID:
type: string
15 changes: 15 additions & 0 deletions openapi/components/schemas/responses/enableHookError.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
type: object
required:
- response
- messageKey
- message
properties:
response:
type: object
properties:
returncode:
type: string
messageKey:
type: string
message:
type: string
2 changes: 2 additions & 0 deletions openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ paths:
$ref: './paths/list.yaml'
/hooks/destroy:
$ref: './paths/destroy.yaml'
/hooks/enable:
$ref: './paths/enable.yaml'

/getDefaultConfigXML:
$ref: './paths/getDefaultConfigXML.yaml'
Expand Down
60 changes: 60 additions & 0 deletions openapi/paths/enable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
get:
summary: enable
operationId: hooks-enable
description: Enables a Hook to receive meetings events.
tags:
- hooks
parameters:
- $ref: '../components/parameters/hookID.yaml'
required: true
- $ref: '../components/parameters/checksum.yaml'

responses:
'200':
description: Successful operation
content:
application/xml:
examples:
$ref: '../components/examples/enableHook/success.yaml'
schema:
$ref: '../components/schemas/responses/enableHook.yaml'
'400':
description: Missing Hook ID
content:
application/xml:
examples:
$ref: '../components/examples/enableHook/missingParamError.yaml'
schema:
$ref: '../components/schemas/responses/enableHookError.yaml'
'401':
description: Checksum check failed
content:
application/xml:
examples:
$ref: '../components/examples/enableHook/checksumError.yaml'
schema:
$ref: '../components/schemas/responses/enableHookError.yaml'
'404':
description: Hook Not Found
content:
application/xml:
examples:
$ref: '../components/examples/enableHook/hookNotFoundError.yaml'
schema:
$ref: '../components/schemas/responses/enableHookError.yaml'
'422':
description: Invalid Hook ID
content:
application/xml:
examples:
$ref: '../components/examples/enableHook/invalidHookIDError.yaml'
schema:
$ref: '../components/schemas/responses/enableHookError.yaml'
'500':
description: Couldn't enable hook
content:
application/xml:
examples:
$ref: '../components/examples/enableHook/enableError.yaml'
schema:
$ref: '../components/schemas/responses/enableHookError.yaml'

0 comments on commit 5fc02b6

Please sign in to comment.