From bb50a7d3014cbfb601ac62b375bd755e08d35000 Mon Sep 17 00:00:00 2001 From: Jan Janusik Date: Mon, 15 Nov 2021 08:46:13 +0100 Subject: [PATCH 1/4] #14793 Add trigger --- certified-connectors/RescoCloud/README.md | 2 + .../RescoCloud/apiDefinition.swagger.json | 92 +++++++++++++++++++ .../RescoCloud/apiProperties.json | 4 +- 3 files changed, 97 insertions(+), 1 deletion(-) diff --git a/certified-connectors/RescoCloud/README.md b/certified-connectors/RescoCloud/README.md index 3ced5670fc..b2ec50a126 100644 --- a/certified-connectors/RescoCloud/README.md +++ b/certified-connectors/RescoCloud/README.md @@ -25,4 +25,6 @@ This connector supports the following operations: * `Update record`: Update record by specific ID. * `Get current user`: Get current user record associated with login credentials. +## Supported Triggers +* `When an item is created,updated or deleted`: Trigger when an item is created,updated or deleted. For more information on parameters accepted/required by the connector's operations, please contact us at www.resco.net/contact-support. \ No newline at end of file diff --git a/certified-connectors/RescoCloud/apiDefinition.swagger.json b/certified-connectors/RescoCloud/apiDefinition.swagger.json index 93aa6ba47f..748c18fc4b 100644 --- a/certified-connectors/RescoCloud/apiDefinition.swagger.json +++ b/certified-connectors/RescoCloud/apiDefinition.swagger.json @@ -592,6 +592,98 @@ } } } + }, + "/$hook": { + "x-ms-notification-content": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "title": "id" + } + } + }, + "description": "Webhook response" + }, + "post": { + "responses": { + "201": { + "description": "Created" + } + }, + "summary": "When an item is created-updated-deleted", + "operationId": "TriggerCreate", + "description": "When an item is created-updated-deleted", + "x-ms-trigger": "single", + "parameters": [ + { + "name": "$entity", + "in": "query", + "required": true, + "type": "string", + "x-ms-dynamic-values": { + "operationId": "Schema-Entities", + "value-path": "name", + "value-collection": "value", + "value-title": "title" + } + }, + { + "name": "$action", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "Create", + "Update", + "Delete" + ] + }, + { + "name": "body", + "in": "body", + "required": false, + "schema": { + "type": "object", + "properties": { + "callbackUrl": { + "type": "string", + "description": "callbackUrl", + "x-ms-notification-url": true, + "x-ms-visibility": "internal" + } + }, + "required": [ + "callbackUrl" + ] + } + } + ] + }, + "delete": { + "responses": { + "204": { + "description": "Deleted" + }, + "404": { + "description": "Hook not found" + } + }, + "summary": "Delete Hook", + "description": "To delete a registered hook when not needed", + "operationId": "TriggerDelete", + "x-ms-visibility": "internal", + "parameters": [ + { + "name": "$id", + "in": "query", + "required": true, + "type": "string", + "x-ms-url-encoding": "single" + } + ] + } } }, "definitions": { diff --git a/certified-connectors/RescoCloud/apiProperties.json b/certified-connectors/RescoCloud/apiProperties.json index 5e9b79d8ef..257b88e5b1 100644 --- a/certified-connectors/RescoCloud/apiProperties.json +++ b/certified-connectors/RescoCloud/apiProperties.json @@ -249,7 +249,9 @@ "Record-Get", "Record-Delete", "Record-Update", - "User-Get" + "User-Get", + "TriggerCreate", + "TriggerDelete" ], "x-ms-apimTemplateParameter.urlTemplate": "@connectionParameters('server')/odata/v4/@connectionParameters('organization')/" } From 455b737f4071ae60750f315021d150aface0ae1d Mon Sep 17 00:00:00 2001 From: Jan Janusik Date: Mon, 15 Nov 2021 09:38:29 +0100 Subject: [PATCH 2/4] #14793 ADD: trigger description --- .../RescoCloud/apiDefinition.swagger.json | 50 ++++++++++++------- 1 file changed, 31 insertions(+), 19 deletions(-) diff --git a/certified-connectors/RescoCloud/apiDefinition.swagger.json b/certified-connectors/RescoCloud/apiDefinition.swagger.json index 748c18fc4b..d75f0b3918 100644 --- a/certified-connectors/RescoCloud/apiDefinition.swagger.json +++ b/certified-connectors/RescoCloud/apiDefinition.swagger.json @@ -618,27 +618,10 @@ "x-ms-trigger": "single", "parameters": [ { - "name": "$entity", - "in": "query", - "required": true, - "type": "string", - "x-ms-dynamic-values": { - "operationId": "Schema-Entities", - "value-path": "name", - "value-collection": "value", - "value-title": "title" - } + "$ref": "#/parameters/Parameter.Entity.Trigger" }, { - "name": "$action", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "Create", - "Update", - "Delete" - ] + "$ref": "#/parameters/List.Trigger.Action" }, { "name": "body", @@ -817,6 +800,21 @@ "value-collection": "value" } }, + "Parameter.Entity.Trigger": { + "name": "$entity", + "in": "query", + "required": true, + "type": "string", + "description": "Name of the entity", + "x-ms-summary": "Entity name", + "x-ms-url-encoding": "single", + "x-ms-dynamic-values": { + "operationId": "Schema-Entities", + "value-path": "name", + "value-collection": "value", + "value-title": "title" + } + }, "Definition.Entity": { "in": "query", "name": "$entitySet", @@ -939,6 +937,20 @@ "type": "boolean", "default": true, "required": true + }, + "List.Trigger.Action": { + "name": "$action", + "in": "query", + "required": true, + "type": "string", + "description": "Action", + "x-ms-summary": "Action name", + "x-ms-url-encoding": "single", + "enum": [ + "Create", + "Update", + "Delete" + ] } }, "responses": { From af2cdc65c835afb63696a04ee4656e8b30df5108 Mon Sep 17 00:00:00 2001 From: Jan Janusik Date: Mon, 15 Nov 2021 09:51:01 +0100 Subject: [PATCH 3/4] #14793 modif readme --- certified-connectors/RescoCloud/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/certified-connectors/RescoCloud/README.md b/certified-connectors/RescoCloud/README.md index b2ec50a126..753d258309 100644 --- a/certified-connectors/RescoCloud/README.md +++ b/certified-connectors/RescoCloud/README.md @@ -26,5 +26,6 @@ This connector supports the following operations: * `Get current user`: Get current user record associated with login credentials. ## Supported Triggers + * `When an item is created,updated or deleted`: Trigger when an item is created,updated or deleted. For more information on parameters accepted/required by the connector's operations, please contact us at www.resco.net/contact-support. \ No newline at end of file From a79fedd63cff4d0963235422589b268c3666f4eb Mon Sep 17 00:00:00 2001 From: Jan Janusik Date: Mon, 15 Nov 2021 09:54:26 +0100 Subject: [PATCH 4/4] #14793 modif readme --- certified-connectors/RescoCloud/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/certified-connectors/RescoCloud/README.md b/certified-connectors/RescoCloud/README.md index 753d258309..578dfde087 100644 --- a/certified-connectors/RescoCloud/README.md +++ b/certified-connectors/RescoCloud/README.md @@ -27,5 +27,6 @@ This connector supports the following operations: ## Supported Triggers -* `When an item is created,updated or deleted`: Trigger when an item is created,updated or deleted. +* `When an item is created,updated or deleted`: Trigger when an item is created,updated or deleted. + For more information on parameters accepted/required by the connector's operations, please contact us at www.resco.net/contact-support. \ No newline at end of file