square.rb 44.2.0.20251016 → 45.0.1.20260122

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (499) hide show
  1. checksums.yaml +4 -4
  2. data/.fern/metadata.json +9 -0
  3. data/.fernignore +20 -0
  4. data/.rubocop.yml +60 -0
  5. data/LICENSE +1 -1
  6. data/Rakefile +29 -0
  7. data/custom.gemspec.rb +19 -0
  8. data/lib/square/apple_pay/client.rb +24 -10
  9. data/lib/square/bank_accounts/client.rb +144 -31
  10. data/lib/square/bank_accounts/types/create_bank_account_request.rb +13 -0
  11. data/lib/square/bank_accounts/types/disable_bank_account_request.rb +11 -0
  12. data/lib/square/bank_accounts/types/get_by_v_1_id_bank_accounts_request.rb +1 -1
  13. data/lib/square/bank_accounts/types/list_bank_accounts_request.rb +1 -0
  14. data/lib/square/bookings/client.rb +238 -100
  15. data/lib/square/bookings/custom_attribute_definitions/client.rb +139 -67
  16. data/lib/square/bookings/custom_attribute_definitions/types/create_booking_custom_attribute_definition_request.rb +1 -3
  17. data/lib/square/bookings/custom_attribute_definitions/types/update_booking_custom_attribute_definition_request.rb +1 -3
  18. data/lib/square/bookings/custom_attributes/client.rb +168 -76
  19. data/lib/square/bookings/custom_attributes/types/bulk_delete_booking_custom_attributes_request.rb +1 -3
  20. data/lib/square/bookings/custom_attributes/types/bulk_upsert_booking_custom_attributes_request.rb +1 -3
  21. data/lib/square/bookings/location_profiles/client.rb +44 -24
  22. data/lib/square/bookings/team_member_profiles/client.rb +66 -31
  23. data/lib/square/cards/client.rb +103 -45
  24. data/lib/square/cash_drawers/client.rb +3 -1
  25. data/lib/square/cash_drawers/shifts/client.rb +121 -61
  26. data/lib/square/catalog/client.rb +203 -91
  27. data/lib/square/catalog/images/client.rb +50 -20
  28. data/lib/square/catalog/object/client.rb +66 -29
  29. data/lib/square/catalog/object/types/delete_object_request.rb +1 -1
  30. data/lib/square/catalog/object/types/get_object_request.rb +1 -1
  31. data/lib/square/catalog/types/batch_upsert_catalog_objects_request.rb +1 -3
  32. data/lib/square/catalog/types/search_catalog_items_request.rb +3 -9
  33. data/lib/square/catalog/types/search_catalog_objects_request.rb +1 -3
  34. data/lib/square/channels/client.rb +85 -38
  35. data/lib/square/checkout/client.rb +77 -31
  36. data/lib/square/checkout/payment_links/client.rb +120 -54
  37. data/lib/square/client.rb +8 -10
  38. data/lib/square/customers/cards/client.rb +43 -16
  39. data/lib/square/customers/client.rb +220 -97
  40. data/lib/square/customers/custom_attribute_definitions/client.rb +157 -74
  41. data/lib/square/customers/custom_attribute_definitions/types/batch_upsert_customer_custom_attributes_request.rb +1 -3
  42. data/lib/square/customers/custom_attribute_definitions/types/create_customer_custom_attribute_definition_request.rb +1 -3
  43. data/lib/square/customers/custom_attribute_definitions/types/update_customer_custom_attribute_definition_request.rb +1 -3
  44. data/lib/square/customers/custom_attributes/client.rb +117 -53
  45. data/lib/square/customers/groups/client.rb +156 -67
  46. data/lib/square/customers/segments/client.rb +62 -31
  47. data/lib/square/customers/types/bulk_create_customers_request.rb +1 -3
  48. data/lib/square/customers/types/bulk_update_customers_request.rb +1 -3
  49. data/lib/square/devices/client.rb +66 -31
  50. data/lib/square/devices/codes/client.rb +83 -38
  51. data/lib/square/disputes/client.rb +140 -60
  52. data/lib/square/disputes/evidence/client.rb +83 -39
  53. data/lib/square/employees/client.rb +66 -31
  54. data/lib/square/events/client.rb +80 -38
  55. data/lib/square/file_param.rb +77 -77
  56. data/lib/square/gift_cards/activities/client.rb +73 -31
  57. data/lib/square/gift_cards/client.rb +163 -69
  58. data/lib/square/internal/http/base_request.rb +6 -0
  59. data/lib/square/internal/http/raw_client.rb +111 -20
  60. data/lib/square/internal/iterators/cursor_item_iterator.rb +28 -0
  61. data/lib/square/internal/iterators/cursor_page_iterator.rb +51 -0
  62. data/lib/square/internal/iterators/item_iterator.rb +65 -0
  63. data/lib/square/internal/iterators/offset_item_iterator.rb +30 -0
  64. data/lib/square/internal/iterators/offset_page_iterator.rb +83 -0
  65. data/lib/square/internal/json/request.rb +2 -1
  66. data/lib/square/internal/multipart/multipart_request.rb +2 -1
  67. data/lib/square/internal/types/enum.rb +8 -0
  68. data/lib/square/internal/types/model/field.rb +11 -1
  69. data/lib/square/internal/types/model.rb +14 -4
  70. data/lib/square/internal/types/union.rb +88 -7
  71. data/lib/square/internal/types/utils.rb +20 -4
  72. data/lib/square/inventory/client.rb +100 -76
  73. data/lib/square/invoices/client.rb +228 -99
  74. data/lib/square/labor/break_types/client.rb +120 -53
  75. data/lib/square/labor/client.rb +205 -81
  76. data/lib/square/labor/employee_wages/client.rb +64 -31
  77. data/lib/square/labor/shifts/client.rb +94 -37
  78. data/lib/square/labor/team_member_wages/client.rb +64 -31
  79. data/lib/square/labor/types/bulk_publish_scheduled_shifts_request.rb +2 -6
  80. data/lib/square/labor/types/publish_scheduled_shift_request.rb +1 -3
  81. data/lib/square/labor/workweek_configs/client.rb +65 -32
  82. data/lib/square/locations/client.rb +102 -41
  83. data/lib/square/locations/custom_attribute_definitions/client.rb +135 -64
  84. data/lib/square/locations/custom_attribute_definitions/types/create_location_custom_attribute_definition_request.rb +1 -3
  85. data/lib/square/locations/custom_attribute_definitions/types/update_location_custom_attribute_definition_request.rb +1 -3
  86. data/lib/square/locations/custom_attributes/client.rb +156 -68
  87. data/lib/square/locations/custom_attributes/types/bulk_delete_location_custom_attributes_request.rb +1 -3
  88. data/lib/square/locations/custom_attributes/types/bulk_upsert_location_custom_attributes_request.rb +1 -3
  89. data/lib/square/locations/transactions/client.rb +93 -37
  90. data/lib/square/locations/types/create_checkout_request.rb +1 -3
  91. data/lib/square/loyalty/accounts/client.rb +109 -44
  92. data/lib/square/loyalty/accounts/types/search_loyalty_accounts_request.rb +1 -3
  93. data/lib/square/loyalty/client.rb +20 -8
  94. data/lib/square/loyalty/programs/client.rb +72 -29
  95. data/lib/square/loyalty/programs/promotions/client.rb +106 -46
  96. data/lib/square/loyalty/rewards/client.rb +96 -38
  97. data/lib/square/loyalty/rewards/types/search_loyalty_rewards_request.rb +1 -3
  98. data/lib/square/merchants/client.rb +60 -31
  99. data/lib/square/merchants/custom_attribute_definitions/client.rb +137 -65
  100. data/lib/square/merchants/custom_attribute_definitions/types/create_merchant_custom_attribute_definition_request.rb +1 -3
  101. data/lib/square/merchants/custom_attribute_definitions/types/update_merchant_custom_attribute_definition_request.rb +1 -3
  102. data/lib/square/merchants/custom_attributes/client.rb +156 -68
  103. data/lib/square/merchants/custom_attributes/types/bulk_delete_merchant_custom_attributes_request.rb +1 -3
  104. data/lib/square/merchants/custom_attributes/types/bulk_upsert_merchant_custom_attributes_request.rb +1 -3
  105. data/lib/square/o_auth/client.rb +76 -31
  106. data/lib/square/o_auth/types/obtain_token_request.rb +1 -0
  107. data/lib/square/orders/client.rb +156 -63
  108. data/lib/square/orders/custom_attribute_definitions/client.rb +137 -65
  109. data/lib/square/orders/custom_attribute_definitions/types/create_order_custom_attribute_definition_request.rb +1 -3
  110. data/lib/square/orders/custom_attribute_definitions/types/update_order_custom_attribute_definition_request.rb +1 -3
  111. data/lib/square/orders/custom_attributes/client.rb +159 -69
  112. data/lib/square/orders/custom_attributes/types/bulk_delete_order_custom_attributes_request.rb +1 -3
  113. data/lib/square/orders/custom_attributes/types/bulk_upsert_order_custom_attributes_request.rb +1 -3
  114. data/lib/square/orders/types/calculate_order_request.rb +1 -3
  115. data/lib/square/payments/client.rb +182 -70
  116. data/lib/square/payouts/client.rb +116 -54
  117. data/lib/square/refunds/client.rb +97 -40
  118. data/lib/square/refunds/types/refund_payment_request.rb +1 -3
  119. data/lib/square/sites/client.rb +26 -11
  120. data/lib/square/snippets/client.rb +73 -28
  121. data/lib/square/subscriptions/client.rb +271 -117
  122. data/lib/square/team/client.rb +81 -36
  123. data/lib/square/team_members/client.rb +119 -49
  124. data/lib/square/team_members/types/batch_create_team_members_request.rb +1 -3
  125. data/lib/square/team_members/types/batch_update_team_members_request.rb +1 -3
  126. data/lib/square/team_members/wage_setting/client.rb +48 -19
  127. data/lib/square/terminal/actions/client.rb +75 -30
  128. data/lib/square/terminal/checkouts/client.rb +76 -30
  129. data/lib/square/terminal/client.rb +60 -23
  130. data/lib/square/terminal/refunds/client.rb +78 -31
  131. data/lib/square/transfer_orders/client.rb +26 -21
  132. data/lib/square/types/address.rb +2 -1
  133. data/lib/square/types/application_details.rb +1 -3
  134. data/lib/square/types/application_type.rb +23 -0
  135. data/lib/square/types/availability.rb +3 -4
  136. data/lib/square/types/bank_account.rb +1 -0
  137. data/lib/square/types/batch_create_team_members_response.rb +1 -3
  138. data/lib/square/types/batch_create_vendors_response.rb +1 -3
  139. data/lib/square/types/batch_get_catalog_objects_response.rb +1 -3
  140. data/lib/square/types/batch_get_vendors_response.rb +1 -3
  141. data/lib/square/types/batch_update_team_members_response.rb +1 -3
  142. data/lib/square/types/batch_update_vendors_response.rb +1 -3
  143. data/lib/square/types/batch_upsert_catalog_objects_response.rb +1 -3
  144. data/lib/square/types/batch_upsert_customer_custom_attributes_request_customer_custom_attribute_upsert_request.rb +2 -1
  145. data/lib/square/types/batch_upsert_customer_custom_attributes_response.rb +4 -4
  146. data/lib/square/types/batch_upsert_customer_custom_attributes_response_customer_custom_attribute_upsert_response.rb +3 -1
  147. data/lib/square/types/booking.rb +2 -6
  148. data/lib/square/types/booking_created_event.rb +2 -1
  149. data/lib/square/types/booking_custom_attribute_definition_visible_created_event.rb +2 -1
  150. data/lib/square/types/booking_custom_attribute_definition_visible_deleted_event.rb +2 -1
  151. data/lib/square/types/booking_custom_attribute_definition_visible_updated_event.rb +2 -1
  152. data/lib/square/types/booking_custom_attribute_delete_request.rb +4 -2
  153. data/lib/square/types/booking_custom_attribute_delete_response.rb +3 -1
  154. data/lib/square/types/booking_custom_attribute_upsert_request.rb +2 -1
  155. data/lib/square/types/booking_custom_attribute_upsert_response.rb +3 -1
  156. data/lib/square/types/booking_updated_event.rb +2 -1
  157. data/lib/square/types/bulk_create_customers_response.rb +1 -3
  158. data/lib/square/types/bulk_delete_booking_custom_attributes_response.rb +4 -4
  159. data/lib/square/types/bulk_delete_customers_response.rb +1 -3
  160. data/lib/square/types/bulk_delete_location_custom_attributes_request_location_custom_attribute_delete_request.rb +2 -1
  161. data/lib/square/types/bulk_delete_location_custom_attributes_response.rb +4 -4
  162. data/lib/square/types/bulk_delete_location_custom_attributes_response_location_custom_attribute_delete_response.rb +2 -1
  163. data/lib/square/types/bulk_delete_merchant_custom_attributes_request_merchant_custom_attribute_delete_request.rb +2 -1
  164. data/lib/square/types/bulk_delete_merchant_custom_attributes_response.rb +4 -4
  165. data/lib/square/types/bulk_delete_merchant_custom_attributes_response_merchant_custom_attribute_delete_response.rb +2 -1
  166. data/lib/square/types/bulk_delete_order_custom_attributes_response.rb +1 -3
  167. data/lib/square/types/bulk_publish_scheduled_shifts_response.rb +1 -3
  168. data/lib/square/types/bulk_retrieve_bookings_response.rb +1 -3
  169. data/lib/square/types/bulk_retrieve_channels_request_constants.rb +23 -0
  170. data/lib/square/types/bulk_retrieve_channels_response.rb +1 -3
  171. data/lib/square/types/bulk_retrieve_customers_response.rb +1 -3
  172. data/lib/square/types/bulk_retrieve_team_member_booking_profiles_response.rb +3 -4
  173. data/lib/square/types/bulk_update_customers_response.rb +1 -3
  174. data/lib/square/types/bulk_upsert_booking_custom_attributes_response.rb +4 -4
  175. data/lib/square/types/bulk_upsert_location_custom_attributes_request_location_custom_attribute_upsert_request.rb +2 -1
  176. data/lib/square/types/bulk_upsert_location_custom_attributes_response.rb +4 -4
  177. data/lib/square/types/bulk_upsert_location_custom_attributes_response_location_custom_attribute_upsert_response.rb +3 -1
  178. data/lib/square/types/bulk_upsert_merchant_custom_attributes_request_merchant_custom_attribute_upsert_request.rb +2 -1
  179. data/lib/square/types/bulk_upsert_merchant_custom_attributes_response.rb +4 -4
  180. data/lib/square/types/bulk_upsert_merchant_custom_attributes_response_merchant_custom_attribute_upsert_response.rb +3 -1
  181. data/lib/square/types/bulk_upsert_order_custom_attributes_response.rb +1 -3
  182. data/lib/square/types/business_appointment_settings.rb +4 -12
  183. data/lib/square/types/business_booking_profile.rb +2 -6
  184. data/lib/square/types/buy_now_pay_later_details.rb +1 -0
  185. data/lib/square/types/card.rb +2 -0
  186. data/lib/square/types/card_issuer_alert.rb +23 -0
  187. data/lib/square/types/catalog_category.rb +1 -3
  188. data/lib/square/types/catalog_custom_attribute_definition.rb +6 -18
  189. data/lib/square/types/catalog_custom_attribute_definition_selection_config.rb +1 -3
  190. data/lib/square/types/catalog_id_mapping.rb +1 -1
  191. data/lib/square/types/catalog_info_response.rb +1 -3
  192. data/lib/square/types/catalog_item.rb +6 -12
  193. data/lib/square/types/catalog_item_food_and_beverage_details.rb +2 -6
  194. data/lib/square/types/catalog_item_food_and_beverage_details_dietary_preference.rb +2 -6
  195. data/lib/square/types/catalog_item_food_and_beverage_details_ingredient.rb +2 -6
  196. data/lib/square/types/catalog_item_modifier_list_info.rb +6 -9
  197. data/lib/square/types/catalog_item_variation.rb +17 -13
  198. data/lib/square/types/catalog_modifier.rb +4 -4
  199. data/lib/square/types/catalog_modifier_list.rb +4 -2
  200. data/lib/square/types/catalog_modifier_override.rb +2 -2
  201. data/lib/square/types/catalog_modifier_toggle_override_type.rb +13 -0
  202. data/lib/square/types/catalog_object.rb +7 -3
  203. data/lib/square/types/catalog_object_base.rb +2 -4
  204. data/lib/square/types/catalog_object_category.rb +3 -4
  205. data/lib/square/types/catalog_object_custom_attribute_definition.rb +1 -3
  206. data/lib/square/types/catalog_object_quick_amounts_settings.rb +1 -3
  207. data/lib/square/types/catalog_object_reference.rb +1 -1
  208. data/lib/square/types/catalog_object_subscription_plan_variation.rb +1 -3
  209. data/lib/square/types/catalog_query.rb +11 -13
  210. data/lib/square/types/catalog_query_prefix.rb +2 -1
  211. data/lib/square/types/catalog_query_text.rb +2 -1
  212. data/lib/square/types/catalog_subscription_plan.rb +5 -5
  213. data/lib/square/types/catalog_subscription_plan_variation.rb +4 -2
  214. data/lib/square/types/catalog_v_1_id.rb +1 -1
  215. data/lib/square/types/catalog_version_updated_event_object.rb +1 -3
  216. data/lib/square/types/checkout.rb +1 -3
  217. data/lib/square/types/checkout_location_settings.rb +1 -3
  218. data/lib/square/types/checkout_location_settings_branding.rb +2 -6
  219. data/lib/square/types/checkout_merchant_settings.rb +1 -3
  220. data/lib/square/types/checkout_merchant_settings_payment_methods.rb +4 -12
  221. data/lib/square/types/checkout_merchant_settings_payment_methods_afterpay_clearpay.rb +2 -6
  222. data/lib/square/types/component.rb +4 -12
  223. data/lib/square/types/create_bank_account_response.rb +11 -0
  224. data/lib/square/types/create_booking_custom_attribute_definition_response.rb +4 -4
  225. data/lib/square/types/create_catalog_image_request.rb +1 -1
  226. data/lib/square/types/create_customer_custom_attribute_definition_response.rb +4 -4
  227. data/lib/square/types/create_location_custom_attribute_definition_response.rb +4 -4
  228. data/lib/square/types/create_merchant_custom_attribute_definition_response.rb +4 -4
  229. data/lib/square/types/create_order_custom_attribute_definition_response.rb +1 -3
  230. data/lib/square/types/create_transfer_order_data.rb +3 -4
  231. data/lib/square/types/create_webhook_subscription_response.rb +2 -1
  232. data/lib/square/types/custom_attribute.rb +1 -1
  233. data/lib/square/types/custom_attribute_definition.rb +1 -3
  234. data/lib/square/types/custom_attribute_definition_event_data_object.rb +1 -3
  235. data/lib/square/types/custom_field.rb +2 -1
  236. data/lib/square/types/customer_address_filter.rb +2 -1
  237. data/lib/square/types/customer_created_event.rb +4 -2
  238. data/lib/square/types/customer_created_event_event_context_merge.rb +2 -1
  239. data/lib/square/types/customer_creation_source_filter.rb +1 -3
  240. data/lib/square/types/customer_custom_attribute_filter.rb +2 -1
  241. data/lib/square/types/customer_custom_attribute_filter_value.rb +2 -1
  242. data/lib/square/types/customer_custom_attribute_filters.rb +7 -6
  243. data/lib/square/types/customer_custom_attribute_visible_updated_event.rb +6 -3
  244. data/lib/square/types/customer_deleted_event.rb +4 -2
  245. data/lib/square/types/customer_deleted_event_event_context_merge.rb +2 -1
  246. data/lib/square/types/customer_tax_ids.rb +4 -2
  247. data/lib/square/types/customer_updated_event.rb +4 -2
  248. data/lib/square/types/delete_booking_custom_attribute_definition_response.rb +5 -2
  249. data/lib/square/types/delete_booking_custom_attribute_response.rb +2 -1
  250. data/lib/square/types/delete_customer_custom_attribute_response.rb +2 -1
  251. data/lib/square/types/delete_location_custom_attribute_response.rb +2 -1
  252. data/lib/square/types/delete_merchant_custom_attribute_response.rb +2 -1
  253. data/lib/square/types/delete_subscription_action_response.rb +2 -1
  254. data/lib/square/types/delete_webhook_subscription_response.rb +2 -1
  255. data/lib/square/types/destination_details.rb +1 -3
  256. data/lib/square/types/device_checkout_options.rb +1 -0
  257. data/lib/square/types/device_component_details_ethernet_details.rb +1 -1
  258. data/lib/square/types/device_component_details_wi_fi_details.rb +1 -1
  259. data/lib/square/types/digital_wallet_details.rb +1 -0
  260. data/lib/square/types/disable_bank_account_response.rb +11 -0
  261. data/lib/square/types/dispute.rb +2 -1
  262. data/lib/square/types/dispute_evidence_added_event.rb +2 -1
  263. data/lib/square/types/dispute_evidence_created_event.rb +2 -1
  264. data/lib/square/types/employee_wage.rb +2 -1
  265. data/lib/square/types/error_code.rb +2 -0
  266. data/lib/square/types/event_data.rb +1 -3
  267. data/lib/square/types/fulfillment.rb +4 -7
  268. data/lib/square/types/fulfillment_delivery_details.rb +1 -3
  269. data/lib/square/types/fulfillment_pickup_details.rb +1 -3
  270. data/lib/square/types/get_bank_account_response.rb +1 -1
  271. data/lib/square/types/get_booking_request.rb +23 -0
  272. data/lib/square/types/get_business_booking_profile_request.rb +23 -0
  273. data/lib/square/types/get_card_request.rb +23 -0
  274. data/lib/square/types/get_catalog_object_response.rb +1 -3
  275. data/lib/square/types/get_customer_custom_attribute_definition_response.rb +4 -4
  276. data/lib/square/types/get_customer_custom_attribute_response.rb +2 -1
  277. data/lib/square/types/get_customer_group_request.rb +23 -0
  278. data/lib/square/types/get_customer_request.rb +23 -0
  279. data/lib/square/types/get_customer_segment_request.rb +23 -0
  280. data/lib/square/types/get_dispute_evidence_request.rb +23 -0
  281. data/lib/square/types/get_dispute_request.rb +23 -0
  282. data/lib/square/types/get_employee_request.rb +23 -0
  283. data/lib/square/types/get_gift_card_request.rb +23 -0
  284. data/lib/square/types/get_inventory_adjustment_request.rb +23 -0
  285. data/lib/square/types/get_inventory_physical_count_request.rb +23 -0
  286. data/lib/square/types/get_inventory_transfer_request.rb +23 -0
  287. data/lib/square/types/get_location_request.rb +23 -0
  288. data/lib/square/types/get_loyalty_account_request.rb +23 -0
  289. data/lib/square/types/get_loyalty_program_request.rb +23 -0
  290. data/lib/square/types/get_loyalty_promotion_request.rb +23 -0
  291. data/lib/square/types/get_loyalty_reward_request.rb +23 -0
  292. data/lib/square/types/get_merchant_request.rb +23 -0
  293. data/lib/square/types/get_order_request.rb +23 -0
  294. data/lib/square/types/get_payment_link_request.rb +23 -0
  295. data/lib/square/types/get_snippet_request.rb +23 -0
  296. data/lib/square/types/get_team_member_booking_profile_request.rb +23 -0
  297. data/lib/square/types/get_team_member_booking_profile_response.rb +1 -3
  298. data/lib/square/types/get_team_member_request.rb +23 -0
  299. data/lib/square/types/get_transaction_request.rb +23 -0
  300. data/lib/square/types/get_vendor_request.rb +23 -0
  301. data/lib/square/types/get_wage_setting_request.rb +23 -0
  302. data/lib/square/types/get_webhook_subscription_request.rb +23 -0
  303. data/lib/square/types/get_webhook_subscription_response.rb +2 -1
  304. data/lib/square/types/gift_card_activity.rb +8 -24
  305. data/lib/square/types/gift_card_activity_block_reason.rb +23 -0
  306. data/lib/square/types/gift_card_activity_unblock_reason.rb +23 -0
  307. data/lib/square/types/gift_card_activity_updated_event.rb +2 -1
  308. data/lib/square/types/inventory_count_updated_event_object.rb +1 -3
  309. data/lib/square/types/invoice.rb +6 -13
  310. data/lib/square/types/invoice_accepted_payment_methods.rb +2 -1
  311. data/lib/square/types/invoice_attachment.rb +1 -1
  312. data/lib/square/types/invoice_custom_field.rb +2 -1
  313. data/lib/square/types/invoice_payment_made_event.rb +2 -1
  314. data/lib/square/types/invoice_payment_request.rb +6 -8
  315. data/lib/square/types/invoice_refunded_event.rb +2 -1
  316. data/lib/square/types/invoice_sort_field.rb +23 -0
  317. data/lib/square/types/labor_scheduled_shift_created_event_object.rb +1 -1
  318. data/lib/square/types/labor_scheduled_shift_published_event_object.rb +1 -1
  319. data/lib/square/types/labor_scheduled_shift_updated_event_object.rb +1 -1
  320. data/lib/square/types/list_bank_accounts_response.rb +1 -1
  321. data/lib/square/types/list_booking_custom_attribute_definitions_response.rb +4 -4
  322. data/lib/square/types/list_booking_custom_attributes_response.rb +3 -4
  323. data/lib/square/types/list_cash_drawer_shift_events_response.rb +1 -3
  324. data/lib/square/types/list_cash_drawer_shifts_response.rb +1 -3
  325. data/lib/square/types/list_channels_request_constants.rb +23 -0
  326. data/lib/square/types/list_customer_custom_attribute_definitions_response.rb +4 -4
  327. data/lib/square/types/list_customer_custom_attributes_response.rb +3 -4
  328. data/lib/square/types/list_gift_card_activities_response.rb +1 -3
  329. data/lib/square/types/list_location_booking_profiles_response.rb +1 -3
  330. data/lib/square/types/list_location_custom_attribute_definitions_response.rb +4 -4
  331. data/lib/square/types/list_location_custom_attributes_response.rb +3 -4
  332. data/lib/square/types/list_loyalty_promotions_response.rb +1 -3
  333. data/lib/square/types/list_merchant_custom_attribute_definitions_response.rb +4 -4
  334. data/lib/square/types/list_merchant_custom_attributes_response.rb +3 -4
  335. data/lib/square/types/list_order_custom_attribute_definitions_response.rb +1 -3
  336. data/lib/square/types/list_order_custom_attributes_response.rb +1 -3
  337. data/lib/square/types/list_subscription_events_response.rb +1 -3
  338. data/lib/square/types/list_team_member_booking_profiles_response.rb +1 -3
  339. data/lib/square/types/list_team_member_wages_response.rb +1 -3
  340. data/lib/square/types/list_webhook_subscriptions_response.rb +1 -3
  341. data/lib/square/types/list_workweek_configs_response.rb +1 -3
  342. data/lib/square/types/location.rb +1 -3
  343. data/lib/square/types/location_booking_profile.rb +2 -1
  344. data/lib/square/types/location_custom_attribute_visible_updated_event.rb +6 -3
  345. data/lib/square/types/loyalty_account.rb +1 -3
  346. data/lib/square/types/loyalty_account_mapping_type.rb +23 -0
  347. data/lib/square/types/loyalty_event.rb +3 -4
  348. data/lib/square/types/loyalty_event_filter.rb +1 -3
  349. data/lib/square/types/loyalty_program.rb +4 -7
  350. data/lib/square/types/loyalty_program_accrual_rule.rb +3 -4
  351. data/lib/square/types/loyalty_program_reward_tier.rb +3 -1
  352. data/lib/square/types/loyalty_promotion_incentive.rb +2 -6
  353. data/lib/square/types/loyalty_promotion_incentive_points_addition_data.rb +2 -1
  354. data/lib/square/types/loyalty_promotion_incentive_points_multiplier_data.rb +2 -1
  355. data/lib/square/types/loyalty_promotion_trigger_limit.rb +2 -1
  356. data/lib/square/types/loyalty_reward.rb +4 -2
  357. data/lib/square/types/measurement_unit_generic.rb +23 -0
  358. data/lib/square/types/oauth_authorization_revoked_event_object.rb +1 -3
  359. data/lib/square/types/oauth_authorization_revoked_event_revocation_object.rb +1 -3
  360. data/lib/square/types/order.rb +2 -6
  361. data/lib/square/types/order_card_surcharge_treatment_type.rb +12 -0
  362. data/lib/square/types/order_custom_attribute_definition_owned_created_event.rb +2 -1
  363. data/lib/square/types/order_custom_attribute_definition_owned_deleted_event.rb +2 -1
  364. data/lib/square/types/order_custom_attribute_definition_owned_updated_event.rb +2 -1
  365. data/lib/square/types/order_custom_attribute_definition_visible_created_event.rb +2 -1
  366. data/lib/square/types/order_custom_attribute_definition_visible_deleted_event.rb +2 -1
  367. data/lib/square/types/order_custom_attribute_definition_visible_updated_event.rb +2 -1
  368. data/lib/square/types/order_custom_attribute_owned_deleted_event.rb +2 -1
  369. data/lib/square/types/order_custom_attribute_owned_updated_event.rb +2 -1
  370. data/lib/square/types/order_custom_attribute_visible_deleted_event.rb +2 -1
  371. data/lib/square/types/order_custom_attribute_visible_updated_event.rb +2 -1
  372. data/lib/square/types/order_fulfillment_updated.rb +1 -3
  373. data/lib/square/types/order_line_item.rb +4 -12
  374. data/lib/square/types/order_line_item_applied_tax.rb +1 -0
  375. data/lib/square/types/order_line_item_pricing_blocklists.rb +3 -6
  376. data/lib/square/types/order_line_item_pricing_blocklists_blocked_service_charge.rb +14 -0
  377. data/lib/square/types/order_return.rb +3 -9
  378. data/lib/square/types/order_return_line_item.rb +4 -12
  379. data/lib/square/types/order_return_service_charge.rb +3 -6
  380. data/lib/square/types/order_service_charge.rb +2 -6
  381. data/lib/square/types/payment.rb +1 -3
  382. data/lib/square/types/payment_link_related_resources.rb +1 -3
  383. data/lib/square/types/payment_refund.rb +1 -3
  384. data/lib/square/types/payout_entry.rb +24 -72
  385. data/lib/square/types/pre_populated_data.rb +2 -1
  386. data/lib/square/types/product_type.rb +23 -0
  387. data/lib/square/types/refund.rb +1 -3
  388. data/lib/square/types/retrieve_booking_custom_attribute_definition_response.rb +4 -4
  389. data/lib/square/types/retrieve_booking_custom_attribute_response.rb +2 -1
  390. data/lib/square/types/retrieve_location_custom_attribute_definition_response.rb +4 -4
  391. data/lib/square/types/retrieve_location_custom_attribute_response.rb +2 -1
  392. data/lib/square/types/retrieve_merchant_custom_attribute_definition_response.rb +4 -4
  393. data/lib/square/types/retrieve_merchant_custom_attribute_response.rb +2 -1
  394. data/lib/square/types/retrieve_order_custom_attribute_definition_response.rb +1 -3
  395. data/lib/square/types/scheduled_shift_filter.rb +3 -7
  396. data/lib/square/types/scheduled_shift_workday.rb +1 -3
  397. data/lib/square/types/search_availability_filter.rb +1 -3
  398. data/lib/square/types/search_catalog_items_response.rb +2 -1
  399. data/lib/square/types/search_catalog_objects_response.rb +1 -3
  400. data/lib/square/types/search_events_sort_field.rb +23 -0
  401. data/lib/square/types/search_loyalty_accounts_request_loyalty_account_query.rb +1 -3
  402. data/lib/square/types/search_loyalty_accounts_response.rb +1 -3
  403. data/lib/square/types/search_orders_date_time_filter.rb +2 -1
  404. data/lib/square/types/search_orders_fulfillment_filter.rb +2 -6
  405. data/lib/square/types/search_orders_source_filter.rb +2 -0
  406. data/lib/square/types/search_scheduled_shifts_response.rb +1 -3
  407. data/lib/square/types/search_transfer_orders_response.rb +1 -3
  408. data/lib/square/types/shift_filter.rb +3 -2
  409. data/lib/square/types/shift_query.rb +2 -1
  410. data/lib/square/types/shift_sort.rb +2 -1
  411. data/lib/square/types/shift_wage.rb +2 -1
  412. data/lib/square/types/shift_workday.rb +2 -1
  413. data/lib/square/types/snippet.rb +2 -1
  414. data/lib/square/types/standard_unit_description_group.rb +1 -3
  415. data/lib/square/types/subscription_event.rb +1 -3
  416. data/lib/square/types/subscription_phase.rb +2 -1
  417. data/lib/square/types/subscription_test_result.rb +5 -3
  418. data/lib/square/types/team_member_assigned_locations.rb +1 -3
  419. data/lib/square/types/team_member_booking_profile.rb +2 -1
  420. data/lib/square/types/tender.rb +2 -6
  421. data/lib/square/types/tender_buy_now_pay_later_details.rb +1 -3
  422. data/lib/square/types/terminal_refund.rb +2 -1
  423. data/lib/square/types/test_webhook_subscription_response.rb +5 -5
  424. data/lib/square/types/timecard_filter.rb +1 -1
  425. data/lib/square/types/transfer_order.rb +1 -3
  426. data/lib/square/types/transfer_order_filter.rb +1 -3
  427. data/lib/square/types/transfer_order_goods_receipt.rb +1 -3
  428. data/lib/square/types/update_booking_custom_attribute_definition_response.rb +4 -4
  429. data/lib/square/types/update_customer_custom_attribute_definition_response.rb +4 -4
  430. data/lib/square/types/update_location_custom_attribute_definition_response.rb +4 -4
  431. data/lib/square/types/update_merchant_custom_attribute_definition_response.rb +4 -4
  432. data/lib/square/types/update_order_custom_attribute_definition_response.rb +1 -3
  433. data/lib/square/types/update_transfer_order_data.rb +1 -3
  434. data/lib/square/types/update_webhook_subscription_response.rb +2 -1
  435. data/lib/square/types/update_webhook_subscription_signature_key_response.rb +3 -1
  436. data/lib/square/types/upsert_booking_custom_attribute_response.rb +2 -1
  437. data/lib/square/types/upsert_catalog_object_response.rb +1 -3
  438. data/lib/square/types/upsert_customer_custom_attribute_response.rb +2 -1
  439. data/lib/square/types/upsert_location_custom_attribute_response.rb +2 -1
  440. data/lib/square/types/upsert_merchant_custom_attribute_response.rb +2 -1
  441. data/lib/square/types/v_1_get_payment_request.rb +23 -0
  442. data/lib/square/types/v_1_get_settlement_request.rb +23 -0
  443. data/lib/square/types/v_1_order.rb +1 -3
  444. data/lib/square/types/vendor_created_event_object_operation.rb +23 -0
  445. data/lib/square/types/vendor_updated_event_object_operation.rb +23 -0
  446. data/lib/square/types/wage_setting.rb +1 -3
  447. data/lib/square/v_1_transactions/client.rb +72 -29
  448. data/lib/square/vendors/client.rb +126 -51
  449. data/lib/square/vendors/types/batch_update_vendors_request.rb +1 -3
  450. data/lib/square/version.rb +1 -1
  451. data/lib/square/webhooks/client.rb +3 -1
  452. data/lib/square/webhooks/event_types/client.rb +25 -14
  453. data/lib/square/webhooks/subscriptions/client.rb +164 -69
  454. data/lib/square.rb +57 -5
  455. data/lib/square_legacy/utilities/webhooks_helper.rb +1 -1
  456. data/reference.md +29588 -0
  457. data/wiremock/docker-compose.test.yml +14 -0
  458. data/wiremock/wiremock-mappings.json +1 -0
  459. metadata +69 -45
  460. data/lib/square/mobile/client.rb +0 -50
  461. data/lib/square/mobile/types/create_mobile_authorization_code_request.rb +0 -11
  462. data/lib/square/types/create_mobile_authorization_code_response.rb +0 -13
  463. data/test/square/integration/client_tests/test_cash_drawers.rb +0 -27
  464. data/test/square/integration/client_tests/test_catalog.rb +0 -704
  465. data/test/square/integration/client_tests/test_customers.rb +0 -65
  466. data/test/square/integration/client_tests/test_customers_groups.rb +0 -144
  467. data/test/square/integration/client_tests/test_customers_segments.rb +0 -36
  468. data/test/square/integration/client_tests/test_devices.rb +0 -67
  469. data/test/square/integration/client_tests/test_inventory.rb +0 -28
  470. data/test/square/integration/client_tests/test_locations.rb +0 -18
  471. data/test/square/integration/client_tests/test_merchants.rb +0 -40
  472. data/test/square/integration/client_tests/test_mobile.rb +0 -21
  473. data/test/square/integration/client_tests/test_orders.rb +0 -177
  474. data/test/square/integration/client_tests/test_payments.rb +0 -167
  475. data/test/square/integration/client_tests/test_refunds.rb +0 -133
  476. data/test/square/integration/client_tests/test_team_members.rb +0 -97
  477. data/test/square/integration/client_tests/test_terminal.rb +0 -107
  478. data/test/square/integration/integration_test_base.rb +0 -16
  479. data/test/square/integration/testdata/image.jpeg +0 -0
  480. data/test/square/internal/multipart/test_form_data.rb +0 -311
  481. data/test/square/internal/types/test_array.rb +0 -37
  482. data/test/square/internal/types/test_boolean.rb +0 -35
  483. data/test/square/internal/types/test_enum.rb +0 -42
  484. data/test/square/internal/types/test_hash.rb +0 -50
  485. data/test/square/internal/types/test_model.rb +0 -105
  486. data/test/square/internal/types/test_union.rb +0 -52
  487. data/test/square/internal/types/test_utils.rb +0 -216
  488. data/test/square_legacy/api/api_test_base.rb +0 -27
  489. data/test/square_legacy/api/test_catalog_api.rb +0 -57
  490. data/test/square_legacy/api/test_customers_api.rb +0 -43
  491. data/test/square_legacy/api/test_employees_api.rb +0 -34
  492. data/test/square_legacy/api/test_labor_api.rb +0 -82
  493. data/test/square_legacy/api/test_locations_api.rb +0 -22
  494. data/test/square_legacy/api/test_merchants_api.rb +0 -38
  495. data/test/square_legacy/api/test_payments_api.rb +0 -40
  496. data/test/square_legacy/api/test_refunds_api.rb +0 -42
  497. data/test/square_legacy/http_response_catcher.rb +0 -14
  498. data/test/square_legacy/webhooks/test_webhooks_helper.rb +0 -153
  499. data/test/test_helper.rb +0 -123
