Skip to content

Commit cb87209

Browse files
committed
feat: add string enums to webhook field types
1 parent 4fec5b3 commit cb87209

File tree

1 file changed

+34
-9
lines changed

1 file changed

+34
-9
lines changed

xero-webhooks.yaml

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
openapi: 3.1.1
22
info:
3-
description: The Xero Webhooks API exposes event notifications relating to entities in the Xero Public API and can be used for a variety of purposes.
3+
description: The Xero Webhooks API exposes event notifications relating to entities in the Xero Public API and can be used for a variety of purposes
44
title: Xero Webhooks API
55
version: 9.2.0
66
termsOfService: https://developer.xero.com/xero-developer-platform-terms-conditions/
@@ -9,8 +9,9 @@ info:
99
1010
url: https://developer.xero.com
1111
servers:
12-
- description: The Xero Webhooks API exposes event notifications relating to entities in the Xero Public API and can be used for a variety of purposes.
12+
- description: The Xero Webhooks API exposes event notifications relating to entities in the Xero Public API and can be used for a variety of purposes
1313
url: https://api.xero.com
14+
security: []
1415
webhooks:
1516
invoices:
1617
post:
@@ -97,17 +98,41 @@ components:
9798
description: The date and time that event occurred (UTC time)
9899
eventType:
99100
type: string
100-
description: The type of event of that occurred (e.g. Update)
101+
description: The type of event of that occurred (e.g. UPDATE)
102+
oneOf:
103+
- type: string
104+
const: CREATE
105+
description: When a new resource is created
106+
- type: string
107+
const: UPDATE
108+
description: When an existing resource is updated (including when they are archived)
101109
eventCategory:
102110
type: string
103-
description: The category of event that occurred (e.g. CONTACT). You will only retrieve events from categories that your webhook is subscribed to.
111+
description: The category of event that occurred (e.g. CONTACT). You will only retrieve events from categories that your webhook is subscribed to
112+
oneOf:
113+
- type: string
114+
const: CONTACT
115+
description: For organisation contact-related events
116+
- type: string
117+
const: INVOICE
118+
description: For organisation invoice-related events
119+
- type: string
120+
const: SUBSCRIPTION
121+
description: For application subscription-related events
104122
tenantId:
105123
type: string
106124
format: uuid
107125
description: The ID of the tenant that the event happened in relation to (OrganisationID or ApplicationID)
108126
tenantType:
109127
type: string
110-
description: The type of tenant, depending on the type of event it will be one of ORGANISATION (for Contact or Invoice events), or APPLICATION (for Subscription events)
128+
description: The type of tenant
129+
oneOf:
130+
- type: string
131+
const: ORGANISATION
132+
description: Represents a Xero organisation (for non-Subscription events)
133+
- type: string
134+
const: APPLICATION
135+
description: Represents a Xero application (for Subscription events)
111136
required:
112137
- resourceUrl
113138
- resourceId
@@ -116,20 +141,20 @@ components:
116141
- eventCategory
117142
- tenantId
118143
- tenantType
119-
description: A list of events that have occurred.
144+
description: A list of events that have occurred
120145
lastEventSequence:
121146
type: integer
122147
minimum: 1
123148
maximum: 2147483647
124-
description: The sequence number of the last event in the list.
149+
description: The sequence number of the last event in the list
125150
firstEventSequence:
126151
type: integer
127152
minimum: 1
128153
maximum: 2147483647
129-
description: The sequence number of the first event in the list.
154+
description: The sequence number of the first event in the list
130155
entropy:
131156
type: string
132-
description: A random string used for security or validation purposes.
157+
description: A random string used for security or validation purposes
133158
responses:
134159
401InvalidWebhookData:
135160
description: Return a 401 status to indicate that the webhook subscription failed

0 commit comments

Comments
 (0)