-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #135 from square/release/37.1.0.20240604
Generated PR for Release: 37.1.0.20240604
- Loading branch information
Showing
44 changed files
with
2,566 additions
and
39 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
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,149 @@ | ||
# Events | ||
|
||
```php | ||
$eventsApi = $client->getEventsApi(); | ||
``` | ||
|
||
## Class Name | ||
|
||
`EventsApi` | ||
|
||
## Methods | ||
|
||
* [Search Events](../../doc/apis/events.md#search-events) | ||
* [Disable Events](../../doc/apis/events.md#disable-events) | ||
* [Enable Events](../../doc/apis/events.md#enable-events) | ||
* [List Event Types](../../doc/apis/events.md#list-event-types) | ||
|
||
|
||
# Search Events | ||
|
||
Search for Square API events that occur within a 28-day timeframe. | ||
|
||
```php | ||
function searchEvents(SearchEventsRequest $body): ApiResponse | ||
``` | ||
|
||
## 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. | | ||
|
||
## Response Type | ||
|
||
This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`SearchEventsResponse`](../../doc/models/search-events-response.md). | ||
|
||
## Example Usage | ||
|
||
```php | ||
$body = SearchEventsRequestBuilder::init()->build(); | ||
|
||
$apiResponse = $eventsApi->searchEvents($body); | ||
|
||
if ($apiResponse->isSuccess()) { | ||
$searchEventsResponse = $apiResponse->getResult(); | ||
} else { | ||
$errors = $apiResponse->getErrors(); | ||
} | ||
|
||
// Getting more response information | ||
var_dump($apiResponse->getStatusCode()); | ||
var_dump($apiResponse->getHeaders()); | ||
``` | ||
|
||
|
||
# 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. | ||
|
||
```php | ||
function disableEvents(): ApiResponse | ||
``` | ||
|
||
## Response Type | ||
|
||
This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`DisableEventsResponse`](../../doc/models/disable-events-response.md). | ||
|
||
## Example Usage | ||
|
||
```php | ||
$apiResponse = $eventsApi->disableEvents(); | ||
|
||
if ($apiResponse->isSuccess()) { | ||
$disableEventsResponse = $apiResponse->getResult(); | ||
} else { | ||
$errors = $apiResponse->getErrors(); | ||
} | ||
|
||
// Getting more response information | ||
var_dump($apiResponse->getStatusCode()); | ||
var_dump($apiResponse->getHeaders()); | ||
``` | ||
|
||
|
||
# Enable Events | ||
|
||
Enables events to make them searchable. Only events that occur while in the enabled state are searchable. | ||
|
||
```php | ||
function enableEvents(): ApiResponse | ||
``` | ||
|
||
## Response Type | ||
|
||
This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`EnableEventsResponse`](../../doc/models/enable-events-response.md). | ||
|
||
## Example Usage | ||
|
||
```php | ||
$apiResponse = $eventsApi->enableEvents(); | ||
|
||
if ($apiResponse->isSuccess()) { | ||
$enableEventsResponse = $apiResponse->getResult(); | ||
} else { | ||
$errors = $apiResponse->getErrors(); | ||
} | ||
|
||
// Getting more response information | ||
var_dump($apiResponse->getStatusCode()); | ||
var_dump($apiResponse->getHeaders()); | ||
``` | ||
|
||
|
||
# List Event Types | ||
|
||
Lists all event types that you can subscribe to as webhooks or query using the Events API. | ||
|
||
```php | ||
function listEventTypes(?string $apiVersion = null): ApiResponse | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Tags | Description | | ||
| --- | --- | --- | --- | | ||
| `apiVersion` | `?string` | Query, Optional | The API version for which to list event types. Setting this field overrides the default version used by the application. | | ||
|
||
## Response Type | ||
|
||
This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListEventTypesResponse`](../../doc/models/list-event-types-response.md). | ||
|
||
## Example Usage | ||
|
||
```php | ||
$apiResponse = $eventsApi->listEventTypes(); | ||
|
||
if ($apiResponse->isSuccess()) { | ||
$listEventTypesResponse = $apiResponse->getResult(); | ||
} else { | ||
$errors = $apiResponse->getErrors(); | ||
} | ||
|
||
// Getting more response information | ||
var_dump($apiResponse->getStatusCode()); | ||
var_dump($apiResponse->getHeaders()); | ||
``` | ||
|
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/apis/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 | Getter | Setter | | ||
| --- | --- | --- | --- | --- | --- | | ||
| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | | ||
|
||
## 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/apis/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 | Getter | Setter | | ||
| --- | --- | --- | --- | --- | --- | | ||
| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | | ||
|
||
## 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 | Getter | Setter | | ||
| --- | --- | --- | --- | --- | --- | | ||
| `eventId` | `?string` | Optional | A unique ID for the event. | getEventId(): ?string | setEventId(?string eventId): void | | ||
| `apiVersion` | `?string` | 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. | getApiVersion(): ?string | setApiVersion(?string apiVersion): void | | ||
|
||
## 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 | Getter | Setter | | ||
| --- | --- | --- | --- | --- | --- | | ||
| `apiVersion` | `?string` | Optional | The API version for which to list event types. Setting this field overrides the default version used by the application. | getApiVersion(): ?string | setApiVersion(?string apiVersion): void | | ||
|
||
## Example (as JSON) | ||
|
||
```json | ||
{ | ||
"api_version": "api_version0" | ||
} | ||
``` | ||
|
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,52 @@ | ||
|
||
# List Event Types Response | ||
|
||
Defines the fields that are included in the response body of | ||
a request to the [ListEventTypes](../../doc/apis/events.md#list-event-types) endpoint. | ||
|
||
Note: if there are errors processing the request, the event types field will not be | ||
present. | ||
|
||
## Structure | ||
|
||
`ListEventTypesResponse` | ||
|
||
## Fields | ||
|
||
| Name | Type | Tags | Description | Getter | Setter | | ||
| --- | --- | --- | --- | --- | --- | | ||
| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | | ||
| `eventTypes` | `?(string[])` | Optional | The list of event types. | getEventTypes(): ?array | setEventTypes(?array eventTypes): void | | ||
| `metadata` | [`?(EventTypeMetadata[])`](../../doc/models/event-type-metadata.md) | Optional | Contains the metadata of an event type. For more information, see [EventTypeMetadata](entity:EventTypeMetadata). | getMetadata(): ?array | setMetadata(?array metadata): void | | ||
|
||
## Example (as JSON) | ||
|
||
```json | ||
{ | ||
"event_types": [ | ||
"inventory.count.updated" | ||
], | ||
"metadata": [ | ||
{ | ||
"api_version_introduced": "2018-07-12", | ||
"event_type": "inventory.count.updated", | ||
"release_status": "PUBLIC" | ||
} | ||
], | ||
"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" | ||
} | ||
] | ||
} | ||
``` | ||
|
Oops, something went wrong.