@@ -2,7 +2,8 @@
2
2
 
3
3
  module Square
4
4
  module Types
5
- # Represents a payment refund processed by the Square Terminal. Only supports Interac (Canadian debit network) payment refunds.
5
+ # Represents a payment refund processed by the Square Terminal. Only supports Interac (Canadian debit network)
6
+ # payment refunds.
6
7
  class TerminalRefund < Internal::Types::Model
7
8
  field :id, -> { String }, optional: true, nullable: false
8
9
  field :refund_id, -> { String }, optional: true, nullable: false
@@ -2,14 +2,14 @@
2
2
 
3
3
  module Square
4
4
  module Types
5
- # Defines the fields that are included in the response body of
6
- # a request to the [TestWebhookSubscription](api-endpoint:WebhookSubscriptions-TestWebhookSubscription) endpoint.
7
- #
8
- # Note: If there are errors processing the request, the [SubscriptionTestResult](entity:SubscriptionTestResult) field is not
9
- # present.
5
+ # Defines the fields that are included in the response body of a request to the TestWebhookSubscription endpoint.
10
6
  class TestWebhookSubscriptionResponse < Internal::Types::Model
11
7
  field :errors, -> { Internal::Types::Array[Square::Types::Error] }, optional: true, nullable: false
12
8
  field :subscription_test_result, -> { Square::Types::SubscriptionTestResult }, optional: true, nullable: false
