Skip to content

Commit 5328ce8

Browse files
authored
feat(specs): add notification settings to tasks [skip-bc] (#4297)
1 parent e8093f0 commit 5328ce8

File tree

4 files changed

+70
-2
lines changed

4 files changed

+70
-2
lines changed

specs/ingestion/common/schemas/task.yml

+43
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ Task:
2626
$ref: '#/ActionType'
2727
cursor:
2828
$ref: './common.yml#/cursor'
29+
notifications:
30+
$ref: '#/Notifications'
31+
policies:
32+
$ref: '#/Policies'
2933
createdAt:
3034
$ref: './common.yml#/createdAt'
3135
updatedAt:
@@ -63,6 +67,10 @@ TaskV1:
6367
$ref: '#/ActionType'
6468
cursor:
6569
$ref: './common.yml#/cursor'
70+
notifications:
71+
$ref: '#/Notifications'
72+
policies:
73+
$ref: '#/Policies'
6674
createdAt:
6775
$ref: './common.yml#/createdAt'
6876
updatedAt:
@@ -105,6 +113,10 @@ TaskCreate:
105113
$ref: '#/TaskInput'
106114
cursor:
107115
$ref: './common.yml#/cursor'
116+
notifications:
117+
$ref: '#/Notifications'
118+
policies:
119+
$ref: '#/Policies'
108120
required:
109121
- sourceID
110122
- destinationID
@@ -175,6 +187,10 @@ TaskUpdate:
175187
description: Whether the task is enabled.
176188
failureThreshold:
177189
$ref: '#/failureThreshold'
190+
notifications:
191+
$ref: '#/Notifications'
192+
policies:
193+
$ref: '#/Policies'
178194

179195
TaskUpdateV1:
180196
type: object
@@ -553,3 +569,30 @@ ShopifyMarket:
553569
- countries
554570
- currencies
555571
- locales
572+
573+
Notifications:
574+
type: object
575+
additionalProperties: false
576+
description: Notifications settings for a task.
577+
properties:
578+
email:
579+
title: emailNotifications
580+
type: object
581+
additionalProperties: false
582+
properties:
583+
enabled:
584+
description: Whether to send email notifications, note that this doesn't prevent the task from being blocked.
585+
type: boolean
586+
required:
587+
- email
588+
589+
Policies:
590+
type: object
591+
additionalProperties: false
592+
description: Set of rules for a task.
593+
properties:
594+
criticalThreshold:
595+
description: The number of critical failures in a row before blocking the task and sending a notification.
596+
type: integer
597+
minimum: 1
598+
maximum: 10

specs/ingestion/common/taskParameters.yml

+8
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ triggerType:
7070
$ref: './schemas/task.yml#/TriggerType'
7171
example: onDemand,schedule,subscription,streaming
7272

73+
withEmailNotifications:
74+
name: withEmailNotifications
75+
in: query
76+
description: If specified, the response only includes tasks with notifications.email.enabled set to this value.
77+
required: false
78+
schema:
79+
type: boolean
80+
7381
sort:
7482
name: sort
7583
in: query

specs/ingestion/paths/tasks/v2/tasks.yml

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ get:
1717
- $ref: '../../../common/taskParameters.yml#/sourceType'
1818
- $ref: '../../../common/taskParameters.yml#/destinationID'
1919
- $ref: '../../../common/taskParameters.yml#/triggerType'
20+
- $ref: '../../../common/taskParameters.yml#/withEmailNotifications'
2021
- $ref: '../../../common/taskParameters.yml#/sort'
2122
- $ref: '../../../common/parameters.yml#/order'
2223
responses:

tests/CTS/requests/ingestion/createTask.json

+18-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,15 @@
2222
"sourceID": "search",
2323
"destinationID": "destinationName",
2424
"cron": "* * * * *",
25-
"action": "replace"
25+
"action": "replace",
26+
"notifications": {
27+
"email": {
28+
"enabled": true
29+
}
30+
},
31+
"policies": {
32+
"criticalThreshold": 8
33+
}
2634
},
2735
"request": {
2836
"path": "/2/tasks",
@@ -31,7 +39,15 @@
3139
"sourceID": "search",
3240
"destinationID": "destinationName",
3341
"cron": "* * * * *",
34-
"action": "replace"
42+
"action": "replace",
43+
"notifications": {
44+
"email": {
45+
"enabled": true
46+
}
47+
},
48+
"policies": {
49+
"criticalThreshold": 8
50+
}
3551
}
3652
}
3753
},

0 commit comments

Comments
 (0)