Skip to content

Commit 73023a4

Browse files
committed
feat(specs): add notification settings to tasks
1 parent 02619a3 commit 73023a4

File tree

2 files changed

+44
-3
lines changed

2 files changed

+44
-3
lines changed

specs/ingestion/common/schemas/task.yml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ Task:
2626
$ref: '#/ActionType'
2727
cursor:
2828
$ref: './common.yml#/cursor'
29+
notifications:
30+
$ref: '#/Notifications'
2931
createdAt:
3032
$ref: './common.yml#/createdAt'
3133
updatedAt:
@@ -41,7 +43,7 @@ TaskV1:
4143
type: object
4244
additionalProperties: false
4345
deprecated: true
44-
description: The V1 task object, please use methods and types that don't contain the V1 suffix.
46+
description: The V1 task object, please use methods and types that doesn't contain the V1 suffix.
4547
properties:
4648
taskID:
4749
$ref: './common.yml#/taskID'
@@ -63,6 +65,8 @@ TaskV1:
6365
$ref: '#/ActionType'
6466
cursor:
6567
$ref: './common.yml#/cursor'
68+
notifications:
69+
$ref: '#/Notifications'
6670
createdAt:
6771
$ref: './common.yml#/createdAt'
6872
updatedAt:
@@ -105,6 +109,8 @@ TaskCreate:
105109
$ref: '#/TaskInput'
106110
cursor:
107111
$ref: './common.yml#/cursor'
112+
notifications:
113+
$ref: '#/Notifications'
108114
required:
109115
- sourceID
110116
- destinationID
@@ -175,6 +181,8 @@ TaskUpdate:
175181
description: Whether the task is enabled.
176182
failureThreshold:
177183
$ref: '#/failureThreshold'
184+
notifications:
185+
$ref: '#/Notifications'
178186

179187
TaskUpdateV1:
180188
type: object
@@ -553,3 +561,24 @@ ShopifyMarket:
553561
- countries
554562
- currencies
555563
- locales
564+
565+
Notifications:
566+
type: object
567+
additionalProperties: false
568+
description: Notifications settings for a task.
569+
properties:
570+
email:
571+
title: emailNotifications
572+
type: object
573+
additionalProperties: false
574+
properties:
575+
enabled:
576+
description: Whether to send email notifications, note that this doesn't prevent the task from being blocked.
577+
type: boolean
578+
criticalThreshold:
579+
description: The number of critical failures in a row before blocking the task and sending a notification.
580+
type: integer
581+
minimum: 1
582+
maximum: 10
583+
required:
584+
- email

tests/CTS/requests/ingestion/createTask.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@
2222
"sourceID": "search",
2323
"destinationID": "destinationName",
2424
"cron": "* * * * *",
25-
"action": "replace"
25+
"action": "replace",
26+
"notifications": {
27+
"email": {
28+
"enabled": true,
29+
"criticalThreshold": 8
30+
}
31+
}
2632
},
2733
"request": {
2834
"path": "/2/tasks",
@@ -31,7 +37,13 @@
3137
"sourceID": "search",
3238
"destinationID": "destinationName",
3339
"cron": "* * * * *",
34-
"action": "replace"
40+
"action": "replace",
41+
"notifications": {
42+
"email": {
43+
"enabled": true,
44+
"criticalThreshold": 8
45+
}
46+
}
3547
}
3648
}
3749
},

0 commit comments

Comments
 (0)