9
+ field :notification_url, -> { String }, optional: true, nullable: false
10
+ field :status_code, -> { Integer }, optional: true, nullable: false
11
+ field :passes_filter, -> { Internal::Types::Boolean }, optional: true, nullable: false
12
+ field :payload, -> { Internal::Types::Hash[String, Object] }, optional: true, nullable: false
13
13
  end
14
14
  end
15
15
  end
@@ -8,7 +8,7 @@ module Square
8
8
  field :location_ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false
9
9
  field :status, -> { Square::Types::TimecardFilterStatus }, optional: true, nullable: false
10
10
  field :start, -> { Square::Types::TimeRange }, optional: true, nullable: false
11
- field :end_, -> { Square::Types::TimeRange }, optional: true, nullable: false
11
+ field :end_, -> { Square::Types::TimeRange }, optional: true, nullable: false, api_name: "end"
12
12
  field :workday, -> { Square::Types::TimecardWorkday }, optional: true, nullable: false
13
13
  field :team_member_ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false
14
14
  end
@@ -28,9 +28,7 @@ module Square
28
28
  field :notes, -> { String }, optional: true, nullable: false
29
29
  field :tracking_number, -> { String }, optional: true, nullable: false
30
30
  field :created_by_team_member_id, -> { String }, optional: true, nullable: false
