diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e8d4014..c34563b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log +## Version 5.1.0.20200325 (2020-03-25) +## Existing API updates +* **[Payments API](${SQUARE_TECH_REF}/payments-api).** In support of the existing [Delayed capture](payments-api/take-payments) for payments, the following fields are added to the [Payment](${SQUARE_TECH_REF}/objects/Payment) type: + * `delay_duration`. In a [CreatePayment](${SQUARE_TECH_REF}/payments-api/create-payment) request, you can set `autocomplete` to false to get payment approval but not charge the payment source. You can now add this field to specify a time period to complete (or cancel) the payment. For more information, see [Delay capture](payments-api/take-payments). + * `delay_action`. Defines the action that Square takes on the payment when the `delay_duration` elapses. In this release, the API supports only the cancel payment action. + * `delayed_until`. Provides the date and time on Square servers when Square applies `delay_action` on the payment. + ## Version 5.0.0.20200226 (2020-02-26) ## API releases * **GA release**: All SDKs have been updated to support the new Bank Accounts and CashDrawerShifts APIs. diff --git a/doc/models/cancel-payment-response.md b/doc/models/cancel-payment-response.md index c57fff60..67828dda 100644 --- a/doc/models/cancel-payment-response.md +++ b/doc/models/cancel-payment-response.md @@ -18,7 +18,7 @@ Return value from the [CancelPayment](#endpoint-payments-cancelpayment) endpoint ```json { "payment": { - "id": "YNR82sYrdgYlEEvJHnkJ7jrRuaB", + "id": "GQTFp1ZlXdpoW4o6eGiZhbjosiDFf", "created_at": "2018-10-17T20:38:46.743Z", "updated_at": "2018-10-17T20:38:57.693Z", "amount_money": { @@ -42,14 +42,22 @@ Return value from the [CancelPayment](#endpoint-payments-cancelpayment) endpoint "last_4": "1234", "exp_month": 2, "exp_year": 2024, - "fingerprint": "sq-1-9PP0tWfcM6vIsYmfsesdjfhduHSDFNdJFNDfDNFjdfjpseirDErsaP" + "fingerprint": "sq-1-9PP0tWfcM6vIsYmfsesdjfhduHSDFNdJFNDfDNFjdfjpseirDErsaP", + "card_type": "DEBIT", + "prepaid_type": "PREPAID", + "bin": "411111" }, "entry_method": "KEYED", "cvv_status": "CVV_ACCEPTED", "avs_status": "AVS_ACCEPTED", - "auth_result_code": "eWZBDh" + "auth_result_code": "eWZBDh", + "statement_description": "SQ *MY MERCHANT" }, - "reference_id": "12323232323" + "location_id": "XTI0H92143A39", + "order_id": "m2Hr8Hk8A3CTyQQ1k4ynExg92tO3", + "reference_id": "123456", + "note": "Brief description", + "customer_id": "RDX9Z4XTIZR7MRZJUXNY9HUK6I" } } ``` diff --git a/doc/models/cash-payment-details.md b/doc/models/cash-payment-details.md deleted file mode 100644 index ba747a1b..00000000 --- a/doc/models/cash-payment-details.md +++ /dev/null @@ -1,27 +0,0 @@ -## Cash Payment Details - -Additional details about CASH type payments. - -### Structure - -`CashPaymentDetails` - -### Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `BuyerSuppliedMoney` | [`Money`](/doc/models/money.md) | | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | -| `ChangeBackMoney` | [`Money`](/doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | - -### Example (as JSON) - -```json -{ - "buyer_supplied_money": { - "amount": null, - "currency": null - }, - "change_back_money": null -} -``` - diff --git a/doc/models/catalog-custom-attribute-definition-app-visibility.md b/doc/models/catalog-custom-attribute-definition-app-visibility.md new file mode 100644 index 00000000..d49adc20 --- /dev/null +++ b/doc/models/catalog-custom-attribute-definition-app-visibility.md @@ -0,0 +1,17 @@ +## Catalog Custom Attribute Definition App Visibility + +Defines the visibility of a custom attribute to applications other than their +creating application. + +### Enumeration + +`CatalogCustomAttributeDefinitionAppVisibility` + +### Fields + +| Name | Description | +| --- | --- | +| `APPVISIBILITYHIDDEN` | Other applications cannot read this custom attribute. | +| `APPVISIBILITYREADONLY` | Other applications can read this custom attribute definition and
values. | +| `APPVISIBILITYREADWRITEVALUES` | Other applications can read and write custom attribute values on objects.
They can read but cannot edit the custom attribute definition. | + diff --git a/doc/models/catalog-custom-attribute-definition-selection-config-custom-attribute-selection.md b/doc/models/catalog-custom-attribute-definition-selection-config-custom-attribute-selection.md new file mode 100644 index 00000000..a40f3d30 --- /dev/null +++ b/doc/models/catalog-custom-attribute-definition-selection-config-custom-attribute-selection.md @@ -0,0 +1,24 @@ +## Catalog Custom Attribute Definition Selection Config Custom Attribute Selection + +A named selection for this `SELECTION`-type custom attribute definition. + +### Structure + +`CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection` + +### Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Uid` | `String` | Optional | Unique ID set by Square. | +| `Name` | `String` | | Selection name, unique within `allowed_selections`.
Required. Min length of 1, max length of 255. | + +### Example (as JSON) + +```json +{ + "uid": null, + "name": "name0" +} +``` + diff --git a/doc/models/catalog-custom-attribute-definition-selection-config.md b/doc/models/catalog-custom-attribute-definition-selection-config.md new file mode 100644 index 00000000..84e0450c --- /dev/null +++ b/doc/models/catalog-custom-attribute-definition-selection-config.md @@ -0,0 +1,24 @@ +## Catalog Custom Attribute Definition Selection Config + +Configuration associated with `SELECTION`-type custom attribute definitions. + +### Structure + +`CatalogCustomAttributeDefinitionSelectionConfig` + +### Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `MaxAllowedSelections` | `Integer` | Optional | The maximum number of selections that can be set. The maximum value for this
attribute is 100. May be modified, but changing the value will not
affect existing custom attribute values on objects. Clients need to
handle Custom Attributes with more selected values than allowed by this limit. | +| `AllowedSelections` | [`List`](/doc/models/catalog-custom-attribute-definition-selection-config-custom-attribute-selection.md) | Optional | The set of valid `CatalogCustomAttributeSelections`. Up to a maximum of 100
selections can be defined. Can be modified. | + +### Example (as JSON) + +```json +{ + "max_allowed_selections": null, + "allowed_selections": null +} +``` + diff --git a/doc/models/catalog-custom-attribute-definition-seller-visibility.md b/doc/models/catalog-custom-attribute-definition-seller-visibility.md new file mode 100644 index 00000000..0790c9b3 --- /dev/null +++ b/doc/models/catalog-custom-attribute-definition-seller-visibility.md @@ -0,0 +1,17 @@ +## Catalog Custom Attribute Definition Seller Visibility + +Defines the visibility of a custom attribute to sellers in Square +client applications, Square APIs or in Square UIs (including Square Point +of Sale applications and Square Dashboard). + +### Enumeration + +`CatalogCustomAttributeDefinitionSellerVisibility` + +### Fields + +| Name | Description | +| --- | --- | +| `SELLERVISIBILITYHIDDEN` | Sellers cannot read this custom attribute in Square client
applications or Square APIs. | +| `SELLERVISIBILITYREADWRITEVALUES` | Sellers can read and write this custom attribute value in catalog objects,
but cannot edit the custom attribute definition. | + diff --git a/doc/models/catalog-custom-attribute-definition-string-config.md b/doc/models/catalog-custom-attribute-definition-string-config.md new file mode 100644 index 00000000..fad6c6a3 --- /dev/null +++ b/doc/models/catalog-custom-attribute-definition-string-config.md @@ -0,0 +1,22 @@ +## Catalog Custom Attribute Definition String Config + +Configuration associated with Custom Attribute Definitions of type `STRING`. + +### Structure + +`CatalogCustomAttributeDefinitionStringConfig` + +### Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `EnforceUniqueness` | `Boolean` | Optional | If true, each Custom Attribute instance associated with this Custom Attribute
Definition must have a unique value within the seller's catalog. For
example, this may be used for a value like a SKU that should not be
duplicated within a seller's catalog. May not be modified after the
definition has been created. | + +### Example (as JSON) + +```json +{ + "enforce_uniqueness": null +} +``` + diff --git a/doc/models/catalog-custom-attribute-definition-type.md b/doc/models/catalog-custom-attribute-definition-type.md new file mode 100644 index 00000000..23995245 --- /dev/null +++ b/doc/models/catalog-custom-attribute-definition-type.md @@ -0,0 +1,17 @@ +## Catalog Custom Attribute Definition Type + +Defines the possible types for a custom attribute. + +### Enumeration + +`CatalogCustomAttributeDefinitionType` + +### Fields + +| Name | Description | +| --- | --- | +| `STRING` | A free-form string containing up to 255 characters. | +| `BOOLEAN` | A `true` or `false` value. | +| `NUMBER` | Integer divided by 100,000. | +| `SELECTION` | One or more choices from `allowed_selections`. | + diff --git a/doc/models/catalog-custom-attribute-definition.md b/doc/models/catalog-custom-attribute-definition.md new file mode 100644 index 00000000..6438fb50 --- /dev/null +++ b/doc/models/catalog-custom-attribute-definition.md @@ -0,0 +1,46 @@ +## Catalog Custom Attribute Definition + +Contains information defining a custom attribute. Custom attributes are +intended to store additional information about a catalog object or to associate a +catalog object with an entity in another system. Do not use custom attributes +to store any sensitive information (personally identifiable information, card details, etc.). +[Read more about custom attributes](https://developer.squareup.com/docs/catalog-api/add-custom-attributes) + +### Structure + +`CatalogCustomAttributeDefinition` + +### Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Type` | [`String`](/doc/models/catalog-custom-attribute-definition-type.md) | | Defines the possible types for a custom attribute. | +| `Name` | `String` | | The name of this definition for API and seller-facing UI purposes.
The name must be unique within the (merchant, application_id) pair. Required.
May not be empty and may not exceed 255 characters. Can be modified after creation. | +| `Description` | `String` | Optional | Seller-oriented description of the meaning of this Custom Attribute,
any constraints that the seller should observe, etc. May be displayed as a tooltip in Square UIs. | +| `SourceApplication` | [`SourceApplication`](/doc/models/source-application.md) | Optional | Provides information about the application used to generate an inventory
change. | +| `AllowedObjectTypes` | [`List`](/doc/models/catalog-object-type.md) | Optional | The set of Catalog Object Types that this Custom Attribute may be applied to.
Currently, only `ITEM` and `ITEM_VARIATION` are allowed.
See [CatalogObjectType](#type-catalogobjecttype) for possible values | +| `SellerVisibility` | [`String`](/doc/models/catalog-custom-attribute-definition-seller-visibility.md) | Optional | Defines the visibility of a custom attribute to sellers in Square
client applications, Square APIs or in Square UIs (including Square Point
of Sale applications and Square Dashboard). | +| `AppVisibility` | [`String`](/doc/models/catalog-custom-attribute-definition-app-visibility.md) | Optional | Defines the visibility of a custom attribute to applications other than their
creating application. | +| `StringConfig` | [`CatalogCustomAttributeDefinitionStringConfig`](/doc/models/catalog-custom-attribute-definition-string-config.md) | Optional | Configuration associated with Custom Attribute Definitions of type `STRING`. | +| `SelectionConfig` | [`CatalogCustomAttributeDefinitionSelectionConfig`](/doc/models/catalog-custom-attribute-definition-selection-config.md) | Optional | Configuration associated with `SELECTION`-type custom attribute definitions. | +| `CustomAttributeUsageCount` | `Integer` | Optional | __Read-only.__ The number of custom attributes that reference this
custom attribute definition. Set by the server in response to a ListCatalog
request with `include_counts` set to `true`. If the actual count is greater
than 100, `custom_attribute_usage_count` will be set to `100`. | +| `Key` | `String` | Optional | The name of the desired custom attribute key that can be used to access
the custom attribute value on catalog objects. Cannot be modified after the
custom attribute definition has been created. | + +### Example (as JSON) + +```json +{ + "type": "NUMBER", + "name": "name0", + "description": null, + "source_application": null, + "allowed_object_types": null, + "seller_visibility": null, + "app_visibility": null, + "string_config": null, + "selection_config": null, + "custom_attribute_usage_count": null, + "key": null +} +``` + diff --git a/doc/models/catalog-custom-attribute-value.md b/doc/models/catalog-custom-attribute-value.md new file mode 100644 index 00000000..aed8298e --- /dev/null +++ b/doc/models/catalog-custom-attribute-value.md @@ -0,0 +1,38 @@ +## Catalog Custom Attribute Value + +An instance of a custom attribute. Custom attributes can be defined and +added to `ITEM` and `ITEM_VARIATION` type catalog objects. +[Read more about custom attributes](https://developer.squareup.com/docs/catalog-api/add-custom-attributes). + +### Structure + +`CatalogCustomAttributeValue` + +### Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Name` | `String` | Optional | The name of the custom attribute. | +| `StringValue` | `String` | Optional | The string value of the custom attribute. Populated if `type` = `STRING`. | +| `CustomAttributeDefinitionId` | `String` | Optional | __Read-only.__ The custom attribute definition this value belongs to. | +| `Type` | [`String`](/doc/models/catalog-custom-attribute-definition-type.md) | Optional | Defines the possible types for a custom attribute. | +| `NumberValue` | `String` | Optional | Populated if `type` = `NUMBER`. Contains a string
representation of a decimal number, using a `.` as the decimal separator. | +| `BooleanValue` | `Boolean` | Optional | A `true` or `false` value. Populated if `type` = `BOOLEAN`. | +| `SelectionUidValues` | `List` | Optional | One or more choices from `allowed_selections`. Populated if `type` = `SELECTION`. | +| `Key` | `String` | Optional | __Read-only.__ A copy of key from the associated custom attribute definition. | + +### Example (as JSON) + +```json +{ + "name": null, + "string_value": null, + "custom_attribute_definition_id": null, + "type": null, + "number_value": null, + "boolean_value": null, + "selection_uid_values": null, + "key": null +} +``` + diff --git a/doc/models/catalog-object-batch.md b/doc/models/catalog-object-batch.md index 75fe86c3..b6fae68a 100644 --- a/doc/models/catalog-object-batch.md +++ b/doc/models/catalog-object-batch.md @@ -23,6 +23,7 @@ A batch of catalog objects. "updated_at": null, "version": null, "is_deleted": null, + "custom_attribute_values": null, "catalog_v1_ids": null, "present_at_all_locations": null, "present_at_location_ids": null, @@ -41,7 +42,8 @@ A batch of catalog objects. "image_data": null, "measurement_unit_data": null, "item_option_data": null, - "item_option_value_data": null + "item_option_value_data": null, + "custom_attribute_definition_data": null }, { "type": "DISCOUNT", @@ -49,6 +51,7 @@ A batch of catalog objects. "updated_at": null, "version": null, "is_deleted": null, + "custom_attribute_values": null, "catalog_v1_ids": null, "present_at_all_locations": null, "present_at_location_ids": null, @@ -67,7 +70,8 @@ A batch of catalog objects. "image_data": null, "measurement_unit_data": null, "item_option_data": null, - "item_option_value_data": null + "item_option_value_data": null, + "custom_attribute_definition_data": null } ] } diff --git a/doc/models/catalog-object.md b/doc/models/catalog-object.md index 671724b9..21b2d146 100644 --- a/doc/models/catalog-object.md +++ b/doc/models/catalog-object.md @@ -29,6 +29,7 @@ For a more detailed discussion of the Catalog data model, please see the | `UpdatedAt` | `String` | Optional | Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"`
would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. | | `Version` | `Long` | Optional | The version of the object. When updating an object, the version supplied
must match the version in the database, otherwise the write will be rejected as conflicting. | | `IsDeleted` | `Boolean` | Optional | If `true`, the object has been deleted from the database. Must be `false` for new objects
being inserted. When deleted, the `updated_at` field will equal the deletion time. | +| `CustomAttributeValues` | [`Map`](/doc/models/catalog-custom-attribute-value.md) | Optional | Application-defined key/value attributes that are set at a global (location-independent) level.
Values from the `*_data` fields may not be duplicated. Custom Attribute fields are intended to store additional
information about a Catalog Object or associations with an entity in another system. Do not use custom attributes
to store any sensitive information (personally identifiable information, card details, etc.).

For CustomAttributesDefinitions defined by the app making the request, the map key is the key defined in
CustomAttributeDefinition (eg. “reference_id”). For CustomAttributesDefinitions by other apps, the map key is
the key defined in CustomAttributeDefinition prefixed with the application ID and a colon
(eg. “abcd1234:reference_id”). | | `CatalogV1Ids` | [`List`](/doc/models/catalog-v1-id.md) | Optional | The Connect v1 IDs for this object at each location where it is present, where they
differ from the object's Connect V2 ID. The field will only be present for objects that
have been created or modified by legacy APIs. | | `PresentAtAllLocations` | `Boolean` | Optional | If `true`, this object is present at all locations (including future locations), except where specified in
the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations),
except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. | | `PresentAtLocationIds` | `List` | Optional | A list of locations where the object is present, even if `present_at_all_locations` is `false`. | @@ -48,6 +49,7 @@ For a more detailed discussion of the Catalog data model, please see the | `MeasurementUnitData` | [`CatalogMeasurementUnit`](/doc/models/catalog-measurement-unit.md) | Optional | Represents the unit used to measure a `CatalogItemVariation` and
specifies the precision for decimal quantities. | | `ItemOptionData` | [`CatalogItemOption`](/doc/models/catalog-item-option.md) | Optional | A group of variations for a `CatalogItem`. | | `ItemOptionValueData` | [`CatalogItemOptionValue`](/doc/models/catalog-item-option-value.md) | Optional | An enumerated value that can link a
`CatalogItemVariation` to an item option as one of
its item option values. | +| `CustomAttributeDefinitionData` | [`CatalogCustomAttributeDefinition`](/doc/models/catalog-custom-attribute-definition.md) | Optional | Contains information defining a custom attribute. Custom attributes are
intended to store additional information about a catalog object or to associate a
catalog object with an entity in another system. Do not use custom attributes
to store any sensitive information (personally identifiable information, card details, etc.).
[Read more about custom attributes](https://developer.squareup.com/docs/catalog-api/add-custom-attributes) | ### Example (as JSON) @@ -58,6 +60,7 @@ For a more detailed discussion of the Catalog data model, please see the "updated_at": null, "version": null, "is_deleted": null, + "custom_attribute_values": null, "catalog_v1_ids": null, "present_at_all_locations": null, "present_at_location_ids": null, @@ -76,7 +79,8 @@ For a more detailed discussion of the Catalog data model, please see the "image_data": null, "measurement_unit_data": null, "item_option_data": null, - "item_option_value_data": null + "item_option_value_data": null, + "custom_attribute_definition_data": null } ``` diff --git a/doc/models/complete-payment-response.md b/doc/models/complete-payment-response.md index a33fc8e1..a1ed4871 100644 --- a/doc/models/complete-payment-response.md +++ b/doc/models/complete-payment-response.md @@ -18,7 +18,7 @@ Return value from a [CompletePayment](#endpoint-payments-completepayment) call. ```json { "payment": { - "id": "EdMl5lwmBxd3ZvsvinkAT5LtvaB", + "id": "GQTFp1ZlXdpoW4o6eGiZhbjosiDFf", "created_at": "2019-07-10T13:39:55.317Z", "updated_at": "2019-07-10T13:40:05.982Z", "amount_money": { @@ -42,18 +42,24 @@ Return value from a [CompletePayment](#endpoint-payments-completepayment) call. "last_4": "2796", "exp_month": 7, "exp_year": 2026, - "fingerprint": "sq-1-TpmjbNBMFdibiIjpQI5LiRgNUBC7u1689i0TgHjnlyHEWYB7tnn-K4QbW4ttvtaqXw" + "fingerprint": "sq-1-TpmjbNBMFdibiIjpQI5LiRgNUBC7u1689i0TgHjnlyHEWYB7tnn-K4QbW4ttvtaqXw", + "card_type": "DEBIT", + "prepaid_type": "PREPAID", + "bin": "411111" }, "entry_method": "ON_FILE", "cvv_status": "CVV_ACCEPTED", "avs_status": "AVS_ACCEPTED", - "auth_result_code": "MhIjEN" + "auth_result_code": "MhIjEN", + "statement_description": "SQ *MY MERCHANT" }, - "location_id": "XK3DBG77NJBFX", - "order_id": "iJbzEHMhcwydeLbN3Apg5ZAjGi4F", + "location_id": "XTI0H92143A39", + "order_id": "m2Hr8Hk8A3CTyQQ1k4ynExg92tO3", "reference_id": "123456", "note": "Brief description", - "customer_id": "VDKXEEKPJN48QDG3BGGFAK05P8" + "customer_id": "RDX9Z4XTIZR7MRZJUXNY9HUK6I", + "receipt_number": "GQTF", + "receipt_url": "https://squareup.com/receipt/preview/GQTFp1ZlXdpoW4o6eGiZhbjosiDFf" } } ``` diff --git a/doc/models/create-payment-request.md b/doc/models/create-payment-request.md index 52f96b77..ddecc105 100644 --- a/doc/models/create-payment-request.md +++ b/doc/models/create-payment-request.md @@ -23,6 +23,7 @@ For information about application fees in a payment, see | `AmountMoney` | [`Money`](/doc/models/money.md) | | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | | `TipMoney` | [`Money`](/doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | | `AppFeeMoney` | [`Money`](/doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | +| `DelayDuration` | `String` | Optional | The duration of time after the payment's creation when Square automatically cancels the
payment. This automatic cancellation applies only to payments that don't reach a terminal state
(COMPLETED, CANCELED, or FAILED) before the `delay_duration` time period.

This parameter should be specified as a time duration, in RFC 3339 format, with a minimum value
of 1 minute.

Notes:
This feature is only supported for card payments. This parameter can only be set for a delayed
capture payment (`autocomplete=false`).

Default:

- Card Present payments: "PT36H" (36 hours) from the creation time.
- Card Not Present payments: "P7D" (7 days) from the creation time. | | `Autocomplete` | `Boolean` | Optional | If set to `true`, this payment will be completed when possible. If
set to `false`, this payment will be held in an approved state until either
explicitly completed (captured) or canceled (voided). For more information, see
[Delayed Payments](https://developer.squareup.com/docs/payments-api/take-payments#delayed-payments).

Default: true | | `OrderId` | `String` | Optional | Associate a previously created order with this payment | | `CustomerId` | `String` | Optional | The ID of the customer associated with the payment.
Required if the `source_id` refers to a card on file created using the
Customers API. | diff --git a/doc/models/create-payment-response.md b/doc/models/create-payment-response.md index 12e59199..2d04f6df 100644 --- a/doc/models/create-payment-response.md +++ b/doc/models/create-payment-response.md @@ -22,7 +22,7 @@ present, or it may be present with a status of `FAILED`. ```json { "payment": { - "id": "iqrBxAil6rmDtr7cak9g9WO8uaB", + "id": "GQTFp1ZlXdpoW4o6eGiZhbjosiDFf", "created_at": "2019-07-10T13:23:49.154Z", "updated_at": "2019-07-10T13:23:49.446Z", "amount_money": { @@ -43,21 +43,27 @@ present, or it may be present with a status of `FAILED`. "status": "CAPTURED", "card": { "card_brand": "VISA", - "last_4": "2796", + "last_4": "1111", "exp_month": 7, "exp_year": 2026, - "fingerprint": "sq-1-TpmjbNBMFdibiIjpQI5LiRgNUBC7u1689i0TgHjnlyHEWYB7tnn-K4QbW4ttvtaqXw" + "fingerprint": "sq-1-TpmjbNBMFdibiIjpQI5LiRgNUBC7u1689i0TgHjnlyHEWYB7tnn-K4QbW4ttvtaqXw", + "card_type": "DEBIT", + "prepaid_type": "PREPAID", + "bin": "411111" }, "entry_method": "ON_FILE", "cvv_status": "CVV_ACCEPTED", "avs_status": "AVS_ACCEPTED", - "auth_result_code": "nsAyY2" + "auth_result_code": "nsAyY2", + "statement_description": "SQ *MY MERCHANT" }, - "location_id": "XK3DBG77NJBFX", - "order_id": "qHkNOb03hMgEgoP3gyzFBDY3cg4F", + "location_id": "XTI0H92143A39", + "order_id": "m2Hr8Hk8A3CTyQQ1k4ynExg92tO3", "reference_id": "123456", "note": "Brief description", - "customer_id": "VDKXEEKPJN48QDG3BGGFAK05P8" + "customer_id": "RDX9Z4XTIZR7MRZJUXNY9HUK6I", + "receipt_number": "GQTF", + "receipt_url": "https://squareup.com/receipt/preview/GQTFp1ZlXdpoW4o6eGiZhbjosiDFf" } } ``` diff --git a/doc/models/external-payment-details.md b/doc/models/external-payment-details.md deleted file mode 100644 index 1332c944..00000000 --- a/doc/models/external-payment-details.md +++ /dev/null @@ -1,28 +0,0 @@ -## External Payment Details - -Additional details about EXTERNAL type payments. - -### Structure - -`ExternalPaymentDetails` - -### Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Type` | `String` | | The type of External payment which can be one of:
CHECK - Paid by a physical check
BANK_TRANSFER - Paid by ACH or other bank transfer
OTHER_GIFT_CARD - Paid by a non-square gift card
CRYPTO - Paid via a crypto currency
SQUARE_CASH - Paid via Square Cash app
SOCIAL - Venmo, WeChatPay, AliPay, etc.
EXTERNAL - A 3rd party application gathered this payment outside of Square
EMONEY - A Japanese e-money brand Square doesn’t support
CREDIT/DEBIT - A credit/debit card Square doesn’t support
OTHER - A type not listed here | -| `Source` | `String` | | A description of the source of the external payment, e.g. “Uber Eats”, “Stripe”, “Shopify”.

Limit 255 characters | -| `SourceId` | `String` | Optional | An ID to associate this payment to its originating source

Limit 255 characters. | -| `SourceFeeMoney` | [`Money`](/doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | - -### Example (as JSON) - -```json -{ - "type": "type0", - "source": "source4", - "source_id": null, - "source_fee_money": null -} -``` - diff --git a/doc/models/get-payment-response.md b/doc/models/get-payment-response.md index 9069608d..51796ac7 100644 --- a/doc/models/get-payment-response.md +++ b/doc/models/get-payment-response.md @@ -19,7 +19,7 @@ a request to the [GetPayment](#endpoint-payments-getpayment) endpoint. ```json { "payment": { - "id": "iqrBxAil6rmDtr7cak9g9WO8uaB", + "id": "GQTFp1ZlXdpoW4o6eGiZhbjosiDFf", "created_at": "2019-07-10T13:23:49.154Z", "updated_at": "2019-07-10T13:23:49.446Z", "amount_money": { @@ -40,21 +40,25 @@ a request to the [GetPayment](#endpoint-payments-getpayment) endpoint. "status": "CAPTURED", "card": { "card_brand": "VISA", - "last_4": "2796", + "last_4": "1111", "exp_month": 7, "exp_year": 2026, - "fingerprint": "sq-1-TpmjbNBMFdibiIjpQI5LiRgNUBC7u1689i0TgHjnlyHEWYB7tnn-K4QbW4ttvtaqXw" + "fingerprint": "sq-1-TpmjbNBMFdibiIjpQI5LiRgNUBC7u1689i0TgHjnlyHEWYB7tnn-K4QbW4ttvtaqXw", + "card_type": "DEBIT", + "prepaid_type": "PREPAID", + "bin": "411111" }, "entry_method": "ON_FILE", "cvv_status": "CVV_ACCEPTED", "avs_status": "AVS_ACCEPTED", - "auth_result_code": "nsAyY2" + "auth_result_code": "nsAyY2", + "statement_description": "SQ *MY MERCHANT" }, - "location_id": "XK3DBG77NJBFX", - "order_id": "qHkNOb03hMgEgoP3gyzFBDY3cg4F", + "location_id": "XTI0H92143A39", + "order_id": "m2Hr8Hk8A3CTyQQ1k4ynExg92tO3", "reference_id": "123456", "note": "Brief description", - "customer_id": "VDKXEEKPJN48QDG3BGGFAK05P8", + "customer_id": "RDX9Z4XTIZR7MRZJUXNY9HUK6I", "processing_fee": [ { "effective_at": "2019-07-10T15:23:49.000Z", @@ -64,7 +68,9 @@ a request to the [GetPayment](#endpoint-payments-getpayment) endpoint. "currency": "USD" } } - ] + ], + "receipt_number": "GQTF", + "receipt_url": "https://squareup.com/receipt/preview/GQTFp1ZlXdpoW4o6eGiZhbjosiDFf" } } ``` diff --git a/doc/models/list-merchants-response.md b/doc/models/list-merchants-response.md index faecd701..c70db8d4 100644 --- a/doc/models/list-merchants-response.md +++ b/doc/models/list-merchants-response.md @@ -18,7 +18,7 @@ The response object returned by the [ListMerchant](#endpoint-listmerchant) endpo ```json { - "merchants": [ + "merchant": [ { "id": "DM7VKY8Q63GNP", "business_name": "Apple A Day", diff --git a/doc/models/list-payments-response.md b/doc/models/list-payments-response.md index f000afeb..854a39ce 100644 --- a/doc/models/list-payments-response.md +++ b/doc/models/list-payments-response.md @@ -21,7 +21,7 @@ a request to the [ListPayments](#endpoint-payments-listpayments) endpoint. { "payments": [ { - "id": "6SRrImjQGn8FuzIsURiN677CwaB", + "id": "ifrBnAil7rRfDtd27cdf9g9WO8paB", "created_at": "2019-07-09T14:36:13.745Z", "updated_at": "2019-07-09T14:36:13.883Z", "amount_money": { @@ -48,11 +48,11 @@ a request to the [ListPayments](#endpoint-payments-listpayments) endpoint. "avs_status": "AVS_ACCEPTED", "auth_result_code": "NQbV3A" }, - "location_id": "XK3DBG77NJBFX", - "order_id": "EM6qWxDd7RSy5udzjXktPw3PJa4F" + "location_id": "QLIJX16Q3UZ0A", + "order_id": "MvfIilKnIYKBium4rauH67wFzRxv" }, { - "id": "MRWmTKxBDNRgwfNSZptAO76xuaB", + "id": "GQTFp1ZlXdpoW4o6eGiZhbjosiDFf", "created_at": "2019-07-08T01:00:51.607Z", "updated_at": "2019-07-08T01:13:58.508Z", "amount_money": { @@ -79,9 +79,9 @@ a request to the [ListPayments](#endpoint-payments-listpayments) endpoint. "avs_status": "AVS_ACCEPTED", "auth_result_code": "vPIr0K" }, - "location_id": "XK3DBG77NJBFX", - "order_id": "OVE4bJyb4B6bGFwMYEtVdfE4ge4F", - "customer_id": "VDKXEEKPJN48QDG3BGGFAK05P8", + "location_id": "XTI0H92143A39", + "order_id": "m2Hr8Hk8A3CTyQQ1k4ynExg92tO3", + "customer_id": "RDX9Z4XTIZR7MRZJUXNY9HUK6I", "processing_fee": [ { "effective_at": "2019-07-08T03:00:53.000Z", @@ -94,7 +94,7 @@ a request to the [ListPayments](#endpoint-payments-listpayments) endpoint. ] } ], - "cursor": "Q2g4SUF4SWJUVkpYYlZSTGVFSkVUbEpuZDJaT1UxcHdkRUZQTnpaNGRXRkNFSmVJNVBpOExRPT0" + "cursor": "2TTnuq0yRYDdBRSFF2XuFkgO1Bclt4ZHNI7YrFNeyZ6rL1WZXkdnLn10H8fBIwFKdKW1Af6ifRa" } ``` diff --git a/doc/models/merchant-status.md b/doc/models/merchant-status.md index 44faabfa..4937588e 100644 --- a/doc/models/merchant-status.md +++ b/doc/models/merchant-status.md @@ -9,5 +9,5 @@ | Name | Description | | --- | --- | | `ACTIVE` | A fully operational merchant account. The merchant can interact with Square products and APIs. | -| `INACTIVE` | A functionally limited merchant account. The merchant can only have limited interaction
via Square APIs. The merchant cannot access the seller dashboard. | +| `INACTIVE` | A functionally limited merchant account. The merchant can only have limited interaction
via Square APIs. The merchant cannot access the seller dashboard. | diff --git a/doc/models/payment.md b/doc/models/payment.md index c548edef..c9be1214 100644 --- a/doc/models/payment.md +++ b/doc/models/payment.md @@ -20,6 +20,9 @@ Represents a payment processed by the Square API. | `ProcessingFee` | [`List`](/doc/models/processing-fee.md) | Optional | Processing fees and fee adjustments assessed by Square on this payment. | | `RefundedMoney` | [`Money`](/doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | | `Status` | `String` | Optional | Indicates whether the payment is `APPROVED`, `COMPLETED`, `CANCELED`, or `FAILED`. | +| `DelayDuration` | `String` | Optional | The duration of time after the payment's creation when Square automatically applies the
`delay_action` to the payment. This automatic `delay_action` applies only to payments that
don't reach a terminal state (COMPLETED, CANCELED, or FAILED) before the `delay_duration`
time period.

This field is specified as a time duration, in RFC 3339 format.

Notes:
This feature is only supported for card payments.

Default:

- Card Present payments: "PT36H" (36 hours) from the creation time.
- Card Not Present payments: "P7D" (7 days) from the creation time. | +| `DelayAction` | `String` | Optional | The action to be applied to the payment when the `delay_duration` has elapsed. This field
is read only.

Current values include:
`CANCEL` | +| `DelayedUntil` | `String` | Optional | Read only timestamp of when the `delay_action` will automatically be applied,
in RFC 3339 format.

Note that this field is calculated by summing the payment's `delay_duration` and `created_at`
fields. The `created_at` field is generated by Square and may not exactly match the
time on your local machine. | | `SourceType` | `String` | Optional | The source type for this payment

Current values include:
`CARD` | | `CardDetails` | [`CardPaymentDetails`](/doc/models/card-payment-details.md) | Optional | Reflects the current status of a card payment. | | `LocationId` | `String` | Optional | ID of the location associated with the payment. | @@ -50,6 +53,9 @@ Represents a payment processed by the Square API. "processing_fee": null, "refunded_money": null, "status": null, + "delay_duration": null, + "delay_action": null, + "delayed_until": null, "source_type": null, "card_details": null, "location_id": null, diff --git a/doc/payments.md b/doc/payments.md index 21ef8fbd..50acbaf0 100644 --- a/doc/payments.md +++ b/doc/payments.md @@ -246,7 +246,8 @@ the payment using this endpoint. For more information, see ```java CompletableFuture completePaymentAsync( - final String paymentId) + final String paymentId, + final Object body) ``` ### Parameters @@ -254,6 +255,7 @@ CompletableFuture completePaymentAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `paymentId` | `String` | Template, Required | Unique ID identifying the payment to be completed. | +| `body` | `Object` | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | ### Response Type @@ -263,8 +265,9 @@ CompletableFuture completePaymentAsync( ```java String paymentId = "payment_id0"; +Object body = com.squareup.square.ApiHelper.deserialize("{\"key1\":\"val1\",\"key2\":\"val2\"}"); -paymentsApi.completePaymentAsync(paymentId).thenAccept(result -> { +paymentsApi.completePaymentAsync(paymentId, body).thenAccept(result -> { // TODO success callback handler }).exceptionally(exception -> { // TODO failure callback handler diff --git a/pom.xml b/pom.xml index eaa6783a..45707bc2 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.squareup square - 5.0.0.20200226 + 5.1.0.20200325 jar Square @@ -110,6 +110,7 @@ 2.9.10 + 2.9.10.3 1.8 1.8 UTF-8 @@ -194,7 +195,7 @@ com.fasterxml.jackson.core jackson-databind - ${jackson.version} + ${jackson.databind.version} com.fasterxml.jackson.core @@ -213,4 +214,4 @@ test - + \ No newline at end of file diff --git a/src/main/java/com/squareup/square/AccessTokenCredentials.java b/src/main/java/com/squareup/square/AccessTokenCredentials.java index 51b78a86..0f935fba 100644 --- a/src/main/java/com/squareup/square/AccessTokenCredentials.java +++ b/src/main/java/com/squareup/square/AccessTokenCredentials.java @@ -9,4 +9,4 @@ public interface AccessTokenCredentials { * @return accessToken */ String getAccessToken(); -} +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/AccessTokenManager.java b/src/main/java/com/squareup/square/AccessTokenManager.java index 9d8b8c4b..1246c700 100644 --- a/src/main/java/com/squareup/square/AccessTokenManager.java +++ b/src/main/java/com/squareup/square/AccessTokenManager.java @@ -45,4 +45,4 @@ public CompletableFuture applyAsync(HttpRequest httpRequest) { httpRequest.getHeaders().add("Authorization", "Bearer " + accessToken); return CompletableFuture.completedFuture(httpRequest); } -} +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/ApiHelper.java b/src/main/java/com/squareup/square/ApiHelper.java index ad0a3fd0..e408b490 100644 --- a/src/main/java/com/squareup/square/ApiHelper.java +++ b/src/main/java/com/squareup/square/ApiHelper.java @@ -61,8 +61,8 @@ public static String serialize(Object obj) /** * Json deserialization of the given Json string. - * @param jParser The Json parser for reading Json to deserialize - * @param The type of the object to deserialize into + * @param json The Json string to deserialize + * @param clazz The type of the object to deserialize into * @return The deserialized object */ public static T deserialize(String json, Class clazz) @@ -75,7 +75,7 @@ public static T deserialize(String json, Class clazz) /** * JSON Deserialization of the given json string. - * @param jParser The json parser for reading json to deserialize + * @param json The Json string to deserialize * @param classArray The class of the array of objects to deserialize into * @return The deserialized list of objects */ @@ -506,4 +506,4 @@ private static void loadKeyValuePairForEncoding( private static boolean isWrapperType(Object object) { return WRAPPER_TYPES.contains(object.getClass()) || object.getClass().isPrimitive() || object.getClass().isEnum(); } -} +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/Environment.java b/src/main/java/com/squareup/square/Environment.java index 17f83f2a..b20c5790 100644 --- a/src/main/java/com/squareup/square/Environment.java +++ b/src/main/java/com/squareup/square/Environment.java @@ -61,4 +61,4 @@ public static List toValue(List toConvert) { } return convertedValues; } -} +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/Server.java b/src/main/java/com/squareup/square/Server.java index 2dd57937..f0260a48 100644 --- a/src/main/java/com/squareup/square/Server.java +++ b/src/main/java/com/squareup/square/Server.java @@ -57,4 +57,4 @@ public static List toValue(List toConvert) { } return convertedValues; } -} +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/SquareClient.java b/src/main/java/com/squareup/square/SquareClient.java index c81bc9e4..47bf9e5b 100644 --- a/src/main/java/com/squareup/square/SquareClient.java +++ b/src/main/java/com/squareup/square/SquareClient.java @@ -391,7 +391,7 @@ public Headers getAdditionalHeaders() { * @return sdkVersion */ public String getSdkVersion() { - return "5.0.0.20200226"; + return "5.1.0.20200325"; } /** @@ -399,7 +399,7 @@ public String getSdkVersion() { * @return squareVersion */ public String getSquareVersion() { - return "2020-02-26"; + return "2020-03-25"; } /** @@ -542,4 +542,4 @@ public SquareClient build() { authManagers, httpCallback); } } -} +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/api/ApplePayApi.java b/src/main/java/com/squareup/square/api/ApplePayApi.java index d1984e73..c7ea01f0 100644 --- a/src/main/java/com/squareup/square/api/ApplePayApi.java +++ b/src/main/java/com/squareup/square/api/ApplePayApi.java @@ -103,7 +103,7 @@ private HttpRequest buildRegisterDomainRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -143,4 +143,4 @@ private RegisterDomainResponse handleRegisterDomainResponse(HttpContext context) return result; } -} +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/api/BankAccountsApi.java b/src/main/java/com/squareup/square/api/BankAccountsApi.java index 19511fc9..8b0e533d 100644 --- a/src/main/java/com/squareup/square/api/BankAccountsApi.java +++ b/src/main/java/com/squareup/square/api/BankAccountsApi.java @@ -113,7 +113,7 @@ private HttpRequest buildListBankAccountsRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -207,7 +207,7 @@ private HttpRequest buildGetBankAccountByV1IdRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -301,7 +301,7 @@ private HttpRequest buildGetBankAccountRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -340,4 +340,4 @@ private GetBankAccountResponse handleGetBankAccountResponse(HttpContext context) return result; } -} +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/api/BaseApi.java b/src/main/java/com/squareup/square/api/BaseApi.java index 3007d74c..b2f39265 100644 --- a/src/main/java/com/squareup/square/api/BaseApi.java +++ b/src/main/java/com/squareup/square/api/BaseApi.java @@ -23,7 +23,7 @@ public abstract class BaseApi { * Protected variables to hold an instance of Configuration */ protected final Configuration config; - protected static final String userAgent = "Square-Java-SDK/5.0.0.20200226"; + protected static final String userAgent = "Square-Java-SDK/5.1.0.20200325"; /** * Protected variable to hold an instance of HttpCallback if the user provides it diff --git a/src/main/java/com/squareup/square/api/CashDrawersApi.java b/src/main/java/com/squareup/square/api/CashDrawersApi.java index dcf83fc0..5af7ef2b 100644 --- a/src/main/java/com/squareup/square/api/CashDrawersApi.java +++ b/src/main/java/com/squareup/square/api/CashDrawersApi.java @@ -129,7 +129,7 @@ private HttpRequest buildListCashDrawerShiftsRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -231,7 +231,7 @@ private HttpRequest buildRetrieveCashDrawerShiftRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -343,7 +343,7 @@ private HttpRequest buildListCashDrawerShiftEventsRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -382,4 +382,4 @@ private ListCashDrawerShiftEventsResponse handleListCashDrawerShiftEventsRespons return result; } -} +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/api/CatalogApi.java b/src/main/java/com/squareup/square/api/CatalogApi.java index 65ced7e1..102f8ac3 100644 --- a/src/main/java/com/squareup/square/api/CatalogApi.java +++ b/src/main/java/com/squareup/square/api/CatalogApi.java @@ -129,7 +129,7 @@ private HttpRequest buildBatchDeleteCatalogObjectsRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -226,7 +226,7 @@ private HttpRequest buildBatchRetrieveCatalogObjectsRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -329,7 +329,7 @@ private HttpRequest buildBatchUpsertCatalogObjectsRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -482,7 +482,7 @@ private HttpRequest buildCreateCatalogImageRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); Headers requestHeaders = new Headers(); requestHeaders.add("Content-Type", "application/json; charset=utf-8"); @@ -579,7 +579,7 @@ private HttpRequest buildCatalogInfoRequest() { Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -689,7 +689,7 @@ private HttpRequest buildListCatalogRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -775,7 +775,7 @@ private HttpRequest buildUpsertCatalogObjectRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -876,7 +876,7 @@ private HttpRequest buildDeleteCatalogObjectRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -988,7 +988,7 @@ private HttpRequest buildRetrieveCatalogObjectRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -1100,7 +1100,7 @@ private HttpRequest buildSearchCatalogObjectsRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -1191,7 +1191,7 @@ private HttpRequest buildUpdateItemModifierListsRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -1282,7 +1282,7 @@ private HttpRequest buildUpdateItemTaxesRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -1322,4 +1322,4 @@ private UpdateItemTaxesResponse handleUpdateItemTaxesResponse(HttpContext contex return result; } -} +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/api/CheckoutApi.java b/src/main/java/com/squareup/square/api/CheckoutApi.java index 12d3af74..25d4e31f 100644 --- a/src/main/java/com/squareup/square/api/CheckoutApi.java +++ b/src/main/java/com/squareup/square/api/CheckoutApi.java @@ -106,7 +106,7 @@ private HttpRequest buildCreateCheckoutRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -146,4 +146,4 @@ private CreateCheckoutResponse handleCreateCheckoutResponse(HttpContext context) return result; } -} +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/api/CustomersApi.java b/src/main/java/com/squareup/square/api/CustomersApi.java index 76eb4f6a..6a6a750a 100644 --- a/src/main/java/com/squareup/square/api/CustomersApi.java +++ b/src/main/java/com/squareup/square/api/CustomersApi.java @@ -118,7 +118,7 @@ private HttpRequest buildListCustomersRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -218,7 +218,7 @@ private HttpRequest buildCreateCustomerRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -311,7 +311,7 @@ private HttpRequest buildSearchCustomersRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -406,7 +406,7 @@ private HttpRequest buildDeleteCustomerRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -496,7 +496,7 @@ private HttpRequest buildRetrieveCustomerRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -604,7 +604,7 @@ private HttpRequest buildUpdateCustomerRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -707,7 +707,7 @@ private HttpRequest buildCreateCustomerCardRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -804,7 +804,7 @@ private HttpRequest buildDeleteCustomerCardRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -843,4 +843,4 @@ private DeleteCustomerCardResponse handleDeleteCustomerCardResponse(HttpContext return result; } -} +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/api/DisputesApi.java b/src/main/java/com/squareup/square/api/DisputesApi.java index d231f5fa..4d0bbee6 100644 --- a/src/main/java/com/squareup/square/api/DisputesApi.java +++ b/src/main/java/com/squareup/square/api/DisputesApi.java @@ -122,7 +122,7 @@ private HttpRequest buildListDisputesRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -212,7 +212,7 @@ private HttpRequest buildRetrieveDisputeRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -314,7 +314,7 @@ private HttpRequest buildAcceptDisputeRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -404,7 +404,7 @@ private HttpRequest buildListDisputeEvidenceRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -506,7 +506,7 @@ private HttpRequest buildRemoveDisputeEvidenceRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -608,7 +608,7 @@ private HttpRequest buildRetrieveDisputeEvidenceRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -732,7 +732,7 @@ private HttpRequest buildCreateDisputeEvidenceFileRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); Headers requestHeaders = new Headers(); requestHeaders.add("Content-Type", "application/json; charset=utf-8"); @@ -845,7 +845,7 @@ private HttpRequest buildCreateDisputeEvidenceTextRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -950,7 +950,7 @@ private HttpRequest buildSubmitEvidenceRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -989,4 +989,4 @@ private SubmitEvidenceResponse handleSubmitEvidenceResponse(HttpContext context) return result; } -} +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/api/EmployeesApi.java b/src/main/java/com/squareup/square/api/EmployeesApi.java index 9f8984cb..1fe25cce 100644 --- a/src/main/java/com/squareup/square/api/EmployeesApi.java +++ b/src/main/java/com/squareup/square/api/EmployeesApi.java @@ -114,7 +114,7 @@ private HttpRequest buildListEmployeesRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -204,7 +204,7 @@ private HttpRequest buildRetrieveEmployeeRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -243,4 +243,4 @@ private RetrieveEmployeeResponse handleRetrieveEmployeeResponse(HttpContext cont return result; } -} +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/api/InventoryApi.java b/src/main/java/com/squareup/square/api/InventoryApi.java index 6e8b582d..cadc25a7 100644 --- a/src/main/java/com/squareup/square/api/InventoryApi.java +++ b/src/main/java/com/squareup/square/api/InventoryApi.java @@ -106,7 +106,7 @@ private HttpRequest buildRetrieveInventoryAdjustmentRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -198,7 +198,7 @@ private HttpRequest buildBatchChangeInventoryRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -295,7 +295,7 @@ private HttpRequest buildBatchRetrieveInventoryChangesRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -398,7 +398,7 @@ private HttpRequest buildBatchRetrieveInventoryCountsRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -491,7 +491,7 @@ private HttpRequest buildRetrieveInventoryPhysicalCountRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -603,7 +603,7 @@ private HttpRequest buildRetrieveInventoryCountRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -723,7 +723,7 @@ private HttpRequest buildRetrieveInventoryChangesRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -762,4 +762,4 @@ private RetrieveInventoryChangesResponse handleRetrieveInventoryChangesResponse( return result; } -} +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/api/LaborApi.java b/src/main/java/com/squareup/square/api/LaborApi.java index 8c63de77..720b7c93 100644 --- a/src/main/java/com/squareup/square/api/LaborApi.java +++ b/src/main/java/com/squareup/square/api/LaborApi.java @@ -126,7 +126,7 @@ private HttpRequest buildListBreakTypesRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -232,7 +232,7 @@ private HttpRequest buildCreateBreakTypeRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -325,7 +325,7 @@ private HttpRequest buildDeleteBreakTypeRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -415,7 +415,7 @@ private HttpRequest buildGetBreakTypeRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -511,7 +511,7 @@ private HttpRequest buildUpdateBreakTypeRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -614,7 +614,7 @@ private HttpRequest buildListEmployeeWagesRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -704,7 +704,7 @@ private HttpRequest buildGetEmployeeWageRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -818,7 +818,7 @@ private HttpRequest buildCreateShiftRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -929,7 +929,7 @@ private HttpRequest buildSearchShiftsRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -1020,7 +1020,7 @@ private HttpRequest buildDeleteShiftRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -1110,7 +1110,7 @@ private HttpRequest buildGetShiftRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -1214,7 +1214,7 @@ private HttpRequest buildUpdateShiftRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -1311,7 +1311,7 @@ private HttpRequest buildListWorkweekConfigsRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -1407,7 +1407,7 @@ private HttpRequest buildUpdateWorkweekConfigRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -1447,4 +1447,4 @@ private UpdateWorkweekConfigResponse handleUpdateWorkweekConfigResponse(HttpCont return result; } -} +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/api/LocationsApi.java b/src/main/java/com/squareup/square/api/LocationsApi.java index 797d1d1f..a8640710 100644 --- a/src/main/java/com/squareup/square/api/LocationsApi.java +++ b/src/main/java/com/squareup/square/api/LocationsApi.java @@ -96,7 +96,7 @@ private HttpRequest buildListLocationsRequest() { Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -184,7 +184,7 @@ private HttpRequest buildCreateLocationRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -275,7 +275,7 @@ private HttpRequest buildRetrieveLocationRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -371,7 +371,7 @@ private HttpRequest buildUpdateLocationRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -411,4 +411,4 @@ private UpdateLocationResponse handleUpdateLocationResponse(HttpContext context) return result; } -} +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/api/MerchantsApi.java b/src/main/java/com/squareup/square/api/MerchantsApi.java index 6bedbd16..4e9ff64a 100644 --- a/src/main/java/com/squareup/square/api/MerchantsApi.java +++ b/src/main/java/com/squareup/square/api/MerchantsApi.java @@ -106,7 +106,7 @@ private HttpRequest buildListMerchantsRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -196,7 +196,7 @@ private HttpRequest buildRetrieveMerchantRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -235,4 +235,4 @@ private RetrieveMerchantResponse handleRetrieveMerchantResponse(HttpContext cont return result; } -} +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/api/MobileAuthorizationApi.java b/src/main/java/com/squareup/square/api/MobileAuthorizationApi.java index 8715a81f..6b6afc5b 100644 --- a/src/main/java/com/squareup/square/api/MobileAuthorizationApi.java +++ b/src/main/java/com/squareup/square/api/MobileAuthorizationApi.java @@ -105,7 +105,7 @@ private HttpRequest buildCreateMobileAuthorizationCodeRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -145,4 +145,4 @@ private CreateMobileAuthorizationCodeResponse handleCreateMobileAuthorizationCod return result; } -} +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/api/OAuthApi.java b/src/main/java/com/squareup/square/api/OAuthApi.java index 83bda740..a1c1e627 100644 --- a/src/main/java/com/squareup/square/api/OAuthApi.java +++ b/src/main/java/com/squareup/square/api/OAuthApi.java @@ -141,7 +141,7 @@ private HttpRequest buildRenewTokenRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -253,7 +253,7 @@ private HttpRequest buildRevokeTokenRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -355,7 +355,7 @@ private HttpRequest buildObtainTokenRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -395,4 +395,4 @@ private ObtainTokenResponse handleObtainTokenResponse(HttpContext context) return result; } -} +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/api/OrdersApi.java b/src/main/java/com/squareup/square/api/OrdersApi.java index 8ca84f9d..fd5a6b10 100644 --- a/src/main/java/com/squareup/square/api/OrdersApi.java +++ b/src/main/java/com/squareup/square/api/OrdersApi.java @@ -122,7 +122,7 @@ private HttpRequest buildCreateOrderRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -221,7 +221,7 @@ private HttpRequest buildBatchRetrieveOrdersRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -348,7 +348,7 @@ private HttpRequest buildUpdateOrderRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -461,7 +461,7 @@ private HttpRequest buildSearchOrdersRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -580,7 +580,7 @@ private HttpRequest buildPayOrderRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -620,4 +620,4 @@ private PayOrderResponse handlePayOrderResponse(HttpContext context) return result; } -} +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/api/PaymentsApi.java b/src/main/java/com/squareup/square/api/PaymentsApi.java index dd683c7a..6b665448 100644 --- a/src/main/java/com/squareup/square/api/PaymentsApi.java +++ b/src/main/java/com/squareup/square/api/PaymentsApi.java @@ -146,7 +146,7 @@ private HttpRequest buildListPaymentsRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -252,7 +252,7 @@ private HttpRequest buildCreatePaymentRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -355,7 +355,7 @@ private HttpRequest buildCancelPaymentByIdempotencyKeyRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -446,7 +446,7 @@ private HttpRequest buildGetPaymentRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -540,7 +540,7 @@ private HttpRequest buildCancelPaymentRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -586,11 +586,13 @@ private CancelPaymentResponse handleCancelPaymentResponse(HttpContext context) * the payment using this endpoint. For more information, see * [Delayed Payments](https://developer.squareup.com/docs/payments-api/take-payments#delayed-payments). * @param paymentId Required parameter: Unique ID identifying the payment to be completed. + * @param body Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. * @return Returns the CompletePaymentResponse response from the API call */ public CompletePaymentResponse completePayment( - final String paymentId) throws ApiException, IOException { - HttpRequest request = buildCompletePaymentRequest(paymentId); + final String paymentId, + final Object body) throws ApiException, IOException { + HttpRequest request = buildCompletePaymentRequest(paymentId, body); authManagers.get("default").apply(request); HttpResponse response = getClientInstance().executeAsString(request); @@ -606,11 +608,13 @@ public CompletePaymentResponse completePayment( * the payment using this endpoint. For more information, see * [Delayed Payments](https://developer.squareup.com/docs/payments-api/take-payments#delayed-payments). * @param paymentId Required parameter: Unique ID identifying the payment to be completed. + * @param body Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. * @return Returns the CompletePaymentResponse response from the API call */ public CompletableFuture completePaymentAsync( - final String paymentId) { - return makeHttpCallAsync(() -> buildCompletePaymentRequest(paymentId), + final String paymentId, + final Object body) { + return makeHttpCallAsync(() -> buildCompletePaymentRequest(paymentId, body), req -> authManagers.get("default").applyAsync(req) .thenCompose(request -> getClientInstance().executeAsStringAsync(request)), context -> handleCompletePaymentResponse(context)); @@ -620,7 +624,8 @@ public CompletableFuture completePaymentAsync( * Builds the HttpRequest object for completePayment */ private HttpRequest buildCompletePaymentRequest( - final String paymentId) { + final String paymentId, + final Object body) throws JsonProcessingException { //the base uri for api requests String baseUri = config.getBaseUri(); @@ -638,11 +643,13 @@ private HttpRequest buildCompletePaymentRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("content-type", "application/json"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response - HttpRequest request = getClientInstance().post(queryUrl, headers, null); + String bodyJson = ApiHelper.serialize(body); + HttpRequest request = getClientInstance().postBody(queryUrl, headers, bodyJson); // Invoke the callback before request if its not null if (getHttpCallback() != null) { @@ -677,4 +684,4 @@ private CompletePaymentResponse handleCompletePaymentResponse(HttpContext contex return result; } -} +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/api/RefundsApi.java b/src/main/java/com/squareup/square/api/RefundsApi.java index 19728526..6819544d 100644 --- a/src/main/java/com/squareup/square/api/RefundsApi.java +++ b/src/main/java/com/squareup/square/api/RefundsApi.java @@ -136,7 +136,7 @@ private HttpRequest buildListPaymentRefundsRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -226,7 +226,7 @@ private HttpRequest buildRefundPaymentRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -317,7 +317,7 @@ private HttpRequest buildGetPaymentRefundRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -356,4 +356,4 @@ private GetPaymentRefundResponse handleGetPaymentRefundResponse(HttpContext cont return result; } -} +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/api/ReportingApi.java b/src/main/java/com/squareup/square/api/ReportingApi.java index 6939cc39..161cf95e 100644 --- a/src/main/java/com/squareup/square/api/ReportingApi.java +++ b/src/main/java/com/squareup/square/api/ReportingApi.java @@ -134,7 +134,7 @@ private HttpRequest buildListAdditionalRecipientReceivableRefundsRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -262,7 +262,7 @@ private HttpRequest buildListAdditionalRecipientReceivablesRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -301,4 +301,4 @@ private ListAdditionalRecipientReceivablesResponse handleListAdditionalRecipient return result; } -} +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/api/TransactionsApi.java b/src/main/java/com/squareup/square/api/TransactionsApi.java index 4d555b4d..656bedd5 100644 --- a/src/main/java/com/squareup/square/api/TransactionsApi.java +++ b/src/main/java/com/squareup/square/api/TransactionsApi.java @@ -161,7 +161,7 @@ private HttpRequest buildListRefundsRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -303,7 +303,7 @@ private HttpRequest buildListTransactionsRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -445,7 +445,7 @@ private HttpRequest buildChargeRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -560,7 +560,7 @@ private HttpRequest buildRetrieveTransactionRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -678,7 +678,7 @@ private HttpRequest buildCaptureTransactionRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -810,7 +810,7 @@ private HttpRequest buildCreateRefundRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -929,7 +929,7 @@ private HttpRequest buildVoidTransactionRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -968,4 +968,4 @@ private VoidTransactionResponse handleVoidTransactionResponse(HttpContext contex return result; } -} +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/api/V1EmployeesApi.java b/src/main/java/com/squareup/square/api/V1EmployeesApi.java index 6db7036f..b3780280 100644 --- a/src/main/java/com/squareup/square/api/V1EmployeesApi.java +++ b/src/main/java/com/squareup/square/api/V1EmployeesApi.java @@ -148,7 +148,7 @@ private HttpRequest buildListEmployeesRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -248,7 +248,7 @@ private HttpRequest buildCreateEmployeeRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -339,7 +339,7 @@ private HttpRequest buildRetrieveEmployeeRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -435,7 +435,7 @@ private HttpRequest buildUpdateEmployeeRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -538,7 +538,7 @@ private HttpRequest buildListEmployeeRolesRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -640,7 +640,7 @@ private HttpRequest buildCreateEmployeeRoleRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -731,7 +731,7 @@ private HttpRequest buildRetrieveEmployeeRoleRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -827,7 +827,7 @@ private HttpRequest buildUpdateEmployeeRoleRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -994,7 +994,7 @@ private HttpRequest buildListTimecardsRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -1114,7 +1114,7 @@ private HttpRequest buildCreateTimecardRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -1244,7 +1244,7 @@ private HttpRequest buildDeleteTimecardRequest( //load all headers for the outgoing API request Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -1358,7 +1358,7 @@ private HttpRequest buildRetrieveTimecardRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -1474,7 +1474,7 @@ private HttpRequest buildUpdateTimecardRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -1593,7 +1593,7 @@ private HttpRequest buildListTimecardEventsRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -1719,7 +1719,7 @@ private HttpRequest buildListCashDrawerShiftsRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -1829,7 +1829,7 @@ private HttpRequest buildRetrieveCashDrawerShiftRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -1868,4 +1868,4 @@ private V1CashDrawerShift handleRetrieveCashDrawerShiftResponse(HttpContext cont return result; } -} +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/api/V1ItemsApi.java b/src/main/java/com/squareup/square/api/V1ItemsApi.java index ab093c39..9c31fcf6 100644 --- a/src/main/java/com/squareup/square/api/V1ItemsApi.java +++ b/src/main/java/com/squareup/square/api/V1ItemsApi.java @@ -123,7 +123,7 @@ private HttpRequest buildListCategoriesRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -233,7 +233,7 @@ private HttpRequest buildCreateCategoryRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -352,7 +352,7 @@ private HttpRequest buildDeleteCategoryRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -470,7 +470,7 @@ private HttpRequest buildUpdateCategoryRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -577,7 +577,7 @@ private HttpRequest buildListDiscountsRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -687,7 +687,7 @@ private HttpRequest buildCreateDiscountRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -806,7 +806,7 @@ private HttpRequest buildDeleteDiscountRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -924,7 +924,7 @@ private HttpRequest buildUpdateDiscountRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -1031,7 +1031,7 @@ private HttpRequest buildListFeesRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -1141,7 +1141,7 @@ private HttpRequest buildCreateFeeRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -1260,7 +1260,7 @@ private HttpRequest buildDeleteFeeRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -1378,7 +1378,7 @@ private HttpRequest buildUpdateFeeRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -1503,7 +1503,7 @@ private HttpRequest buildListInventoryRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -1619,7 +1619,7 @@ private HttpRequest buildAdjustInventoryRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -1736,7 +1736,7 @@ private HttpRequest buildListItemsRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -1862,7 +1862,7 @@ private HttpRequest buildCreateItemRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -1981,7 +1981,7 @@ private HttpRequest buildDeleteItemRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -2095,7 +2095,7 @@ private HttpRequest buildRetrieveItemRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -2213,7 +2213,7 @@ private HttpRequest buildUpdateItemRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -2334,7 +2334,7 @@ private HttpRequest buildRemoveFeeRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -2454,7 +2454,7 @@ private HttpRequest buildApplyFeeRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -2574,7 +2574,7 @@ private HttpRequest buildRemoveModifierListRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -2694,7 +2694,7 @@ private HttpRequest buildApplyModifierListRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -2812,7 +2812,7 @@ private HttpRequest buildCreateVariationRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -2937,7 +2937,7 @@ private HttpRequest buildDeleteVariationRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -3061,7 +3061,7 @@ private HttpRequest buildUpdateVariationRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -3168,7 +3168,7 @@ private HttpRequest buildListModifierListsRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -3278,7 +3278,7 @@ private HttpRequest buildCreateModifierListRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -3399,7 +3399,7 @@ private HttpRequest buildDeleteModifierListRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -3511,7 +3511,7 @@ private HttpRequest buildRetrieveModifierListRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -3629,7 +3629,7 @@ private HttpRequest buildUpdateModifierListRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -3748,7 +3748,7 @@ private HttpRequest buildCreateModifierOptionRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -3873,7 +3873,7 @@ private HttpRequest buildDeleteModifierOptionRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -3997,7 +3997,7 @@ private HttpRequest buildUpdateModifierOptionRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -4106,7 +4106,7 @@ private HttpRequest buildListPagesRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -4216,7 +4216,7 @@ private HttpRequest buildCreatePageRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -4333,7 +4333,7 @@ private HttpRequest buildDeletePageRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -4451,7 +4451,7 @@ private HttpRequest buildUpdatePageRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -4586,7 +4586,7 @@ private HttpRequest buildDeletePageCellRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -4704,7 +4704,7 @@ private HttpRequest buildUpdatePageCellRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -4744,4 +4744,4 @@ private V1Page handleUpdatePageCellResponse(HttpContext context) return result; } -} +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/api/V1LocationsApi.java b/src/main/java/com/squareup/square/api/V1LocationsApi.java index fc8d5ee0..993a7098 100644 --- a/src/main/java/com/squareup/square/api/V1LocationsApi.java +++ b/src/main/java/com/squareup/square/api/V1LocationsApi.java @@ -101,7 +101,7 @@ private HttpRequest buildRetrieveBusinessRequest() { Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -199,7 +199,7 @@ private HttpRequest buildListLocationsRequest() { Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -236,4 +236,4 @@ private List handleListLocationsResponse(HttpContext context) return result; } -} +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/api/V1TransactionsApi.java b/src/main/java/com/squareup/square/api/V1TransactionsApi.java index 70e81a42..72563469 100644 --- a/src/main/java/com/squareup/square/api/V1TransactionsApi.java +++ b/src/main/java/com/squareup/square/api/V1TransactionsApi.java @@ -118,7 +118,7 @@ private HttpRequest buildListBankAccountsRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -228,7 +228,7 @@ private HttpRequest buildRetrieveBankAccountRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -340,7 +340,7 @@ private HttpRequest buildListOrdersRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -434,7 +434,7 @@ private HttpRequest buildRetrieveOrderRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -536,7 +536,7 @@ private HttpRequest buildUpdateOrderRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -685,7 +685,7 @@ private HttpRequest buildListPaymentsRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -779,7 +779,7 @@ private HttpRequest buildRetrievePaymentRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -903,7 +903,7 @@ private HttpRequest buildListRefundsRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -1015,7 +1015,7 @@ private HttpRequest buildCreateRefundRequest( headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); headers.add("content-type", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -1154,7 +1154,7 @@ private HttpRequest buildListSettlementsRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -1274,7 +1274,7 @@ private HttpRequest buildRetrieveSettlementRequest( Headers headers = new Headers(); headers.add("user-agent", BaseApi.userAgent); headers.add("accept", "application/json"); - headers.add("Square-Version", "2020-02-26"); + headers.add("Square-Version", "2020-03-25"); headers.addAll(config.getAdditionalHeaders()); //prepare and invoke the API call request to fetch the response @@ -1313,4 +1313,4 @@ private V1Settlement handleRetrieveSettlementResponse(HttpContext context) return result; } -} +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/exceptions/ApiException.java b/src/main/java/com/squareup/square/exceptions/ApiException.java index 8d3a3aca..8aec5dca 100644 --- a/src/main/java/com/squareup/square/exceptions/ApiException.java +++ b/src/main/java/com/squareup/square/exceptions/ApiException.java @@ -85,4 +85,4 @@ public ApiException(String reason, HttpContext context) { // Can throw exception while object mapper tries to convert results from JSON tree into given value type. } } -} +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/http/client/HttpCallback.java b/src/main/java/com/squareup/square/http/client/HttpCallback.java index 2e4c38ac..20f11dac 100644 --- a/src/main/java/com/squareup/square/http/client/HttpCallback.java +++ b/src/main/java/com/squareup/square/http/client/HttpCallback.java @@ -17,4 +17,4 @@ public interface HttpCallback { * @param context Context for the HTTP call */ public void onAfterResponse(HttpContext context); -} +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/http/client/HttpClient.java b/src/main/java/com/squareup/square/http/client/HttpClient.java index 4b49a153..bd90bbfb 100644 --- a/src/main/java/com/squareup/square/http/client/HttpClient.java +++ b/src/main/java/com/squareup/square/http/client/HttpClient.java @@ -102,4 +102,4 @@ HttpRequest delete(String queryUrl, */ public HttpBodyRequest deleteBody(String queryUrl, Headers headers, Object body); -} +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/http/client/HttpClientConfiguration.java b/src/main/java/com/squareup/square/http/client/HttpClientConfiguration.java index d077179a..6cf0dcc2 100644 --- a/src/main/java/com/squareup/square/http/client/HttpClientConfiguration.java +++ b/src/main/java/com/squareup/square/http/client/HttpClientConfiguration.java @@ -27,4 +27,4 @@ public void setTimeout(long timeout) { } -} +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/http/client/HttpContext.java b/src/main/java/com/squareup/square/http/client/HttpContext.java index 8cb06b63..00cf3591 100644 --- a/src/main/java/com/squareup/square/http/client/HttpContext.java +++ b/src/main/java/com/squareup/square/http/client/HttpContext.java @@ -35,4 +35,4 @@ public HttpRequest getRequest() { public HttpResponse getResponse() { return response; } -} +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/http/client/OkClient.java b/src/main/java/com/squareup/square/http/client/OkClient.java index 99b7ab78..a8e6a39c 100644 --- a/src/main/java/com/squareup/square/http/client/OkClient.java +++ b/src/main/java/com/squareup/square/http/client/OkClient.java @@ -50,7 +50,7 @@ private okhttp3.OkHttpClient getDefaultOkHttpClient() { if (defaultOkHttpClient == null) { defaultOkHttpClient = new okhttp3.OkHttpClient.Builder() .addInterceptor(new HttpRedirectInterceptor(true)) - .retryOnConnectionFailure(false) + .retryOnConnectionFailure(true) .callTimeout(60, TimeUnit.SECONDS) .build(); } @@ -71,7 +71,7 @@ public static void shutdown() { /** * Execute a given HttpRequest to get string response back - * @param request The given HttpRequest to execute + * @param httpRequest The given HttpRequest to execute * @return CompletableFuture after execution */ public CompletableFuture executeAsStringAsync(final HttpRequest httpRequest) { @@ -103,7 +103,7 @@ public void onResponse(okhttp3.Call call, okhttp3.Response okHttpResponse) throw /** * Execute a given HttpRequest to get binary response back - * @param request The given HttpRequest to execute + * @param httpRequest The given HttpRequest to execute * @return CompletableFuture after execution */ public CompletableFuture executeAsBinaryAsync(final HttpRequest httpRequest) { @@ -133,7 +133,7 @@ public void onResponse(okhttp3.Call call, okhttp3.Response okHttpResponse) throw /** * Execute a given HttpRequest to get string response back - * @param request The given HttpRequest to execute + * @param httpRequest The given HttpRequest to execute */ public HttpResponse executeAsString(HttpRequest httpRequest) throws IOException { okhttp3.Request okHttpRequest = convertRequest(httpRequest); @@ -143,7 +143,7 @@ public HttpResponse executeAsString(HttpRequest httpRequest) throws IOException /** * Execute a given HttpRequest to get binary response back - * @param request The given HttpRequest to execute + * @param httpRequest The given HttpRequest to execute */ public HttpResponse executeAsBinary(HttpRequest httpRequest) throws IOException { okhttp3.Request okHttpRequest = convertRequest(httpRequest); @@ -210,7 +210,7 @@ private static HttpResponse convertResponse(okhttp3.Response response, boolean b /** * Converts a given internal http request into an okhttp request model - * @param request The given http request in internal format + * @param httpRequest The given http request in internal format * @return The converted okhttp request */ private static okhttp3.Request convertRequest(HttpRequest httpRequest) { @@ -337,13 +337,13 @@ private static okhttp3.Request convertRequest(HttpRequest httpRequest) { } private static okhttp3.Headers.Builder createRequestHeaders(Headers headers) { - okhttp3.Headers.Builder requestHeaders = new okhttp3.Headers.Builder(); - for (Entry> kv : headers.asMultimap().entrySet()) { + okhttp3.Headers.Builder requestHeaders = new okhttp3.Headers.Builder(); + for (Entry> kv : headers.asMultimap().entrySet()) { for (String value : kv.getValue()) { requestHeaders.add(kv.getKey(), value); } } - return requestHeaders; + return requestHeaders; } private static String appendQuotedStringAndEncodeEscapeCharacters(String key) { @@ -352,17 +352,17 @@ private static String appendQuotedStringAndEncodeEscapeCharacters(String key) { char ch = key.charAt(i); switch (ch) { case '\n': - target += "%0A"; - break; + target += "%0A"; + break; case '\r': - target += "%0D"; - break; + target += "%0D"; + break; case '"': - target += "%22"; - break; + target += "%22"; + break; default: - target += ch; - break; + target += ch; + break; } } target += '"'; diff --git a/src/main/java/com/squareup/square/http/client/ReadonlyHttpClientConfiguration.java b/src/main/java/com/squareup/square/http/client/ReadonlyHttpClientConfiguration.java index 127574f7..ecd0cf83 100644 --- a/src/main/java/com/squareup/square/http/client/ReadonlyHttpClientConfiguration.java +++ b/src/main/java/com/squareup/square/http/client/ReadonlyHttpClientConfiguration.java @@ -11,4 +11,4 @@ public interface ReadonlyHttpClientConfiguration { public long getTimeout(); -} +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/http/response/HttpResponse.java b/src/main/java/com/squareup/square/http/response/HttpResponse.java index 79d27c27..ab9d3f21 100644 --- a/src/main/java/com/squareup/square/http/response/HttpResponse.java +++ b/src/main/java/com/squareup/square/http/response/HttpResponse.java @@ -47,4 +47,4 @@ public HttpResponse(int code, Headers headers, InputStream rawBody) { this.headers = headers; this.rawBody = rawBody; } -} +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/models/CashPaymentDetails.java b/src/main/java/com/squareup/square/models/CashPaymentDetails.java deleted file mode 100644 index d240a320..00000000 --- a/src/main/java/com/squareup/square/models/CashPaymentDetails.java +++ /dev/null @@ -1,129 +0,0 @@ -package com.squareup.square.models; - -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonGetter; - - -/** - * This is a model class for CashPaymentDetails type. - */ -public class CashPaymentDetails { - - /** - * Initialization constructor. - * @param buyerSuppliedMoney - * @param changeBackMoney - */ - @JsonCreator - public CashPaymentDetails( - @JsonProperty("buyer_supplied_money") Money buyerSuppliedMoney, - @JsonProperty("change_back_money") Money changeBackMoney) { - this.buyerSuppliedMoney = buyerSuppliedMoney; - this.changeBackMoney = changeBackMoney; - } - - private final Money buyerSuppliedMoney; - private final Money changeBackMoney; - /** - * Getter for BuyerSuppliedMoney. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts) - * for more information. - */ - @JsonGetter("buyer_supplied_money") - public Money getBuyerSuppliedMoney() { - return this.buyerSuppliedMoney; - } - - /** - * Getter for ChangeBackMoney. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts) - * for more information. - */ - @JsonGetter("change_back_money") - public Money getChangeBackMoney() { - return this.changeBackMoney; - } - - - @Override - public int hashCode() { - return Objects.hash(buyerSuppliedMoney, changeBackMoney); - } - - @Override - public boolean equals(Object obj) { - if(obj == this) { - return true; - } - if(!(obj instanceof CashPaymentDetails)) { - return false; - } - CashPaymentDetails cashPaymentDetails = (CashPaymentDetails) obj; - return Objects.equals(buyerSuppliedMoney, cashPaymentDetails.buyerSuppliedMoney) && - Objects.equals(changeBackMoney, cashPaymentDetails.changeBackMoney); - } - - /** - * Builds a new {@link CashPaymentDetails.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link CashPaymentDetails.Builder} object - */ - public Builder toBuilder() { - Builder builder = new Builder(buyerSuppliedMoney) - .changeBackMoney(getChangeBackMoney()); - return builder; - } - - /** - * Class to build instances of {@link CashPaymentDetails} - */ - public static class Builder { - private Money buyerSuppliedMoney; - private Money changeBackMoney; - - /** - * Initialization constructor - */ - public Builder(Money buyerSuppliedMoney) { - this.buyerSuppliedMoney = buyerSuppliedMoney; - } - - /** - * Setter for buyerSuppliedMoney - * @param buyerSuppliedMoney - * @return Builder - */ - public Builder buyerSuppliedMoney(Money buyerSuppliedMoney) { - this.buyerSuppliedMoney = buyerSuppliedMoney; - return this; - } - /** - * Setter for changeBackMoney - * @param changeBackMoney - * @return Builder - */ - public Builder changeBackMoney(Money changeBackMoney) { - this.changeBackMoney = changeBackMoney; - return this; - } - - /** - * Builds a new {@link CashPaymentDetails} object using the set fields. - * @return {@link CashPaymentDetails} - */ - public CashPaymentDetails build() { - return new CashPaymentDetails(buyerSuppliedMoney, - changeBackMoney); - } - } -} diff --git a/src/main/java/com/squareup/square/models/CatalogCustomAttributeDefinition.java b/src/main/java/com/squareup/square/models/CatalogCustomAttributeDefinition.java new file mode 100644 index 00000000..d9d417b8 --- /dev/null +++ b/src/main/java/com/squareup/square/models/CatalogCustomAttributeDefinition.java @@ -0,0 +1,372 @@ +package com.squareup.square.models; + +import java.util.List; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonGetter; + + +/** + * This is a model class for CatalogCustomAttributeDefinition type. + */ +public class CatalogCustomAttributeDefinition { + + /** + * Initialization constructor. + * @param type + * @param name + * @param description + * @param sourceApplication + * @param allowedObjectTypes + * @param sellerVisibility + * @param appVisibility + * @param stringConfig + * @param selectionConfig + * @param customAttributeUsageCount + * @param key + */ + @JsonCreator + public CatalogCustomAttributeDefinition( + @JsonProperty("type") String type, + @JsonProperty("name") String name, + @JsonProperty("description") String description, + @JsonProperty("source_application") SourceApplication sourceApplication, + @JsonProperty("allowed_object_types") List allowedObjectTypes, + @JsonProperty("seller_visibility") String sellerVisibility, + @JsonProperty("app_visibility") String appVisibility, + @JsonProperty("string_config") CatalogCustomAttributeDefinitionStringConfig stringConfig, + @JsonProperty("selection_config") CatalogCustomAttributeDefinitionSelectionConfig selectionConfig, + @JsonProperty("custom_attribute_usage_count") Integer customAttributeUsageCount, + @JsonProperty("key") String key) { + this.type = type; + this.name = name; + this.description = description; + this.sourceApplication = sourceApplication; + this.allowedObjectTypes = allowedObjectTypes; + this.sellerVisibility = sellerVisibility; + this.appVisibility = appVisibility; + this.stringConfig = stringConfig; + this.selectionConfig = selectionConfig; + this.customAttributeUsageCount = customAttributeUsageCount; + this.key = key; + } + + private final String type; + private final String name; + private final String description; + private final SourceApplication sourceApplication; + private final List allowedObjectTypes; + private final String sellerVisibility; + private final String appVisibility; + private final CatalogCustomAttributeDefinitionStringConfig stringConfig; + private final CatalogCustomAttributeDefinitionSelectionConfig selectionConfig; + private final Integer customAttributeUsageCount; + private final String key; + /** + * Getter for Type. + * Defines the possible types for a custom attribute. + */ + @JsonGetter("type") + public String getType() { + return this.type; + } + + /** + * Getter for Name. + * The name of this definition for API and seller-facing UI purposes. + * The name must be unique within the (merchant, application_id) pair. Required. + * May not be empty and may not exceed 255 characters. Can be modified after creation. + */ + @JsonGetter("name") + public String getName() { + return this.name; + } + + /** + * Getter for Description. + * Seller-oriented description of the meaning of this Custom Attribute, + * any constraints that the seller should observe, etc. May be displayed as a tooltip in Square UIs. + */ + @JsonGetter("description") + public String getDescription() { + return this.description; + } + + /** + * Getter for SourceApplication. + * Provides information about the application used to generate an inventory + * change. + */ + @JsonGetter("source_application") + public SourceApplication getSourceApplication() { + return this.sourceApplication; + } + + /** + * Getter for AllowedObjectTypes. + * The set of Catalog Object Types that this Custom Attribute may be applied to. + * Currently, only `ITEM` and `ITEM_VARIATION` are allowed. + * See [CatalogObjectType](#type-catalogobjecttype) for possible values + */ + @JsonGetter("allowed_object_types") + public List getAllowedObjectTypes() { + return this.allowedObjectTypes; + } + + /** + * Getter for SellerVisibility. + * Defines the visibility of a custom attribute to sellers in Square + * client applications, Square APIs or in Square UIs (including Square Point + * of Sale applications and Square Dashboard). + */ + @JsonGetter("seller_visibility") + public String getSellerVisibility() { + return this.sellerVisibility; + } + + /** + * Getter for AppVisibility. + * Defines the visibility of a custom attribute to applications other than their + * creating application. + */ + @JsonGetter("app_visibility") + public String getAppVisibility() { + return this.appVisibility; + } + + /** + * Getter for StringConfig. + * Configuration associated with Custom Attribute Definitions of type `STRING`. + */ + @JsonGetter("string_config") + public CatalogCustomAttributeDefinitionStringConfig getStringConfig() { + return this.stringConfig; + } + + /** + * Getter for SelectionConfig. + * Configuration associated with `SELECTION`-type custom attribute definitions. + */ + @JsonGetter("selection_config") + public CatalogCustomAttributeDefinitionSelectionConfig getSelectionConfig() { + return this.selectionConfig; + } + + /** + * Getter for CustomAttributeUsageCount. + * __Read-only.__ The number of custom attributes that reference this + * custom attribute definition. Set by the server in response to a ListCatalog + * request with `include_counts` set to `true`. If the actual count is greater + * than 100, `custom_attribute_usage_count` will be set to `100`. + */ + @JsonGetter("custom_attribute_usage_count") + public Integer getCustomAttributeUsageCount() { + return this.customAttributeUsageCount; + } + + /** + * Getter for Key. + * The name of the desired custom attribute key that can be used to access + * the custom attribute value on catalog objects. Cannot be modified after the + * custom attribute definition has been created. + */ + @JsonGetter("key") + public String getKey() { + return this.key; + } + + + @Override + public int hashCode() { + return Objects.hash(type, name, description, sourceApplication, allowedObjectTypes, + sellerVisibility, appVisibility, stringConfig, selectionConfig, + customAttributeUsageCount, key); + } + + @Override + public boolean equals(Object obj) { + if(obj == this) { + return true; + } + if(!(obj instanceof CatalogCustomAttributeDefinition)) { + return false; + } + CatalogCustomAttributeDefinition catalogCustomAttributeDefinition = (CatalogCustomAttributeDefinition) obj; + return Objects.equals(type, catalogCustomAttributeDefinition.type) && + Objects.equals(name, catalogCustomAttributeDefinition.name) && + Objects.equals(description, catalogCustomAttributeDefinition.description) && + Objects.equals(sourceApplication, catalogCustomAttributeDefinition.sourceApplication) && + Objects.equals(allowedObjectTypes, catalogCustomAttributeDefinition.allowedObjectTypes) && + Objects.equals(sellerVisibility, catalogCustomAttributeDefinition.sellerVisibility) && + Objects.equals(appVisibility, catalogCustomAttributeDefinition.appVisibility) && + Objects.equals(stringConfig, catalogCustomAttributeDefinition.stringConfig) && + Objects.equals(selectionConfig, catalogCustomAttributeDefinition.selectionConfig) && + Objects.equals(customAttributeUsageCount, catalogCustomAttributeDefinition.customAttributeUsageCount) && + Objects.equals(key, catalogCustomAttributeDefinition.key); + } + + /** + * Builds a new {@link CatalogCustomAttributeDefinition.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link CatalogCustomAttributeDefinition.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(type, + name) + .description(getDescription()) + .sourceApplication(getSourceApplication()) + .allowedObjectTypes(getAllowedObjectTypes()) + .sellerVisibility(getSellerVisibility()) + .appVisibility(getAppVisibility()) + .stringConfig(getStringConfig()) + .selectionConfig(getSelectionConfig()) + .customAttributeUsageCount(getCustomAttributeUsageCount()) + .key(getKey()); + return builder; + } + + /** + * Class to build instances of {@link CatalogCustomAttributeDefinition} + */ + public static class Builder { + private String type; + private String name; + private String description; + private SourceApplication sourceApplication; + private List allowedObjectTypes; + private String sellerVisibility; + private String appVisibility; + private CatalogCustomAttributeDefinitionStringConfig stringConfig; + private CatalogCustomAttributeDefinitionSelectionConfig selectionConfig; + private Integer customAttributeUsageCount; + private String key; + + /** + * Initialization constructor + */ + public Builder(String type, + String name) { + this.type = type; + this.name = name; + } + + /** + * Setter for type + * @param type + * @return Builder + */ + public Builder type(String type) { + this.type = type; + return this; + } + /** + * Setter for name + * @param name + * @return Builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + /** + * Setter for description + * @param description + * @return Builder + */ + public Builder description(String description) { + this.description = description; + return this; + } + /** + * Setter for sourceApplication + * @param sourceApplication + * @return Builder + */ + public Builder sourceApplication(SourceApplication sourceApplication) { + this.sourceApplication = sourceApplication; + return this; + } + /** + * Setter for allowedObjectTypes + * @param allowedObjectTypes + * @return Builder + */ + public Builder allowedObjectTypes(List allowedObjectTypes) { + this.allowedObjectTypes = allowedObjectTypes; + return this; + } + /** + * Setter for sellerVisibility + * @param sellerVisibility + * @return Builder + */ + public Builder sellerVisibility(String sellerVisibility) { + this.sellerVisibility = sellerVisibility; + return this; + } + /** + * Setter for appVisibility + * @param appVisibility + * @return Builder + */ + public Builder appVisibility(String appVisibility) { + this.appVisibility = appVisibility; + return this; + } + /** + * Setter for stringConfig + * @param stringConfig + * @return Builder + */ + public Builder stringConfig(CatalogCustomAttributeDefinitionStringConfig stringConfig) { + this.stringConfig = stringConfig; + return this; + } + /** + * Setter for selectionConfig + * @param selectionConfig + * @return Builder + */ + public Builder selectionConfig(CatalogCustomAttributeDefinitionSelectionConfig selectionConfig) { + this.selectionConfig = selectionConfig; + return this; + } + /** + * Setter for customAttributeUsageCount + * @param customAttributeUsageCount + * @return Builder + */ + public Builder customAttributeUsageCount(Integer customAttributeUsageCount) { + this.customAttributeUsageCount = customAttributeUsageCount; + return this; + } + /** + * Setter for key + * @param key + * @return Builder + */ + public Builder key(String key) { + this.key = key; + return this; + } + + /** + * Builds a new {@link CatalogCustomAttributeDefinition} object using the set fields. + * @return {@link CatalogCustomAttributeDefinition} + */ + public CatalogCustomAttributeDefinition build() { + return new CatalogCustomAttributeDefinition(type, + name, + description, + sourceApplication, + allowedObjectTypes, + sellerVisibility, + appVisibility, + stringConfig, + selectionConfig, + customAttributeUsageCount, + key); + } + } +} diff --git a/src/main/java/com/squareup/square/models/CatalogCustomAttributeDefinitionSelectionConfig.java b/src/main/java/com/squareup/square/models/CatalogCustomAttributeDefinitionSelectionConfig.java new file mode 100644 index 00000000..721449b3 --- /dev/null +++ b/src/main/java/com/squareup/square/models/CatalogCustomAttributeDefinitionSelectionConfig.java @@ -0,0 +1,125 @@ +package com.squareup.square.models; + +import java.util.List; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonGetter; + + +/** + * This is a model class for CatalogCustomAttributeDefinitionSelectionConfig type. + */ +public class CatalogCustomAttributeDefinitionSelectionConfig { + + /** + * Initialization constructor. + * @param maxAllowedSelections + * @param allowedSelections + */ + @JsonCreator + public CatalogCustomAttributeDefinitionSelectionConfig( + @JsonProperty("max_allowed_selections") Integer maxAllowedSelections, + @JsonProperty("allowed_selections") List allowedSelections) { + this.maxAllowedSelections = maxAllowedSelections; + this.allowedSelections = allowedSelections; + } + + private final Integer maxAllowedSelections; + private final List allowedSelections; + /** + * Getter for MaxAllowedSelections. + * The maximum number of selections that can be set. The maximum value for this + * attribute is 100. May be modified, but changing the value will not + * affect existing custom attribute values on objects. Clients need to + * handle Custom Attributes with more selected values than allowed by this limit. + */ + @JsonGetter("max_allowed_selections") + public Integer getMaxAllowedSelections() { + return this.maxAllowedSelections; + } + + /** + * Getter for AllowedSelections. + * The set of valid `CatalogCustomAttributeSelections`. Up to a maximum of 100 + * selections can be defined. Can be modified. + */ + @JsonGetter("allowed_selections") + public List getAllowedSelections() { + return this.allowedSelections; + } + + + @Override + public int hashCode() { + return Objects.hash(maxAllowedSelections, allowedSelections); + } + + @Override + public boolean equals(Object obj) { + if(obj == this) { + return true; + } + if(!(obj instanceof CatalogCustomAttributeDefinitionSelectionConfig)) { + return false; + } + CatalogCustomAttributeDefinitionSelectionConfig catalogCustomAttributeDefinitionSelectionConfig = (CatalogCustomAttributeDefinitionSelectionConfig) obj; + return Objects.equals(maxAllowedSelections, catalogCustomAttributeDefinitionSelectionConfig.maxAllowedSelections) && + Objects.equals(allowedSelections, catalogCustomAttributeDefinitionSelectionConfig.allowedSelections); + } + + /** + * Builds a new {@link CatalogCustomAttributeDefinitionSelectionConfig.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link CatalogCustomAttributeDefinitionSelectionConfig.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .maxAllowedSelections(getMaxAllowedSelections()) + .allowedSelections(getAllowedSelections()); + return builder; + } + + /** + * Class to build instances of {@link CatalogCustomAttributeDefinitionSelectionConfig} + */ + public static class Builder { + private Integer maxAllowedSelections; + private List allowedSelections; + + /** + * Initialization constructor + */ + public Builder() { + + } + + /** + * Setter for maxAllowedSelections + * @param maxAllowedSelections + * @return Builder + */ + public Builder maxAllowedSelections(Integer maxAllowedSelections) { + this.maxAllowedSelections = maxAllowedSelections; + return this; + } + /** + * Setter for allowedSelections + * @param allowedSelections + * @return Builder + */ + public Builder allowedSelections(List allowedSelections) { + this.allowedSelections = allowedSelections; + return this; + } + + /** + * Builds a new {@link CatalogCustomAttributeDefinitionSelectionConfig} object using the set fields. + * @return {@link CatalogCustomAttributeDefinitionSelectionConfig} + */ + public CatalogCustomAttributeDefinitionSelectionConfig build() { + return new CatalogCustomAttributeDefinitionSelectionConfig(maxAllowedSelections, + allowedSelections); + } + } +} diff --git a/src/main/java/com/squareup/square/models/CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection.java b/src/main/java/com/squareup/square/models/CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection.java new file mode 100644 index 00000000..e1ea031a --- /dev/null +++ b/src/main/java/com/squareup/square/models/CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection.java @@ -0,0 +1,120 @@ +package com.squareup.square.models; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonGetter; + + +/** + * This is a model class for CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection type. + */ +public class CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection { + + /** + * Initialization constructor. + * @param name + * @param uid + */ + @JsonCreator + public CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection( + @JsonProperty("name") String name, + @JsonProperty("uid") String uid) { + this.uid = uid; + this.name = name; + } + + private final String uid; + private final String name; + /** + * Getter for Uid. + * Unique ID set by Square. + */ + @JsonGetter("uid") + public String getUid() { + return this.uid; + } + + /** + * Getter for Name. + * Selection name, unique within `allowed_selections`. + * Required. Min length of 1, max length of 255. + */ + @JsonGetter("name") + public String getName() { + return this.name; + } + + + @Override + public int hashCode() { + return Objects.hash(uid, name); + } + + @Override + public boolean equals(Object obj) { + if(obj == this) { + return true; + } + if(!(obj instanceof CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection)) { + return false; + } + CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection catalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection = (CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection) obj; + return Objects.equals(uid, catalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection.uid) && + Objects.equals(name, catalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection.name); + } + + /** + * Builds a new {@link CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(name) + .uid(getUid()); + return builder; + } + + /** + * Class to build instances of {@link CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection} + */ + public static class Builder { + private String name; + private String uid; + + /** + * Initialization constructor + */ + public Builder(String name) { + this.name = name; + } + + /** + * Setter for name + * @param name + * @return Builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + /** + * Setter for uid + * @param uid + * @return Builder + */ + public Builder uid(String uid) { + this.uid = uid; + return this; + } + + /** + * Builds a new {@link CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection} object using the set fields. + * @return {@link CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection} + */ + public CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection build() { + return new CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection(name, + uid); + } + } +} diff --git a/src/main/java/com/squareup/square/models/CatalogCustomAttributeDefinitionStringConfig.java b/src/main/java/com/squareup/square/models/CatalogCustomAttributeDefinitionStringConfig.java new file mode 100644 index 00000000..8f9d2df8 --- /dev/null +++ b/src/main/java/com/squareup/square/models/CatalogCustomAttributeDefinitionStringConfig.java @@ -0,0 +1,98 @@ +package com.squareup.square.models; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonGetter; + + +/** + * This is a model class for CatalogCustomAttributeDefinitionStringConfig type. + */ +public class CatalogCustomAttributeDefinitionStringConfig { + + /** + * Initialization constructor. + * @param enforceUniqueness + */ + @JsonCreator + public CatalogCustomAttributeDefinitionStringConfig( + @JsonProperty("enforce_uniqueness") Boolean enforceUniqueness) { + this.enforceUniqueness = enforceUniqueness; + } + + private final Boolean enforceUniqueness; + /** + * Getter for EnforceUniqueness. + * If true, each Custom Attribute instance associated with this Custom Attribute + * Definition must have a unique value within the seller's catalog. For + * example, this may be used for a value like a SKU that should not be + * duplicated within a seller's catalog. May not be modified after the + * definition has been created. + */ + @JsonGetter("enforce_uniqueness") + public Boolean getEnforceUniqueness() { + return this.enforceUniqueness; + } + + + @Override + public int hashCode() { + return Objects.hash(enforceUniqueness); + } + + @Override + public boolean equals(Object obj) { + if(obj == this) { + return true; + } + if(!(obj instanceof CatalogCustomAttributeDefinitionStringConfig)) { + return false; + } + CatalogCustomAttributeDefinitionStringConfig catalogCustomAttributeDefinitionStringConfig = (CatalogCustomAttributeDefinitionStringConfig) obj; + return Objects.equals(enforceUniqueness, catalogCustomAttributeDefinitionStringConfig.enforceUniqueness); + } + + /** + * Builds a new {@link CatalogCustomAttributeDefinitionStringConfig.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link CatalogCustomAttributeDefinitionStringConfig.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .enforceUniqueness(getEnforceUniqueness()); + return builder; + } + + /** + * Class to build instances of {@link CatalogCustomAttributeDefinitionStringConfig} + */ + public static class Builder { + private Boolean enforceUniqueness; + + /** + * Initialization constructor + */ + public Builder() { + + } + + /** + * Setter for enforceUniqueness + * @param enforceUniqueness + * @return Builder + */ + public Builder enforceUniqueness(Boolean enforceUniqueness) { + this.enforceUniqueness = enforceUniqueness; + return this; + } + + /** + * Builds a new {@link CatalogCustomAttributeDefinitionStringConfig} object using the set fields. + * @return {@link CatalogCustomAttributeDefinitionStringConfig} + */ + public CatalogCustomAttributeDefinitionStringConfig build() { + return new CatalogCustomAttributeDefinitionStringConfig(enforceUniqueness); + } + } +} diff --git a/src/main/java/com/squareup/square/models/CatalogCustomAttributeValue.java b/src/main/java/com/squareup/square/models/CatalogCustomAttributeValue.java new file mode 100644 index 00000000..1674e867 --- /dev/null +++ b/src/main/java/com/squareup/square/models/CatalogCustomAttributeValue.java @@ -0,0 +1,279 @@ +package com.squareup.square.models; + +import java.util.List; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonGetter; + + +/** + * This is a model class for CatalogCustomAttributeValue type. + */ +public class CatalogCustomAttributeValue { + + /** + * Initialization constructor. + * @param name + * @param stringValue + * @param customAttributeDefinitionId + * @param type + * @param numberValue + * @param booleanValue + * @param selectionUidValues + * @param key + */ + @JsonCreator + public CatalogCustomAttributeValue( + @JsonProperty("name") String name, + @JsonProperty("string_value") String stringValue, + @JsonProperty("custom_attribute_definition_id") String customAttributeDefinitionId, + @JsonProperty("type") String type, + @JsonProperty("number_value") String numberValue, + @JsonProperty("boolean_value") Boolean booleanValue, + @JsonProperty("selection_uid_values") List selectionUidValues, + @JsonProperty("key") String key) { + this.name = name; + this.stringValue = stringValue; + this.customAttributeDefinitionId = customAttributeDefinitionId; + this.type = type; + this.numberValue = numberValue; + this.booleanValue = booleanValue; + this.selectionUidValues = selectionUidValues; + this.key = key; + } + + private final String name; + private final String stringValue; + private final String customAttributeDefinitionId; + private final String type; + private final String numberValue; + private final Boolean booleanValue; + private final List selectionUidValues; + private final String key; + /** + * Getter for Name. + * The name of the custom attribute. + */ + @JsonGetter("name") + public String getName() { + return this.name; + } + + /** + * Getter for StringValue. + * The string value of the custom attribute. Populated if `type` = `STRING`. + */ + @JsonGetter("string_value") + public String getStringValue() { + return this.stringValue; + } + + /** + * Getter for CustomAttributeDefinitionId. + * __Read-only.__ The custom attribute definition this value belongs to. + */ + @JsonGetter("custom_attribute_definition_id") + public String getCustomAttributeDefinitionId() { + return this.customAttributeDefinitionId; + } + + /** + * Getter for Type. + * Defines the possible types for a custom attribute. + */ + @JsonGetter("type") + public String getType() { + return this.type; + } + + /** + * Getter for NumberValue. + * Populated if `type` = `NUMBER`. Contains a string + * representation of a decimal number, using a `.` as the decimal separator. + */ + @JsonGetter("number_value") + public String getNumberValue() { + return this.numberValue; + } + + /** + * Getter for BooleanValue. + * A `true` or `false` value. Populated if `type` = `BOOLEAN`. + */ + @JsonGetter("boolean_value") + public Boolean getBooleanValue() { + return this.booleanValue; + } + + /** + * Getter for SelectionUidValues. + * One or more choices from `allowed_selections`. Populated if `type` = `SELECTION`. + */ + @JsonGetter("selection_uid_values") + public List getSelectionUidValues() { + return this.selectionUidValues; + } + + /** + * Getter for Key. + * __Read-only.__ A copy of key from the associated custom attribute definition. + */ + @JsonGetter("key") + public String getKey() { + return this.key; + } + + + @Override + public int hashCode() { + return Objects.hash(name, stringValue, customAttributeDefinitionId, type, numberValue, + booleanValue, selectionUidValues, key); + } + + @Override + public boolean equals(Object obj) { + if(obj == this) { + return true; + } + if(!(obj instanceof CatalogCustomAttributeValue)) { + return false; + } + CatalogCustomAttributeValue catalogCustomAttributeValue = (CatalogCustomAttributeValue) obj; + return Objects.equals(name, catalogCustomAttributeValue.name) && + Objects.equals(stringValue, catalogCustomAttributeValue.stringValue) && + Objects.equals(customAttributeDefinitionId, catalogCustomAttributeValue.customAttributeDefinitionId) && + Objects.equals(type, catalogCustomAttributeValue.type) && + Objects.equals(numberValue, catalogCustomAttributeValue.numberValue) && + Objects.equals(booleanValue, catalogCustomAttributeValue.booleanValue) && + Objects.equals(selectionUidValues, catalogCustomAttributeValue.selectionUidValues) && + Objects.equals(key, catalogCustomAttributeValue.key); + } + + /** + * Builds a new {@link CatalogCustomAttributeValue.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link CatalogCustomAttributeValue.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .name(getName()) + .stringValue(getStringValue()) + .customAttributeDefinitionId(getCustomAttributeDefinitionId()) + .type(getType()) + .numberValue(getNumberValue()) + .booleanValue(getBooleanValue()) + .selectionUidValues(getSelectionUidValues()) + .key(getKey()); + return builder; + } + + /** + * Class to build instances of {@link CatalogCustomAttributeValue} + */ + public static class Builder { + private String name; + private String stringValue; + private String customAttributeDefinitionId; + private String type; + private String numberValue; + private Boolean booleanValue; + private List selectionUidValues; + private String key; + + /** + * Initialization constructor + */ + public Builder() { + + } + + /** + * Setter for name + * @param name + * @return Builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + /** + * Setter for stringValue + * @param stringValue + * @return Builder + */ + public Builder stringValue(String stringValue) { + this.stringValue = stringValue; + return this; + } + /** + * Setter for customAttributeDefinitionId + * @param customAttributeDefinitionId + * @return Builder + */ + public Builder customAttributeDefinitionId(String customAttributeDefinitionId) { + this.customAttributeDefinitionId = customAttributeDefinitionId; + return this; + } + /** + * Setter for type + * @param type + * @return Builder + */ + public Builder type(String type) { + this.type = type; + return this; + } + /** + * Setter for numberValue + * @param numberValue + * @return Builder + */ + public Builder numberValue(String numberValue) { + this.numberValue = numberValue; + return this; + } + /** + * Setter for booleanValue + * @param booleanValue + * @return Builder + */ + public Builder booleanValue(Boolean booleanValue) { + this.booleanValue = booleanValue; + return this; + } + /** + * Setter for selectionUidValues + * @param selectionUidValues + * @return Builder + */ + public Builder selectionUidValues(List selectionUidValues) { + this.selectionUidValues = selectionUidValues; + return this; + } + /** + * Setter for key + * @param key + * @return Builder + */ + public Builder key(String key) { + this.key = key; + return this; + } + + /** + * Builds a new {@link CatalogCustomAttributeValue} object using the set fields. + * @return {@link CatalogCustomAttributeValue} + */ + public CatalogCustomAttributeValue build() { + return new CatalogCustomAttributeValue(name, + stringValue, + customAttributeDefinitionId, + type, + numberValue, + booleanValue, + selectionUidValues, + key); + } + } +} diff --git a/src/main/java/com/squareup/square/models/CatalogObject.java b/src/main/java/com/squareup/square/models/CatalogObject.java index ea220fdc..fac54511 100644 --- a/src/main/java/com/squareup/square/models/CatalogObject.java +++ b/src/main/java/com/squareup/square/models/CatalogObject.java @@ -1,6 +1,7 @@ package com.squareup.square.models; import java.util.List; +import java.util.Map; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; @@ -19,6 +20,7 @@ public class CatalogObject { * @param updatedAt * @param version * @param isDeleted + * @param customAttributeValues * @param catalogV1Ids * @param presentAtAllLocations * @param presentAtLocationIds @@ -38,6 +40,7 @@ public class CatalogObject { * @param measurementUnitData * @param itemOptionData * @param itemOptionValueData + * @param customAttributeDefinitionData */ @JsonCreator public CatalogObject( @@ -46,6 +49,7 @@ public CatalogObject( @JsonProperty("updated_at") String updatedAt, @JsonProperty("version") Long version, @JsonProperty("is_deleted") Boolean isDeleted, + @JsonProperty("custom_attribute_values") Map customAttributeValues, @JsonProperty("catalog_v1_ids") List catalogV1Ids, @JsonProperty("present_at_all_locations") Boolean presentAtAllLocations, @JsonProperty("present_at_location_ids") List presentAtLocationIds, @@ -64,12 +68,14 @@ public CatalogObject( @JsonProperty("image_data") CatalogImage imageData, @JsonProperty("measurement_unit_data") CatalogMeasurementUnit measurementUnitData, @JsonProperty("item_option_data") CatalogItemOption itemOptionData, - @JsonProperty("item_option_value_data") CatalogItemOptionValue itemOptionValueData) { + @JsonProperty("item_option_value_data") CatalogItemOptionValue itemOptionValueData, + @JsonProperty("custom_attribute_definition_data") CatalogCustomAttributeDefinition customAttributeDefinitionData) { this.type = type; this.id = id; this.updatedAt = updatedAt; this.version = version; this.isDeleted = isDeleted; + this.customAttributeValues = customAttributeValues; this.catalogV1Ids = catalogV1Ids; this.presentAtAllLocations = presentAtAllLocations; this.presentAtLocationIds = presentAtLocationIds; @@ -89,6 +95,7 @@ public CatalogObject( this.measurementUnitData = measurementUnitData; this.itemOptionData = itemOptionData; this.itemOptionValueData = itemOptionValueData; + this.customAttributeDefinitionData = customAttributeDefinitionData; } private final String type; @@ -96,6 +103,7 @@ public CatalogObject( private final String updatedAt; private final Long version; private final Boolean isDeleted; + private final Map customAttributeValues; private final List catalogV1Ids; private final Boolean presentAtAllLocations; private final List presentAtLocationIds; @@ -115,6 +123,7 @@ public CatalogObject( private final CatalogMeasurementUnit measurementUnitData; private final CatalogItemOption itemOptionData; private final CatalogItemOptionValue itemOptionValueData; + private final CatalogCustomAttributeDefinition customAttributeDefinitionData; /** * Getter for Type. * Possible types of CatalogObjects returned from the Catalog, each @@ -169,6 +178,22 @@ public Boolean getIsDeleted() { return this.isDeleted; } + /** + * Getter for CustomAttributeValues. + * Application-defined key/value attributes that are set at a global (location-independent) level. + * Values from the `*_data` fields may not be duplicated. Custom Attribute fields are intended to store additional + * information about a Catalog Object or associations with an entity in another system. Do not use custom attributes + * to store any sensitive information (personally identifiable information, card details, etc.). + * For CustomAttributesDefinitions defined by the app making the request, the map key is the key defined in + * CustomAttributeDefinition (eg. “reference_id”). For CustomAttributesDefinitions by other apps, the map key is + * the key defined in CustomAttributeDefinition prefixed with the application ID and a colon + * (eg. “abcd1234:reference_id”). + */ + @JsonGetter("custom_attribute_values") + public Map getCustomAttributeValues() { + return this.customAttributeValues; + } + /** * Getter for CatalogV1Ids. * The Connect v1 IDs for this object at each location where it is present, where they @@ -360,14 +385,27 @@ public CatalogItemOptionValue getItemOptionValueData() { return this.itemOptionValueData; } + /** + * Getter for CustomAttributeDefinitionData. + * Contains information defining a custom attribute. Custom attributes are + * intended to store additional information about a catalog object or to associate a + * catalog object with an entity in another system. Do not use custom attributes + * to store any sensitive information (personally identifiable information, card details, etc.). + * [Read more about custom attributes](https://developer.squareup.com/docs/catalog-api/add-custom-attributes) + */ + @JsonGetter("custom_attribute_definition_data") + public CatalogCustomAttributeDefinition getCustomAttributeDefinitionData() { + return this.customAttributeDefinitionData; + } + @Override public int hashCode() { - return Objects.hash(type, id, updatedAt, version, isDeleted, catalogV1Ids, - presentAtAllLocations, presentAtLocationIds, absentAtLocationIds, imageId, itemData, - categoryData, itemVariationData, taxData, discountData, modifierListData, modifierData, - timePeriodData, productSetData, pricingRuleData, imageData, measurementUnitData, - itemOptionData, itemOptionValueData); + return Objects.hash(type, id, updatedAt, version, isDeleted, customAttributeValues, + catalogV1Ids, presentAtAllLocations, presentAtLocationIds, absentAtLocationIds, imageId, + itemData, categoryData, itemVariationData, taxData, discountData, modifierListData, + modifierData, timePeriodData, productSetData, pricingRuleData, imageData, + measurementUnitData, itemOptionData, itemOptionValueData, customAttributeDefinitionData); } @Override @@ -384,6 +422,7 @@ public boolean equals(Object obj) { Objects.equals(updatedAt, catalogObject.updatedAt) && Objects.equals(version, catalogObject.version) && Objects.equals(isDeleted, catalogObject.isDeleted) && + Objects.equals(customAttributeValues, catalogObject.customAttributeValues) && Objects.equals(catalogV1Ids, catalogObject.catalogV1Ids) && Objects.equals(presentAtAllLocations, catalogObject.presentAtAllLocations) && Objects.equals(presentAtLocationIds, catalogObject.presentAtLocationIds) && @@ -402,7 +441,8 @@ public boolean equals(Object obj) { Objects.equals(imageData, catalogObject.imageData) && Objects.equals(measurementUnitData, catalogObject.measurementUnitData) && Objects.equals(itemOptionData, catalogObject.itemOptionData) && - Objects.equals(itemOptionValueData, catalogObject.itemOptionValueData); + Objects.equals(itemOptionValueData, catalogObject.itemOptionValueData) && + Objects.equals(customAttributeDefinitionData, catalogObject.customAttributeDefinitionData); } /** @@ -416,6 +456,7 @@ public Builder toBuilder() { .updatedAt(getUpdatedAt()) .version(getVersion()) .isDeleted(getIsDeleted()) + .customAttributeValues(getCustomAttributeValues()) .catalogV1Ids(getCatalogV1Ids()) .presentAtAllLocations(getPresentAtAllLocations()) .presentAtLocationIds(getPresentAtLocationIds()) @@ -434,7 +475,8 @@ public Builder toBuilder() { .imageData(getImageData()) .measurementUnitData(getMeasurementUnitData()) .itemOptionData(getItemOptionData()) - .itemOptionValueData(getItemOptionValueData()); + .itemOptionValueData(getItemOptionValueData()) + .customAttributeDefinitionData(getCustomAttributeDefinitionData()); return builder; } @@ -447,6 +489,7 @@ public static class Builder { private String updatedAt; private Long version; private Boolean isDeleted; + private Map customAttributeValues; private List catalogV1Ids; private Boolean presentAtAllLocations; private List presentAtLocationIds; @@ -466,6 +509,7 @@ public static class Builder { private CatalogMeasurementUnit measurementUnitData; private CatalogItemOption itemOptionData; private CatalogItemOptionValue itemOptionValueData; + private CatalogCustomAttributeDefinition customAttributeDefinitionData; /** * Initialization constructor @@ -521,6 +565,15 @@ public Builder isDeleted(Boolean isDeleted) { this.isDeleted = isDeleted; return this; } + /** + * Setter for customAttributeValues + * @param customAttributeValues + * @return Builder + */ + public Builder customAttributeValues(Map customAttributeValues) { + this.customAttributeValues = customAttributeValues; + return this; + } /** * Setter for catalogV1Ids * @param catalogV1Ids @@ -692,6 +745,15 @@ public Builder itemOptionValueData(CatalogItemOptionValue itemOptionValueData) { this.itemOptionValueData = itemOptionValueData; return this; } + /** + * Setter for customAttributeDefinitionData + * @param customAttributeDefinitionData + * @return Builder + */ + public Builder customAttributeDefinitionData(CatalogCustomAttributeDefinition customAttributeDefinitionData) { + this.customAttributeDefinitionData = customAttributeDefinitionData; + return this; + } /** * Builds a new {@link CatalogObject} object using the set fields. @@ -703,6 +765,7 @@ public CatalogObject build() { updatedAt, version, isDeleted, + customAttributeValues, catalogV1Ids, presentAtAllLocations, presentAtLocationIds, @@ -721,7 +784,8 @@ public CatalogObject build() { imageData, measurementUnitData, itemOptionData, - itemOptionValueData); + itemOptionValueData, + customAttributeDefinitionData); } } } diff --git a/src/main/java/com/squareup/square/models/CreatePaymentRequest.java b/src/main/java/com/squareup/square/models/CreatePaymentRequest.java index d80db689..23ad1b45 100644 --- a/src/main/java/com/squareup/square/models/CreatePaymentRequest.java +++ b/src/main/java/com/squareup/square/models/CreatePaymentRequest.java @@ -18,6 +18,7 @@ public class CreatePaymentRequest { * @param amountMoney * @param tipMoney * @param appFeeMoney + * @param delayDuration * @param autocomplete * @param orderId * @param customerId @@ -38,6 +39,7 @@ public CreatePaymentRequest( @JsonProperty("amount_money") Money amountMoney, @JsonProperty("tip_money") Money tipMoney, @JsonProperty("app_fee_money") Money appFeeMoney, + @JsonProperty("delay_duration") String delayDuration, @JsonProperty("autocomplete") Boolean autocomplete, @JsonProperty("order_id") String orderId, @JsonProperty("customer_id") String customerId, @@ -55,6 +57,7 @@ public CreatePaymentRequest( this.amountMoney = amountMoney; this.tipMoney = tipMoney; this.appFeeMoney = appFeeMoney; + this.delayDuration = delayDuration; this.autocomplete = autocomplete; this.orderId = orderId; this.customerId = customerId; @@ -74,6 +77,7 @@ public CreatePaymentRequest( private final Money amountMoney; private final Money tipMoney; private final Money appFeeMoney; + private final String delayDuration; private final Boolean autocomplete; private final String orderId; private final String customerId; @@ -150,6 +154,25 @@ public Money getAppFeeMoney() { return this.appFeeMoney; } + /** + * Getter for DelayDuration. + * The duration of time after the payment's creation when Square automatically cancels the + * payment. This automatic cancellation applies only to payments that don't reach a terminal state + * (COMPLETED, CANCELED, or FAILED) before the `delay_duration` time period. + * This parameter should be specified as a time duration, in RFC 3339 format, with a minimum value + * of 1 minute. + * Notes: + * This feature is only supported for card payments. This parameter can only be set for a delayed + * capture payment (`autocomplete=false`). + * Default: + * - Card Present payments: "PT36H" (36 hours) from the creation time. + * - Card Not Present payments: "P7D" (7 days) from the creation time. + */ + @JsonGetter("delay_duration") + public String getDelayDuration() { + return this.delayDuration; + } + /** * Getter for Autocomplete. * If set to `true`, this payment will be completed when possible. If @@ -289,9 +312,9 @@ public String getStatementDescriptionIdentifier() { @Override public int hashCode() { return Objects.hash(sourceId, idempotencyKey, amountMoney, tipMoney, appFeeMoney, - autocomplete, orderId, customerId, locationId, referenceId, verificationToken, - acceptPartialAuthorization, buyerEmailAddress, billingAddress, shippingAddress, note, - statementDescriptionIdentifier); + delayDuration, autocomplete, orderId, customerId, locationId, referenceId, + verificationToken, acceptPartialAuthorization, buyerEmailAddress, billingAddress, + shippingAddress, note, statementDescriptionIdentifier); } @Override @@ -308,6 +331,7 @@ public boolean equals(Object obj) { Objects.equals(amountMoney, createPaymentRequest.amountMoney) && Objects.equals(tipMoney, createPaymentRequest.tipMoney) && Objects.equals(appFeeMoney, createPaymentRequest.appFeeMoney) && + Objects.equals(delayDuration, createPaymentRequest.delayDuration) && Objects.equals(autocomplete, createPaymentRequest.autocomplete) && Objects.equals(orderId, createPaymentRequest.orderId) && Objects.equals(customerId, createPaymentRequest.customerId) && @@ -333,6 +357,7 @@ public Builder toBuilder() { amountMoney) .tipMoney(getTipMoney()) .appFeeMoney(getAppFeeMoney()) + .delayDuration(getDelayDuration()) .autocomplete(getAutocomplete()) .orderId(getOrderId()) .customerId(getCustomerId()) @@ -357,6 +382,7 @@ public static class Builder { private Money amountMoney; private Money tipMoney; private Money appFeeMoney; + private String delayDuration; private Boolean autocomplete; private String orderId; private String customerId; @@ -426,6 +452,15 @@ public Builder appFeeMoney(Money appFeeMoney) { this.appFeeMoney = appFeeMoney; return this; } + /** + * Setter for delayDuration + * @param delayDuration + * @return Builder + */ + public Builder delayDuration(String delayDuration) { + this.delayDuration = delayDuration; + return this; + } /** * Setter for autocomplete * @param autocomplete @@ -545,6 +580,7 @@ public CreatePaymentRequest build() { amountMoney, tipMoney, appFeeMoney, + delayDuration, autocomplete, orderId, customerId, diff --git a/src/main/java/com/squareup/square/models/ExternalPaymentDetails.java b/src/main/java/com/squareup/square/models/ExternalPaymentDetails.java deleted file mode 100644 index a05e6743..00000000 --- a/src/main/java/com/squareup/square/models/ExternalPaymentDetails.java +++ /dev/null @@ -1,190 +0,0 @@ -package com.squareup.square.models; - -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonGetter; - - -/** - * This is a model class for ExternalPaymentDetails type. - */ -public class ExternalPaymentDetails { - - /** - * Initialization constructor. - * @param type - * @param source - * @param sourceId - * @param sourceFeeMoney - */ - @JsonCreator - public ExternalPaymentDetails( - @JsonProperty("type") String type, - @JsonProperty("source") String source, - @JsonProperty("source_id") String sourceId, - @JsonProperty("source_fee_money") Money sourceFeeMoney) { - this.type = type; - this.source = source; - this.sourceId = sourceId; - this.sourceFeeMoney = sourceFeeMoney; - } - - private final String type; - private final String source; - private final String sourceId; - private final Money sourceFeeMoney; - /** - * Getter for Type. - * The type of External payment which can be one of: - * CHECK - Paid by a physical check - * BANK_TRANSFER - Paid by ACH or other bank transfer - * OTHER_GIFT_CARD - Paid by a non-square gift card - * CRYPTO - Paid via a crypto currency - * SQUARE_CASH - Paid via Square Cash app - * SOCIAL - Venmo, WeChatPay, AliPay, etc. - * EXTERNAL - A 3rd party application gathered this payment outside of Square - * EMONEY - A Japanese e-money brand Square doesn’t support - * CREDIT/DEBIT - A credit/debit card Square doesn’t support - * OTHER - A type not listed here - */ - @JsonGetter("type") - public String getType() { - return this.type; - } - - /** - * Getter for Source. - * A description of the source of the external payment, e.g. “Uber Eats”, “Stripe”, “Shopify”. - * Limit 255 characters - */ - @JsonGetter("source") - public String getSource() { - return this.source; - } - - /** - * Getter for SourceId. - * An ID to associate this payment to its originating source - * Limit 255 characters. - */ - @JsonGetter("source_id") - public String getSourceId() { - return this.sourceId; - } - - /** - * Getter for SourceFeeMoney. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts) - * for more information. - */ - @JsonGetter("source_fee_money") - public Money getSourceFeeMoney() { - return this.sourceFeeMoney; - } - - - @Override - public int hashCode() { - return Objects.hash(type, source, sourceId, sourceFeeMoney); - } - - @Override - public boolean equals(Object obj) { - if(obj == this) { - return true; - } - if(!(obj instanceof ExternalPaymentDetails)) { - return false; - } - ExternalPaymentDetails externalPaymentDetails = (ExternalPaymentDetails) obj; - return Objects.equals(type, externalPaymentDetails.type) && - Objects.equals(source, externalPaymentDetails.source) && - Objects.equals(sourceId, externalPaymentDetails.sourceId) && - Objects.equals(sourceFeeMoney, externalPaymentDetails.sourceFeeMoney); - } - - /** - * Builds a new {@link ExternalPaymentDetails.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link ExternalPaymentDetails.Builder} object - */ - public Builder toBuilder() { - Builder builder = new Builder(type, - source) - .sourceId(getSourceId()) - .sourceFeeMoney(getSourceFeeMoney()); - return builder; - } - - /** - * Class to build instances of {@link ExternalPaymentDetails} - */ - public static class Builder { - private String type; - private String source; - private String sourceId; - private Money sourceFeeMoney; - - /** - * Initialization constructor - */ - public Builder(String type, - String source) { - this.type = type; - this.source = source; - } - - /** - * Setter for type - * @param type - * @return Builder - */ - public Builder type(String type) { - this.type = type; - return this; - } - /** - * Setter for source - * @param source - * @return Builder - */ - public Builder source(String source) { - this.source = source; - return this; - } - /** - * Setter for sourceId - * @param sourceId - * @return Builder - */ - public Builder sourceId(String sourceId) { - this.sourceId = sourceId; - return this; - } - /** - * Setter for sourceFeeMoney - * @param sourceFeeMoney - * @return Builder - */ - public Builder sourceFeeMoney(Money sourceFeeMoney) { - this.sourceFeeMoney = sourceFeeMoney; - return this; - } - - /** - * Builds a new {@link ExternalPaymentDetails} object using the set fields. - * @return {@link ExternalPaymentDetails} - */ - public ExternalPaymentDetails build() { - return new ExternalPaymentDetails(type, - source, - sourceId, - sourceFeeMoney); - } - } -} diff --git a/src/main/java/com/squareup/square/models/Payment.java b/src/main/java/com/squareup/square/models/Payment.java index 6445feaa..f9226036 100644 --- a/src/main/java/com/squareup/square/models/Payment.java +++ b/src/main/java/com/squareup/square/models/Payment.java @@ -24,6 +24,9 @@ public class Payment { * @param processingFee * @param refundedMoney * @param status + * @param delayDuration + * @param delayAction + * @param delayedUntil * @param sourceType * @param cardDetails * @param locationId @@ -52,6 +55,9 @@ public Payment( @JsonProperty("processing_fee") List processingFee, @JsonProperty("refunded_money") Money refundedMoney, @JsonProperty("status") String status, + @JsonProperty("delay_duration") String delayDuration, + @JsonProperty("delay_action") String delayAction, + @JsonProperty("delayed_until") String delayedUntil, @JsonProperty("source_type") String sourceType, @JsonProperty("card_details") CardPaymentDetails cardDetails, @JsonProperty("location_id") String locationId, @@ -77,6 +83,9 @@ public Payment( this.processingFee = processingFee; this.refundedMoney = refundedMoney; this.status = status; + this.delayDuration = delayDuration; + this.delayAction = delayAction; + this.delayedUntil = delayedUntil; this.sourceType = sourceType; this.cardDetails = cardDetails; this.locationId = locationId; @@ -104,6 +113,9 @@ public Payment( private final List processingFee; private final Money refundedMoney; private final String status; + private final String delayDuration; + private final String delayAction; + private final String delayedUntil; private final String sourceType; private final CardPaymentDetails cardDetails; private final String locationId; @@ -234,6 +246,49 @@ public String getStatus() { return this.status; } + /** + * Getter for DelayDuration. + * The duration of time after the payment's creation when Square automatically applies the + * `delay_action` to the payment. This automatic `delay_action` applies only to payments that + * don't reach a terminal state (COMPLETED, CANCELED, or FAILED) before the `delay_duration` + * time period. + * This field is specified as a time duration, in RFC 3339 format. + * Notes: + * This feature is only supported for card payments. + * Default: + * - Card Present payments: "PT36H" (36 hours) from the creation time. + * - Card Not Present payments: "P7D" (7 days) from the creation time. + */ + @JsonGetter("delay_duration") + public String getDelayDuration() { + return this.delayDuration; + } + + /** + * Getter for DelayAction. + * The action to be applied to the payment when the `delay_duration` has elapsed. This field + * is read only. + * Current values include: + * `CANCEL` + */ + @JsonGetter("delay_action") + public String getDelayAction() { + return this.delayAction; + } + + /** + * Getter for DelayedUntil. + * Read only timestamp of when the `delay_action` will automatically be applied, + * in RFC 3339 format. + * Note that this field is calculated by summing the payment's `delay_duration` and `created_at` + * fields. The `created_at` field is generated by Square and may not exactly match the + * time on your local machine. + */ + @JsonGetter("delayed_until") + public String getDelayedUntil() { + return this.delayedUntil; + } + /** * Getter for SourceType. * The source type for this payment @@ -382,9 +437,10 @@ public String getReceiptUrl() { @Override public int hashCode() { return Objects.hash(id, createdAt, updatedAt, amountMoney, tipMoney, totalMoney, appFeeMoney, - processingFee, refundedMoney, status, sourceType, cardDetails, locationId, orderId, - referenceId, customerId, employeeId, refundIds, buyerEmailAddress, billingAddress, - shippingAddress, note, statementDescriptionIdentifier, receiptNumber, receiptUrl); + processingFee, refundedMoney, status, delayDuration, delayAction, delayedUntil, + sourceType, cardDetails, locationId, orderId, referenceId, customerId, employeeId, + refundIds, buyerEmailAddress, billingAddress, shippingAddress, note, + statementDescriptionIdentifier, receiptNumber, receiptUrl); } @Override @@ -406,6 +462,9 @@ public boolean equals(Object obj) { Objects.equals(processingFee, payment.processingFee) && Objects.equals(refundedMoney, payment.refundedMoney) && Objects.equals(status, payment.status) && + Objects.equals(delayDuration, payment.delayDuration) && + Objects.equals(delayAction, payment.delayAction) && + Objects.equals(delayedUntil, payment.delayedUntil) && Objects.equals(sourceType, payment.sourceType) && Objects.equals(cardDetails, payment.cardDetails) && Objects.equals(locationId, payment.locationId) && @@ -440,6 +499,9 @@ public Builder toBuilder() { .processingFee(getProcessingFee()) .refundedMoney(getRefundedMoney()) .status(getStatus()) + .delayDuration(getDelayDuration()) + .delayAction(getDelayAction()) + .delayedUntil(getDelayedUntil()) .sourceType(getSourceType()) .cardDetails(getCardDetails()) .locationId(getLocationId()) @@ -472,6 +534,9 @@ public static class Builder { private List processingFee; private Money refundedMoney; private String status; + private String delayDuration; + private String delayAction; + private String delayedUntil; private String sourceType; private CardPaymentDetails cardDetails; private String locationId; @@ -585,6 +650,33 @@ public Builder status(String status) { this.status = status; return this; } + /** + * Setter for delayDuration + * @param delayDuration + * @return Builder + */ + public Builder delayDuration(String delayDuration) { + this.delayDuration = delayDuration; + return this; + } + /** + * Setter for delayAction + * @param delayAction + * @return Builder + */ + public Builder delayAction(String delayAction) { + this.delayAction = delayAction; + return this; + } + /** + * Setter for delayedUntil + * @param delayedUntil + * @return Builder + */ + public Builder delayedUntil(String delayedUntil) { + this.delayedUntil = delayedUntil; + return this; + } /** * Setter for sourceType * @param sourceType @@ -736,6 +828,9 @@ public Payment build() { processingFee, refundedMoney, status, + delayDuration, + delayAction, + delayedUntil, sourceType, cardDetails, locationId,