Skip to content

Commit

Permalink
Merge pull request #109 from square/release/34.0.0.20231018
Browse files Browse the repository at this point in the history
Generated PR for Release: 34.0.0.20231018
  • Loading branch information
joanc-sq authored Oct 17, 2023
2 parents c70e66d + 64802be commit 6b432a8
Show file tree
Hide file tree
Showing 60 changed files with 3,009 additions and 178 deletions.
72 changes: 72 additions & 0 deletions doc/api/bookings.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ BookingsApi bookingsApi = client.getBookingsApi();
* [Search Availability](../../doc/api/bookings.md#search-availability)
* [Bulk Retrieve Bookings](../../doc/api/bookings.md#bulk-retrieve-bookings)
* [Retrieve Business Booking Profile](../../doc/api/bookings.md#retrieve-business-booking-profile)
* [List Location Booking Profiles](../../doc/api/bookings.md#list-location-booking-profiles)
* [Retrieve Location Booking Profile](../../doc/api/bookings.md#retrieve-location-booking-profile)
* [List Team Member Booking Profiles](../../doc/api/bookings.md#list-team-member-booking-profiles)
* [Bulk Retrieve Team Member Booking Profiles](../../doc/api/bookings.md#bulk-retrieve-team-member-booking-profiles)
* [Retrieve Team Member Booking Profile](../../doc/api/bookings.md#retrieve-team-member-booking-profile)
Expand Down Expand Up @@ -243,6 +245,76 @@ bookingsApi.retrieveBusinessBookingProfileAsync().thenAccept(result -> {
```


# List Location Booking Profiles

Lists location booking profiles of a seller.

```java
CompletableFuture<ListLocationBookingProfilesResponse> listLocationBookingProfilesAsync(
final Integer limit,
final String cursor)
```

## Parameters

| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `limit` | `Integer` | Query, Optional | The maximum number of results to return in a paged response. |
| `cursor` | `String` | Query, Optional | The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results. |

## Response Type

[`ListLocationBookingProfilesResponse`](../../doc/models/list-location-booking-profiles-response.md)

## Example Usage

```java
bookingsApi.listLocationBookingProfilesAsync(null, null).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
```


# Retrieve Location Booking Profile

Retrieves a seller's location booking profile.

```java
CompletableFuture<RetrieveLocationBookingProfileResponse> retrieveLocationBookingProfileAsync(
final String locationId)
```

## Parameters

| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `locationId` | `String` | Template, Required | The ID of the location to retrieve the booking profile. |

## Response Type

[`RetrieveLocationBookingProfileResponse`](../../doc/models/retrieve-location-booking-profile-response.md)

## Example Usage

```java
String locationId = "location_id4";

bookingsApi.retrieveLocationBookingProfileAsync(locationId).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
```


# List Team Member Booking Profiles

Lists booking profiles for team members.
Expand Down
8 changes: 2 additions & 6 deletions doc/api/employees.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ EmployeesApi employeesApi = client.getEmployeesApi();

# List Employees

**This endpoint is deprecated.**

ListEmployees
**This endpoint is deprecated.**

```java
CompletableFuture<ListEmployeesResponse> listEmployeesAsync(
Expand Down Expand Up @@ -57,9 +55,7 @@ employeesApi.listEmployeesAsync(null, null, null, null).thenAccept(result -> {

# Retrieve Employee

**This endpoint is deprecated.**

RetrieveEmployee
**This endpoint is deprecated.**

```java
CompletableFuture<RetrieveEmployeeResponse> retrieveEmployeeAsync(
Expand Down
88 changes: 86 additions & 2 deletions doc/api/subscriptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ SubscriptionsApi subscriptionsApi = client.getSubscriptionsApi();
## Methods

* [Create Subscription](../../doc/api/subscriptions.md#create-subscription)
* [Bulk Swap Plan](../../doc/api/subscriptions.md#bulk-swap-plan)
* [Search Subscriptions](../../doc/api/subscriptions.md#search-subscriptions)
* [Retrieve Subscription](../../doc/api/subscriptions.md#retrieve-subscription)
* [Update Subscription](../../doc/api/subscriptions.md#update-subscription)
* [Delete Subscription Action](../../doc/api/subscriptions.md#delete-subscription-action)
* [Change Billing Anchor Date](../../doc/api/subscriptions.md#change-billing-anchor-date)
* [Cancel Subscription](../../doc/api/subscriptions.md#cancel-subscription)
* [List Subscription Events](../../doc/api/subscriptions.md#list-subscription-events)
* [Pause Subscription](../../doc/api/subscriptions.md#pause-subscription)
Expand Down Expand Up @@ -65,7 +67,7 @@ CreateSubscriptionRequest body = new CreateSubscriptionRequest.Builder(
.build())
.phases(Arrays.asList(
new Phase.Builder()
.ordinal(0)
.ordinal(0L)
.orderTemplateId("U2NaowWxzXwpsZU697x7ZHOAnCNZY")
.build()
))
Expand All @@ -82,6 +84,47 @@ subscriptionsApi.createSubscriptionAsync(body).thenAccept(result -> {
```


# Bulk Swap Plan

Schedules a plan variation change for all active subscriptions under a given plan
variation. For more information, see [Swap Subscription Plan Variations](https://developer.squareup.com/docs/subscriptions-api/swap-plan-variations).

```java
CompletableFuture<BulkSwapPlanResponse> bulkSwapPlanAsync(
final BulkSwapPlanRequest body)
```

## Parameters

| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `body` | [`BulkSwapPlanRequest`](../../doc/models/bulk-swap-plan-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

[`BulkSwapPlanResponse`](../../doc/models/bulk-swap-plan-response.md)

## Example Usage

```java
BulkSwapPlanRequest body = new BulkSwapPlanRequest.Builder(
"FQ7CDXXWSLUJRPM3GFJSJGZ7",
"6JHXF3B2CW3YKHDV4XEM674H",
"S8GWD5R9QB376"
)
.build();

subscriptionsApi.bulkSwapPlanAsync(body).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
```


# Search Subscriptions

Searches for subscriptions.
Expand Down Expand Up @@ -263,6 +306,47 @@ subscriptionsApi.deleteSubscriptionActionAsync(subscriptionId, actionId).thenAcc
```


# Change Billing Anchor Date

Changes the [billing anchor date](https://developer.squareup.com/docs/subscriptions-api/subscription-billing#billing-dates)
for a subscription.

```java
CompletableFuture<ChangeBillingAnchorDateResponse> changeBillingAnchorDateAsync(
final String subscriptionId,
final ChangeBillingAnchorDateRequest body)
```

## Parameters

| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `subscriptionId` | `String` | Template, Required | The ID of the subscription to update the billing anchor date. |
| `body` | [`ChangeBillingAnchorDateRequest`](../../doc/models/change-billing-anchor-date-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

[`ChangeBillingAnchorDateResponse`](../../doc/models/change-billing-anchor-date-response.md)

## Example Usage

```java
String subscriptionId = "subscription_id0";
ChangeBillingAnchorDateRequest body = new ChangeBillingAnchorDateRequest.Builder()
.monthlyBillingAnchorDate(1)
.build();

subscriptionsApi.changeBillingAnchorDateAsync(subscriptionId, body).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
```


# Cancel Subscription

Schedules a `CANCEL` action to cancel an active subscription. This
Expand Down Expand Up @@ -447,7 +531,7 @@ SwapPlanRequest body = new SwapPlanRequest.Builder()
.newPlanVariationId("FQ7CDXXWSLUJRPM3GFJSJGZ7")
.phases(Arrays.asList(
new PhaseInput.Builder(
0
0L
)
.orderTemplateId("uhhnjH9osVv3shUADwaC0b3hNxQZY")
.build()
Expand Down
6 changes: 3 additions & 3 deletions doc/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The following parameters are configurable for the API Client:

| Parameter | Type | Description |
| --- | --- | --- |
| `squareVersion` | `String` | Square Connect API versions<br>*Default*: `"2023-09-25"` |
| `squareVersion` | `String` | Square Connect API versions<br>*Default*: `"2023-10-18"` |
| `customUrl` | `String` | Sets the base URL requests are made to. Defaults to `https://connect.squareup.com`<br>*Default*: `"https://connect.squareup.com"` |
| `environment` | `string` | The API environment. <br> **Default: `production`** |
| `httpClientConfig` | [`ReadonlyHttpClientConfiguration`](http-client-configuration.md) | Http Client Configuration instance. |
Expand All @@ -19,7 +19,7 @@ The API client can be initialized as follows:
SquareClient client = new SquareClient.Builder()
.httpClientConfig(configBuilder -> configBuilder
.timeout(0))
.squareVersion("2023-09-25")
.squareVersion("2023-10-18")
.accessToken("AccessToken")
.environment(Environment.PRODUCTION)
.customUrl("https://connect.squareup.com")
Expand All @@ -40,7 +40,7 @@ public class Program {
SquareClient client = new SquareClient.Builder()
.httpClientConfig(configBuilder -> configBuilder
.timeout(0))
.squareVersion("2023-09-25")
.squareVersion("2023-10-18")
.accessToken("AccessToken")
.build();

Expand Down
28 changes: 28 additions & 0 deletions doc/models/bulk-swap-plan-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

# Bulk Swap Plan Request

Defines input parameters in a call to the
[BulkSwapPlan](../../doc/api/subscriptions.md#bulk-swap-plan) endpoint.

## Structure

`BulkSwapPlanRequest`

## Fields

| Name | Type | Tags | Description | Getter |
| --- | --- | --- | --- | --- |
| `NewPlanVariationId` | `String` | Required | The ID of the new subscription plan variation.<br><br>This field is required.<br>**Constraints**: *Minimum Length*: `1` | String getNewPlanVariationId() |
| `OldPlanVariationId` | `String` | Required | The ID of the plan variation whose subscriptions should be swapped. Active subscriptions<br>using this plan variation will be subscribed to the new plan variation on their next billing<br>day.<br>**Constraints**: *Minimum Length*: `1` | String getOldPlanVariationId() |
| `LocationId` | `String` | Required | The ID of the location to associate with the swapped subscriptions.<br>**Constraints**: *Minimum Length*: `1` | String getLocationId() |

## Example (as JSON)

```json
{
"location_id": "S8GWD5R9QB376",
"new_plan_variation_id": "FQ7CDXXWSLUJRPM3GFJSJGZ7",
"old_plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H"
}
```

39 changes: 39 additions & 0 deletions doc/models/bulk-swap-plan-response.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

# Bulk Swap Plan Response

Defines output parameters in a response of the
[BulkSwapPlan](../../doc/api/subscriptions.md#bulk-swap-plan) endpoint.

## Structure

`BulkSwapPlanResponse`

## Fields

| Name | Type | Tags | Description | Getter |
| --- | --- | --- | --- | --- |
| `Errors` | [`List<Error>`](../../doc/models/error.md) | Optional | Errors encountered during the request. | List<Error> getErrors() |
| `AffectedSubscriptions` | `Integer` | Optional | The number of affected subscriptions. | Integer getAffectedSubscriptions() |

## Example (as JSON)

```json
{
"affected_subscriptions": 12,
"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"
}
]
}
```

2 changes: 2 additions & 0 deletions doc/models/business-booking-profile.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

# Business Booking Profile

A seller's business booking profile, including booking policy, appointment settings, etc.

## Structure

`BusinessBookingProfile`
Expand Down
18 changes: 9 additions & 9 deletions doc/models/cancel-subscription-response.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ Defines output parameters in a response from the
"actions": [
{
"id": "id8",
"type": "CANCEL",
"type": "RESUME",
"effective_date": "effective_date8",
"monthly_billing_anchor_date": 186,
"phases": [
{
"uid": "uid0",
Expand All @@ -85,13 +86,13 @@ Defines output parameters in a response from the
"order_template_id": "order_template_id2",
"plan_phase_uid": "plan_phase_uid6"
}
],
"new_plan_variation_id": "new_plan_variation_id8"
]
},
{
"id": "id8",
"type": "CANCEL",
"type": "RESUME",
"effective_date": "effective_date8",
"monthly_billing_anchor_date": 186,
"phases": [
{
"uid": "uid0",
Expand All @@ -111,13 +112,13 @@ Defines output parameters in a response from the
"order_template_id": "order_template_id2",
"plan_phase_uid": "plan_phase_uid6"
}
],
"new_plan_variation_id": "new_plan_variation_id8"
]
},
{
"id": "id8",
"type": "CANCEL",
"type": "RESUME",
"effective_date": "effective_date8",
"monthly_billing_anchor_date": 186,
"phases": [
{
"uid": "uid0",
Expand All @@ -137,8 +138,7 @@ Defines output parameters in a response from the
"order_template_id": "order_template_id2",
"plan_phase_uid": "plan_phase_uid6"
}
],
"new_plan_variation_id": "new_plan_variation_id8"
]
}
]
}
Expand Down
Loading

0 comments on commit 6b432a8

Please sign in to comment.