31
- field :line_items, lambda {
32
- Internal::Types::Array[Square::Types::TransferOrderLine]
33
- }, optional: true, nullable: false
31
+ field :line_items, -> { Internal::Types::Array[Square::Types::TransferOrderLine] }, optional: true, nullable: false
34
32
  field :version, -> { Integer }, optional: true, nullable: false
35
33
  end
36
34
  end
@@ -6,9 +6,7 @@ module Square
6
6
  class TransferOrderFilter < Internal::Types::Model
7
7
  field :source_location_ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false
8
8
  field :destination_location_ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false
9
- field :statuses, lambda {
10
- Internal::Types::Array[Square::Types::TransferOrderStatus]
11
- }, optional: true, nullable: false
9
+ field :statuses, -> { Internal::Types::Array[Square::Types::TransferOrderStatus] }, optional: true, nullable: false
12
10
  end
13
11
  end
14
12
  end
@@ -21,9 +21,7 @@ module Square
21
21
  # - Adjusts received quantities
22
22
  # - Updates inventory levels at both source and destination [Location](entity:Location)s
23
23
  class TransferOrderGoodsReceipt < Internal::Types::Model
24
- field :line_items, lambda {
25
- Internal::Types::Array[Square::Types::TransferOrderGoodsReceiptLineItem]
26
- }, optional: true, nullable: false
24
+ field :line_items, -> { Internal::Types::Array[Square::Types::TransferOrderGoodsReceiptLineItem] }, optional: true, nullable: false
27
25
  end
