From f48227944db922b6993ecf6fdafcff2ab179bb68 Mon Sep 17 00:00:00 2001 From: autobot Date: Wed, 17 Jul 2024 13:38:00 +0000 Subject: [PATCH] Generated PR for Release: 38.1.1.20240717 --- doc/api/apple-pay.md | 7 +- doc/api/invoices.md | 20 ++-- doc/client.md | 4 +- doc/models/update-invoice-request.md | 13 ++- lib/square/api/apple_pay_api.rb | 24 ++-- lib/square/api/bank_accounts_api.rb | 18 +-- lib/square/api/base_api.rb | 2 +- .../api/booking_custom_attributes_api.rb | 66 +++++------ lib/square/api/bookings_api.rb | 78 ++++++------- lib/square/api/cards_api.rb | 24 ++-- lib/square/api/cash_drawers_api.rb | 18 +-- lib/square/api/catalog_api.rb | 84 +++++++------- lib/square/api/checkout_api.rb | 60 +++++----- .../api/customer_custom_attributes_api.rb | 60 +++++----- lib/square/api/customer_groups_api.rb | 30 ++--- lib/square/api/customer_segments_api.rb | 12 +- lib/square/api/customers_api.rb | 84 +++++++------- lib/square/api/devices_api.rb | 30 ++--- lib/square/api/disputes_api.rb | 54 ++++----- lib/square/api/employees_api.rb | 12 +- lib/square/api/events_api.rb | 24 ++-- lib/square/api/gift_card_activities_api.rb | 12 +- lib/square/api/gift_cards_api.rb | 42 +++---- lib/square/api/inventory_api.rb | 78 ++++++------- lib/square/api/invoices_api.rb | 75 ++++++------ lib/square/api/labor_api.rb | 96 ++++++++-------- .../api/location_custom_attributes_api.rb | 66 +++++------ lib/square/api/locations_api.rb | 24 ++-- lib/square/api/loyalty_api.rb | 108 +++++++++--------- .../api/merchant_custom_attributes_api.rb | 66 +++++------ lib/square/api/merchants_api.rb | 12 +- lib/square/api/mobile_authorization_api.rb | 6 +- lib/square/api/o_auth_api.rb | 18 +-- lib/square/api/order_custom_attributes_api.rb | 66 +++++------ lib/square/api/orders_api.rb | 48 ++++---- lib/square/api/payments_api.rb | 42 +++---- lib/square/api/payouts_api.rb | 18 +-- lib/square/api/refunds_api.rb | 18 +-- lib/square/api/sites_api.rb | 6 +- lib/square/api/snippets_api.rb | 18 +-- lib/square/api/subscriptions_api.rb | 72 ++++++------ lib/square/api/team_api.rb | 48 ++++---- lib/square/api/terminal_api.rb | 90 +++++++-------- lib/square/api/transactions_api.rb | 24 ++-- lib/square/api/v1_transactions_api.rb | 20 ++-- lib/square/api/vendors_api.rb | 42 +++---- lib/square/api/webhook_subscriptions_api.rb | 48 ++++---- lib/square/client.rb | 4 +- lib/square/configuration.rb | 2 +- square.gemspec | 8 +- test/webhooks/test_webhooks_helper.rb | 17 +++ 51 files changed, 973 insertions(+), 945 deletions(-) diff --git a/doc/api/apple-pay.md b/doc/api/apple-pay.md index bd37f3a8..ec2be280 100644 --- a/doc/api/apple-pay.md +++ b/doc/api/apple-pay.md @@ -18,8 +18,11 @@ an Apple Pay enabled domain. This endpoint provides an easy way for platform developers to bulk activate Apple Pay on the Web with Square for merchants using their platform. -Note: The SqPaymentForm library is deprecated as of May 13, 2021, and will only receive critical security updates until it is retired on October 31, 2022. -You must migrate your payment form code to the Web Payments SDK to continue using your domain for Apple Pay. For more information on migrating to the Web Payments SDK, see [Migrate to the Web Payments SDK](https://developer.squareup.com/docs/web-payments/migrate). +Note: You will need to host a valid domain verification file on your domain to support Apple Pay. The +current version of this file is always available at https://app.squareup.com/digital-wallets/apple-pay/apple-developer-merchantid-domain-association, +and should be hosted at `.well_known/apple-developer-merchantid-domain-association` on your +domain. This file is subject to change; we strongly recommend checking for updates regularly and avoiding +long-lived caches that might not keep in sync with the correct file version. To learn more about the Web Payments SDK and how to add Apple Pay, see [Take an Apple Pay Payment](https://developer.squareup.com/docs/web-payments/apple-pay). diff --git a/doc/api/invoices.md b/doc/api/invoices.md index ee17e5ea..f63a971a 100644 --- a/doc/api/invoices.md +++ b/doc/api/invoices.md @@ -278,10 +278,10 @@ end # Update Invoice -Updates an invoice by modifying fields, clearing fields, or both. For most updates, you can use a sparse -`Invoice` object to add fields or change values and use the `fields_to_clear` field to specify fields to clear. -However, some restrictions apply. For example, you cannot change the `order_id` or `location_id` field and you -must provide the complete `custom_fields` list to update a custom field. Published invoices have additional restrictions. +Updates an invoice. This endpoint supports sparse updates, so you only need +to specify the fields you want to change along with the required `version` field. +Some restrictions apply to updating invoices. For example, you cannot change the +`order_id` or `location_id` field. ```ruby def update_invoice(invoice_id:, @@ -310,14 +310,16 @@ body = { :payment_requests => [ { :uid => '2da7964f-f3d2-4f43-81e8-5aa220bf3355', - :tipping_enabled => false + :tipping_enabled => false, + :reminders => [ + {}, + {}, + {} + ] } ] }, - :idempotency_key => '4ee82288-0910-499e-ab4c-5d0071dad1be', - :fields_to_clear => [ - 'payments_requests[2da7964f-f3d2-4f43-81e8-5aa220bf3355].reminders' - ] + :idempotency_key => '4ee82288-0910-499e-ab4c-5d0071dad1be' } diff --git a/doc/client.md b/doc/client.md index c646122d..e1a56b3e 100644 --- a/doc/client.md +++ b/doc/client.md @@ -5,7 +5,7 @@ The following parameters are configurable for the API Client: | Parameter | Type | Description | | --- | --- | --- | -| `square_version` | `String` | Square Connect API versions
*Default*: `'2024-06-04'` | +| `square_version` | `String` | Square Connect API versions
*Default*: `'2024-07-17'` | | `custom_url` | `String` | Sets the base URL requests are made to. Defaults to `https://connect.squareup.com`
*Default*: `'https://connect.squareup.com'` | | `environment` | `string` | The API environment.
**Default: `production`** | | `connection` | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests | @@ -25,7 +25,7 @@ The API client can be initialized as follows: ```ruby client = Square::Client.new( - square_version: '2024-06-04', + square_version: '2024-07-17', bearer_auth_credentials: BearerAuthCredentials.new( access_token: 'AccessToken' ), diff --git a/doc/models/update-invoice-request.md b/doc/models/update-invoice-request.md index 656c8c6f..b2afdc13 100644 --- a/doc/models/update-invoice-request.md +++ b/doc/models/update-invoice-request.md @@ -13,19 +13,17 @@ Describes a `UpdateInvoice` request. | --- | --- | --- | --- | | `invoice` | [`Invoice Hash`](../../doc/models/invoice.md) | Required | Stores information about an invoice. You use the Invoices API to create and manage
invoices. For more information, see [Invoices API Overview](https://developer.squareup.com/docs/invoices-api/overview). | | `idempotency_key` | `String` | Optional | A unique string that identifies the `UpdateInvoice` request. If you do not
provide `idempotency_key` (or provide an empty string as the value), the endpoint
treats each request as independent.

For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
**Constraints**: *Maximum Length*: `128` | -| `fields_to_clear` | `Array` | Optional | The list of fields to clear.
For examples, see [Update an Invoice](https://developer.squareup.com/docs/invoices-api/update-invoices). | +| `fields_to_clear` | `Array` | Optional | The list of fields to clear. Although this field is currently supported, we
recommend using null values or the `remove` field when possible. For examples, see
[Update an Invoice](https://developer.squareup.com/docs/invoices-api/update-invoices). | ## Example (as JSON) ```json { - "fields_to_clear": [ - "payments_requests[2da7964f-f3d2-4f43-81e8-5aa220bf3355].reminders" - ], "idempotency_key": "4ee82288-0910-499e-ab4c-5d0071dad1be", "invoice": { "payment_requests": [ { + "reminders": null, "tipping_enabled": false, "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" } @@ -47,7 +45,12 @@ Describes a `UpdateInvoice` request. "sublocality": "sublocality6" } } - } + }, + "fields_to_clear": [ + "fields_to_clear1", + "fields_to_clear2", + "fields_to_clear3" + ] } ``` diff --git a/lib/square/api/apple_pay_api.rb b/lib/square/api/apple_pay_api.rb index 5f0ab13d..f7b7b82f 100644 --- a/lib/square/api/apple_pay_api.rb +++ b/lib/square/api/apple_pay_api.rb @@ -9,13 +9,17 @@ class ApplePayApi < BaseApi # This endpoint provides an easy way for platform developers to bulk # activate # Apple Pay on the Web with Square for merchants using their platform. - # Note: The SqPaymentForm library is deprecated as of May 13, 2021, and will - # only receive critical security updates until it is retired on October 31, - # 2022. - # You must migrate your payment form code to the Web Payments SDK to - # continue using your domain for Apple Pay. For more information on - # migrating to the Web Payments SDK, see [Migrate to the Web Payments - # SDK](https://developer.squareup.com/docs/web-payments/migrate). + # Note: You will need to host a valid domain verification file on your + # domain to support Apple Pay. The + # current version of this file is always available at + # https://app.squareup.com/digital-wallets/apple-pay/apple-developer-merchan + # tid-domain-association, + # and should be hosted at + # `.well_known/apple-developer-merchantid-domain-association` on your + # domain. This file is subject to change; we strongly recommend checking + # for updates regularly and avoiding + # long-lived caches that might not keep in sync with the correct file + # version. # To learn more about the Web Payments SDK and how to add Apple Pay, see # [Take an Apple Pay # Payment](https://developer.squareup.com/docs/web-payments/apple-pay). @@ -34,9 +38,9 @@ def register_domain(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/bank_accounts_api.rb b/lib/square/api/bank_accounts_api.rb index 650087e5..1f14a1c4 100644 --- a/lib/square/api/bank_accounts_api.rb +++ b/lib/square/api/bank_accounts_api.rb @@ -29,9 +29,9 @@ def list_bank_accounts(cursor: nil, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -53,9 +53,9 @@ def get_bank_account_by_v1_id(v1_bank_account_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -74,9 +74,9 @@ def get_bank_account(bank_account_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/base_api.rb b/lib/square/api/base_api.rb index 1620f8c7..8e21106c 100644 --- a/lib/square/api/base_api.rb +++ b/lib/square/api/base_api.rb @@ -5,7 +5,7 @@ class BaseApi attr_accessor :config, :http_call_back def self.user_agent - 'Square-Ruby-SDK/38.1.0.20240604 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}' + 'Square-Ruby-SDK/38.1.1.20240717 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}' end def self.user_agent_parameters diff --git a/lib/square/api/booking_custom_attributes_api.rb b/lib/square/api/booking_custom_attributes_api.rb index 910dfd30..dca32035 100644 --- a/lib/square/api/booking_custom_attributes_api.rb +++ b/lib/square/api/booking_custom_attributes_api.rb @@ -30,9 +30,9 @@ def list_booking_custom_attribute_definitions(limit: nil, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -59,9 +59,9 @@ def create_booking_custom_attribute_definition(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -86,9 +86,9 @@ def delete_booking_custom_attribute_definition(key:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -119,9 +119,9 @@ def retrieve_booking_custom_attribute_definition(key:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -153,9 +153,9 @@ def update_booking_custom_attribute_definition(key:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -182,9 +182,9 @@ def bulk_delete_booking_custom_attributes(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -211,9 +211,9 @@ def bulk_upsert_booking_custom_attributes(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -259,9 +259,9 @@ def list_booking_custom_attributes(booking_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -293,9 +293,9 @@ def delete_booking_custom_attribute(booking_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -340,9 +340,9 @@ def retrieve_booking_custom_attribute(booking_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -381,9 +381,9 @@ def upsert_booking_custom_attribute(booking_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/bookings_api.rb b/lib/square/api/bookings_api.rb index 3215193a..b4e2bbed 100644 --- a/lib/square/api/bookings_api.rb +++ b/lib/square/api/bookings_api.rb @@ -48,9 +48,9 @@ def list_bookings(limit: nil, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -83,9 +83,9 @@ def create_booking(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -109,9 +109,9 @@ def search_availability(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -135,9 +135,9 @@ def bulk_retrieve_bookings(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -151,9 +151,9 @@ def retrieve_business_booking_profile .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -175,9 +175,9 @@ def list_location_booking_profiles(limit: nil, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -195,9 +195,9 @@ def retrieve_location_booking_profile(location_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -229,9 +229,9 @@ def list_team_member_booking_profiles(bookable_only: false, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -251,9 +251,9 @@ def bulk_retrieve_team_member_booking_profiles(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -271,9 +271,9 @@ def retrieve_team_member_booking_profile(team_member_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -296,9 +296,9 @@ def retrieve_booking(booking_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -330,9 +330,9 @@ def update_booking(booking_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -365,9 +365,9 @@ def cancel_booking(booking_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/cards_api.rb b/lib/square/api/cards_api.rb index 42ddc906..5d576dde 100644 --- a/lib/square/api/cards_api.rb +++ b/lib/square/api/cards_api.rb @@ -37,9 +37,9 @@ def list_cards(cursor: nil, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -59,9 +59,9 @@ def create_card(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -79,9 +79,9 @@ def retrieve_card(card_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -100,9 +100,9 @@ def disable_card(card_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/cash_drawers_api.rb b/lib/square/api/cash_drawers_api.rb index cf717957..bf1b337b 100644 --- a/lib/square/api/cash_drawers_api.rb +++ b/lib/square/api/cash_drawers_api.rb @@ -36,9 +36,9 @@ def list_cash_drawer_shifts(location_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -61,9 +61,9 @@ def retrieve_cash_drawer_shift(location_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -92,9 +92,9 @@ def list_cash_drawer_shift_events(location_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/catalog_api.rb b/lib/square/api/catalog_api.rb index a16055dc..4683b711 100644 --- a/lib/square/api/catalog_api.rb +++ b/lib/square/api/catalog_api.rb @@ -32,9 +32,9 @@ def batch_delete_catalog_objects(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -59,9 +59,9 @@ def batch_retrieve_catalog_objects(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -99,9 +99,9 @@ def batch_upsert_catalog_objects(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -129,9 +129,9 @@ def create_catalog_image(request: nil, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -161,9 +161,9 @@ def update_catalog_image(image_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -178,9 +178,9 @@ def catalog_info .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -232,9 +232,9 @@ def list_catalog(cursor: nil, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -259,9 +259,9 @@ def upsert_catalog_object(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -293,9 +293,9 @@ def delete_catalog_object(object_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -353,9 +353,9 @@ def retrieve_catalog_object(object_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -391,9 +391,9 @@ def search_catalog_objects(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -429,9 +429,9 @@ def search_catalog_items(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -453,9 +453,9 @@ def update_item_modifier_lists(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -477,9 +477,9 @@ def update_item_taxes(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/checkout_api.rb b/lib/square/api/checkout_api.rb index d8bcc3a2..879e0065 100644 --- a/lib/square/api/checkout_api.rb +++ b/lib/square/api/checkout_api.rb @@ -29,9 +29,9 @@ def create_checkout(location_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -49,9 +49,9 @@ def retrieve_location_settings(location_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -76,9 +76,9 @@ def update_location_settings(location_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -92,9 +92,9 @@ def retrieve_merchant_settings .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -114,9 +114,9 @@ def update_merchant_settings(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -144,9 +144,9 @@ def list_payment_links(cursor: nil, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -167,9 +167,9 @@ def create_payment_link(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -187,9 +187,9 @@ def delete_payment_link(id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -206,9 +206,9 @@ def retrieve_payment_link(id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -236,9 +236,9 @@ def update_payment_link(id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/customer_custom_attributes_api.rb b/lib/square/api/customer_custom_attributes_api.rb index c4040fc4..95232614 100644 --- a/lib/square/api/customer_custom_attributes_api.rb +++ b/lib/square/api/customer_custom_attributes_api.rb @@ -36,9 +36,9 @@ def list_customer_custom_attribute_definitions(limit: nil, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -73,9 +73,9 @@ def create_customer_custom_attribute_definition(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -98,9 +98,9 @@ def delete_customer_custom_attribute_definition(key:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -134,9 +134,9 @@ def retrieve_customer_custom_attribute_definition(key:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -169,9 +169,9 @@ def update_customer_custom_attribute_definition(key:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -212,9 +212,9 @@ def bulk_upsert_customer_custom_attributes(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -265,9 +265,9 @@ def list_customer_custom_attributes(customer_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -298,9 +298,9 @@ def delete_customer_custom_attribute(customer_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -351,9 +351,9 @@ def retrieve_customer_custom_attribute(customer_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -399,9 +399,9 @@ def upsert_customer_custom_attribute(customer_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/customer_groups_api.rb b/lib/square/api/customer_groups_api.rb index 3ddb5503..b7524458 100644 --- a/lib/square/api/customer_groups_api.rb +++ b/lib/square/api/customer_groups_api.rb @@ -26,9 +26,9 @@ def list_customer_groups(cursor: nil, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -49,9 +49,9 @@ def create_customer_group(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -69,9 +69,9 @@ def delete_customer_group(group_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -89,9 +89,9 @@ def retrieve_customer_group(group_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -116,9 +116,9 @@ def update_customer_group(group_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/customer_segments_api.rb b/lib/square/api/customer_segments_api.rb index 7d155a07..86654769 100644 --- a/lib/square/api/customer_segments_api.rb +++ b/lib/square/api/customer_segments_api.rb @@ -26,9 +26,9 @@ def list_customer_segments(cursor: nil, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -47,9 +47,9 @@ def retrieve_customer_segment(segment_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/customers_api.rb b/lib/square/api/customers_api.rb index efafbccd..5aecdc4d 100644 --- a/lib/square/api/customers_api.rb +++ b/lib/square/api/customers_api.rb @@ -47,9 +47,9 @@ def list_customers(cursor: nil, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -77,9 +77,9 @@ def create_customer(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -108,9 +108,9 @@ def bulk_create_customers(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -131,9 +131,9 @@ def bulk_delete_customers(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -154,9 +154,9 @@ def bulk_retrieve_customers(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -180,9 +180,9 @@ def bulk_update_customers(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -212,9 +212,9 @@ def search_customers(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -245,9 +245,9 @@ def delete_customer(customer_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -265,9 +265,9 @@ def retrieve_customer(customer_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -299,9 +299,9 @@ def update_customer(customer_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -331,9 +331,9 @@ def create_customer_card(customer_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -357,9 +357,9 @@ def delete_customer_card(customer_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -384,9 +384,9 @@ def remove_group_from_customer(customer_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -411,9 +411,9 @@ def add_group_to_customer(customer_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/devices_api.rb b/lib/square/api/devices_api.rb index 8709d2e2..8e720501 100644 --- a/lib/square/api/devices_api.rb +++ b/lib/square/api/devices_api.rb @@ -31,9 +31,9 @@ def list_devices(cursor: nil, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -68,9 +68,9 @@ def list_device_codes(cursor: nil, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -92,9 +92,9 @@ def create_device_code(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -112,9 +112,9 @@ def get_device_code(id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -132,9 +132,9 @@ def get_device(device_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/disputes_api.rb b/lib/square/api/disputes_api.rb index 40503ea5..5566f2dc 100644 --- a/lib/square/api/disputes_api.rb +++ b/lib/square/api/disputes_api.rb @@ -27,9 +27,9 @@ def list_disputes(cursor: nil, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -47,9 +47,9 @@ def retrieve_dispute(dispute_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -72,9 +72,9 @@ def accept_dispute(dispute_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -98,9 +98,9 @@ def list_dispute_evidence(dispute_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -130,9 +130,9 @@ def create_dispute_evidence_file(dispute_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -157,9 +157,9 @@ def create_dispute_evidence_text(dispute_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -183,9 +183,9 @@ def delete_dispute_evidence(dispute_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -210,9 +210,9 @@ def retrieve_dispute_evidence(dispute_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -238,9 +238,9 @@ def submit_evidence(dispute_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/employees_api.rb b/lib/square/api/employees_api.rb index d3be3388..4d9a77ea 100644 --- a/lib/square/api/employees_api.rb +++ b/lib/square/api/employees_api.rb @@ -26,9 +26,9 @@ def list_employees(location_id: nil, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -47,9 +47,9 @@ def retrieve_employee(id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/events_api.rb b/lib/square/api/events_api.rb index 341ebbb3..1ae7fd7e 100644 --- a/lib/square/api/events_api.rb +++ b/lib/square/api/events_api.rb @@ -17,9 +17,9 @@ def search_events(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -37,9 +37,9 @@ def disable_events .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -54,9 +54,9 @@ def enable_events .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -75,9 +75,9 @@ def list_event_types(api_version: nil) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/gift_card_activities_api.rb b/lib/square/api/gift_card_activities_api.rb index 0659f6e7..cf0e2d47 100644 --- a/lib/square/api/gift_card_activities_api.rb +++ b/lib/square/api/gift_card_activities_api.rb @@ -65,9 +65,9 @@ def list_gift_card_activities(gift_card_id: nil, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -91,9 +91,9 @@ def create_gift_card_activity(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/gift_cards_api.rb b/lib/square/api/gift_cards_api.rb index a20f29ce..faf28bfd 100644 --- a/lib/square/api/gift_cards_api.rb +++ b/lib/square/api/gift_cards_api.rb @@ -43,9 +43,9 @@ def list_gift_cards(type: nil, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -70,9 +70,9 @@ def create_gift_card(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -92,9 +92,9 @@ def retrieve_gift_card_from_gan(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -115,9 +115,9 @@ def retrieve_gift_card_from_nonce(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -143,9 +143,9 @@ def link_customer_to_gift_card(gift_card_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -171,9 +171,9 @@ def unlink_customer_from_gift_card(gift_card_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -191,9 +191,9 @@ def retrieve_gift_card(id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/inventory_api.rb b/lib/square/api/inventory_api.rb index 7be905bc..c4c4381a 100644 --- a/lib/square/api/inventory_api.rb +++ b/lib/square/api/inventory_api.rb @@ -20,9 +20,9 @@ def deprecated_retrieve_inventory_adjustment(adjustment_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -41,9 +41,9 @@ def retrieve_inventory_adjustment(adjustment_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -68,9 +68,9 @@ def deprecated_batch_change_inventory(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -95,9 +95,9 @@ def deprecated_batch_retrieve_inventory_changes(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -122,9 +122,9 @@ def deprecated_batch_retrieve_inventory_counts(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -147,9 +147,9 @@ def batch_change_inventory(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -174,9 +174,9 @@ def batch_retrieve_inventory_changes(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -205,9 +205,9 @@ def batch_retrieve_inventory_counts(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -230,9 +230,9 @@ def deprecated_retrieve_inventory_physical_count(physical_count_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -251,9 +251,9 @@ def retrieve_inventory_physical_count(physical_count_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -272,9 +272,9 @@ def retrieve_inventory_transfer(transfer_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -307,9 +307,9 @@ def retrieve_inventory_count(catalog_object_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -353,9 +353,9 @@ def retrieve_inventory_changes(catalog_object_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/invoices_api.rb b/lib/square/api/invoices_api.rb index 0e3b3998..40d44adb 100644 --- a/lib/square/api/invoices_api.rb +++ b/lib/square/api/invoices_api.rb @@ -28,9 +28,9 @@ def list_invoices(location_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -54,9 +54,9 @@ def create_invoice(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -82,9 +82,9 @@ def search_invoices(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -111,9 +111,9 @@ def delete_invoice(invoice_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -131,20 +131,19 @@ def get_invoice(invoice_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end - # Updates an invoice by modifying fields, clearing fields, or both. For most - # updates, you can use a sparse - # `Invoice` object to add fields or change values and use the - # `fields_to_clear` field to specify fields to clear. - # However, some restrictions apply. For example, you cannot change the - # `order_id` or `location_id` field and you - # must provide the complete `custom_fields` list to update a custom field. - # Published invoices have additional restrictions. + # Updates an invoice. This endpoint supports sparse updates, so you only + # need + # to specify the fields you want to change along with the required `version` + # field. + # Some restrictions apply to updating invoices. For example, you cannot + # change the + # `order_id` or `location_id` field. # @param [String] invoice_id Required parameter: The ID of the invoice to # update. # @param [UpdateInvoiceRequest] body Required parameter: An object @@ -165,9 +164,9 @@ def update_invoice(invoice_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -202,9 +201,9 @@ def create_invoice_attachment(invoice_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -230,9 +229,9 @@ def delete_invoice_attachment(invoice_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -260,9 +259,9 @@ def cancel_invoice(invoice_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -303,9 +302,9 @@ def publish_invoice(invoice_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/labor_api.rb b/lib/square/api/labor_api.rb index fa8e5f3a..f0bc0149 100644 --- a/lib/square/api/labor_api.rb +++ b/lib/square/api/labor_api.rb @@ -24,9 +24,9 @@ def list_break_types(location_id: nil, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -58,9 +58,9 @@ def create_break_type(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -79,9 +79,9 @@ def delete_break_type(id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -99,9 +99,9 @@ def get_break_type(id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -126,9 +126,9 @@ def update_break_type(id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -155,9 +155,9 @@ def list_employee_wages(employee_id: nil, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -176,9 +176,9 @@ def get_employee_wage(id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -215,9 +215,9 @@ def create_shift(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -249,9 +249,9 @@ def search_shifts(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -269,9 +269,9 @@ def delete_shift(id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -289,9 +289,9 @@ def get_shift(id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -322,9 +322,9 @@ def update_shift(id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -350,9 +350,9 @@ def list_team_member_wages(team_member_id: nil, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -370,9 +370,9 @@ def get_team_member_wage(id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -393,9 +393,9 @@ def list_workweek_configs(limit: nil, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -420,9 +420,9 @@ def update_workweek_config(id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/location_custom_attributes_api.rb b/lib/square/api/location_custom_attributes_api.rb index db22f50d..92d41b47 100644 --- a/lib/square/api/location_custom_attributes_api.rb +++ b/lib/square/api/location_custom_attributes_api.rb @@ -38,9 +38,9 @@ def list_location_custom_attribute_definitions(visibility_filter: nil, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -71,9 +71,9 @@ def create_location_custom_attribute_definition(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -96,9 +96,9 @@ def delete_location_custom_attribute_definition(key:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -129,9 +129,9 @@ def retrieve_location_custom_attribute_definition(key:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -161,9 +161,9 @@ def update_location_custom_attribute_definition(key:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -187,9 +187,9 @@ def bulk_delete_location_custom_attributes(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -227,9 +227,9 @@ def bulk_upsert_location_custom_attributes(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -284,9 +284,9 @@ def list_location_custom_attributes(location_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -315,9 +315,9 @@ def delete_location_custom_attribute(location_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -365,9 +365,9 @@ def retrieve_location_custom_attribute(location_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -410,9 +410,9 @@ def upsert_location_custom_attribute(location_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/locations_api.rb b/lib/square/api/locations_api.rb index 86f96d15..2c0e31f8 100644 --- a/lib/square/api/locations_api.rb +++ b/lib/square/api/locations_api.rb @@ -14,9 +14,9 @@ def list_locations .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -45,9 +45,9 @@ def create_location(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -68,9 +68,9 @@ def retrieve_location(location_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -95,9 +95,9 @@ def update_location(location_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/loyalty_api.rb b/lib/square/api/loyalty_api.rb index a5cdf15b..0ff636f2 100644 --- a/lib/square/api/loyalty_api.rb +++ b/lib/square/api/loyalty_api.rb @@ -18,9 +18,9 @@ def create_loyalty_account(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -44,9 +44,9 @@ def search_loyalty_accounts(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -64,9 +64,9 @@ def retrieve_loyalty_account(account_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -115,9 +115,9 @@ def accumulate_loyalty_points(account_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -146,9 +146,9 @@ def adjust_loyalty_points(account_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -175,9 +175,9 @@ def search_loyalty_events(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -200,9 +200,9 @@ def list_loyalty_programs .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -227,9 +227,9 @@ def retrieve_loyalty_program(program_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -278,9 +278,9 @@ def calculate_loyalty_points(program_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -324,9 +324,9 @@ def list_loyalty_promotions(program_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -362,9 +362,9 @@ def create_loyalty_promotion(program_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -389,9 +389,9 @@ def retrieve_loyalty_promotion(promotion_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -422,9 +422,9 @@ def cancel_loyalty_promotion(promotion_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -451,9 +451,9 @@ def create_loyalty_reward(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -479,9 +479,9 @@ def search_loyalty_rewards(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -505,9 +505,9 @@ def delete_loyalty_reward(reward_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -525,9 +525,9 @@ def retrieve_loyalty_reward(reward_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -559,9 +559,9 @@ def redeem_loyalty_reward(reward_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/merchant_custom_attributes_api.rb b/lib/square/api/merchant_custom_attributes_api.rb index 6f705f45..a7c8d740 100644 --- a/lib/square/api/merchant_custom_attributes_api.rb +++ b/lib/square/api/merchant_custom_attributes_api.rb @@ -38,9 +38,9 @@ def list_merchant_custom_attribute_definitions(visibility_filter: nil, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -71,9 +71,9 @@ def create_merchant_custom_attribute_definition(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -96,9 +96,9 @@ def delete_merchant_custom_attribute_definition(key:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -129,9 +129,9 @@ def retrieve_merchant_custom_attribute_definition(key:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -161,9 +161,9 @@ def update_merchant_custom_attribute_definition(key:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -187,9 +187,9 @@ def bulk_delete_merchant_custom_attributes(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -227,9 +227,9 @@ def bulk_upsert_merchant_custom_attributes(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -284,9 +284,9 @@ def list_merchant_custom_attributes(merchant_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -315,9 +315,9 @@ def delete_merchant_custom_attribute(merchant_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -365,9 +365,9 @@ def retrieve_merchant_custom_attribute(merchant_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -410,9 +410,9 @@ def upsert_merchant_custom_attribute(merchant_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/merchants_api.rb b/lib/square/api/merchants_api.rb index 8a68e2ac..f6266b2a 100644 --- a/lib/square/api/merchants_api.rb +++ b/lib/square/api/merchants_api.rb @@ -24,9 +24,9 @@ def list_merchants(cursor: nil) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -45,9 +45,9 @@ def retrieve_merchant(merchant_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/mobile_authorization_api.rb b/lib/square/api/mobile_authorization_api.rb index 77ac9414..b949e4fa 100644 --- a/lib/square/api/mobile_authorization_api.rb +++ b/lib/square/api/mobile_authorization_api.rb @@ -29,9 +29,9 @@ def create_mobile_authorization_code(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/o_auth_api.rb b/lib/square/api/o_auth_api.rb index ba25ecdf..d33e2c06 100644 --- a/lib/square/api/o_auth_api.rb +++ b/lib/square/api/o_auth_api.rb @@ -30,9 +30,9 @@ def revoke_token(body:, .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end)) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -66,9 +66,9 @@ def obtain_token(body:) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end)) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -100,9 +100,9 @@ def retrieve_token_status(authorization:) .header_param(new_parameter(authorization, key: 'Authorization')) .header_param(new_parameter('application/json', key: 'accept'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/order_custom_attributes_api.rb b/lib/square/api/order_custom_attributes_api.rb index 3ddb689d..cb8c8dc6 100644 --- a/lib/square/api/order_custom_attributes_api.rb +++ b/lib/square/api/order_custom_attributes_api.rb @@ -42,9 +42,9 @@ def list_order_custom_attribute_definitions(visibility_filter: nil, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -69,9 +69,9 @@ def create_order_custom_attribute_definition(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -91,9 +91,9 @@ def delete_order_custom_attribute_definition(key:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -124,9 +124,9 @@ def retrieve_order_custom_attribute_definition(key:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -155,9 +155,9 @@ def update_order_custom_attribute_definition(key:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -197,9 +197,9 @@ def bulk_delete_order_custom_attributes(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -240,9 +240,9 @@ def bulk_upsert_order_custom_attributes(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -299,9 +299,9 @@ def list_order_custom_attributes(order_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -331,9 +331,9 @@ def delete_order_custom_attribute(order_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -381,9 +381,9 @@ def retrieve_order_custom_attribute(order_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -427,9 +427,9 @@ def upsert_order_custom_attribute(order_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/orders_api.rb b/lib/square/api/orders_api.rb index f9ebab3e..d6cc20d2 100644 --- a/lib/square/api/orders_api.rb +++ b/lib/square/api/orders_api.rb @@ -24,9 +24,9 @@ def create_order(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -48,9 +48,9 @@ def batch_retrieve_orders(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -70,9 +70,9 @@ def calculate_order(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -95,9 +95,9 @@ def clone_order(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -133,9 +133,9 @@ def search_orders(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -153,9 +153,9 @@ def retrieve_order(order_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -197,9 +197,9 @@ def update_order(order_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -242,9 +242,9 @@ def pay_order(order_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/payments_api.rb b/lib/square/api/payments_api.rb index c4833879..694a9706 100644 --- a/lib/square/api/payments_api.rb +++ b/lib/square/api/payments_api.rb @@ -63,9 +63,9 @@ def list_payments(begin_time: nil, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -92,9 +92,9 @@ def create_payment(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -128,9 +128,9 @@ def cancel_payment_by_idempotency_key(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -148,9 +148,9 @@ def get_payment(payment_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -176,9 +176,9 @@ def update_payment(payment_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -198,9 +198,9 @@ def cancel_payment(payment_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -229,9 +229,9 @@ def complete_payment(payment_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/payouts_api.rb b/lib/square/api/payouts_api.rb index 388c601d..3222f932 100644 --- a/lib/square/api/payouts_api.rb +++ b/lib/square/api/payouts_api.rb @@ -50,9 +50,9 @@ def list_payouts(location_id: nil, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -71,9 +71,9 @@ def get_payout(payout_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -111,9 +111,9 @@ def list_payout_entries(payout_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/refunds_api.rb b/lib/square/api/refunds_api.rb index 61356dfc..b9637a46 100644 --- a/lib/square/api/refunds_api.rb +++ b/lib/square/api/refunds_api.rb @@ -64,9 +64,9 @@ def list_payment_refunds(begin_time: nil, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -92,9 +92,9 @@ def refund_payment(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -112,9 +112,9 @@ def get_payment_refund(refund_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/sites_api.rb b/lib/square/api/sites_api.rb index 1fa2dc3a..e4a738aa 100644 --- a/lib/square/api/sites_api.rb +++ b/lib/square/api/sites_api.rb @@ -17,9 +17,9 @@ def list_sites .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/snippets_api.rb b/lib/square/api/snippets_api.rb index 00576681..db90da42 100644 --- a/lib/square/api/snippets_api.rb +++ b/lib/square/api/snippets_api.rb @@ -22,9 +22,9 @@ def delete_snippet(site_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -51,9 +51,9 @@ def retrieve_snippet(site_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -89,9 +89,9 @@ def upsert_snippet(site_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/subscriptions_api.rb b/lib/square/api/subscriptions_api.rb index 23dcc321..c519145b 100644 --- a/lib/square/api/subscriptions_api.rb +++ b/lib/square/api/subscriptions_api.rb @@ -26,9 +26,9 @@ def create_subscription(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -52,9 +52,9 @@ def bulk_swap_plan(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -86,9 +86,9 @@ def search_subscriptions(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -112,9 +112,9 @@ def retrieve_subscription(subscription_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -141,9 +141,9 @@ def update_subscription(subscription_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -166,9 +166,9 @@ def delete_subscription_action(subscription_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -196,9 +196,9 @@ def change_billing_anchor_date(subscription_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -219,9 +219,9 @@ def cancel_subscription(subscription_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -254,9 +254,9 @@ def list_subscription_events(subscription_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -281,9 +281,9 @@ def pause_subscription(subscription_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -309,9 +309,9 @@ def resume_subscription(subscription_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -340,9 +340,9 @@ def swap_plan(subscription_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/team_api.rb b/lib/square/api/team_api.rb index 7809a8e5..5f004bac 100644 --- a/lib/square/api/team_api.rb +++ b/lib/square/api/team_api.rb @@ -24,9 +24,9 @@ def create_team_member(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -55,9 +55,9 @@ def bulk_create_team_members(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -86,9 +86,9 @@ def bulk_update_team_members(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -111,9 +111,9 @@ def search_team_members(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -134,9 +134,9 @@ def retrieve_team_member(team_member_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -165,9 +165,9 @@ def update_team_member(team_member_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -189,9 +189,9 @@ def retrieve_wage_setting(team_member_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -223,9 +223,9 @@ def update_wage_setting(team_member_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/terminal_api.rb b/lib/square/api/terminal_api.rb index 013f4611..cfb5936c 100644 --- a/lib/square/api/terminal_api.rb +++ b/lib/square/api/terminal_api.rb @@ -17,9 +17,9 @@ def create_terminal_action(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -41,9 +41,9 @@ def search_terminal_actions(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -62,9 +62,9 @@ def get_terminal_action(action_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -82,9 +82,9 @@ def cancel_terminal_action(action_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -106,9 +106,9 @@ def dismiss_terminal_action(action_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -130,9 +130,9 @@ def create_terminal_checkout(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -155,9 +155,9 @@ def search_terminal_checkouts(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -176,9 +176,9 @@ def get_terminal_checkout(checkout_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -197,9 +197,9 @@ def cancel_terminal_checkout(checkout_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -218,9 +218,9 @@ def dismiss_terminal_checkout(checkout_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -244,9 +244,9 @@ def create_terminal_refund(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -268,9 +268,9 @@ def search_terminal_refunds(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -289,9 +289,9 @@ def get_terminal_refund(terminal_refund_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -310,9 +310,9 @@ def cancel_terminal_refund(terminal_refund_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -331,9 +331,9 @@ def dismiss_terminal_refund(terminal_refund_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/transactions_api.rb b/lib/square/api/transactions_api.rb index b3a1671b..8bd617c3 100644 --- a/lib/square/api/transactions_api.rb +++ b/lib/square/api/transactions_api.rb @@ -48,9 +48,9 @@ def list_transactions(location_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -74,9 +74,9 @@ def retrieve_transaction(location_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -104,9 +104,9 @@ def capture_transaction(location_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -134,9 +134,9 @@ def void_transaction(location_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/v1_transactions_api.rb b/lib/square/api/v1_transactions_api.rb index 1eff9511..1fe6c588 100644 --- a/lib/square/api/v1_transactions_api.rb +++ b/lib/square/api/v1_transactions_api.rb @@ -29,10 +29,10 @@ def v1_list_orders(location_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create)) - .is_response_array(true)) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create)) + .is_response_array(true)) .execute end @@ -58,9 +58,9 @@ def v1_retrieve_order(location_id:, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -93,9 +93,9 @@ def v1_update_order(location_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/vendors_api.rb b/lib/square/api/vendors_api.rb index 4722b530..363d0b7a 100644 --- a/lib/square/api/vendors_api.rb +++ b/lib/square/api/vendors_api.rb @@ -18,9 +18,9 @@ def bulk_create_vendors(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -40,9 +40,9 @@ def bulk_retrieve_vendors(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -63,9 +63,9 @@ def bulk_update_vendors(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -86,9 +86,9 @@ def create_vendor(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -109,9 +109,9 @@ def search_vendors(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -129,9 +129,9 @@ def retrieve_vendor(vendor_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -155,9 +155,9 @@ def update_vendor(body:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/api/webhook_subscriptions_api.rb b/lib/square/api/webhook_subscriptions_api.rb index ed6bc5da..e38074b6 100644 --- a/lib/square/api/webhook_subscriptions_api.rb +++ b/lib/square/api/webhook_subscriptions_api.rb @@ -15,9 +15,9 @@ def list_webhook_event_types(api_version: nil) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -53,9 +53,9 @@ def list_webhook_subscriptions(cursor: nil, .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -75,9 +75,9 @@ def create_webhook_subscription(body:) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -95,9 +95,9 @@ def delete_webhook_subscription(subscription_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -115,9 +115,9 @@ def retrieve_webhook_subscription(subscription_id:) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -142,9 +142,9 @@ def update_webhook_subscription(subscription_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -170,9 +170,9 @@ def update_webhook_subscription_signature_key(subscription_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end @@ -198,9 +198,9 @@ def test_webhook_subscription(subscription_id:, .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler - .deserializer(APIHelper.method(:json_deserialize)) - .is_api_response(true) - .convertor(ApiResponse.method(:create))) + .deserializer(APIHelper.method(:json_deserialize)) + .is_api_response(true) + .convertor(ApiResponse.method(:create))) .execute end end diff --git a/lib/square/client.rb b/lib/square/client.rb index 9f87c793..b89636a3 100644 --- a/lib/square/client.rb +++ b/lib/square/client.rb @@ -5,7 +5,7 @@ class Client attr_reader :config, :auth_managers def sdk_version - '38.1.0.20240604' + '38.1.1.20240717' end def square_version @@ -274,7 +274,7 @@ def initialize( retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524], retry_methods: %i[get put], http_callback: nil, environment: 'production', custom_url: 'https://connect.squareup.com', access_token: nil, - bearer_auth_credentials: nil, square_version: '2024-06-04', + bearer_auth_credentials: nil, square_version: '2024-07-17', user_agent_detail: '', additional_headers: {}, config: nil ) @config = if config.nil? diff --git a/lib/square/configuration.rb b/lib/square/configuration.rb index 79296beb..9fe4fa7e 100644 --- a/lib/square/configuration.rb +++ b/lib/square/configuration.rb @@ -24,7 +24,7 @@ def initialize( retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524], retry_methods: %i[get put], http_callback: nil, environment: 'production', custom_url: 'https://connect.squareup.com', access_token: nil, - bearer_auth_credentials: nil, square_version: '2024-06-04', + bearer_auth_credentials: nil, square_version: '2024-07-17', user_agent_detail: '', additional_headers: {} ) diff --git a/square.gemspec b/square.gemspec index 5140f8ec..719e9549 100644 --- a/square.gemspec +++ b/square.gemspec @@ -1,15 +1,15 @@ Gem::Specification.new do |s| s.name = 'square.rb' - s.version = '38.1.0.20240604' + s.version = '38.1.1.20240717' s.summary = 'square' s.description = '' s.authors = ['Square Developer Platform'] s.email = ['developers@squareup.com'] s.homepage = '' s.licenses = ['Apache-2.0'] - s.add_dependency('apimatic_core_interfaces', '~> 0.2.0') - s.add_dependency('apimatic_core', '~> 0.3.0') - s.add_dependency('apimatic_faraday_client_adapter', '~> 0.1.0') + s.add_dependency('apimatic_core_interfaces', '~> 0.2.1') + s.add_dependency('apimatic_core', '~> 0.3.9') + s.add_dependency('apimatic_faraday_client_adapter', '~> 0.1.4') s.add_development_dependency('minitest', '~> 5.14', '>= 5.14.1') s.add_development_dependency('minitest-proveit', '~> 1.0') s.required_ruby_version = ['>= 2.6'] diff --git a/test/webhooks/test_webhooks_helper.rb b/test/webhooks/test_webhooks_helper.rb index 365bca07..ce38ae26 100644 --- a/test/webhooks/test_webhooks_helper.rb +++ b/test/webhooks/test_webhooks_helper.rb @@ -27,6 +27,23 @@ def test_signature_validation_pass assert_equal true, is_valid end + def test_signature_validation_escaped_pass + @logger.info('Running test_signature_validation_pass') # Log a message + + escpaedRequestBody = '{"data":{"type":"webhooks","id":">id<"}}'; + newSignatureHeader = "Cxt7+aTi4rKgcA0bC4g9EHdVtLSDWdqccmL5MvihU4U="; + signatureKey = "signature-key"; + url = "https://webhook.site/webhooks"; + + is_valid = Square::WebhooksHelper.is_valid_webhook_event_signature( + escpaedRequestBody, + newSignatureHeader, + signatureKey, + url + ) + assert_equal true, is_valid + end + def test_signature_validation_fails_on_notification_url_mismatch @logger.info('Running test_signature_validation_fails_on_notification_url_mismatch') # Log a message is_valid = Square::WebhooksHelper.is_valid_webhook_event_signature(