square.rb 6.4.0.20200923 → 6.5.0.20201028

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +31 -30
  3. data/lib/square.rb +61 -61
  4. data/lib/square/api/apple_pay_api.rb +3 -1
  5. data/lib/square/api/bank_accounts_api.rb +12 -15
  6. data/lib/square/api/base_api.rb +1 -1
  7. data/lib/square/api/cash_drawers_api.rb +11 -5
  8. data/lib/square/api/catalog_api.rb +47 -25
  9. data/lib/square/api/checkout_api.rb +4 -2
  10. data/lib/square/api/customer_groups_api.rb +18 -8
  11. data/lib/square/api/customer_segments_api.rb +7 -3
  12. data/lib/square/api/customers_api.rb +47 -27
  13. data/lib/square/api/devices_api.rb +17 -6
  14. data/lib/square/api/disputes_api.rb +37 -19
  15. data/lib/square/api/employees_api.rb +7 -3
  16. data/lib/square/api/inventory_api.rb +25 -11
  17. data/lib/square/api/invoices_api.rb +29 -13
  18. data/lib/square/api/labor_api.rb +57 -25
  19. data/lib/square/api/locations_api.rb +16 -13
  20. data/lib/square/api/loyalty_api.rb +59 -65
  21. data/lib/square/api/merchants_api.rb +7 -3
  22. data/lib/square/api/mobile_authorization_api.rb +3 -1
  23. data/lib/square/api/o_auth_api.rb +10 -4
  24. data/lib/square/api/orders_api.rb +55 -8
  25. data/lib/square/api/payments_api.rb +68 -55
  26. data/lib/square/api/refunds_api.rb +12 -6
  27. data/lib/square/api/subscriptions_api.rb +22 -10
  28. data/lib/square/api/team_api.rb +32 -16
  29. data/lib/square/api/terminal_api.rb +156 -7
  30. data/lib/square/api/transactions_api.rb +32 -18
  31. data/lib/square/api/v1_employees_api.rb +59 -27
  32. data/lib/square/api/v1_items_api.rb +195 -115
  33. data/lib/square/api/v1_locations_api.rb +6 -2
  34. data/lib/square/api/v1_transactions_api.rb +49 -27
  35. data/lib/square/api_helper.rb +14 -9
  36. data/lib/square/client.rb +2 -2
  37. data/lib/square/configuration.rb +1 -1
  38. data/lib/square/http/api_response.rb +2 -0
  39. data/lib/square/http/faraday_client.rb +1 -0
  40. data/spec/user_journey_spec.rb +2 -5
  41. data/test/api/test_locations_api.rb +1 -1
  42. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ff331317ad3b1bea0c21cf6a6cc9bfd0b46296890792bf0f5d19d21be6ea8ddb
4
- data.tar.gz: dbf543ea3a0ebd7a70cd04e754ffc843d13575899c7e0fe1697c0a538d68fa0c
3
+ metadata.gz: e89b291628ca9e34dd317c1cabd319b96d3e7861de70eb8e9b1e006f521bd9e7
4
+ data.tar.gz: 316cd50188c224693b87df34043991a7cea712cfdc22814d08b90268924bd85b
5
5
  SHA512:
6
- metadata.gz: 15818b53efa7435cc292b14f3d504feef1ab423e3edafdba332694ad229910d8400eb08e6ba67906c19629ac2ecdc9a76251d29f85790fb3046a115aca3a566c
7
- data.tar.gz: 749326579ee962e569e387f932af7176f0137e6f6b175e7392bfa9b8e19e872092f34b7f2097fa9ce9d21cd744c2837cd23015e5c826b50510664887bd9ee546
6
+ metadata.gz: 7d3b58b7592ba99f662b7e6601f9eee48535fa61a5009c159d05a21080e75b5af4f182ba7907e6350830400790fcd802531a62b5130da19392e95e6c8af9322f
7
+ data.tar.gz: abf4ab1de91013ea370e77fa7186a2f9436831b2611d6bc574d1c1401c6f2d99676c5984c37a5024f5bbd231799b4d4a599bdc43b00557a213f8191a7039cc65
data/README.md CHANGED
@@ -280,38 +280,39 @@ The Square Platform is built on the [Square API]. Square has a number of other S
280
280
 