28
26
  end
29
27
  end
@@ -2,12 +2,12 @@
2
2
 
3
3
  module Square
4
4
  module Types
5
- # Represents an [UpdateBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-UpdateBookingCustomAttributeDefinition) response.
5
+ # Represents an
6
+ # [UpdateBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-UpdateBookingCustomAttributeDefinition)
7
+ # response.
6
8
  # Either `custom_attribute_definition` or `errors` is present in the response.
7
9
  class UpdateBookingCustomAttributeDefinitionResponse < Internal::Types::Model
8
- field :custom_attribute_definition, lambda {
9
- Square::Types::CustomAttributeDefinition
10
- }, optional: true, nullable: false
10
+ field :custom_attribute_definition, -> { Square::Types::CustomAttributeDefinition }, optional: true, nullable: false
11
11
  field :errors, -> { Internal::Types::Array[Square::Types::Error] }, optional: true, nullable: false
12
12
  end
13
13
  end
@@ -2,12 +2,12 @@
2
2
 
3
3
  module Square
4
4
  module Types
5
- # Represents an [UpdateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-UpdateCustomerCustomAttributeDefinition) response.
5
+ # Represents an
6
+ # [UpdateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-UpdateCustomerCustomAttributeDefinition)
7
+ # response.
6
8
  # Either `custom_attribute_definition` or `errors` is present in the response.
