square.rb 33.0.0.20231018 → 42.1.0.20250416
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.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/lib/square/api/apple_pay_api.rb +15 -11
- data/lib/square/api/bank_accounts_api.rb +12 -12
- data/lib/square/api/base_api.rb +2 -1
- data/lib/square/api/booking_custom_attributes_api.rb +44 -44
- data/lib/square/api/bookings_api.rb +53 -53
- data/lib/square/api/cards_api.rb +16 -16
- data/lib/square/api/cash_drawers_api.rb +12 -12
- data/lib/square/api/catalog_api.rb +67 -57
- data/lib/square/api/checkout_api.rb +111 -26
- data/lib/square/api/customer_custom_attributes_api.rb +40 -40
- data/lib/square/api/customer_groups_api.rb +20 -20
- data/lib/square/api/customer_segments_api.rb +8 -8
- data/lib/square/api/customers_api.rb +144 -54
- data/lib/square/api/devices_api.rb +20 -20
- data/lib/square/api/disputes_api.rb +36 -36
- data/lib/square/api/employees_api.rb +8 -8
- data/lib/square/api/events_api.rb +84 -0
- data/lib/square/api/gift_card_activities_api.rb +10 -11
- data/lib/square/api/gift_cards_api.rb +36 -33
- data/lib/square/api/inventory_api.rb +52 -52
- data/lib/square/api/invoices_api.rb +109 -41
- data/lib/square/api/labor_api.rb +81 -80
- data/lib/square/api/location_custom_attributes_api.rb +44 -44
- data/lib/square/api/locations_api.rb +18 -17
- data/lib/square/api/loyalty_api.rb +72 -72
- data/lib/square/api/merchant_custom_attributes_api.rb +44 -44
- data/lib/square/api/merchants_api.rb +8 -8
- data/lib/square/api/mobile_authorization_api.rb +4 -4
- data/lib/square/api/o_auth_api.rb +15 -69
- data/lib/square/api/order_custom_attributes_api.rb +44 -44
- data/lib/square/api/orders_api.rb +32 -32
- data/lib/square/api/payments_api.rb +67 -31
- data/lib/square/api/payouts_api.rb +12 -12
- data/lib/square/api/refunds_api.rb +31 -13
- data/lib/square/api/sites_api.rb +4 -4
- data/lib/square/api/snippets_api.rb +12 -12
- data/lib/square/api/subscriptions_api.rb +48 -48
- data/lib/square/api/team_api.rb +146 -40
- data/lib/square/api/terminal_api.rb +95 -53
- data/lib/square/api/transactions_api.rb +16 -16
- data/lib/square/api/v1_transactions_api.rb +13 -292
- data/lib/square/api/vendors_api.rb +28 -28
- data/lib/square/api/webhook_subscriptions_api.rb +32 -32
- data/lib/square/client.rb +32 -24
- data/lib/square/configuration.rb +43 -15
- data/lib/square/http/api_response.rb +1 -1
- data/lib/square/http/auth/o_auth2.rb +21 -2
- data/lib/square.rb +4 -3
- data/test/api/api_test_base.rb +1 -1
- data/test/api/test_locations_api.rb +1 -1
- data/test/api/test_refunds_api.rb +4 -1
- data/test/webhooks/test_webhooks_helper.rb +17 -0
- metadata +12 -17
@@ -9,7 +9,7 @@ module Square
|
|
9
9
|
# returned on each page.
|
10
10
|
# @param [String] cursor Optional parameter: The token required to retrieve
|
11
11
|
# the specified page of results.
|
12
|
-
# @return [
|
12
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
13
13
|
def list_employees(location_id: nil,
|
14
14
|
status: nil,
|
15
15
|
limit: nil,
|
@@ -26,16 +26,16 @@ module Square
|
|
26
26
|
.header_param(new_parameter('application/json', key: 'accept'))
|
27
27
|
.auth(Single.new('global')))
|
28
28
|
.response(new_response_handler
|
29
|
-
|
30
|
-
|
31
|
-
|
29
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
30
|
+
.is_api_response(true)
|
31
|
+
.convertor(ApiResponse.method(:create)))
|
32
32
|
.execute
|
33
33
|
end
|
34
34
|
|
35
35
|
# TODO: type endpoint description here
|
36
36
|
# @param [String] id Required parameter: UUID for the employee that was
|
37
37
|
# requested.
|
38
|
-
# @return [
|
38
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
39
39
|
def retrieve_employee(id:)
|
40
40
|
warn 'Endpoint retrieve_employee in EmployeesApi is deprecated'
|
41
41
|
new_api_call_builder
|
@@ -47,9 +47,9 @@ module Square
|
|
47
47
|
.header_param(new_parameter('application/json', key: 'accept'))
|
48
48
|
.auth(Single.new('global')))
|
49
49
|
.response(new_response_handler
|
50
|
-
|
51
|
-
|
52
|
-
|
50
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
51
|
+
.is_api_response(true)
|
52
|
+
.convertor(ApiResponse.method(:create)))
|
53
53
|
.execute
|
54
54
|
end
|
55
55
|
end
|
@@ -0,0 +1,84 @@
|
|
1
|
+
module Square
|
2
|
+
# EventsApi
|
3
|
+
class EventsApi < BaseApi
|
4
|
+
# Search for Square API events that occur within a 28-day timeframe.
|
5
|
+
# @param [SearchEventsRequest] body Required parameter: An object containing
|
6
|
+
# the fields to POST for the request. See the corresponding object
|
7
|
+
# definition for field details.
|
8
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
9
|
+
def search_events(body:)
|
10
|
+
new_api_call_builder
|
11
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
12
|
+
'/v2/events',
|
13
|
+
'default')
|
14
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
15
|
+
.body_param(new_parameter(body))
|
16
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
17
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
18
|
+
.auth(Single.new('global')))
|
19
|
+
.response(new_response_handler
|
20
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
21
|
+
.is_api_response(true)
|
22
|
+
.convertor(ApiResponse.method(:create)))
|
23
|
+
.execute
|
24
|
+
end
|
25
|
+
|
26
|
+
# Disables events to prevent them from being searchable.
|
27
|
+
# All events are disabled by default. You must enable events to make them
|
28
|
+
# searchable.
|
29
|
+
# Disabling events for a specific time period prevents them from being
|
30
|
+
# searchable, even if you re-enable them later.
|
31
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
32
|
+
def disable_events
|
33
|
+
new_api_call_builder
|
34
|
+
.request(new_request_builder(HttpMethodEnum::PUT,
|
35
|
+
'/v2/events/disable',
|
36
|
+
'default')
|
37
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
38
|
+
.auth(Single.new('global')))
|
39
|
+
.response(new_response_handler
|
40
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
41
|
+
.is_api_response(true)
|
42
|
+
.convertor(ApiResponse.method(:create)))
|
43
|
+
.execute
|
44
|
+
end
|
45
|
+
|
46
|
+
# Enables events to make them searchable. Only events that occur while in
|
47
|
+
# the enabled state are searchable.
|
48
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
49
|
+
def enable_events
|
50
|
+
new_api_call_builder
|
51
|
+
.request(new_request_builder(HttpMethodEnum::PUT,
|
52
|
+
'/v2/events/enable',
|
53
|
+
'default')
|
54
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
55
|
+
.auth(Single.new('global')))
|
56
|
+
.response(new_response_handler
|
57
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
58
|
+
.is_api_response(true)
|
59
|
+
.convertor(ApiResponse.method(:create)))
|
60
|
+
.execute
|
61
|
+
end
|
62
|
+
|
63
|
+
# Lists all event types that you can subscribe to as webhooks or query using
|
64
|
+
# the Events API.
|
65
|
+
# @param [String] api_version Optional parameter: The API version for which
|
66
|
+
# to list event types. Setting this field overrides the default version used
|
67
|
+
# by the application.
|
68
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
69
|
+
def list_event_types(api_version: nil)
|
70
|
+
new_api_call_builder
|
71
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
72
|
+
'/v2/events/types',
|
73
|
+
'default')
|
74
|
+
.query_param(new_parameter(api_version, key: 'api_version'))
|
75
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
76
|
+
.auth(Single.new('global')))
|
77
|
+
.response(new_response_handler
|
78
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
79
|
+
.is_api_response(true)
|
80
|
+
.convertor(ApiResponse.method(:create)))
|
81
|
+
.execute
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
@@ -41,7 +41,7 @@ module Square
|
|
41
41
|
# @param [String] sort_order Optional parameter: The order in which the
|
42
42
|
# endpoint returns the activities, based on `created_at`. - `ASC` - Oldest
|
43
43
|
# to newest. - `DESC` - Newest to oldest (default).
|
44
|
-
# @return [
|
44
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
45
45
|
def list_gift_card_activities(gift_card_id: nil,
|
46
46
|
type: nil,
|
47
47
|
location_id: nil,
|
@@ -65,21 +65,20 @@ module Square
|
|
65
65
|
.header_param(new_parameter('application/json', key: 'accept'))
|
66
66
|
.auth(Single.new('global')))
|
67
67
|
.response(new_response_handler
|
68
|
-
|
69
|
-
|
70
|
-
|
68
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
69
|
+
.is_api_response(true)
|
70
|
+
.convertor(ApiResponse.method(:create)))
|
71
71
|
.execute
|
72
72
|
end
|
73
73
|
|
74
74
|
# Creates a gift card activity to manage the balance or state of a [gift
|
75
75
|
# card]($m/GiftCard).
|
76
|
-
# For example,
|
77
|
-
#
|
78
|
-
# before the gift card can be used.
|
76
|
+
# For example, create an `ACTIVATE` activity to activate a gift card with an
|
77
|
+
# initial balance before first use.
|
79
78
|
# @param [CreateGiftCardActivityRequest] body Required parameter: An object
|
80
79
|
# containing the fields to POST for the request. See the corresponding
|
81
80
|
# object definition for field details.
|
82
|
-
# @return [
|
81
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
83
82
|
def create_gift_card_activity(body:)
|
84
83
|
new_api_call_builder
|
85
84
|
.request(new_request_builder(HttpMethodEnum::POST,
|
@@ -91,9 +90,9 @@ module Square
|
|
91
90
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
92
91
|
.auth(Single.new('global')))
|
93
92
|
.response(new_response_handler
|
94
|
-
|
95
|
-
|
96
|
-
|
93
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
94
|
+
.is_api_response(true)
|
95
|
+
.convertor(ApiResponse.method(:create)))
|
97
96
|
.execute
|
98
97
|
end
|
99
98
|
end
|
@@ -25,7 +25,7 @@ module Square
|
|
25
25
|
# @param [String] customer_id Optional parameter: If a customer ID is
|
26
26
|
# provided, the endpoint returns only the gift cards linked to the specified
|
27
27
|
# customer.
|
28
|
-
# @return [
|
28
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
29
29
|
def list_gift_cards(type: nil,
|
30
30
|
state: nil,
|
31
31
|
limit: nil,
|
@@ -43,22 +43,25 @@ module Square
|
|
43
43
|
.header_param(new_parameter('application/json', key: 'accept'))
|
44
44
|
.auth(Single.new('global')))
|
45
45
|
.response(new_response_handler
|
46
|
-
|
47
|
-
|
48
|
-
|
46
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
47
|
+
.is_api_response(true)
|
48
|
+
.convertor(ApiResponse.method(:create)))
|
49
49
|
.execute
|
50
50
|
end
|
51
51
|
|
52
52
|
# Creates a digital gift card or registers a physical (plastic) gift card.
|
53
|
-
#
|
54
|
-
#
|
55
|
-
#
|
56
|
-
#
|
57
|
-
#
|
53
|
+
# The resulting gift card
|
54
|
+
# has a `PENDING` state. To activate a gift card so that it can be redeemed
|
55
|
+
# for purchases, call
|
56
|
+
# [CreateGiftCardActivity]($e/GiftCardActivities/CreateGiftCardActivity) and
|
57
|
+
# create an `ACTIVATE`
|
58
|
+
# activity with the initial balance. Alternatively, you can use
|
59
|
+
# [RefundPayment]($e/Refunds/RefundPayment)
|
60
|
+
# to refund a payment to the new gift card.
|
58
61
|
# @param [CreateGiftCardRequest] body Required parameter: An object
|
59
62
|
# containing the fields to POST for the request. See the corresponding
|
60
63
|
# object definition for field details.
|
61
|
-
# @return [
|
64
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
62
65
|
def create_gift_card(body:)
|
63
66
|
new_api_call_builder
|
64
67
|
.request(new_request_builder(HttpMethodEnum::POST,
|
@@ -70,9 +73,9 @@ module Square
|
|
70
73
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
71
74
|
.auth(Single.new('global')))
|
72
75
|
.response(new_response_handler
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
77
|
+
.is_api_response(true)
|
78
|
+
.convertor(ApiResponse.method(:create)))
|
76
79
|
.execute
|
77
80
|
end
|
78
81
|
|
@@ -80,7 +83,7 @@ module Square
|
|
80
83
|
# @param [RetrieveGiftCardFromGANRequest] body Required parameter: An object
|
81
84
|
# containing the fields to POST for the request. See the corresponding
|
82
85
|
# object definition for field details.
|
83
|
-
# @return [
|
86
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
84
87
|
def retrieve_gift_card_from_gan(body:)
|
85
88
|
new_api_call_builder
|
86
89
|
.request(new_request_builder(HttpMethodEnum::POST,
|
@@ -92,9 +95,9 @@ module Square
|
|
92
95
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
93
96
|
.auth(Single.new('global')))
|
94
97
|
.response(new_response_handler
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
99
|
+
.is_api_response(true)
|
100
|
+
.convertor(ApiResponse.method(:create)))
|
98
101
|
.execute
|
99
102
|
end
|
100
103
|
|
@@ -103,7 +106,7 @@ module Square
|
|
103
106
|
# @param [RetrieveGiftCardFromNonceRequest] body Required parameter: An
|
104
107
|
# object containing the fields to POST for the request. See the
|
105
108
|
# corresponding object definition for field details.
|
106
|
-
# @return [
|
109
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
107
110
|
def retrieve_gift_card_from_nonce(body:)
|
108
111
|
new_api_call_builder
|
109
112
|
.request(new_request_builder(HttpMethodEnum::POST,
|
@@ -115,9 +118,9 @@ module Square
|
|
115
118
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
116
119
|
.auth(Single.new('global')))
|
117
120
|
.response(new_response_handler
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
122
|
+
.is_api_response(true)
|
123
|
+
.convertor(ApiResponse.method(:create)))
|
121
124
|
.execute
|
122
125
|
end
|
123
126
|
|
@@ -128,7 +131,7 @@ module Square
|
|
128
131
|
# @param [LinkCustomerToGiftCardRequest] body Required parameter: An object
|
129
132
|
# containing the fields to POST for the request. See the corresponding
|
130
133
|
# object definition for field details.
|
131
|
-
# @return [
|
134
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
132
135
|
def link_customer_to_gift_card(gift_card_id:,
|
133
136
|
body:)
|
134
137
|
new_api_call_builder
|
@@ -143,9 +146,9 @@ module Square
|
|
143
146
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
144
147
|
.auth(Single.new('global')))
|
145
148
|
.response(new_response_handler
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
150
|
+
.is_api_response(true)
|
151
|
+
.convertor(ApiResponse.method(:create)))
|
149
152
|
.execute
|
150
153
|
end
|
151
154
|
|
@@ -156,7 +159,7 @@ module Square
|
|
156
159
|
# @param [UnlinkCustomerFromGiftCardRequest] body Required parameter: An
|
157
160
|
# object containing the fields to POST for the request. See the
|
158
161
|
# corresponding object definition for field details.
|
159
|
-
# @return [
|
162
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
160
163
|
def unlink_customer_from_gift_card(gift_card_id:,
|
161
164
|
body:)
|
162
165
|
new_api_call_builder
|
@@ -171,16 +174,16 @@ module Square
|
|
171
174
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
172
175
|
.auth(Single.new('global')))
|
173
176
|
.response(new_response_handler
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
178
|
+
.is_api_response(true)
|
179
|
+
.convertor(ApiResponse.method(:create)))
|
177
180
|
.execute
|
178
181
|
end
|
179
182
|
|
180
183
|
# Retrieves a gift card using the gift card ID.
|
181
184
|
# @param [String] id Required parameter: The ID of the gift card to
|
182
185
|
# retrieve.
|
183
|
-
# @return [
|
186
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
184
187
|
def retrieve_gift_card(id:)
|
185
188
|
new_api_call_builder
|
186
189
|
.request(new_request_builder(HttpMethodEnum::GET,
|
@@ -191,9 +194,9 @@ module Square
|
|
191
194
|
.header_param(new_parameter('application/json', key: 'accept'))
|
192
195
|
.auth(Single.new('global')))
|
193
196
|
.response(new_response_handler
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
198
|
+
.is_api_response(true)
|
199
|
+
.convertor(ApiResponse.method(:create)))
|
197
200
|
.execute
|
198
201
|
end
|
199
202
|
end
|
@@ -7,7 +7,7 @@ module Square
|
|
7
7
|
# is updated to conform to the standard convention.
|
8
8
|
# @param [String] adjustment_id Required parameter: ID of the
|
9
9
|
# [InventoryAdjustment](entity:InventoryAdjustment) to retrieve.
|
10
|
-
# @return [
|
10
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
11
11
|
def deprecated_retrieve_inventory_adjustment(adjustment_id:)
|
12
12
|
warn 'Endpoint deprecated_retrieve_inventory_adjustment in InventoryApi '\
|
13
13
|
'is deprecated'
|
@@ -20,9 +20,9 @@ module Square
|
|
20
20
|
.header_param(new_parameter('application/json', key: 'accept'))
|
21
21
|
.auth(Single.new('global')))
|
22
22
|
.response(new_response_handler
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
24
|
+
.is_api_response(true)
|
25
|
+
.convertor(ApiResponse.method(:create)))
|
26
26
|
.execute
|
27
27
|
end
|
28
28
|
|
@@ -30,7 +30,7 @@ module Square
|
|
30
30
|
# with the provided `adjustment_id`.
|
31
31
|
# @param [String] adjustment_id Required parameter: ID of the
|
32
32
|
# [InventoryAdjustment](entity:InventoryAdjustment) to retrieve.
|
33
|
-
# @return [
|
33
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
34
34
|
def retrieve_inventory_adjustment(adjustment_id:)
|
35
35
|
new_api_call_builder
|
36
36
|
.request(new_request_builder(HttpMethodEnum::GET,
|
@@ -41,9 +41,9 @@ module Square
|
|
41
41
|
.header_param(new_parameter('application/json', key: 'accept'))
|
42
42
|
.auth(Single.new('global')))
|
43
43
|
.response(new_response_handler
|
44
|
-
|
45
|
-
|
46
|
-
|
44
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
45
|
+
.is_api_response(true)
|
46
|
+
.convertor(ApiResponse.method(:create)))
|
47
47
|
.execute
|
48
48
|
end
|
49
49
|
|
@@ -54,7 +54,7 @@ module Square
|
|
54
54
|
# @param [BatchChangeInventoryRequest] body Required parameter: An object
|
55
55
|
# containing the fields to POST for the request. See the corresponding
|
56
56
|
# object definition for field details.
|
57
|
-
# @return [
|
57
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
58
58
|
def deprecated_batch_change_inventory(body:)
|
59
59
|
warn 'Endpoint deprecated_batch_change_inventory in InventoryApi is depr'\
|
60
60
|
'ecated'
|
@@ -68,9 +68,9 @@ module Square
|
|
68
68
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
69
69
|
.auth(Single.new('global')))
|
70
70
|
.response(new_response_handler
|
71
|
-
|
72
|
-
|
73
|
-
|
71
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
72
|
+
.is_api_response(true)
|
73
|
+
.convertor(ApiResponse.method(:create)))
|
74
74
|
.execute
|
75
75
|
end
|
76
76
|
|
@@ -81,7 +81,7 @@ module Square
|
|
81
81
|
# @param [BatchRetrieveInventoryChangesRequest] body Required parameter: An
|
82
82
|
# object containing the fields to POST for the request. See the
|
83
83
|
# corresponding object definition for field details.
|
84
|
-
# @return [
|
84
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
85
85
|
def deprecated_batch_retrieve_inventory_changes(body:)
|
86
86
|
warn 'Endpoint deprecated_batch_retrieve_inventory_changes in InventoryA'\
|
87
87
|
'pi is deprecated'
|
@@ -95,9 +95,9 @@ module Square
|
|
95
95
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
96
96
|
.auth(Single.new('global')))
|
97
97
|
.response(new_response_handler
|
98
|
-
|
99
|
-
|
100
|
-
|
98
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
99
|
+
.is_api_response(true)
|
100
|
+
.convertor(ApiResponse.method(:create)))
|
101
101
|
.execute
|
102
102
|
end
|
103
103
|
|
@@ -108,7 +108,7 @@ module Square
|
|
108
108
|
# @param [BatchRetrieveInventoryCountsRequest] body Required parameter: An
|
109
109
|
# object containing the fields to POST for the request. See the
|
110
110
|
# corresponding object definition for field details.
|
111
|
-
# @return [
|
111
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
112
112
|
def deprecated_batch_retrieve_inventory_counts(body:)
|
113
113
|
warn 'Endpoint deprecated_batch_retrieve_inventory_counts in InventoryAp'\
|
114
114
|
'i is deprecated'
|
@@ -122,9 +122,9 @@ module Square
|
|
122
122
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
123
123
|
.auth(Single.new('global')))
|
124
124
|
.response(new_response_handler
|
125
|
-
|
126
|
-
|
127
|
-
|
125
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
126
|
+
.is_api_response(true)
|
127
|
+
.convertor(ApiResponse.method(:create)))
|
128
128
|
.execute
|
129
129
|
end
|
130
130
|
|
@@ -135,7 +135,7 @@ module Square
|
|
135
135
|
# @param [BatchChangeInventoryRequest] body Required parameter: An object
|
136
136
|
# containing the fields to POST for the request. See the corresponding
|
137
137
|
# object definition for field details.
|
138
|
-
# @return [
|
138
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
139
139
|
def batch_change_inventory(body:)
|
140
140
|
new_api_call_builder
|
141
141
|
.request(new_request_builder(HttpMethodEnum::POST,
|
@@ -147,9 +147,9 @@ module Square
|
|
147
147
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
148
148
|
.auth(Single.new('global')))
|
149
149
|
.response(new_response_handler
|
150
|
-
|
151
|
-
|
152
|
-
|
150
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
151
|
+
.is_api_response(true)
|
152
|
+
.convertor(ApiResponse.method(:create)))
|
153
153
|
.execute
|
154
154
|
end
|
155
155
|
|
@@ -162,7 +162,7 @@ module Square
|
|
162
162
|
# @param [BatchRetrieveInventoryChangesRequest] body Required parameter: An
|
163
163
|
# object containing the fields to POST for the request. See the
|
164
164
|
# corresponding object definition for field details.
|
165
|
-
# @return [
|
165
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
166
166
|
def batch_retrieve_inventory_changes(body:)
|
167
167
|
new_api_call_builder
|
168
168
|
.request(new_request_builder(HttpMethodEnum::POST,
|
@@ -174,9 +174,9 @@ module Square
|
|
174
174
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
175
175
|
.auth(Single.new('global')))
|
176
176
|
.response(new_response_handler
|
177
|
-
|
178
|
-
|
179
|
-
|
177
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
178
|
+
.is_api_response(true)
|
179
|
+
.convertor(ApiResponse.method(:create)))
|
180
180
|
.execute
|
181
181
|
end
|
182
182
|
|
@@ -193,7 +193,7 @@ module Square
|
|
193
193
|
# @param [BatchRetrieveInventoryCountsRequest] body Required parameter: An
|
194
194
|
# object containing the fields to POST for the request. See the
|
195
195
|
# corresponding object definition for field details.
|
196
|
-
# @return [
|
196
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
197
197
|
def batch_retrieve_inventory_counts(body:)
|
198
198
|
new_api_call_builder
|
199
199
|
.request(new_request_builder(HttpMethodEnum::POST,
|
@@ -205,9 +205,9 @@ module Square
|
|
205
205
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
206
206
|
.auth(Single.new('global')))
|
207
207
|
.response(new_response_handler
|
208
|
-
|
209
|
-
|
210
|
-
|
208
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
209
|
+
.is_api_response(true)
|
210
|
+
.convertor(ApiResponse.method(:create)))
|
211
211
|
.execute
|
212
212
|
end
|
213
213
|
|
@@ -217,7 +217,7 @@ module Square
|
|
217
217
|
# is updated to conform to the standard convention.
|
218
218
|
# @param [String] physical_count_id Required parameter: ID of the
|
219
219
|
# [InventoryPhysicalCount](entity:InventoryPhysicalCount) to retrieve.
|
220
|
-
# @return [
|
220
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
221
221
|
def deprecated_retrieve_inventory_physical_count(physical_count_id:)
|
222
222
|
warn 'Endpoint deprecated_retrieve_inventory_physical_count in Inventory'\
|
223
223
|
'Api is deprecated'
|
@@ -230,9 +230,9 @@ module Square
|
|
230
230
|
.header_param(new_parameter('application/json', key: 'accept'))
|
231
231
|
.auth(Single.new('global')))
|
232
232
|
.response(new_response_handler
|
233
|
-
|
234
|
-
|
235
|
-
|
233
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
234
|
+
.is_api_response(true)
|
235
|
+
.convertor(ApiResponse.method(:create)))
|
236
236
|
.execute
|
237
237
|
end
|
238
238
|
|
@@ -240,7 +240,7 @@ module Square
|
|
240
240
|
# object with the provided `physical_count_id`.
|
241
241
|
# @param [String] physical_count_id Required parameter: ID of the
|
242
242
|
# [InventoryPhysicalCount](entity:InventoryPhysicalCount) to retrieve.
|
243
|
-
# @return [
|
243
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
244
244
|
def retrieve_inventory_physical_count(physical_count_id:)
|
245
245
|
new_api_call_builder
|
246
246
|
.request(new_request_builder(HttpMethodEnum::GET,
|
@@ -251,9 +251,9 @@ module Square
|
|
251
251
|
.header_param(new_parameter('application/json', key: 'accept'))
|
252
252
|
.auth(Single.new('global')))
|
253
253
|
.response(new_response_handler
|
254
|
-
|
255
|
-
|
256
|
-
|
254
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
255
|
+
.is_api_response(true)
|
256
|
+
.convertor(ApiResponse.method(:create)))
|
257
257
|
.execute
|
258
258
|
end
|
259
259
|
|
@@ -261,7 +261,7 @@ module Square
|
|
261
261
|
# with the provided `transfer_id`.
|
262
262
|
# @param [String] transfer_id Required parameter: ID of the
|
263
263
|
# [InventoryTransfer](entity:InventoryTransfer) to retrieve.
|
264
|
-
# @return [
|
264
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
265
265
|
def retrieve_inventory_transfer(transfer_id:)
|
266
266
|
new_api_call_builder
|
267
267
|
.request(new_request_builder(HttpMethodEnum::GET,
|
@@ -272,9 +272,9 @@ module Square
|
|
272
272
|
.header_param(new_parameter('application/json', key: 'accept'))
|
273
273
|
.auth(Single.new('global')))
|
274
274
|
.response(new_response_handler
|
275
|
-
|
276
|
-
|
277
|
-
|
275
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
276
|
+
.is_api_response(true)
|
277
|
+
.convertor(ApiResponse.method(:create)))
|
278
278
|
.execute
|
279
279
|
end
|
280
280
|
|
@@ -292,7 +292,7 @@ module Square
|
|
292
292
|
# results for the original query. See the
|
293
293
|
# [Pagination](https://developer.squareup.com/docs/working-with-apis/paginat
|
294
294
|
# ion) guide for more information.
|
295
|
-
# @return [
|
295
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
296
296
|
def retrieve_inventory_count(catalog_object_id:,
|
297
297
|
location_ids: nil,
|
298
298
|
cursor: nil)
|
@@ -307,9 +307,9 @@ module Square
|
|
307
307
|
.header_param(new_parameter('application/json', key: 'accept'))
|
308
308
|
.auth(Single.new('global')))
|
309
309
|
.response(new_response_handler
|
310
|
-
|
311
|
-
|
312
|
-
|
310
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
311
|
+
.is_api_response(true)
|
312
|
+
.convertor(ApiResponse.method(:create)))
|
313
313
|
.execute
|
314
314
|
end
|
315
315
|
|
@@ -337,7 +337,7 @@ module Square
|
|
337
337
|
# results for the original query. See the
|
338
338
|
# [Pagination](https://developer.squareup.com/docs/working-with-apis/paginat
|
339
339
|
# ion) guide for more information.
|
340
|
-
# @return [
|
340
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
341
341
|
def retrieve_inventory_changes(catalog_object_id:,
|
342
342
|
location_ids: nil,
|
343
343
|
cursor: nil)
|
@@ -353,9 +353,9 @@ module Square
|
|
353
353
|
.header_param(new_parameter('application/json', key: 'accept'))
|
354
354
|
.auth(Single.new('global')))
|
355
355
|
.response(new_response_handler
|
356
|
-
|
357
|
-
|
358
|
-
|
356
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
357
|
+
.is_api_response(true)
|
358
|
+
.convertor(ApiResponse.method(:create)))
|
359
359
|
.execute
|
360
360
|
end
|
361
361
|
end
|