281
281
  You can also use the Square API to create applications or services that work with payments, orders, inventory, etc. that have been created and managed in Square’s in-person hardware products (Square Point of Sale and Square Register).
282
282
 
283
+ [//]: # "Link anchor definitions"
283
284
  [Square Logo]: https://docs.connect.squareup.com/images/github/github-square-logo.svg
284
285
  [Developer Dashboard]: https://developer.squareup.com/apps
285
286
  [Square API]: https://squareup.com/developers
286
287
  [sign up for a developer account]: https://squareup.com/signup?v=developers
287
288
  [Client]: doc/client.md
288
- [Devices]: doc/devices.md
289
- [Disputes]: doc/disputes.md
290
- [Terminal]: doc/terminal.md
291
- [Team]: doc/team.md
292
- [Cash Drawers]: doc/cash-drawers.md
293
- [Customer Groups]: doc/customer-groups.md
294
- [Customer Segments]: doc/customer-segments.md
295
- [Bank Accounts]: doc/bank-accounts
296
- [Payments]: doc/payments.md
297
- [Checkout]: doc/checkout.md
298
- [Catalog]: doc/catalog.md
299
- [Customers]: doc/customers.md
300
- [Employees]: doc/employees.md
301
- [Inventory]: doc/inventory.md
302
- [Labor]: doc/labor.md
303
- [Loyalty]: doc/loyalty.md
304
- [Locations]: doc/locations.md
305
- [Merchants]: doc/merchants.md
306
- [Orders]: doc/orders.md
307
- [Invoices]: doc/invoices.md
308
- [Apple Pay]: doc/apple-pay.md
309
- [Refunds]: doc/refunds.md
310
- [Mobile Authorization]: doc/mobile-authorization.md
311
- [O Auth]: doc/o-auth.md
312
- [V1 Locations]: doc/v1-locations.md
313
- [V1 Employees]: doc/v1-employees.md
314
- [V1 Transactions]: doc/v1-transactions.md
315
- [V1 Items]: doc/v1-items.md
316
- [Transactions]: doc/transactions.md
317
- [Subscriptions]: doc/subscriptions.md
289
+ [Devices]: doc/apis/devices.md
290
+ [Disputes]: doc/apis/disputes.md
291
+ [Terminal]: doc/apis/terminal.md
292
+ [Team]: doc/apis/team.md
293
+ [Cash Drawers]: doc/apis/cash-drawers.md
294
+ [Customer Groups]: doc/apis/customer-groups.md
295
+ [Customer Segments]: doc/apis/customer-segments.md
296
+ [Bank Accounts]: doc/apis/bank-accounts
297
+ [Payments]: doc/apis/payments.md
298
+ [Checkout]: doc/apis/checkout.md
299
+ [Catalog]: doc/apis/catalog.md
300
+ [Customers]: doc/apis/customers.md
301
+ [Employees]: doc/apis/employees.md
302
+ [Inventory]: doc/apis/inventory.md
303
+ [Labor]: doc/apis/labor.md
304
+ [Loyalty]: doc/apis/loyalty.md
305
+ [Locations]: doc/apis/locations.md
306
+ [Merchants]: doc/apis/merchants.md
307
+ [Orders]: doc/apis/orders.md
308
+ [Invoices]: doc/apis/invoices.md
309
+ [Apple Pay]: doc/apis/apple-pay.md
310
+ [Refunds]: doc/apis/refunds.md
311
+ [Subscriptions]: doc/apis/subscriptions.md
312
+ [Mobile Authorization]: doc/apis/mobile-authorization.md
313
+ [O Auth]: doc/apis/o-auth.md
314
+ [V1 Locations]: doc/apis/v1-locations.md
315
+ [V1 Employees]: doc/apis/v1-employees.md
316
+ [V1 Transactions]: doc/apis/v1-transactions.md
317
+ [V1 Items]: doc/apis/v1-items.md
318
+ [Transactions]: doc/apis/transactions.md
@@ -1,61 +1,61 @@
1
- require 'date'
2
- require 'json'
3
- require 'faraday'
4
- require 'certifi'
5
- require 'logging'
6
-
7
- require_relative 'square/api_helper.rb'
8
- require_relative 'square/client.rb'
9
-
10
- # Utilities
11
- require_relative 'square/utilities/file_wrapper.rb'
12
-
13
- # Http
14
- require_relative 'square/http/api_response.rb'
15
- require_relative 'square/http/http_call_back.rb'
16
- require_relative 'square/http/http_client.rb'
17
- require_relative 'square/http/faraday_client.rb'
18
- require_relative 'square/http/http_method_enum.rb'
19
- require_relative 'square/http/http_request.rb'
20
- require_relative 'square/http/http_response.rb'
21
- require_relative 'square/http/auth/o_auth2.rb'
22
-
23
- # Models
24
-
25
- # Exceptions
26
- require_relative 'square/exceptions/api_exception.rb'
27
-
28
- require_relative 'square/configuration.rb'
29
-
30
- # Controllers
31
- require_relative 'square/api/base_api.rb'
32
- require_relative 'square/api/mobile_authorization_api.rb'
33
- require_relative 'square/api/o_auth_api.rb'
34
- require_relative 'square/api/v1_locations_api.rb'
35
- require_relative 'square/api/v1_employees_api.rb'
36
- require_relative 'square/api/v1_transactions_api.rb'
37
- require_relative 'square/api/v1_items_api.rb'
38
- require_relative 'square/api/apple_pay_api.rb'
39
- require_relative 'square/api/bank_accounts_api.rb'
40
- require_relative 'square/api/cash_drawers_api.rb'
41
- require_relative 'square/api/catalog_api.rb'
42
- require_relative 'square/api/customers_api.rb'
43
- require_relative 'square/api/customer_groups_api.rb'
44
- require_relative 'square/api/customer_segments_api.rb'
45
- require_relative 'square/api/devices_api.rb'
46
- require_relative 'square/api/disputes_api.rb'
47
- require_relative 'square/api/employees_api.rb'
48
- require_relative 'square/api/inventory_api.rb'
49
- require_relative 'square/api/invoices_api.rb'
50
- require_relative 'square/api/labor_api.rb'
51
- require_relative 'square/api/locations_api.rb'
52
- require_relative 'square/api/checkout_api.rb'
53
- require_relative 'square/api/transactions_api.rb'
54
- require_relative 'square/api/loyalty_api.rb'
55
- require_relative 'square/api/merchants_api.rb'
56
- require_relative 'square/api/orders_api.rb'
57
- require_relative 'square/api/payments_api.rb'
58
- require_relative 'square/api/refunds_api.rb'
59
- require_relative 'square/api/subscriptions_api.rb'
60
- require_relative 'square/api/team_api.rb'
61
- require_relative 'square/api/terminal_api.rb'
1
+ require 'date'
2
+ require 'json'
3
+ require 'faraday'
4
+ require 'certifi'
5
+ require 'logging'
6
+
7
+ require_relative 'square/api_helper.rb'
8
+ require_relative 'square/client.rb'
9
+
10
+ # Utilities
11
+ require_relative 'square/utilities/file_wrapper.rb'
12
+
13
+ # Http
14
+ require_relative 'square/http/api_response.rb'
15
+ require_relative 'square/http/http_call_back.rb'
16
+ require_relative 'square/http/http_client.rb'
17
+ require_relative 'square/http/faraday_client.rb'
18
+ require_relative 'square/http/http_method_enum.rb'
19
+ require_relative 'square/http/http_request.rb'
20
+ require_relative 'square/http/http_response.rb'
21
+ require_relative 'square/http/auth/o_auth2.rb'
22
+
23
+ # Models
24
+
25
+ # Exceptions
26
+ require_relative 'square/exceptions/api_exception.rb'
27
+
28
+ require_relative 'square/configuration.rb'
29
+
30
+ # Controllers
31
+ require_relative 'square/api/base_api.rb'
32
+ require_relative 'square/api/mobile_authorization_api.rb'
33
+ require_relative 'square/api/o_auth_api.rb'
34
+ require_relative 'square/api/v1_locations_api.rb'
35
+ require_relative 'square/api/v1_employees_api.rb'
36
+ require_relative 'square/api/v1_transactions_api.rb'
37
+ require_relative 'square/api/v1_items_api.rb'
38
+ require_relative 'square/api/apple_pay_api.rb'
39
+ require_relative 'square/api/bank_accounts_api.rb'
40
+ require_relative 'square/api/cash_drawers_api.rb'
41
+ require_relative 'square/api/catalog_api.rb'
42
+ require_relative 'square/api/customers_api.rb'
43
+ require_relative 'square/api/customer_groups_api.rb'
44
+ require_relative 'square/api/customer_segments_api.rb'
45
+ require_relative 'square/api/devices_api.rb'
46
+ require_relative 'square/api/disputes_api.rb'
47
+ require_relative 'square/api/employees_api.rb'
48
+ require_relative 'square/api/inventory_api.rb'
49
+ require_relative 'square/api/invoices_api.rb'
50
+ require_relative 'square/api/labor_api.rb'
51
+ require_relative 'square/api/locations_api.rb'
52
+ require_relative 'square/api/checkout_api.rb'
53
+ require_relative 'square/api/transactions_api.rb'
54
+ require_relative 'square/api/loyalty_api.rb'
55
+ require_relative 'square/api/merchants_api.rb'
56
+ require_relative 'square/api/orders_api.rb'
57
+ require_relative 'square/api/payments_api.rb'
58
+ require_relative 'square/api/refunds_api.rb'
59
+ require_relative 'square/api/subscriptions_api.rb'
60
+ require_relative 'square/api/team_api.rb'
61
+ require_relative 'square/api/terminal_api.rb'
@@ -44,7 +44,9 @@ module Square
44
44
  # Return appropriate response type.
45
45
  decoded = APIHelper.json_deserialize(_response.raw_body)
46
46
  _errors = APIHelper.map_response(decoded, ['errors'])
47
- ApiResponse.new(_response, data: decoded, errors: _errors)
47
+ ApiResponse.new(
48
+ _response, data: decoded, errors: _errors
49
+ )
48
50
  end
49
51
  end
50
52
  end
@@ -7,9 +7,6 @@ module Square
7
7
 
8
8
  # Returns a list of [BankAccount](#type-bankaccount) objects linked to a
9
9
  # Square account.
10
- # For more information, see
11
- # [Bank Accounts
12
- # API](https://developer.squareup.com/docs/docs/bank-accounts-api).
13
10
  # @param [String] cursor Optional parameter: The pagination cursor returned
14
11
  # by a previous call to this endpoint. Use it in the next `ListBankAccounts`
15
12
  # request to retrieve the next set of results. See the
@@ -53,15 +50,13 @@ module Square
53
50
  # Return appropriate response type.
54
51
  decoded = APIHelper.json_deserialize(_response.raw_body)
55
52
  _errors = APIHelper.map_response(decoded, ['errors'])
56
- ApiResponse.new(_response, data: decoded, errors: _errors)
53
+ ApiResponse.new(
54
+ _response, data: decoded, errors: _errors
55
+ )
57
56
  end
58
57
 
59
58
  # Returns details of a [BankAccount](#type-bankaccount) identified by V1
60
59
  # bank account ID.
61
- # For more information, see
62
- # [Retrieve a bank account by using an ID issued by V1 Bank Accounts
63
- # API](https://developer.squareup.com/docs/docs/bank-accounts-api#retrieve-a
64
- # -bank-account-by-using-an-id-issued-by-the-v1-bank-accounts-api).
65
60
  # @param [String] v1_bank_account_id Required parameter: Connect V1 ID of
66
61
  # the desired `BankAccount`. For more information, see [Retrieve a bank
67
62
  # account by using an ID issued by V1 Bank Accounts
@@ -74,7 +69,7 @@ module Square
74
69
  _query_builder << '/v2/bank-accounts/by-v1-id/{v1_bank_account_id}'
75
70
  _query_builder = APIHelper.append_url_with_template_parameters(
76
71
  _query_builder,
77
- 'v1_bank_account_id' => v1_bank_account_id
72
+ 'v1_bank_account_id' => { 'value' => v1_bank_account_id, 'encode' => true }
78
73
  )
79
74
  _query_url = APIHelper.clean_url _query_builder
80
75
 
@@ -94,13 +89,13 @@ module Square
94
89
  # Return appropriate response type.
95
90
  decoded = APIHelper.json_deserialize(_response.raw_body)
96
91
  _errors = APIHelper.map_response(decoded, ['errors'])
97
- ApiResponse.new(_response, data: decoded, errors: _errors)
92
+ ApiResponse.new(
93
+ _response, data: decoded, errors: _errors
94
+ )
98
95
  end
99
96
 
100
97
  # Returns details of a [BankAccount](#type-bankaccount)
101
- # linked to a Square account. For more information, see
102
- # [Bank Accounts
103
- # API](https://developer.squareup.com/docs/docs/bank-accounts-api).
98
+ # linked to a Square account.
104
99
  # @param [String] bank_account_id Required parameter: Square-issued ID of
105
100
  # the desired `BankAccount`.
106
101
  # @return [GetBankAccountResponse Hash] response from the API call
@@ -110,7 +105,7 @@ module Square
110
105
  _query_builder << '/v2/bank-accounts/{bank_account_id}'
111
106
  _query_builder = APIHelper.append_url_with_template_parameters(
112
107
  _query_builder,
113
- 'bank_account_id' => bank_account_id
108
+ 'bank_account_id' => { 'value' => bank_account_id, 'encode' => true }
114
109
  )
115
110
  _query_url = APIHelper.clean_url _query_builder
116
111
 
@@ -130,7 +125,9 @@ module Square
130
125
  # Return appropriate response type.
131
126
  decoded = APIHelper.json_deserialize(_response.raw_body)
132
127
  _errors = APIHelper.map_response(decoded, ['errors'])
133
- ApiResponse.new(_response, data: decoded, errors: _errors)
128
+ ApiResponse.new(
129
+ _response, data: decoded, errors: _errors
130
+ )
134
131
  end
135
132
  end
136
133
  end
@@ -8,7 +8,7 @@ module Square
8
8
  @http_call_back = http_call_back
9
9
 
10
10
  @global_headers = {
11
- 'user-agent' => 'Square-Ruby-SDK/6.4.0.20200923',
11
+ 'user-agent' => 'Square-Ruby-SDK/6.5.0.20201028',
12
12
  'Square-Version' => config.square_version
13
13
  }
14
14
  end
@@ -57,7 +57,9 @@ module Square
57
57
  # Return appropriate response type.
58
58
  decoded = APIHelper.json_deserialize(_response.raw_body)
59
59
  _errors = APIHelper.map_response(decoded, ['errors'])
60
- ApiResponse.new(_response, data: decoded, errors: _errors)
60
+ ApiResponse.new(
61
+ _response, data: decoded, errors: _errors
62
+ )
61
63
  end
62
64
 
63
65
  # Provides the summary details for a single cash drawer shift. See
@@ -73,7 +75,7 @@ module Square
73
75
  _query_builder << '/v2/cash-drawers/shifts/{shift_id}'
74
76
  _query_builder = APIHelper.append_url_with_template_parameters(
75
77
  _query_builder,
76
- 'shift_id' => shift_id
78
+ 'shift_id' => { 'value' => shift_id, 'encode' => true }
77
79
  )
78
80
  _query_builder = APIHelper.append_url_with_query_parameters(
79
81
  _query_builder,
@@ -97,7 +99,9 @@ module Square
97
99
  # Return appropriate response type.
98
100
  decoded = APIHelper.json_deserialize(_response.raw_body)
99
101
  _errors = APIHelper.map_response(decoded, ['errors'])
100
- ApiResponse.new(_response, data: decoded, errors: _errors)
102
+ ApiResponse.new(
103
+ _response, data: decoded, errors: _errors
104
+ )
101
105
  end
102
106
 
103
107
  # Provides a paginated list of events for a single cash drawer shift.
@@ -118,7 +122,7 @@ module Square
118
122
  _query_builder << '/v2/cash-drawers/shifts/{shift_id}/events'
119
123
  _query_builder = APIHelper.append_url_with_template_parameters(
120
124
  _query_builder,
121
- 'shift_id' => shift_id
125
+ 'shift_id' => { 'value' => shift_id, 'encode' => true }
122
126
  )
123
127
  _query_builder = APIHelper.append_url_with_query_parameters(
124
128
  _query_builder,
@@ -144,7 +148,9 @@ module Square
144
148
  # Return appropriate response type.
145
149
  decoded = APIHelper.json_deserialize(_response.raw_body)
146
150
  _errors = APIHelper.map_response(decoded, ['errors'])
147
- ApiResponse.new(_response, data: decoded, errors: _errors)
151
+ ApiResponse.new(
152
+ _response, data: decoded, errors: _errors
153
+ )
148
154
  end
149
155
  end
150
156
  end
@@ -44,7 +44,9 @@ module Square
44
44
  # Return appropriate response type.
45
45
  decoded = APIHelper.json_deserialize(_response.raw_body)
46
46
  _errors = APIHelper.map_response(decoded, ['errors'])
47
- ApiResponse.new(_response, data: decoded, errors: _errors)
47
+ ApiResponse.new(
48
+ _response, data: decoded, errors: _errors
49
+ )
48
50
  end
49
51
 
50
52
  # Returns a set of objects based on the provided ID.
@@ -83,7 +85,9 @@ module Square
83
85
  # Return appropriate response type.
84
86
  decoded = APIHelper.json_deserialize(_response.raw_body)
85
87
  _errors = APIHelper.map_response(decoded, ['errors'])
86
- ApiResponse.new(_response, data: decoded, errors: _errors)
88
+ ApiResponse.new(
89
+ _response, data: decoded, errors: _errors
90
+ )
87
91
  end
88
92
 
89
93
  # Creates or updates up to 10,000 target objects based on the provided
@@ -128,10 +132,12 @@ module Square
128
132
  # Return appropriate response type.
129
133
  decoded = APIHelper.json_deserialize(_response.raw_body)
130
134
  _errors = APIHelper.map_response(decoded, ['errors'])
131
- ApiResponse.new(_response, data: decoded, errors: _errors)
135
+ ApiResponse.new(
136
+ _response, data: decoded, errors: _errors
137
+ )
132
138
  end
133
139
 
134
- # Uploads an image file to be represented by an
140
+ # Uploads an image file to be represented by a
135
141
  # [CatalogImage](#type-catalogimage) object linked to an existing
136
142
  # [CatalogObject](#type-catalogobject) instance. A call to this endpoint can
137
143
  # upload an image, link an image to
@@ -139,10 +145,6 @@ module Square
139
145
  # This `CreateCatalogImage` endpoint accepts HTTP multipart/form-data
140
146
  # requests with a JSON part and an image file part in
141
147
  # JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB.
142
- # Additional information and an example cURL request can be found in the
143
- # [Create a Catalog Image
144
- # recipe](https://developer.squareup.com/docs/more-apis/catalog/cookbook/cre
145
- # ate-catalog-images).
146
148
  # @param [CreateCatalogImageRequest] request Optional parameter: Example:
147
149
  # @param [File | UploadIO] image_file Optional parameter: Example:
148
150
  # @return [CreateCatalogImageResponse Hash] response from the API call
@@ -191,7 +193,9 @@ module Square
191
193
  # Return appropriate response type.
192
194
  decoded = APIHelper.json_deserialize(_response.raw_body)
193
195
  _errors = APIHelper.map_response(decoded, ['errors'])
194
- ApiResponse.new(_response, data: decoded, errors: _errors)
196
+ ApiResponse.new(
197
+ _response, data: decoded, errors: _errors
198
+ )
195
199
  end
196
200
 
197
201
  # Retrieves information about the Square Catalog API, such as batch size
@@ -219,7 +223,9 @@ module Square
219
223
  # Return appropriate response type.
220
224
  decoded = APIHelper.json_deserialize(_response.raw_body)
221
225
  _errors = APIHelper.map_response(decoded, ['errors'])
222
- ApiResponse.new(_response, data: decoded, errors: _errors)
226
+ ApiResponse.new(
227
+ _response, data: decoded, errors: _errors
228
+ )
223
229
  end
224
230
 
225
231
  # Returns a list of [CatalogObject](#type-catalogobject)s that includes
@@ -274,7 +280,9 @@ module Square
274
280
  # Return appropriate response type.
275
281
  decoded = APIHelper.json_deserialize(_response.raw_body)
276
282
  _errors = APIHelper.map_response(decoded, ['errors'])
277
- ApiResponse.new(_response, data: decoded, errors: _errors)
283
+ ApiResponse.new(
284
+ _response, data: decoded, errors: _errors
285
+ )
278
286
  end
279
287
 
280
288
  # Creates or updates the target [CatalogObject](#type-catalogobject).
@@ -306,7 +314,9 @@ module Square
306
314
  # Return appropriate response type.
307
315
  decoded = APIHelper.json_deserialize(_response.raw_body)
308
316
  _errors = APIHelper.map_response(decoded, ['errors'])
309
- ApiResponse.new(_response, data: decoded, errors: _errors)
317
+ ApiResponse.new(
318
+ _response, data: decoded, errors: _errors
319
+ )
310
320
  end
311
321
 
312
322
  # Deletes a single [CatalogObject](#type-catalogobject) based on the
@@ -328,7 +338,7 @@ module Square
328
338
  _query_builder << '/v2/catalog/object/{object_id}'
329
339
  _query_builder = APIHelper.append_url_with_template_parameters(
330
340
  _query_builder,
331
- 'object_id' => object_id
341
+ 'object_id' => { 'value' => object_id, 'encode' => true }
332
342
  )
333
343
  _query_url = APIHelper.clean_url _query_builder
334
344
 
@@ -348,7 +358,9 @@ module Square
348
358
  # Return appropriate response type.
349
359
  decoded = APIHelper.json_deserialize(_response.raw_body)
350
360
  _errors = APIHelper.map_response(decoded, ['errors'])
351
- ApiResponse.new(_response, data: decoded, errors: _errors)
361
+ ApiResponse.new(
362
+ _response, data: decoded, errors: _errors
363
+ )
352
364
  end
353
365
 
354
366
  # Returns a single [CatalogItem](#type-catalogitem) as a
@@ -364,12 +376,12 @@ module Square
364
376
  # @param [Boolean] include_related_objects Optional parameter: If `true`,
365
377
  # the response will include additional objects that are related to the
366
378
  # requested object, as follows: If the `object` field of the response
367
- # contains a CatalogItem, its associated CatalogCategory, CatalogTax
368
- # objects, CatalogImages and CatalogModifierLists will be returned in the
379
+ # contains a `CatalogItem`, its associated `CatalogCategory`, `CatalogTax`,
380
+ # `CatalogImage` and `CatalogModifierList` objects will be returned in the
369
381
  # `related_objects` field of the response. If the `object` field of the
370
- # response contains a CatalogItemVariation, its parent CatalogItem will be
371
- # returned in the `related_objects` field of the response. Default value:
372
- # `false`
382
+ # response contains a `CatalogItemVariation`, its parent `CatalogItem` will
383
+ # be returned in the `related_objects` field of the response. Default
384
+ # value: `false`
373
385
  # @return [RetrieveCatalogObjectResponse Hash] response from the API call
374
386
  def retrieve_catalog_object(object_id:,
375
387
  include_related_objects: false)
@@ -378,7 +390,7 @@ module Square
378
390
  _query_builder << '/v2/catalog/object/{object_id}'
379
391
  _query_builder = APIHelper.append_url_with_template_parameters(
380
392
  _query_builder,
381
- 'object_id' => object_id
393
+ 'object_id' => { 'value' => object_id, 'encode' => true }
382
394
  )
383
395
  _query_builder = APIHelper.append_url_with_query_parameters(
384
396
  _query_builder,
@@ -402,7 +414,9 @@ module Square
402
414
  # Return appropriate response type.
403
415
  decoded = APIHelper.json_deserialize(_response.raw_body)
404
416
  _errors = APIHelper.map_response(decoded, ['errors'])
405
- ApiResponse.new(_response, data: decoded, errors: _errors)
417
+ ApiResponse.new(
418
+ _response, data: decoded, errors: _errors
419
+ )
406
420
  end
407
421
 
408
422
  # Searches for [CatalogObject](#type-CatalogObject) of any types against
@@ -450,7 +464,9 @@ module Square
450
464
  # Return appropriate response type.
451
465
  decoded = APIHelper.json_deserialize(_response.raw_body)
452
466
  _errors = APIHelper.map_response(decoded, ['errors'])
453
- ApiResponse.new(_response, data: decoded, errors: _errors)
467
+ ApiResponse.new(
468
+ _response, data: decoded, errors: _errors
469
+ )
454
470
  end
455
471
 
456
472
  # Searches for catalog items or item variations by matching supported search
@@ -498,7 +514,9 @@ module Square
498
514
  # Return appropriate response type.
499
515
  decoded = APIHelper.json_deserialize(_response.raw_body)
500
516
  _errors = APIHelper.map_response(decoded, ['errors'])
501
- ApiResponse.new(_response, data: decoded, errors: _errors)
517
+ ApiResponse.new(
518
+ _response, data: decoded, errors: _errors
519
+ )
502
520
  end
503
521
 
504
522
  # Updates the [CatalogModifierList](#type-catalogmodifierlist) objects
@@ -532,7 +550,9 @@ module Square
532
550
  # Return appropriate response type.
533
551
  decoded = APIHelper.json_deserialize(_response.raw_body)
534
552
  _errors = APIHelper.map_response(decoded, ['errors'])
535
- ApiResponse.new(_response, data: decoded, errors: _errors)
553
+ ApiResponse.new(
554
+ _response, data: decoded, errors: _errors
555
+ )
536
556
  end
537
557
 
538
558
  # Updates the [CatalogTax](#type-catalogtax) objects that apply to the
@@ -566,7 +586,9 @@ module Square
566
586
  # Return appropriate response type.
567
587
  decoded = APIHelper.json_deserialize(_response.raw_body)
568
588
  _errors = APIHelper.map_response(decoded, ['errors'])
569
- ApiResponse.new(_response, data: decoded, errors: _errors)
589
+ ApiResponse.new(
590
+ _response, data: decoded, errors: _errors
591
+ )
570
592
  end
571
593
  end
572
594
  end