7
9
  class UpdateCustomerCustomAttributeDefinitionResponse < Internal::Types::Model
8
- field :custom_attribute_definition, lambda {
9
- Square::Types::CustomAttributeDefinition
10
- }, optional: true, nullable: false
10
+ field :custom_attribute_definition, -> { Square::Types::CustomAttributeDefinition }, optional: true, nullable: false
11
11
  field :errors, -> { Internal::Types::Array[Square::Types::Error] }, optional: true, nullable: false
12
12
  end
13
13
  end
@@ -2,12 +2,12 @@
2
2
 
3
3
  module Square
4
4
  module Types
5
- # Represents an [UpdateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-UpdateLocationCustomAttributeDefinition) response.
5
+ # Represents an
6
+ # [UpdateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-UpdateLocationCustomAttributeDefinition)
7
+ # response.
6
8
  # Either `custom_attribute_definition` or `errors` is present in the response.
7
9
  class UpdateLocationCustomAttributeDefinitionResponse < Internal::Types::Model
8
- field :custom_attribute_definition, lambda {
9
- Square::Types::CustomAttributeDefinition
10
- }, optional: true, nullable: false
10
+ field :custom_attribute_definition, -> { Square::Types::CustomAttributeDefinition }, optional: true, nullable: false
11
11
  field :errors, -> { Internal::Types::Array[Square::Types::Error] }, optional: true, nullable: false
12
12
  end
13
13
  end
@@ -2,12 +2,12 @@
2
2
 
3
3
  module Square
4
4
  module Types
5
- # Represents an [UpdateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-UpdateMerchantCustomAttributeDefinition) response.
5
+ # Represents an
6
+ # [UpdateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-UpdateMerchantCustomAttributeDefinition)
7
+ # response.
6
8
  # Either `custom_attribute_definition` or `errors` is present in the response.
7
9
  class UpdateMerchantCustomAttributeDefinitionResponse < Internal::Types::Model
8
- field :custom_attribute_definition, lambda {
9
- Square::Types::CustomAttributeDefinition
10
- }, optional: true, nullable: false
10
+ field :custom_attribute_definition, -> { Square::Types::CustomAttributeDefinition }, optional: true, nullable: false
11
11
  field :errors, -> { Internal::Types::Array[Square::Types::Error] }, optional: true, nullable: false
12
12
  end
13
13
  end
@@ -4,9 +4,7 @@ module Square
4
4
  module Types
