Skip to content

Commit ab43d38

Browse files
committed
Updated API from documentation release
1 parent 5a2a769 commit ab43d38

10 files changed

+57
-61
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#%RAML 1.0 DataType
2+
(package): Event
3+
displayName: BaseEvent
4+
description: |
5+
Base representation of an Event containing common fields to all [Event Types](#eventtype).
6+
properties:
7+
id:
8+
(identifier): true
9+
type: string
10+
description: Unique identifier of the Event.
11+
notificationType:
12+
type: string
13+
enum:
14+
- Event
15+
resourceType:
16+
type: EventSubscriptionResourceTypeId
17+
description: |
18+
The type of resource targeted by the Event.
19+
type:
20+
type: EventType
21+
description: |
22+
The type of Event that has occurred.
23+
data:
24+
type: object
25+
description: |
26+
An object containing details related to the Event.
27+
createdAt:
28+
type: datetime
29+
description: Date and time (UTC) the Event was generated.

api-specs/api/types/event/Event.raml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ properties:
2121
type: EventType
2222
description: |
2323
The type of Event that has occurred.
24-
data:
25-
type: object
26-
description: |
27-
An object containing details related to the Event.
2824
createdAt:
2925
type: datetime
3026
description: Date and time (UTC) the Event was generated.
Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
#%RAML 1.0 DataType
22
(package): Subscription
3-
type: object
3+
type: SubscriptionNotification
44
displayName: DeliveryPayload
5-
discriminator: notificationType
5+
(ignoreValidators): [PolymorphicSubtypesRule]
66
description: |
77
All payloads for the [PlatformFormat](ctp:api:type:PlatformFormat) share these common fields.
88
properties:
9-
notificationType:
9+
projectKey:
1010
type: string
1111
description: |
12-
Identifies the payload.
12+
`key` of the [Project](ctp:api:type:Project).
13+
Useful for processing notifications if the Destination receives them from multiple Projects.
14+
resource:
15+
type: Reference
16+
description: |
17+
Reference to the resource that triggered the notification.
18+
resourceUserProvidedIdentifiers?:
19+
type: UserProvidedIdentifiers
20+
description: |
21+
User-defined unique identifiers of the resource.

api-specs/api/types/subscription/EventDeliveryPayload.raml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#%RAML 1.0 DataType
22
(package): Subscription
3-
type: DeliveryPayload
3+
type: SubscriptionNotification
44
displayName: EventDeliveryPayload
55
discriminatorValue: Event
66
example: !include ../../examples/Subscription/event-payload.example.json

api-specs/api/types/subscription/MessageDeliveryPayload.raml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ properties:
1616
format: int64
1717
description: |
1818
Last seen version of the resource.
19-
projectKey:
20-
type: string
21-
description: |
22-
`key` of the [Project](ctp:api:type:Project).
23-
Useful for processing notifications if the Destination receives them from multiple Projects.
2419
createdAt:
2520
type: datetime
2621
description: |
@@ -40,14 +35,6 @@ properties:
4035
format: int64
4136
description: |
4237
Version of the resource on which the update was performed.
43-
resource:
44-
type: Reference
45-
description: |
46-
Reference to the resource that triggered the notification.
47-
resourceUserProvidedIdentifiers?:
48-
type: UserProvidedIdentifiers
49-
description: |
50-
User-defined unique identifiers of the resource.
5138
payloadNotIncluded?:
5239
type: PayloadNotIncluded
5340
description: |

api-specs/api/types/subscription/ResourceCreatedDeliveryPayload.raml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,6 @@ example: !include ../../examples/Subscription/resource-created-payload.example.j
77
description: |
88
This payload is sent for a [ChangeSubscription](ctp:api:type:ChangeSubscription) when a resource is created.
99
properties:
10-
projectKey:
11-
type: string
12-
description: |
13-
`key` of the [Project](ctp:api:type:Project).
14-
Useful for processing notifications if the Destination receives them from multiple Projects.
15-
resource:
16-
type: Reference
17-
description: |
18-
Reference to the resource that triggered the notification.
19-
resourceUserProvidedIdentifiers?:
20-
type: UserProvidedIdentifiers
21-
description: |
22-
User-defined unique identifiers of the resource.
2310
version:
2411
type: number
2512
format: int64

api-specs/api/types/subscription/ResourceDeletedDeliveryPayload.raml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,6 @@ example: !include ../../examples/Subscription/resource-deleted-payload.example.j
77
description: |
88
This payload is sent for a [ChangeSubscription](ctp:api:type:ChangeSubscription) when a resource is deleted.
99
properties:
10-
projectKey:
11-
type: string
12-
description: |
13-
`key` of the [Project](ctp:api:type:Project).
14-
Useful for processing notifications if the Destination receives them from multiple Projects.
15-
resource:
16-
type: Reference
17-
description: |
18-
Reference to the resource that triggered the notification.
19-
resourceUserProvidedIdentifiers?:
20-
type: UserProvidedIdentifiers
21-
description: |
22-
User-defined unique identifiers of the resource.
2310
version:
2411
type: number
2512
format: int64

api-specs/api/types/subscription/ResourceUpdatedDeliveryPayload.raml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,6 @@ example: !include ../../examples/Subscription/resource-updated-payload.example.j
77
description: |
88
This payload is sent for a [ChangeSubscription](ctp:api:type:ChangeSubscription) when a resource is updated. This includes updates by a background process, like a change in product availability.
99
properties:
10-
projectKey:
11-
type: string
12-
description: |
13-
`key` of the [Project](ctp:api:type:Project).
14-
Useful for processing notifications if the Destination receives them from multiple Projects.
15-
resource:
16-
type: Reference
17-
description: |
18-
Reference to the resource that triggered the notification.
19-
resourceUserProvidedIdentifiers?:
20-
type: UserProvidedIdentifiers
21-
description: |
22-
User-defined unique identifiers of the resource.
2310
version:
2411
type: number
2512
format: int64
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#%RAML 1.0 DataType
2+
(package): Subscription
3+
type: object
4+
displayName: SubscriptionNotification
5+
discriminator: notificationType
6+
description: |
7+
All payloads for the [PlatformFormat](ctp:api:type:PlatformFormat) share these common fields.
8+
properties:
9+
notificationType:
10+
type: string
11+
description: |
12+
Identifies the payload.

api-specs/api/types/types.raml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,7 @@ GraphQLSemanticErrorError: !include error/graphql/GraphQLSemanticErrorError.raml
676676
GraphQLShippingMethodDoesNotMatchCartError: !include error/graphql/GraphQLShippingMethodDoesNotMatchCartError.raml
677677
GraphQLStoreCartDiscountsLimitReachedError: !include error/graphql/GraphQLStoreCartDiscountsLimitReachedError.raml
678678
GraphQLSyntaxErrorError: !include error/graphql/GraphQLSyntaxErrorError.raml
679+
BaseEvent: !include event/BaseEvent.raml
679680
Event: !include event/Event.raml
680681
ImportContainerCreatedEvent: !include event/ImportContainerCreatedEvent.raml
681682
ImportContainerCreatedEventData: !include event/ImportContainerCreatedEventData.raml
@@ -2291,6 +2292,7 @@ SqsDestination: !include subscription/SqsDestination.raml
22912292
Subscription: !include subscription/Subscription.raml
22922293
SubscriptionDraft: !include subscription/SubscriptionDraft.raml
22932294
SubscriptionHealthStatus: !include subscription/SubscriptionHealthStatus.raml
2295+
SubscriptionNotification: !include subscription/SubscriptionNotification.raml
22942296
SubscriptionPagedQueryResponse: !include subscription/SubscriptionPagedQueryResponse.raml
22952297
SubscriptionUpdate: !include subscription/SubscriptionUpdate.raml
22962298
SubscriptionUpdateAction: !include subscription/SubscriptionUpdateAction.raml

0 commit comments

Comments
 (0)