Skip to content

Commit ce5be46

Browse files
Merge pull request #119 from square/release/40.1.0.20240604
Generated PR for Release: 40.1.0.20240604
2 parents 3c30fae + ed3939b commit ce5be46

34 files changed

+2602
-33
lines changed

doc/api/events.md

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# Events
2+
3+
```java
4+
EventsApi eventsApi = client.getEventsApi();
5+
```
6+
7+
## Class Name
8+
9+
`EventsApi`
10+
11+
## Methods
12+
13+
* [Search Events](../../doc/api/events.md#search-events)
14+
* [Disable Events](../../doc/api/events.md#disable-events)
15+
* [Enable Events](../../doc/api/events.md#enable-events)
16+
* [List Event Types](../../doc/api/events.md#list-event-types)
17+
18+
19+
# Search Events
20+
21+
Search for Square API events that occur within a 28-day timeframe.
22+
23+
```java
24+
CompletableFuture<SearchEventsResponse> searchEventsAsync(
25+
final SearchEventsRequest body)
26+
```
27+
28+
## Parameters
29+
30+
| Parameter | Type | Tags | Description |
31+
| --- | --- | --- | --- |
32+
| `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. |
33+
34+
## Response Type
35+
36+
[`SearchEventsResponse`](../../doc/models/search-events-response.md)
37+
38+
## Example Usage
39+
40+
```java
41+
SearchEventsRequest body = new SearchEventsRequest.Builder()
42+
.build();
43+
44+
eventsApi.searchEventsAsync(body).thenAccept(result -> {
45+
// TODO success callback handler
46+
System.out.println(result);
47+
}).exceptionally(exception -> {
48+
// TODO failure callback handler
49+
exception.printStackTrace();
50+
return null;
51+
});
52+
```
53+
54+
55+
# Disable Events
56+
57+
Disables events to prevent them from being searchable.
58+
All events are disabled by default. You must enable events to make them searchable.
59+
Disabling events for a specific time period prevents them from being searchable, even if you re-enable them later.
60+
61+
```java
62+
CompletableFuture<DisableEventsResponse> disableEventsAsync()
63+
```
64+
65+
## Response Type
66+
67+
[`DisableEventsResponse`](../../doc/models/disable-events-response.md)
68+
69+
## Example Usage
70+
71+
```java
72+
eventsApi.disableEventsAsync().thenAccept(result -> {
73+
// TODO success callback handler
74+
System.out.println(result);
75+
}).exceptionally(exception -> {
76+
// TODO failure callback handler
77+
exception.printStackTrace();
78+
return null;
79+
});
80+
```
81+
82+
83+
# Enable Events
84+
85+
Enables events to make them searchable. Only events that occur while in the enabled state are searchable.
86+
87+
```java
88+
CompletableFuture<EnableEventsResponse> enableEventsAsync()
89+
```
90+
91+
## Response Type
92+
93+
[`EnableEventsResponse`](../../doc/models/enable-events-response.md)
94+
95+
## Example Usage
96+
97+
```java
98+
eventsApi.enableEventsAsync().thenAccept(result -> {
99+
// TODO success callback handler
100+
System.out.println(result);
101+
}).exceptionally(exception -> {
102+
// TODO failure callback handler
103+
exception.printStackTrace();
104+
return null;
105+
});
106+
```
107+
108+
109+
# List Event Types
110+
111+
Lists all event types that you can subscribe to as webhooks or query using the Events API.
112+
113+
```java
114+
CompletableFuture<ListEventTypesResponse> listEventTypesAsync(
115+
final String apiVersion)
116+
```
117+
118+
## Parameters
119+
120+
| Parameter | Type | Tags | Description |
121+
| --- | --- | --- | --- |
122+
| `apiVersion` | `String` | Query, Optional | The API version for which to list event types. Setting this field overrides the default version used by the application. |
123+
124+
## Response Type
125+
126+
[`ListEventTypesResponse`](../../doc/models/list-event-types-response.md)
127+
128+
## Example Usage
129+
130+
```java
131+
eventsApi.listEventTypesAsync(null).thenAccept(result -> {
132+
// TODO success callback handler
133+
System.out.println(result);
134+
}).exceptionally(exception -> {
135+
// TODO failure callback handler
136+
exception.printStackTrace();
137+
return null;
138+
});
139+
```
140+

doc/client.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ The following parameters are configurable for the API Client:
55

66
| Parameter | Type | Description |
77
| --- | --- | --- |
8-
| `squareVersion` | `String` | Square Connect API versions<br>*Default*: `"2024-05-15"` |
8+
| `squareVersion` | `String` | Square Connect API versions<br>*Default*: `"2024-06-04"` |
99
| `customUrl` | `String` | Sets the base URL requests are made to. Defaults to `https://connect.squareup.com`<br>*Default*: `"https://connect.squareup.com"` |
1010
| `environment` | `string` | The API environment. <br> **Default: `production`** |
11-
| `httpClientConfig` | [`ReadonlyHttpClientConfiguration`](http-client-configuration.md) | Http Client Configuration instance. |
11+
| `httpClientConfig` | [`Consumer<HttpClientConfiguration.Builder>`](http-client-configuration-builder.md) | Set up Http Client Configuration instance. |
1212
| `additionalHeaders` | [`Headers`](headers.md) | Additional headers to add to each API request.<br>*Default*: `new Headers()` |
1313
| `userAgentDetail` | `String` | Additional detail which can be appended with User-Agent header.<br>*Default*: `"null"` |
1414
| `bearerAuthCredentials` | [`BearerAuthCredentials`](auth/oauth-2-bearer-token.md) | The Credentials Setter for OAuth 2 Bearer token |
@@ -19,7 +19,7 @@ The API client can be initialized as follows:
1919
SquareClient client = new SquareClient.Builder()
2020
.httpClientConfig(configBuilder -> configBuilder
2121
.timeout(0))
22-
.squareVersion("2024-05-15")
22+
.squareVersion("2024-06-04")
2323
.bearerAuthCredentials(new BearerAuthModel.Builder(
2424
"AccessToken"
2525
)
@@ -44,7 +44,7 @@ public class Program {
4444
SquareClient client = new SquareClient.Builder()
4545
.httpClientConfig(configBuilder -> configBuilder
4646
.timeout(0))
47-
.squareVersion("2024-05-15")
47+
.squareVersion("2024-06-04")
4848
.bearerAuthCredentials(new BearerAuthModel.Builder(
4949
"AccessToken"
5050
)
@@ -90,6 +90,7 @@ The gateway for the SDK. This class acts as a factory for the Apis and also hold
9090
| `getDevicesApi()` | Provides access to Devices controller. | `DevicesApi` |
9191
| `getDisputesApi()` | Provides access to Disputes controller. | `DisputesApi` |
9292
| `getEmployeesApi()` | Provides access to Employees controller. | `EmployeesApi` |
93+
| `getEventsApi()` | Provides access to Events controller. | `EventsApi` |
9394
| `getGiftCardsApi()` | Provides access to GiftCards controller. | `GiftCardsApi` |
9495
| `getGiftCardActivitiesApi()` | Provides access to GiftCardActivities controller. | `GiftCardActivitiesApi` |
9596
| `getInventoryApi()` | Provides access to Inventory controller. | `InventoryApi` |
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
2+
# Disable Events Response
3+
4+
Defines the fields that are included in the response body of
5+
a request to the [DisableEvents](../../doc/api/events.md#disable-events) endpoint.
6+
7+
Note: if there are errors processing the request, the events field will not be
8+
present.
9+
10+
## Structure
11+
12+
`DisableEventsResponse`
13+
14+
## Fields
15+
16+
| Name | Type | Tags | Description | Getter |
17+
| --- | --- | --- | --- | --- |
18+
| `Errors` | [`List<Error>`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | List<Error> getErrors() |
19+
20+
## Example (as JSON)
21+
22+
```json
23+
{
24+
"errors": [
25+
{
26+
"category": "MERCHANT_SUBSCRIPTION_ERROR",
27+
"code": "MAP_KEY_LENGTH_TOO_LONG",
28+
"detail": "detail6",
29+
"field": "field4"
30+
},
31+
{
32+
"category": "MERCHANT_SUBSCRIPTION_ERROR",
33+
"code": "MAP_KEY_LENGTH_TOO_LONG",
34+
"detail": "detail6",
35+
"field": "field4"
36+
}
37+
]
38+
}
39+
```
40+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
2+
# Enable Events Response
3+
4+
Defines the fields that are included in the response body of
5+
a request to the [EnableEvents](../../doc/api/events.md#enable-events) endpoint.
6+
7+
Note: if there are errors processing the request, the events field will not be
8+
present.
9+
10+
## Structure
11+
12+
`EnableEventsResponse`
13+
14+
## Fields
15+
16+
| Name | Type | Tags | Description | Getter |
17+
| --- | --- | --- | --- | --- |
18+
| `Errors` | [`List<Error>`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | List<Error> getErrors() |
19+
20+
## Example (as JSON)
21+
22+
```json
23+
{
24+
"errors": [
25+
{
26+
"category": "MERCHANT_SUBSCRIPTION_ERROR",
27+
"code": "MAP_KEY_LENGTH_TOO_LONG",
28+
"detail": "detail6",
29+
"field": "field4"
30+
}
31+
]
32+
}
33+
```
34+

doc/models/event-data.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99

1010
| Name | Type | Tags | Description | Getter |
1111
| --- | --- | --- | --- | --- |
12-
| `Type` | `String` | Optional | Name of the affected object’s type. | String getType() |
13-
| `Id` | `String` | Optional | ID of the affected object. | String getId() |
14-
| `Deleted` | `Boolean` | Optional | Is true if the affected object was deleted. Otherwise absent. | Boolean getDeleted() |
15-
| `Object` | `JsonObject` | Optional | An object containing fields and values relevant to the event. Is absent if affected object was deleted. | JsonObject getObject() |
12+
| `Type` | `String` | Optional | The name of the affected object’s type. | String getType() |
13+
| `Id` | `String` | Optional | The ID of the affected object. | String getId() |
14+
| `Deleted` | `Boolean` | Optional | This is true if the affected object has been deleted; otherwise, it's absent. | Boolean getDeleted() |
15+
| `Object` | `JsonObject` | Optional | An object containing fields and values relevant to the event. It is absent if the affected object has been deleted. | JsonObject getObject() |
1616

1717
## Example (as JSON)
1818

doc/models/event-metadata.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
# Event Metadata
3+
4+
Contains metadata about a particular [Event](../../doc/models/event.md).
5+
6+
## Structure
7+
8+
`EventMetadata`
9+
10+
## Fields
11+
12+
| Name | Type | Tags | Description | Getter |
13+
| --- | --- | --- | --- | --- |
14+
| `EventId` | `String` | Optional | A unique ID for the event. | String getEventId() |
15+
| `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. | String getApiVersion() |
16+
17+
## Example (as JSON)
18+
19+
```json
20+
{
21+
"event_id": "event_id0",
22+
"api_version": "api_version6"
23+
}
24+
```
25+

doc/models/event.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
| Name | Type | Tags | Description | Getter |
1111
| --- | --- | --- | --- | --- |
1212
| `MerchantId` | `String` | Optional | The ID of the target merchant associated with the event. | String getMerchantId() |
13-
| `LocationId` | `String` | Optional | The ID of the location associated with the event. | String getLocationId() |
13+
| `LocationId` | `String` | Optional | The ID of the target location associated with the event. | String getLocationId() |
1414
| `Type` | `String` | Optional | The type of event this represents. | String getType() |
1515
| `EventId` | `String` | Optional | A unique ID for the event. | String getEventId() |
1616
| `CreatedAt` | `String` | Optional | Timestamp of when the event was created, in RFC 3339 format. | String getCreatedAt() |
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
# List Event Types Request
3+
4+
Lists all event types that can be subscribed to.
5+
6+
## Structure
7+
8+
`ListEventTypesRequest`
9+
10+
## Fields
11+
12+
| Name | Type | Tags | Description | Getter |
13+
| --- | --- | --- | --- | --- |
14+
| `ApiVersion` | `String` | Optional | The API version for which to list event types. Setting this field overrides the default version used by the application. | String getApiVersion() |
15+
16+
## Example (as JSON)
17+
18+
```json
19+
{
20+
"api_version": "api_version0"
21+
}
22+
```
23+
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
2+
# List Event Types Response
3+
4+
Defines the fields that are included in the response body of
5+
a request to the [ListEventTypes](../../doc/api/events.md#list-event-types) endpoint.
6+
7+
Note: if there are errors processing the request, the event types field will not be
8+
present.
9+
10+
## Structure
11+
12+
`ListEventTypesResponse`
13+
14+
## Fields
15+
16+
| Name | Type | Tags | Description | Getter |
17+
| --- | --- | --- | --- | --- |
18+
| `Errors` | [`List<Error>`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | List<Error> getErrors() |
19+
| `EventTypes` | `List<String>` | Optional | The list of event types. | List<String> getEventTypes() |
20+
| `Metadata` | [`List<EventTypeMetadata>`](../../doc/models/event-type-metadata.md) | Optional | Contains the metadata of an event type. For more information, see [EventTypeMetadata](entity:EventTypeMetadata). | List<EventTypeMetadata> getMetadata() |
21+
22+
## Example (as JSON)
23+
24+
```json
25+
{
26+
"event_types": [
27+
"inventory.count.updated"
28+
],
29+
"metadata": [
30+
{
31+
"api_version_introduced": "2018-07-12",
32+
"event_type": "inventory.count.updated",
33+
"release_status": "PUBLIC"
34+
}
35+
],
36+
"errors": [
37+
{
38+
"category": "MERCHANT_SUBSCRIPTION_ERROR",
39+
"code": "MAP_KEY_LENGTH_TOO_LONG",
40+
"detail": "detail6",
41+
"field": "field4"
42+
},
43+
{
44+
"category": "MERCHANT_SUBSCRIPTION_ERROR",
45+
"code": "MAP_KEY_LENGTH_TOO_LONG",
46+
"detail": "detail6",
47+
"field": "field4"
48+
}
49+
]
50+
}
51+
```
52+

doc/models/quantity-ratio.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ A whole number or unreduced fractional ratio.
1212
| Name | Type | Tags | Description | Getter |
1313
| --- | --- | --- | --- | --- |
1414
| `Quantity` | `Integer` | Optional | The whole or fractional quantity as the numerator. | Integer getQuantity() |
15-
| `QuantityDenominator` | `Integer` | Optional | The whole or fractional quantity as the denominator.<br>In the case of fractional quantity this field is the denominator and quantity is the numerator.<br>When unspecified, the value is `1`. For example, when `quantity=3` and `quantity_donominator` is unspecified,<br>the quantity ratio is `3` or `3/1`. | Integer getQuantityDenominator() |
15+
| `QuantityDenominator` | `Integer` | Optional | The whole or fractional quantity as the denominator.<br>With fractional quantity this field is the denominator and quantity is the numerator.<br>The default value is `1`. For example, when `quantity=3` and `quantity_denominator` is unspecified,<br>the quantity ratio is `3` or `3/1`. | Integer getQuantityDenominator() |
1616

1717
## Example (as JSON)
1818

0 commit comments

Comments
 (0)