5
5
  # Represents a response from updating an order custom attribute definition.
6
6
  class UpdateOrderCustomAttributeDefinitionResponse < Internal::Types::Model
7
- field :custom_attribute_definition, lambda {
8
- Square::Types::CustomAttributeDefinition
9
- }, optional: true, nullable: false
7
+ field :custom_attribute_definition, -> { Square::Types::CustomAttributeDefinition }, optional: true, nullable: false
10
8
  field :errors, -> { Internal::Types::Array[Square::Types::Error] }, optional: true, nullable: false
11
9
  end
12
10
  end
@@ -9,9 +9,7 @@ module Square
9
9
  field :expected_at, -> { String }, optional: true, nullable: false
10
10
  field :notes, -> { String }, optional: true, nullable: false
11
11
  field :tracking_number, -> { String }, optional: true, nullable: false
12
- field :line_items, lambda {
13
- Internal::Types::Array[Square::Types::UpdateTransferOrderLineData]
14
- }, optional: true, nullable: false
12
+ field :line_items, -> { Internal::Types::Array[Square::Types::UpdateTransferOrderLineData] }, optional: true, nullable: false
15
13
  end
16
14
  end
17
15
  end
@@ -3,7 +3,8 @@
3
3
  module Square
4
4
  module Types
5
5
  # Defines the fields that are included in the response body of
6
- # a request to the [UpdateWebhookSubscription](api-endpoint:WebhookSubscriptions-UpdateWebhookSubscription) endpoint.
6
+ # a request to the [UpdateWebhookSubscription](api-endpoint:WebhookSubscriptions-UpdateWebhookSubscription)
7
+ # endpoint.
7
8
  #
8
9
  # Note: If there are errors processing the request, the [Subscription](entity:WebhookSubscription) is not
9
10
  # present.
@@ -3,7 +3,9 @@
3
3
  module Square
4
4
  module Types
5
5
  # Defines the fields that are included in the response body of
6
- # a request to the [UpdateWebhookSubscriptionSignatureKey](api-endpoint:WebhookSubscriptions-UpdateWebhookSubscriptionSignatureKey) endpoint.
6
+ # a request to the
7
+ # [UpdateWebhookSubscriptionSignatureKey](api-endpoint:WebhookSubscriptions-UpdateWebhookSubscriptionSignatureKey)
8
+ # endpoint.
7
9
  #
8
10
  # Note: If there are errors processing the request, the [Subscription](entity:WebhookSubscription) is not
9
11
  # present.
@@ -2,7 +2,8 @@
2
2
 
3
3
  module Square
4
4
  module Types
5
- # Represents an [UpsertBookingCustomAttribute](api-endpoint:BookingCustomAttributes-UpsertBookingCustomAttribute) response.
5
+ # Represents an [UpsertBookingCustomAttribute](api-endpoint:BookingCustomAttributes-UpsertBookingCustomAttribute)
6
+ # response.
6
7
  # Either `custom_attribute_definition` or `errors` is present in the response.
7
8
  class UpsertBookingCustomAttributeResponse < Internal::Types::Model
8
9
  field :custom_attribute, -> { Square::Types::CustomAttribute }, optional: true, nullable: false
@@ -5,9 +5,7 @@ module Square
5
5
  class UpsertCatalogObjectResponse < Internal::Types::Model
6
6
  field :errors, -> { Internal::Types::Array[Square::Types::Error] }, optional: true, nullable: false
7
7
  field :catalog_object, -> { Square::Types::CatalogObject }, optional: true, nullable: false
8
- field :id_mappings, lambda {
9
- Internal::Types::Array[Square::Types::CatalogIdMapping]
10
- }, optional: true, nullable: false
8
+ field :id_mappings, -> { Internal::Types::Array[Square::Types::CatalogIdMapping] }, optional: true, nullable: false
11
9
  end
12
10
  end
13
11
  end
@@ -2,7 +2,8 @@
2
2
 
3
3
  module Square
4
4
  module Types
5
- # Represents an [UpsertCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-UpsertCustomerCustomAttribute) response.
5
+ # Represents an [UpsertCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-UpsertCustomerCustomAttribute)
6
+ # response.
6
7
  # Either `custom_attribute_definition` or `errors` is present in the response.
7
8
  class UpsertCustomerCustomAttributeResponse < Internal::Types::Model
8
9
  field :custom_attribute, -> { Square::Types::CustomAttribute }, optional: true, nullable: false
@@ -2,7 +2,8 @@
2
2
 
3
3
  module Square
4
4
  module Types
5
- # Represents an [UpsertLocationCustomAttribute](api-endpoint:LocationCustomAttributes-UpsertLocationCustomAttribute) response.
5
+ # Represents an [UpsertLocationCustomAttribute](api-endpoint:LocationCustomAttributes-UpsertLocationCustomAttribute)
6
+ # response.
6
7
  # Either `custom_attribute_definition` or `errors` is present in the response.
7
8
  class UpsertLocationCustomAttributeResponse < Internal::Types::Model
8
9
  field :custom_attribute, -> { Square::Types::CustomAttribute }, optional: true, nullable: false
@@ -2,7 +2,8 @@
2
2
 
3
3
  module Square
4
4
  module Types
5
- # Represents an [UpsertMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-UpsertMerchantCustomAttribute) response.
5
+ # Represents an [UpsertMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-UpsertMerchantCustomAttribute)
6
+ # response.
6
7
  # Either `custom_attribute_definition` or `errors` is present in the response.
7
8
  class UpsertMerchantCustomAttributeResponse < Internal::Types::Model
8
9
  field :custom_attribute, -> { Square::Types::CustomAttribute }, optional: true, nullable: false
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Square
4
+ module Types
5
+ module V1GetPaymentRequest
6
+ # V1GetPaymentRequest is an alias for Object
7
+
8
+ # @option str [String]
9
+ #
10
+ # @return [untyped]
11
+ def self.load(str)
12
+ ::JSON.parse(str)
13
+ end
14
+
15
+ # @option value [untyped]
16
+ #
17
+ # @return [String]
18
+ def self.dump(value)
19
+ ::JSON.generate(value)
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Square
4
+ module Types
5
+ module V1GetSettlementRequest
6
+ # V1GetSettlementRequest is an alias for Object
7
+
8
+ # @option str [String]
9
+ #
10
+ # @return [untyped]
11
+ def self.load(str)
12
+ ::JSON.parse(str)
13
+ end
14
+
15
+ # @option value [untyped]
16
+ #
17
+ # @return [String]
18
+ def self.dump(value)
19
+ ::JSON.generate(value)
20
+ end
21
+ end
22
+ end
23
+ end
@@ -25,9 +25,7 @@ module Square
25
25
  field :refunded_note, -> { String }, optional: true, nullable: false
26
26
  field :canceled_note, -> { String }, optional: true, nullable: false
27
27
  field :tender, -> { Square::Types::V1Tender }, optional: true, nullable: false
28
- field :order_history, lambda {
29
- Internal::Types::Array[Square::Types::V1OrderHistoryEntry]
30
- }, optional: true, nullable: false
28
+ field :order_history, -> { Internal::Types::Array[Square::Types::V1OrderHistoryEntry] }, optional: true, nullable: false
31
29
  field :promo_code, -> { String }, optional: true, nullable: false
32
30
  field :btc_receive_address, -> { String }, optional: true, nullable: false
