Skip to content

Commit

Permalink
Merge 441a31e into e8093f0
Browse files Browse the repository at this point in the history
  • Loading branch information
millotp authored Jan 6, 2025
2 parents e8093f0 + 441a31e commit 9a531d7
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 2 deletions.
43 changes: 43 additions & 0 deletions specs/ingestion/common/schemas/task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ Task:
$ref: '#/ActionType'
cursor:
$ref: './common.yml#/cursor'
notifications:
$ref: '#/Notifications'
policies:
$ref: '#/Policies'
createdAt:
$ref: './common.yml#/createdAt'
updatedAt:
Expand Down Expand Up @@ -63,6 +67,10 @@ TaskV1:
$ref: '#/ActionType'
cursor:
$ref: './common.yml#/cursor'
notifications:
$ref: '#/Notifications'
policies:
$ref: '#/Policies'
createdAt:
$ref: './common.yml#/createdAt'
updatedAt:
Expand Down Expand Up @@ -105,6 +113,10 @@ TaskCreate:
$ref: '#/TaskInput'
cursor:
$ref: './common.yml#/cursor'
notifications:
$ref: '#/Notifications'
policies:
$ref: '#/Policies'
required:
- sourceID
- destinationID
Expand Down Expand Up @@ -175,6 +187,10 @@ TaskUpdate:
description: Whether the task is enabled.
failureThreshold:
$ref: '#/failureThreshold'
notifications:
$ref: '#/Notifications'
policies:
$ref: '#/Policies'

TaskUpdateV1:
type: object
Expand Down Expand Up @@ -553,3 +569,30 @@ ShopifyMarket:
- countries
- currencies
- locales

Notifications:
type: object
additionalProperties: false
description: Notifications settings for a task.
properties:
email:
title: emailNotifications
type: object
additionalProperties: false
properties:
enabled:
description: Whether to send email notifications, note that this doesn't prevent the task from being blocked.
type: boolean
required:
- email

Policies:
type: object
additionalProperties: false
description: Set of rules for a task.
properties:
criticalThreshold:
description: The number of critical failures in a row before blocking the task and sending a notification.
type: integer
minimum: 1
maximum: 10
8 changes: 8 additions & 0 deletions specs/ingestion/common/taskParameters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ triggerType:
$ref: './schemas/task.yml#/TriggerType'
example: onDemand,schedule,subscription,streaming

withEmailNotifications:
name: withEmailNotifications
in: query
description: If specified, the response only includes tasks with notifications.email.enabled set to this value.
required: false
schema:
type: boolean

sort:
name: sort
in: query
Expand Down
1 change: 1 addition & 0 deletions specs/ingestion/paths/tasks/v2/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ get:
- $ref: '../../../common/taskParameters.yml#/sourceType'
- $ref: '../../../common/taskParameters.yml#/destinationID'
- $ref: '../../../common/taskParameters.yml#/triggerType'
- $ref: '../../../common/taskParameters.yml#/withEmailNotifications'
- $ref: '../../../common/taskParameters.yml#/sort'
- $ref: '../../../common/parameters.yml#/order'
responses:
Expand Down
20 changes: 18 additions & 2 deletions tests/CTS/requests/ingestion/createTask.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,15 @@
"sourceID": "search",
"destinationID": "destinationName",
"cron": "* * * * *",
"action": "replace"
"action": "replace",
"notifications": {
"email": {
"enabled": true
}
},
"policies": {
"criticalThreshold": 8
}
},
"request": {
"path": "/2/tasks",
Expand All @@ -31,7 +39,15 @@
"sourceID": "search",
"destinationID": "destinationName",
"cron": "* * * * *",
"action": "replace"
"action": "replace",
"notifications": {
"email": {
"enabled": true
}
},
"policies": {
"criticalThreshold": 8
}
}
}
},
Expand Down

0 comments on commit 9a531d7

Please sign in to comment.