-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
autobot
committed
Jun 3, 2024
1 parent
f00152c
commit 8292eef
Showing
34 changed files
with
945 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,169 @@ | ||
# Events | ||
|
||
```ts | ||
const eventsApi = client.eventsApi; | ||
``` | ||
|
||
## Class Name | ||
|
||
`EventsApi` | ||
|
||
## Methods | ||
|
||
* [Search Events](../../doc/api/events.md#search-events) | ||
* [Disable Events](../../doc/api/events.md#disable-events) | ||
* [Enable Events](../../doc/api/events.md#enable-events) | ||
* [List Event Types](../../doc/api/events.md#list-event-types) | ||
|
||
|
||
# Search Events | ||
|
||
Search for Square API events that occur within a 28-day timeframe. | ||
|
||
```ts | ||
async searchEvents( | ||
body: SearchEventsRequest, | ||
requestOptions?: RequestOptions | ||
): Promise<ApiResponse<SearchEventsResponse>> | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Tags | Description | | ||
| --- | --- | --- | --- | | ||
| `body` | [`SearchEventsRequest`](../../doc/models/search-events-request.md) | Body, Required | An object containing the fields to POST for the request.<br><br>See the corresponding object definition for field details. | | ||
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | | ||
|
||
## Response Type | ||
|
||
[`SearchEventsResponse`](../../doc/models/search-events-response.md) | ||
|
||
## Example Usage | ||
|
||
```ts | ||
const body: SearchEventsRequest = {}; | ||
|
||
try { | ||
const { result, ...httpResponse } = await eventsApi.searchEvents(body); | ||
// Get more response info... | ||
// const { statusCode, headers } = httpResponse; | ||
} catch (error) { | ||
if (error instanceof ApiError) { | ||
const errors = error.result; | ||
// const { statusCode, headers } = error; | ||
} | ||
} | ||
``` | ||
|
||
|
||
# Disable Events | ||
|
||
Disables events to prevent them from being searchable. | ||
All events are disabled by default. You must enable events to make them searchable. | ||
Disabling events for a specific time period prevents them from being searchable, even if you re-enable them later. | ||
|
||
```ts | ||
async disableEvents( | ||
requestOptions?: RequestOptions | ||
): Promise<ApiResponse<DisableEventsResponse>> | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Tags | Description | | ||
| --- | --- | --- | --- | | ||
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | | ||
|
||
## Response Type | ||
|
||
[`DisableEventsResponse`](../../doc/models/disable-events-response.md) | ||
|
||
## Example Usage | ||
|
||
```ts | ||
try { | ||
const { result, ...httpResponse } = await eventsApi.disableEvents(); | ||
// Get more response info... | ||
// const { statusCode, headers } = httpResponse; | ||
} catch (error) { | ||
if (error instanceof ApiError) { | ||
const errors = error.result; | ||
// const { statusCode, headers } = error; | ||
} | ||
} | ||
``` | ||
|
||
|
||
# Enable Events | ||
|
||
Enables events to make them searchable. Only events that occur while in the enabled state are searchable. | ||
|
||
```ts | ||
async enableEvents( | ||
requestOptions?: RequestOptions | ||
): Promise<ApiResponse<EnableEventsResponse>> | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Tags | Description | | ||
| --- | --- | --- | --- | | ||
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | | ||
|
||
## Response Type | ||
|
||
[`EnableEventsResponse`](../../doc/models/enable-events-response.md) | ||
|
||
## Example Usage | ||
|
||
```ts | ||
try { | ||
const { result, ...httpResponse } = await eventsApi.enableEvents(); | ||
// Get more response info... | ||
// const { statusCode, headers } = httpResponse; | ||
} catch (error) { | ||
if (error instanceof ApiError) { | ||
const errors = error.result; | ||
// const { statusCode, headers } = error; | ||
} | ||
} | ||
``` | ||
|
||
|
||
# List Event Types | ||
|
||
Lists all event types that you can subscribe to as webhooks or query using the Events API. | ||
|
||
```ts | ||
async listEventTypes( | ||
apiVersion?: string, | ||
requestOptions?: RequestOptions | ||
): Promise<ApiResponse<ListEventTypesResponse>> | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Tags | Description | | ||
| --- | --- | --- | --- | | ||
| `apiVersion` | `string \| undefined` | Query, Optional | The API version for which to list event types. Setting this field overrides the default version used by the application. | | ||
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | | ||
|
||
## Response Type | ||
|
||
[`ListEventTypesResponse`](../../doc/models/list-event-types-response.md) | ||
|
||
## Example Usage | ||
|
||
```ts | ||
try { | ||
const { result, ...httpResponse } = await eventsApi.listEventTypes(); | ||
// Get more response info... | ||
// const { statusCode, headers } = httpResponse; | ||
} catch (error) { | ||
if (error instanceof ApiError) { | ||
const errors = error.result; | ||
// const { statusCode, headers } = error; | ||
} | ||
} | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
|
||
# Disable Events Response | ||
|
||
Defines the fields that are included in the response body of | ||
a request to the [DisableEvents](../../doc/api/events.md#disable-events) endpoint. | ||
|
||
Note: if there are errors processing the request, the events field will not be | ||
present. | ||
|
||
## Structure | ||
|
||
`DisableEventsResponse` | ||
|
||
## Fields | ||
|
||
| Name | Type | Tags | Description | | ||
| --- | --- | --- | --- | | ||
| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | | ||
|
||
## Example (as JSON) | ||
|
||
```json | ||
{ | ||
"errors": [ | ||
{ | ||
"category": "MERCHANT_SUBSCRIPTION_ERROR", | ||
"code": "MAP_KEY_LENGTH_TOO_LONG", | ||
"detail": "detail6", | ||
"field": "field4" | ||
}, | ||
{ | ||
"category": "MERCHANT_SUBSCRIPTION_ERROR", | ||
"code": "MAP_KEY_LENGTH_TOO_LONG", | ||
"detail": "detail6", | ||
"field": "field4" | ||
} | ||
] | ||
} | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
|
||
# Enable Events Response | ||
|
||
Defines the fields that are included in the response body of | ||
a request to the [EnableEvents](../../doc/api/events.md#enable-events) endpoint. | ||
|
||
Note: if there are errors processing the request, the events field will not be | ||
present. | ||
|
||
## Structure | ||
|
||
`EnableEventsResponse` | ||
|
||
## Fields | ||
|
||
| Name | Type | Tags | Description | | ||
| --- | --- | --- | --- | | ||
| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | | ||
|
||
## Example (as JSON) | ||
|
||
```json | ||
{ | ||
"errors": [ | ||
{ | ||
"category": "MERCHANT_SUBSCRIPTION_ERROR", | ||
"code": "MAP_KEY_LENGTH_TOO_LONG", | ||
"detail": "detail6", | ||
"field": "field4" | ||
} | ||
] | ||
} | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
# Event Metadata | ||
|
||
Contains metadata about a particular [Event](../../doc/models/event.md). | ||
|
||
## Structure | ||
|
||
`EventMetadata` | ||
|
||
## Fields | ||
|
||
| Name | Type | Tags | Description | | ||
| --- | --- | --- | --- | | ||
| `eventId` | `string \| null \| undefined` | Optional | A unique ID for the event. | | ||
| `apiVersion` | `string \| null \| undefined` | Optional | The API version of the event. This corresponds to the default API version of the developer application at the time when the event was created. | | ||
|
||
## Example (as JSON) | ||
|
||
```json | ||
{ | ||
"event_id": "event_id0", | ||
"api_version": "api_version6" | ||
} | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
# List Event Types Request | ||
|
||
Lists all event types that can be subscribed to. | ||
|
||
## Structure | ||
|
||
`ListEventTypesRequest` | ||
|
||
## Fields | ||
|
||
| Name | Type | Tags | Description | | ||
| --- | --- | --- | --- | | ||
| `apiVersion` | `string \| null \| undefined` | Optional | The API version for which to list event types. Setting this field overrides the default version used by the application. | | ||
|
||
## Example (as JSON) | ||
|
||
```json | ||
{ | ||
"api_version": "api_version0" | ||
} | ||
``` | ||
|
Oops, something went wrong.