33
31
  field :btc_price_satoshi, -> { Integer }, optional: true, nullable: false
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Square
4
+ module Types
5
+ module VendorCreatedEventObjectOperation
6
+ # VendorCreatedEventObjectOperation is an alias for Object
7
+
8
+ # @option str [String]
9
+ #
10
+ # @return [untyped]
11
+ def self.load(str)
12
+ ::JSON.parse(str)
13
+ end
14
+
15
+ # @option value [untyped]
16
+ #
17
+ # @return [String]
18
+ def self.dump(value)
19
+ ::JSON.generate(value)
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Square
4
+ module Types
5
+ module VendorUpdatedEventObjectOperation
6
+ # VendorUpdatedEventObjectOperation is an alias for Object
7
+
8
+ # @option str [String]
9
+ #
10
+ # @return [untyped]
11
+ def self.load(str)
12
+ ::JSON.parse(str)
13
+ end
14
+
15
+ # @option value [untyped]
16
+ #
17
+ # @return [String]
18
+ def self.dump(value)
19
+ ::JSON.generate(value)
20
+ end
21
+ end
22
+ end
23
+ end
@@ -6,9 +6,7 @@ module Square
6
6
  # for a [team member](entity:TeamMember).
7
7
  class WageSetting < Internal::Types::Model
8
8
  field :team_member_id, -> { String }, optional: true, nullable: false
9
- field :job_assignments, lambda {
10
- Internal::Types::Array[Square::Types::JobAssignment]
11
- }, optional: true, nullable: false
9
+ field :job_assignments, -> { Internal::Types::Array[Square::Types::JobAssignment] }, optional: true, nullable: false
12
10
  field :is_overtime_exempt, -> { Internal::Types::Boolean }, optional: true, nullable: false
13
11
  field :version, -> { Integer }, optional: true, nullable: false
14
12
  field :created_at, -> { String }, optional: true, nullable: false
@@ -3,86 +3,129 @@
3
3
  module Square
4
4
  module V1Transactions
5
5
  class Client
6
- # @return [Square::V1Transactions::Client]
6
+ # @param client [Square::Internal::Http::RawClient]
7
+ #
8
+ # @return [void]
7
9
  def initialize(client:)
8
10
  @client = client
9
11
  end
10
12
 
11
13
  # Provides summary information for a merchant's online store orders.
12
14
  #
15
+ # @param request_options [Hash]
16
+ # @param params [Hash]
17
+ # @option request_options [String] :base_url
18
+ # @option request_options [Hash{String => Object}] :additional_headers
19
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
20
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
21
+ # @option request_options [Integer] :timeout_in_seconds
22
+ # @option params [String] :location_id
23
+ # @option params [Square::Types::SortOrder, nil] :order
24
+ # @option params [Integer, nil] :limit
25
+ # @option params [String, nil] :batch_token
26
+ #
13
27
  # @return [Array[Square::Types::V1Order]]
14
28
  def v_1_list_orders(request_options: {}, **params)
15
- _query_param_names = [
16
- %w[order limit batch_token],
17
- %i[order limit batch_token]
18
- ].flatten
19
- _query = params.slice(*_query_param_names)
20
- params = params.except(*_query_param_names)
29
+ params = Square::Internal::Types::Utils.normalize_keys(params)
30
+ query_param_names = %i[order limit batch_token]
31
+ query_params = {}
32
+ query_params["order"] = params[:order] if params.key?(:order)
33
+ query_params["limit"] = params[:limit] if params.key?(:limit)
34
+ query_params["batch_token"] = params[:batch_token] if params.key?(:batch_token)
35
+ params = params.except(*query_param_names)
21
36
 
22
- _request = Square::Internal::JSON::Request.new(
23
- base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
37
+ request = Square::Internal::JSON::Request.new(
38
+ base_url: request_options[:base_url],
24
39
  method: "GET",
25
40
  path: "v1/#{params[:location_id]}/orders",
26
- query: _query
41
+ query: query_params,
42
+ request_options: request_options
27
43
  )
28
44
  begin
29
- _response = @client.send(_request)
45
+ response = @client.send(request)
30
46
  rescue Net::HTTPRequestTimeout
31
47
  raise Square::Errors::TimeoutError
32
48
  end
33
- code = _response.code.to_i
49
+ code = response.code.to_i
34
50
  return if code.between?(200, 299)
35
51
 
36
52
  error_class = Square::Errors::ResponseError.subclass_for_code(code)
37
- raise error_class.new(_response.body, code: code)
53
+ raise error_class.new(response.body, code: code)
38
54
  end
39
55
 
40
56
  # Provides comprehensive information for a single online store order, including the order's history.
41
57
  #
58
+ # @param request_options [Hash]
59
+ # @param params [Hash]
60
+ # @option request_options [String] :base_url
61
+ # @option request_options [Hash{String => Object}] :additional_headers
62
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
63
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
64
+ # @option request_options [Integer] :timeout_in_seconds
65
+ # @option params [String] :location_id
66
+ # @option params [String] :order_id
67
+ #
42
68
  # @return [Square::Types::V1Order]
43
69
  def v_1_retrieve_order(request_options: {}, **params)
44
- _request = Square::Internal::JSON::Request.new(
45
- base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
70
+ params = Square::Internal::Types::Utils.normalize_keys(params)
71
+ request = Square::Internal::JSON::Request.new(
72
+ base_url: request_options[:base_url],
46
73
  method: "GET",
47
- path: "v1/#{params[:location_id]}/orders/#{params[:order_id]}"
74
+ path: "v1/#{params[:location_id]}/orders/#{params[:order_id]}",
75
+ request_options: request_options
48
76
  )
49
77
  begin
50
- _response = @client.send(_request)
78
+ response = @client.send(request)
51
79
  rescue Net::HTTPRequestTimeout
52
80
  raise Square::Errors::TimeoutError
53
81
  end
54
- code = _response.code.to_i
82
+ code = response.code.to_i
55
83
  if code.between?(200, 299)
56
- Square::Types::V1Order.load(_response.body)
84
+ Square::Types::V1Order.load(response.body)
57
85
  else
58
86
  error_class = Square::Errors::ResponseError.subclass_for_code(code)
59
- raise error_class.new(_response.body, code: code)
87
+ raise error_class.new(response.body, code: code)
60
88
  end
61
89
  end
62
90
 
63
- # Updates the details of an online store order. Every update you perform on an order corresponds to one of three actions:
91
+ # Updates the details of an online store order. Every update you perform on an order corresponds to one of three
92
+ # actions:
93
+ #
94
+ # @param request_options [Hash]
95
+ # @param params [Square::V1Transactions::Types::V1UpdateOrderRequest]
96
+ # @option request_options [String] :base_url
97
+ # @option request_options [Hash{String => Object}] :additional_headers
98
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
99
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
100
+ # @option request_options [Integer] :timeout_in_seconds
101
+ # @option params [String] :location_id
102
+ # @option params [String] :order_id
64
103
  #
65
104
  # @return [Square::Types::V1Order]
66
105
  def v_1_update_order(request_options: {}, **params)
67
- _path_param_names = %w[location_id order_id]
106
+ params = Square::Internal::Types::Utils.normalize_keys(params)
107
+ request_data = Square::V1Transactions::Types::V1UpdateOrderRequest.new(params).to_h
108
+ non_body_param_names = %w[location_id order_id]
109
+ body = request_data.except(*non_body_param_names)
68
110
 
69
- _request = Square::Internal::JSON::Request.new(
70
- base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
111
+ request = Square::Internal::JSON::Request.new(
112
+ base_url: request_options[:base_url],
71
113
  method: "PUT",
72
114
  path: "v1/#{params[:location_id]}/orders/#{params[:order_id]}",
73
- body: params.except(*_path_param_names)
115
+ body: body,
116
+ request_options: request_options
74
117
  )
75
118
  begin
76
- _response = @client.send(_request)
119
+ response = @client.send(request)
77
120
  rescue Net::HTTPRequestTimeout
78
121
  raise Square::Errors::TimeoutError
79
122
  end
80
- code = _response.code.to_i
123
+ code = response.code.to_i
81
124
  if code.between?(200, 299)
82
- Square::Types::V1Order.load(_response.body)
125
+ Square::Types::V1Order.load(response.body)
83
126
  else
84
127
  error_class = Square::Errors::ResponseError.subclass_for_code(code)
85
- raise error_class.new(_response.body, code: code)
128
+ raise error_class.new(response.body, code: code)
86
129
  end
87
130
  end
88
131
  end