Skip to content

Commit e7bb101

Browse files
authored
Merge pull request #10 from square/release/5.2.0.20200422
release
2 parents 1a43b33 + 8819831 commit e7bb101

File tree

161 files changed

+11050
-242
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+11050
-242
lines changed

doc/customer-groups.md

Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
# Customer Groups
2+
3+
```java
4+
CustomerGroupsApi customerGroupsApi = client.getCustomerGroupsApi();
5+
```
6+
7+
## Class Name
8+
9+
`CustomerGroupsApi`
10+
11+
## Methods
12+
13+
* [List Customer Groups](/doc/customer-groups.md#list-customer-groups)
14+
* [Create Customer Group](/doc/customer-groups.md#create-customer-group)
15+
* [Delete Customer Group](/doc/customer-groups.md#delete-customer-group)
16+
* [Retrieve Customer Group](/doc/customer-groups.md#retrieve-customer-group)
17+
* [Update Customer Group](/doc/customer-groups.md#update-customer-group)
18+
19+
## List Customer Groups
20+
21+
Retrieves the list of customer groups of a business.
22+
23+
```java
24+
CompletableFuture<ListCustomerGroupsResponse> listCustomerGroupsAsync(
25+
final String cursor)
26+
```
27+
28+
### Parameters
29+
30+
| Parameter | Type | Tags | Description |
31+
| --- | --- | --- | --- |
32+
| `cursor` | `String` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.<br>Provide this to retrieve the next set of results for your original query.<br><br>See the [Pagination guide](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. |
33+
34+
### Response Type
35+
36+
[`ListCustomerGroupsResponse`](/doc/models/list-customer-groups-response.md)
37+
38+
### Example Usage
39+
40+
```java
41+
customerGroupsApi.listCustomerGroupsAsync(null).thenAccept(result -> {
42+
// TODO success callback handler
43+
}).exceptionally(exception -> {
44+
// TODO failure callback handler
45+
return null;
46+
});
47+
```
48+
49+
## Create Customer Group
50+
51+
Creates a new customer group for a business.
52+
53+
The request must include at least the `name` value of the group.
54+
55+
```java
56+
CompletableFuture<CreateCustomerGroupResponse> createCustomerGroupAsync(
57+
final CreateCustomerGroupRequest body)
58+
```
59+
60+
### Parameters
61+
62+
| Parameter | Type | Tags | Description |
63+
| --- | --- | --- | --- |
64+
| `body` | [`CreateCustomerGroupRequest`](/doc/models/create-customer-group-request.md) | Body, Required | An object containing the fields to POST for the request.<br><br>See the corresponding object definition for field details. |
65+
66+
### Response Type
67+
68+
[`CreateCustomerGroupResponse`](/doc/models/create-customer-group-response.md)
69+
70+
### Example Usage
71+
72+
```java
73+
CustomerGroup bodyGroup = new CustomerGroup.Builder(
74+
"Loyal Customers")
75+
.build();
76+
CreateCustomerGroupRequest body = new CreateCustomerGroupRequest.Builder(
77+
bodyGroup)
78+
.build();
79+
80+
customerGroupsApi.createCustomerGroupAsync(body).thenAccept(result -> {
81+
// TODO success callback handler
82+
}).exceptionally(exception -> {
83+
// TODO failure callback handler
84+
return null;
85+
});
86+
```
87+
88+
## Delete Customer Group
89+
90+
Deletes a customer group as identified by the `group_id` value.
91+
92+
```java
93+
CompletableFuture<DeleteCustomerGroupResponse> deleteCustomerGroupAsync(
94+
final String groupId)
95+
```
96+
97+
### Parameters
98+
99+
| Parameter | Type | Tags | Description |
100+
| --- | --- | --- | --- |
101+
| `groupId` | `String` | Template, Required | The ID of the customer group to delete. |
102+
103+
### Response Type
104+
105+
[`DeleteCustomerGroupResponse`](/doc/models/delete-customer-group-response.md)
106+
107+
### Example Usage
108+
109+
```java
110+
String groupId = "group_id0";
111+
112+
customerGroupsApi.deleteCustomerGroupAsync(groupId).thenAccept(result -> {
113+
// TODO success callback handler
114+
}).exceptionally(exception -> {
115+
// TODO failure callback handler
116+
return null;
117+
});
118+
```
119+
120+
## Retrieve Customer Group
121+
122+
Retrieves a specific customer group as identified by the `group_id` value.
123+
124+
```java
125+
CompletableFuture<RetrieveCustomerGroupResponse> retrieveCustomerGroupAsync(
126+
final String groupId)
127+
```
128+
129+
### Parameters
130+
131+
| Parameter | Type | Tags | Description |
132+
| --- | --- | --- | --- |
133+
| `groupId` | `String` | Template, Required | The ID of the customer group to retrieve. |
134+
135+
### Response Type
136+
137+
[`RetrieveCustomerGroupResponse`](/doc/models/retrieve-customer-group-response.md)
138+
139+
### Example Usage
140+
141+
```java
142+
String groupId = "group_id0";
143+
144+
customerGroupsApi.retrieveCustomerGroupAsync(groupId).thenAccept(result -> {
145+
// TODO success callback handler
146+
}).exceptionally(exception -> {
147+
// TODO failure callback handler
148+
return null;
149+
});
150+
```
151+
152+
## Update Customer Group
153+
154+
Updates a customer group as identified by the `group_id` value.
155+
156+
```java
157+
CompletableFuture<UpdateCustomerGroupResponse> updateCustomerGroupAsync(
158+
final String groupId,
159+
final UpdateCustomerGroupRequest body)
160+
```
161+
162+
### Parameters
163+
164+
| Parameter | Type | Tags | Description |
165+
| --- | --- | --- | --- |
166+
| `groupId` | `String` | Template, Required | The ID of the customer group to update. |
167+
| `body` | [`UpdateCustomerGroupRequest`](/doc/models/update-customer-group-request.md) | Body, Required | An object containing the fields to POST for the request.<br><br>See the corresponding object definition for field details. |
168+
169+
### Response Type
170+
171+
[`UpdateCustomerGroupResponse`](/doc/models/update-customer-group-response.md)
172+
173+
### Example Usage
174+
175+
```java
176+
String groupId = "group_id0";
177+
CustomerGroup bodyGroup = new CustomerGroup.Builder(
178+
"Loyal Customers")
179+
.build();
180+
UpdateCustomerGroupRequest body = new UpdateCustomerGroupRequest.Builder(
181+
bodyGroup)
182+
.build();
183+
184+
customerGroupsApi.updateCustomerGroupAsync(groupId, body).thenAccept(result -> {
185+
// TODO success callback handler
186+
}).exceptionally(exception -> {
187+
// TODO failure callback handler
188+
return null;
189+
});
190+
```
191+

doc/customer-segments.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Customer Segments
2+
3+
```java
4+
CustomerSegmentsApi customerSegmentsApi = client.getCustomerSegmentsApi();
5+
```
6+
7+
## Class Name
8+
9+
`CustomerSegmentsApi`
10+
11+
## Methods
12+
13+
* [List Customer Segments](/doc/customer-segments.md#list-customer-segments)
14+
* [Retrieve Customer Segment](/doc/customer-segments.md#retrieve-customer-segment)
15+
16+
## List Customer Segments
17+
18+
Retrieves the list of customer segments of a business.
19+
20+
```java
21+
CompletableFuture<ListCustomerSegmentsResponse> listCustomerSegmentsAsync(
22+
final String cursor,
23+
final Long limit)
24+
```
25+
26+
### Parameters
27+
28+
| Parameter | Type | Tags | Description |
29+
| --- | --- | --- | --- |
30+
| `cursor` | `String` | Query, Optional | A pagination cursor returned by previous calls to __ListCustomerSegments__.<br>Used to retrieve the next set of query results.<br><br>See the [Pagination guide](https://developer.squareup.com/docs/docs/working-with-apis/pagination) for more information. |
31+
| `limit` | `Long` | Query, Optional | Sets the maximum number of results to be returned in a single page.<br>Limit values outside the supported range are ignored.<br><br>Minimum value: `1`<br>Maximum value: `1,000` |
32+
33+
### Response Type
34+
35+
[`ListCustomerSegmentsResponse`](/doc/models/list-customer-segments-response.md)
36+
37+
### Example Usage
38+
39+
```java
40+
customerSegmentsApi.listCustomerSegmentsAsync(null, null).thenAccept(result -> {
41+
// TODO success callback handler
42+
}).exceptionally(exception -> {
43+
// TODO failure callback handler
44+
return null;
45+
});
46+
```
47+
48+
## Retrieve Customer Segment
49+
50+
Retrieves a specific customer segment as identified by the `segment_id` value.
51+
52+
```java
53+
CompletableFuture<RetrieveCustomerSegmentResponse> retrieveCustomerSegmentAsync(
54+
final String segmentId)
55+
```
56+
57+
### Parameters
58+
59+
| Parameter | Type | Tags | Description |
60+
| --- | --- | --- | --- |
61+
| `segmentId` | `String` | Template, Required | The Square-issued ID of the customer segment. |
62+
63+
### Response Type
64+
65+
[`RetrieveCustomerSegmentResponse`](/doc/models/retrieve-customer-segment-response.md)
66+
67+
### Example Usage
68+
69+
```java
70+
String segmentId = "segment_id4";
71+
72+
customerSegmentsApi.retrieveCustomerSegmentAsync(segmentId).thenAccept(result -> {
73+
// TODO success callback handler
74+
}).exceptionally(exception -> {
75+
// TODO failure callback handler
76+
return null;
77+
});
78+
```
79+

doc/customers.md

Lines changed: 79 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ CustomersApi customersApi = client.getCustomersApi();
1717
* [Retrieve Customer](/doc/customers.md#retrieve-customer)
1818
* [Update Customer](/doc/customers.md#update-customer)
1919
* [Create Customer Card](/doc/customers.md#create-customer-card)
20-
* [Delete Customer Card](/doc/customers.md#delete-customer-card)
20+
* [Delete Customer Card](/doc/customers.md#delete-customer-card)
21+
* [Remove Group From Customer](/doc/customers.md#remove-group-from-customer)
22+
* [Add Group to Customer](/doc/customers.md#add-group-to-customer)
2123

2224
## List Customers
2325

@@ -368,3 +370,79 @@ customersApi.deleteCustomerCardAsync(customerId, cardId).thenAccept(result -> {
368370
});
369371
```
370372

373+
## Remove Group From Customer
374+
375+
Removes a customer membership from a customer group.
376+
377+
The customer is identified by the `customer_id` value
378+
and the customer group is identified by the `group_id` value.
379+
380+
```java
381+
CompletableFuture<RemoveGroupFromCustomerResponse> removeGroupFromCustomerAsync(
382+
final String customerId,
383+
final String groupId)
384+
```
385+
386+
### Parameters
387+
388+
| Parameter | Type | Tags | Description |
389+
| --- | --- | --- | --- |
390+
| `customerId` | `String` | Template, Required | The ID of the customer to remove from the group. |
391+
| `groupId` | `String` | Template, Required | The ID of the customer group to remove the customer from. |
392+
393+
### Response Type
394+
395+
[`RemoveGroupFromCustomerResponse`](/doc/models/remove-group-from-customer-response.md)
396+
397+
### Example Usage
398+
399+
```java
400+
String customerId = "customer_id8";
401+
String groupId = "group_id0";
402+
403+
customersApi.removeGroupFromCustomerAsync(customerId, groupId).thenAccept(result -> {
404+
// TODO success callback handler
405+
}).exceptionally(exception -> {
406+
// TODO failure callback handler
407+
return null;
408+
});
409+
```
410+
411+
## Add Group to Customer
412+
413+
Adds a customer membership to a customer group.
414+
415+
The customer is identified by the `customer_id` value
416+
and the customer group is identified by the `group_id` value.
417+
418+
```java
419+
CompletableFuture<AddGroupToCustomerResponse> addGroupToCustomerAsync(
420+
final String customerId,
421+
final String groupId)
422+
```
423+
424+
### Parameters
425+
426+
| Parameter | Type | Tags | Description |
427+
| --- | --- | --- | --- |
428+
| `customerId` | `String` | Template, Required | The ID of the customer to add to a group. |
429+
| `groupId` | `String` | Template, Required | The ID of the customer group to add the customer to. |
430+
431+
### Response Type
432+
433+
[`AddGroupToCustomerResponse`](/doc/models/add-group-to-customer-response.md)
434+
435+
### Example Usage
436+
437+
```java
438+
String customerId = "customer_id8";
439+
String groupId = "group_id0";
440+
441+
customersApi.addGroupToCustomerAsync(customerId, groupId).thenAccept(result -> {
442+
// TODO success callback handler
443+
}).exceptionally(exception -> {
444+
// TODO failure callback handler
445+
return null;
446+
});
447+
```
448+

0 commit comments

Comments
 (0)