From 82a5417aa6d1a8588a3bd7b865f9aeae7ff0401a Mon Sep 17 00:00:00 2001 From: autobot Date: Wed, 20 Mar 2024 16:45:04 +0000 Subject: [PATCH] Generated PR for Release: 35.1.0.20240320 --- doc/api/bookings.md | 2 +- doc/api/labor.md | 28 ++++++------- doc/client.md | 6 +-- doc/models/catalog-item-modifier-list-info.md | 4 +- doc/models/digital-wallet-details.md | 2 +- ...list-location-booking-profiles-response.md | 40 ++++--------------- doc/models/tender-type.md | 2 +- pyproject.toml | 2 +- square/api/base_api.py | 2 +- square/api/bookings_api.py | 2 +- square/api/labor_api.py | 30 +++++++------- square/client.py | 6 +-- square/configuration.py | 2 +- 13 files changed, 52 insertions(+), 76 deletions(-) diff --git a/doc/api/bookings.md b/doc/api/bookings.md index 02876c0b..4a3d8fec 100644 --- a/doc/api/bookings.md +++ b/doc/api/bookings.md @@ -80,7 +80,7 @@ The required input must include the following: - `Booking.location_id` - `Booking.start_at` -- `Booking.team_member_id` +- `Booking.AppointmentSegment.team_member_id` - `Booking.AppointmentSegment.service_variation_id` - `Booking.AppointmentSegment.service_variation_version` diff --git a/doc/api/labor.md b/doc/api/labor.md index 8c36e7ea..470609e3 100644 --- a/doc/api/labor.md +++ b/doc/api/labor.md @@ -316,20 +316,20 @@ elif result.is_error(): Creates a new `Shift`. -A `Shift` represents a complete workday for a single employee. +A `Shift` represents a complete workday for a single team member. You must provide the following values in your request to this endpoint: - `location_id` -- `employee_id` +- `team_member_id` - `start_at` An attempt to create a new `Shift` can result in a `BAD_REQUEST` error when: -- The `status` of the new `Shift` is `OPEN` and the employee has another +- The `status` of the new `Shift` is `OPEN` and the team member has another shift with an `OPEN` status. - The `start_at` date is in the future. -- The `start_at` or `end_at` date overlaps another shift for the same employee. +- The `start_at` or `end_at` date overlaps another shift for the same team member. - The `Break` instances are set in the request and a break `start_at` is before the `Shift.start_at`, a break `end_at` is after the `Shift.end_at`, or both. @@ -399,19 +399,19 @@ elif result.is_error(): Returns a paginated list of `Shift` records for a business. The list to be returned can be filtered by: -- Location IDs. -- Employee IDs. -- Shift status (`OPEN` and `CLOSED`). -- Shift start. -- Shift end. -- Workday details. +- Location IDs +- Team member IDs +- Shift status (`OPEN` or `CLOSED`) +- Shift start +- Shift end +- Workday details The list can be sorted by: -- `start_at`. -- `end_at`. -- `created_at`. -- `updated_at`. +- `START_AT` +- `END_AT` +- `CREATED_AT` +- `UPDATED_AT` ```python def search_shifts(self, diff --git a/doc/client.md b/doc/client.md index aa7320fc..992d0cd5 100644 --- a/doc/client.md +++ b/doc/client.md @@ -5,7 +5,7 @@ The following parameters are configurable for the API Client: | Parameter | Type | Description | | --- | --- | --- | -| `square_version` | `str` | Square Connect API versions
*Default*: `'2024-02-22'` | +| `square_version` | `str` | Square Connect API versions
*Default*: `'2024-03-20'` | | `custom_url` | `str` | Sets the base URL requests are made to. Defaults to `https://connect.squareup.com`
*Default*: `'https://connect.squareup.com'` | | `environment` | `string` | The API environment.
**Default: `production`** | | `http_client_instance` | `HttpClient` | The Http Client passed from the sdk user for making requests | @@ -24,7 +24,7 @@ The API client can be initialized as follows: ```python client = Client( - square_version='2024-02-22', + square_version='2024-03-20', bearer_auth_credentials=BearerAuthCredentials( access_token='AccessToken' ) @@ -51,7 +51,7 @@ from square.http.auth.o_auth_2 import BearerAuthCredentials from square.client import Client client = Client( - square_version='2024-02-22', + square_version='2024-03-20', bearer_auth_credentials=BearerAuthCredentials( access_token='AccessToken' ) diff --git a/doc/models/catalog-item-modifier-list-info.md b/doc/models/catalog-item-modifier-list-info.md index ce4f44ae..d84a7af5 100644 --- a/doc/models/catalog-item-modifier-list-info.md +++ b/doc/models/catalog-item-modifier-list-info.md @@ -14,8 +14,8 @@ and specifies supported behaviors of the application. | --- | --- | --- | --- | | `modifier_list_id` | `str` | Required | The ID of the `CatalogModifierList` controlled by this `CatalogModifierListInfo`.
**Constraints**: *Minimum Length*: `1` | | `modifier_overrides` | [`List Catalog Modifier Override`](../../doc/models/catalog-modifier-override.md) | Optional | A set of `CatalogModifierOverride` objects that override whether a given `CatalogModifier` is enabled by default. | -| `min_selected_modifiers` | `int` | Optional | If 0 or larger, the smallest number of `CatalogModifier`s that must be selected from this `CatalogModifierList`. | -| `max_selected_modifiers` | `int` | Optional | If 0 or larger, the largest number of `CatalogModifier`s that can be selected from this `CatalogModifierList`. | +| `min_selected_modifiers` | `int` | Optional | If 0 or larger, the smallest number of `CatalogModifier`s that must be selected from this `CatalogModifierList`.
The default value is `-1`.

When `CatalogModifierList.selection_type` is `MULTIPLE`, `CatalogModifierListInfo.min_selected_modifiers=-1`
and `CatalogModifierListInfo.max_selected_modifier=-1` means that from zero to the maximum number of modifiers of
the `CatalogModifierList` can be selected from the `CatalogModifierList`.

When the `CatalogModifierList.selection_type` is `SINGLE`, `CatalogModifierListInfo.min_selected_modifiers=-1`
and `CatalogModifierListInfo.max_selected_modifier=-1` means that exactly one modifier must be present in
and can be selected from the `CatalogModifierList` | +| `max_selected_modifiers` | `int` | Optional | If 0 or larger, the largest number of `CatalogModifier`s that can be selected from this `CatalogModifierList`.
The default value is `-1`.

When `CatalogModifierList.selection_type` is `MULTIPLE`, `CatalogModifierListInfo.min_selected_modifiers=-1`
and `CatalogModifierListInfo.max_selected_modifier=-1` means that from zero to the maximum number of modifiers of
the `CatalogModifierList` can be selected from the `CatalogModifierList`.

When the `CatalogModifierList.selection_type` is `SINGLE`, `CatalogModifierListInfo.min_selected_modifiers=-1`
and `CatalogModifierListInfo.max_selected_modifier=-1` means that exactly one modifier must be present in
and can be selected from the `CatalogModifierList` | | `enabled` | `bool` | Optional | If `true`, enable this `CatalogModifierList`. The default value is `true`. | | `ordinal` | `int` | Optional | The position of this `CatalogItemModifierListInfo` object within the `modifier_list_info` list applied
to a `CatalogItem` instance. | diff --git a/doc/models/digital-wallet-details.md b/doc/models/digital-wallet-details.md index 1af62eff..596c9b30 100644 --- a/doc/models/digital-wallet-details.md +++ b/doc/models/digital-wallet-details.md @@ -12,7 +12,7 @@ Additional details about `WALLET` type payments. Contains only non-confidential | Name | Type | Tags | Description | | --- | --- | --- | --- | | `status` | `str` | Optional | The status of the `WALLET` payment. The status can be `AUTHORIZED`, `CAPTURED`, `VOIDED`, or
`FAILED`.
**Constraints**: *Maximum Length*: `50` | -| `brand` | `str` | Optional | The brand used for the `WALLET` payment. The brand can be `CASH_APP`, `PAYPAY` or `UNKNOWN`.
**Constraints**: *Maximum Length*: `50` | +| `brand` | `str` | Optional | The brand used for the `WALLET` payment. The brand can be `CASH_APP`, `PAYPAY`, `ALIPAY`,
`RAKUTEN_PAY`, `AU_PAY`, `D_BARAI`, `MERPAY`, `WECHAT_PAY` or `UNKNOWN`.
**Constraints**: *Maximum Length*: `50` | | `cash_app_details` | [`Cash App Details`](../../doc/models/cash-app-details.md) | Optional | Additional details about `WALLET` type payments with the `brand` of `CASH_APP`. | ## Example (as JSON) diff --git a/doc/models/list-location-booking-profiles-response.md b/doc/models/list-location-booking-profiles-response.md index e6a6c943..b9aa8ed8 100644 --- a/doc/models/list-location-booking-profiles-response.md +++ b/doc/models/list-location-booking-profiles-response.md @@ -17,44 +17,20 @@ ```json { + "errors": [], "location_booking_profiles": [ { - "location_id": "location_id0", - "booking_site_url": "booking_site_url2", - "online_booking_enabled": false + "booking_site_url": "https://squareup.com/book/LY6WNBPVM6VGV/testbusiness", + "location_id": "LY6WNBPVM6VGV", + "online_booking_enabled": true }, { - "location_id": "location_id0", - "booking_site_url": "booking_site_url2", - "online_booking_enabled": false - }, - { - "location_id": "location_id0", - "booking_site_url": "booking_site_url2", - "online_booking_enabled": false + "location_id": "PYTRNBPVMJUPV", + "online_booking_enabled": false, + "booking_site_url": "booking_site_url2" } ], - "cursor": "cursor8", - "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" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "MAP_KEY_LENGTH_TOO_LONG", - "detail": "detail6", - "field": "field4" - } - ] + "cursor": "cursor8" } ``` diff --git a/doc/models/tender-type.md b/doc/models/tender-type.md index b1c167db..5412958e 100644 --- a/doc/models/tender-type.md +++ b/doc/models/tender-type.md @@ -17,7 +17,7 @@ Indicates a tender's type. | `SQUARE_GIFT_CARD` | A Square gift card. | | `NO_SALE` | This tender represents the register being opened for a "no sale" event. | | `BANK_ACCOUNT` | A bank account payment. | -| `WALLET` | A payment from a digital wallet, e.g. Cash App.

Note: Some "digital wallets", including Google Pay and Apple Pay, facilitate
card payments. Those payments have the `CARD` type. | +| `WALLET` | A payment from a digital wallet, e.g. Cash App, Paypay, Rakuten Pay,
Au Pay, D Barai, Merpay, Wechat Pay, Alipay.

Note: Some "digital wallets", including Google Pay and Apple Pay, facilitate
card payments. Those payments have the `CARD` type. | | `BUY_NOW_PAY_LATER` | A Buy Now Pay Later payment. | | `SQUARE_ACCOUNT` | A Square House Account payment. | | `OTHER` | A form of tender that does not match any other value. | diff --git a/pyproject.toml b/pyproject.toml index f0aa03d9..57545fa9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ requires = ["setuptools>=61.0"] [project] name = "squareup" description = "Use Square APIs to manage and run business including payment, customer, product, inventory, and employee management." -version = "35.0.0.20240222" +version = "35.1.0.20240320" readme = "README.md" requires-python = ">=3.7" authors = [{name = "Square Developer Platform", email = "developers@squareup.com"}] diff --git a/square/api/base_api.py b/square/api/base_api.py index a971495f..b5ec78bb 100644 --- a/square/api/base_api.py +++ b/square/api/base_api.py @@ -22,7 +22,7 @@ class BaseApi(object): @staticmethod def user_agent(): - return 'Square-Python-SDK/35.0.0.20240222 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}' + return 'Square-Python-SDK/35.1.0.20240320 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}' @staticmethod def user_agent_parameters(): diff --git a/square/api/bookings_api.py b/square/api/bookings_api.py index 00fb4091..acaebf48 100644 --- a/square/api/bookings_api.py +++ b/square/api/bookings_api.py @@ -110,7 +110,7 @@ def create_booking(self, The required input must include the following: - `Booking.location_id` - `Booking.start_at` - - `Booking.team_member_id` + - `Booking.AppointmentSegment.team_member_id` - `Booking.AppointmentSegment.service_variation_id` - `Booking.AppointmentSegment.service_variation_version` To call this endpoint with buyer-level permissions, set diff --git a/square/api/labor_api.py b/square/api/labor_api.py index 646fdbc8..b44bc29c 100644 --- a/square/api/labor_api.py +++ b/square/api/labor_api.py @@ -358,20 +358,20 @@ def create_shift(self, """Does a POST request to /v2/labor/shifts. Creates a new `Shift`. - A `Shift` represents a complete workday for a single employee. + A `Shift` represents a complete workday for a single team member. You must provide the following values in your request to this endpoint: - `location_id` - - `employee_id` + - `team_member_id` - `start_at` An attempt to create a new `Shift` can result in a `BAD_REQUEST` error when: - - The `status` of the new `Shift` is `OPEN` and the employee has + - The `status` of the new `Shift` is `OPEN` and the team member has another shift with an `OPEN` status. - The `start_at` date is in the future. - The `start_at` or `end_at` date overlaps another shift for the same - employee. + team member. - The `Break` instances are set in the request and a break `start_at` is before the `Shift.start_at`, a break `end_at` is after the `Shift.end_at`, or both. @@ -420,17 +420,17 @@ def search_shifts(self, Returns a paginated list of `Shift` records for a business. The list to be returned can be filtered by: - - Location IDs. - - Employee IDs. - - Shift status (`OPEN` and `CLOSED`). - - Shift start. - - Shift end. - - Workday details. + - Location IDs + - Team member IDs + - Shift status (`OPEN` or `CLOSED`) + - Shift start + - Shift end + - Workday details The list can be sorted by: - - `start_at`. - - `end_at`. - - `created_at`. - - `updated_at`. + - `START_AT` + - `END_AT` + - `CREATED_AT` + - `UPDATED_AT` Args: body (SearchShiftsRequest): An object containing the fields to @@ -664,7 +664,7 @@ def get_team_member_wage(self, id): """Does a GET request to /v2/labor/team-member-wages/{id}. - Returns a single `TeamMemberWage` specified by `id `. + Returns a single `TeamMemberWage` specified by `id`. Args: id (str): The UUID for the `TeamMemberWage` being retrieved. diff --git a/square/client.py b/square/client.py index 8cfffde1..e1a077c1 100644 --- a/square/client.py +++ b/square/client.py @@ -54,11 +54,11 @@ class Client(object): @staticmethod def sdk_version(): - return '35.0.0.20240222' + return '35.1.0.20240320' @staticmethod def square_version(): - return '2024-02-22' + return '2024-03-20' def user_agent_detail(self): return self.config.user_agent_detail @@ -233,7 +233,7 @@ def __init__(self, http_client_instance=None, retry_statuses=None, retry_methods=None, environment='production', custom_url='https://connect.squareup.com', access_token=None, - bearer_auth_credentials=None, square_version='2024-02-22', + bearer_auth_credentials=None, square_version='2024-03-20', additional_headers={}, user_agent_detail='', config=None): self.config = config or Configuration( http_client_instance=http_client_instance, diff --git a/square/configuration.py b/square/configuration.py index b64f8c9c..069a2b6c 100644 --- a/square/configuration.py +++ b/square/configuration.py @@ -45,7 +45,7 @@ def __init__(self, http_client_instance=None, retry_statuses=None, retry_methods=None, environment='production', custom_url='https://connect.squareup.com', access_token=None, - bearer_auth_credentials=None, square_version='2024-02-22', + bearer_auth_credentials=None, square_version='2024-03-20', additional_headers={}, user_agent_detail=''): if retry_methods is None: retry_methods = ['GET', 'PUT']