Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated PR for Release: 32.0.0.20231018 #124

Merged
merged 1 commit into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "square/square",
"description": "Use Square APIs to manage and run business including payment, customer, product, inventory, and employee management.",
"version": "31.0.0.20230925",
"version": "32.0.0.20231018",
"type": "library",
"keywords": [
"Square",
Expand Down
75 changes: 75 additions & 0 deletions doc/apis/bookings.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ $bookingsApi = $client->getBookingsApi();
* [Search Availability](../../doc/apis/bookings.md#search-availability)
* [Bulk Retrieve Bookings](../../doc/apis/bookings.md#bulk-retrieve-bookings)
* [Retrieve Business Booking Profile](../../doc/apis/bookings.md#retrieve-business-booking-profile)
* [List Location Booking Profiles](../../doc/apis/bookings.md#list-location-booking-profiles)
* [Retrieve Location Booking Profile](../../doc/apis/bookings.md#retrieve-location-booking-profile)
* [List Team Member Booking Profiles](../../doc/apis/bookings.md#list-team-member-booking-profiles)
* [Bulk Retrieve Team Member Booking Profiles](../../doc/apis/bookings.md#bulk-retrieve-team-member-booking-profiles)
* [Retrieve Team Member Booking Profile](../../doc/apis/bookings.md#retrieve-team-member-booking-profile)
Expand Down Expand Up @@ -249,6 +251,79 @@ var_dump($apiResponse->getHeaders());
```


# List Location Booking Profiles

Lists location booking profiles of a seller.

```php
function listLocationBookingProfiles(?int $limit = null, ?string $cursor = null): ApiResponse
```

## Parameters

| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `limit` | `?int` | 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

This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListLocationBookingProfilesResponse`](../../doc/models/list-location-booking-profiles-response.md).

## Example Usage

```php
$apiResponse = $bookingsApi->listLocationBookingProfiles();

if ($apiResponse->isSuccess()) {
$listLocationBookingProfilesResponse = $apiResponse->getResult();
} else {
$errors = $apiResponse->getErrors();
}

// Getting more response information
var_dump($apiResponse->getStatusCode());
var_dump($apiResponse->getHeaders());
```


# Retrieve Location Booking Profile

Retrieves a seller's location booking profile.

```php
function retrieveLocationBookingProfile(string $locationId): ApiResponse
```

## Parameters

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

## Response Type

This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveLocationBookingProfileResponse`](../../doc/models/retrieve-location-booking-profile-response.md).

## Example Usage

```php
$locationId = 'location_id4';

$apiResponse = $bookingsApi->retrieveLocationBookingProfile($locationId);

if ($apiResponse->isSuccess()) {
$retrieveLocationBookingProfileResponse = $apiResponse->getResult();
} else {
$errors = $apiResponse->getErrors();
}

// Getting more response information
var_dump($apiResponse->getStatusCode());
var_dump($apiResponse->getHeaders());
```


# List Team Member Booking Profiles

Lists booking profiles for team members.
Expand Down
4 changes: 0 additions & 4 deletions doc/apis/employees.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ $employeesApi = $client->getEmployeesApi();

**This endpoint is deprecated.**

ListEmployees

```php
function listEmployees(
?string $locationId = null,
Expand Down Expand Up @@ -63,8 +61,6 @@ var_dump($apiResponse->getHeaders());

**This endpoint is deprecated.**

RetrieveEmployee

```php
function retrieveEmployee(string $id): ApiResponse
```
Expand Down
90 changes: 90 additions & 0 deletions doc/apis/subscriptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ $subscriptionsApi = $client->getSubscriptionsApi();
## Methods

* [Create Subscription](../../doc/apis/subscriptions.md#create-subscription)
* [Bulk Swap Plan](../../doc/apis/subscriptions.md#bulk-swap-plan)
* [Search Subscriptions](../../doc/apis/subscriptions.md#search-subscriptions)
* [Retrieve Subscription](../../doc/apis/subscriptions.md#retrieve-subscription)
* [Update Subscription](../../doc/apis/subscriptions.md#update-subscription)
* [Delete Subscription Action](../../doc/apis/subscriptions.md#delete-subscription-action)
* [Change Billing Anchor Date](../../doc/apis/subscriptions.md#change-billing-anchor-date)
* [Cancel Subscription](../../doc/apis/subscriptions.md#cancel-subscription)
* [List Subscription Events](../../doc/apis/subscriptions.md#list-subscription-events)
* [Pause Subscription](../../doc/apis/subscriptions.md#pause-subscription)
Expand Down Expand Up @@ -88,6 +90,48 @@ var_dump($apiResponse->getHeaders());
```


# 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).

```php
function bulkSwapPlan(BulkSwapPlanRequest $body): ApiResponse
```

## 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

This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`BulkSwapPlanResponse`](../../doc/models/bulk-swap-plan-response.md).

## Example Usage

```php
$body = BulkSwapPlanRequestBuilder::init(
'FQ7CDXXWSLUJRPM3GFJSJGZ7',
'6JHXF3B2CW3YKHDV4XEM674H',
'S8GWD5R9QB376'
)->build();

$apiResponse = $subscriptionsApi->bulkSwapPlan($body);

if ($apiResponse->isSuccess()) {
$bulkSwapPlanResponse = $apiResponse->getResult();
} else {
$errors = $apiResponse->getErrors();
}

// Getting more response information
var_dump($apiResponse->getStatusCode());
var_dump($apiResponse->getHeaders());
```


# Search Subscriptions

Searches for subscriptions.
Expand Down Expand Up @@ -294,6 +338,52 @@ var_dump($apiResponse->getHeaders());
```


# Change Billing Anchor Date

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

```php
function changeBillingAnchorDate(string $subscriptionId, ChangeBillingAnchorDateRequest $body): ApiResponse
```

## 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

This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ChangeBillingAnchorDateResponse`](../../doc/models/change-billing-anchor-date-response.md).

## Example Usage

```php
$subscriptionId = 'subscription_id0';

$body = ChangeBillingAnchorDateRequestBuilder::init()
->monthlyBillingAnchorDate(1)
->build();

$apiResponse = $subscriptionsApi->changeBillingAnchorDate(
$subscriptionId,
$body
);

if ($apiResponse->isSuccess()) {
$changeBillingAnchorDateResponse = $apiResponse->getResult();
} else {
$errors = $apiResponse->getErrors();
}

// Getting more response information
var_dump($apiResponse->getStatusCode());
var_dump($apiResponse->getHeaders());
```


# Cancel Subscription

Schedules a `CANCEL` action to cancel an active subscription. This
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`** |
| `timeout` | `int` | Timeout for API calls in seconds.<br>*Default*: `60` |
Expand All @@ -26,7 +26,7 @@ The API client can be initialized as follows:
```php
$client = SquareClientBuilder::init()
->accessToken('AccessToken')
->squareVersion('2023-09-25')
->squareVersion('2023-10-18')
->environment('production')
->customUrl('https://connect.squareup.com')
->build();
Expand All @@ -51,7 +51,7 @@ use Square\SquareClientBuilder;

$client = SquareClientBuilder::init()
->accessToken('AccessToken')
->squareVersion('2023-09-25')
->squareVersion('2023-10-18')
->build();

$apiResponse = $client->getLocationsApi()->listLocations();
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/apis/subscriptions.md#bulk-swap-plan) endpoint.

## Structure

`BulkSwapPlanRequest`

## Fields

| Name | Type | Tags | Description | Getter | Setter |
| --- | --- | --- | --- | --- | --- |
| `newPlanVariationId` | `string` | Required | The ID of the new subscription plan variation.<br><br>This field is required.<br>**Constraints**: *Minimum Length*: `1` | getNewPlanVariationId(): string | setNewPlanVariationId(string newPlanVariationId): void |
| `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` | getOldPlanVariationId(): string | setOldPlanVariationId(string oldPlanVariationId): void |
| `locationId` | `string` | Required | The ID of the location to associate with the swapped subscriptions.<br>**Constraints**: *Minimum Length*: `1` | getLocationId(): string | setLocationId(string locationId): void |

## 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/apis/subscriptions.md#bulk-swap-plan) endpoint.

## Structure

`BulkSwapPlanResponse`

## Fields

| Name | Type | Tags | Description | Getter | Setter |
| --- | --- | --- | --- | --- | --- |
| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void |
| `affectedSubscriptions` | `?int` | Optional | The number of affected subscriptions. | getAffectedSubscriptions(): ?int | setAffectedSubscriptions(?int affectedSubscriptions): void |

## 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
2 changes: 1 addition & 1 deletion doc/models/catalog-query-text.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The query filter to return the search result whose searchable attribute values c

| Name | Type | Tags | Description | Getter | Setter |
| --- | --- | --- | --- | --- | --- |
| `keywords` | `string[]` | Required | A list of 1, 2, or 3 search keywords. Keywords with fewer than 3 characters are ignored. | getKeywords(): array | setKeywords(array keywords): void |
| `keywords` | `string[]` | Required | A list of 1, 2, or 3 search keywords. Keywords with fewer than 3 alphanumeric characters are ignored. | getKeywords(): array | setKeywords(array keywords): void |

## Example (as JSON)

Expand Down
Loading
Loading