square.rb 40.0.0.20241120 → 40.1.0.20241218

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8393ed6eca406991807e1330dd142d2b5a346e856bc96832e908144efbf44b99
4
- data.tar.gz: fdb42c86b5f181cff6998d4c49ddfb54c6c4c236729f2568d08b5b08a25b8cc4
3
+ metadata.gz: 4e7b1bb2c87e0ece74eca3aea1dce625d64ca37ca825a1d74a0b9dce2110b51b
4
+ data.tar.gz: 958e0831f484baa6a6ff74fe15a070404ac795d1385213e47073b10027a4c4ac
5
5
  SHA512:
6
- metadata.gz: bff2ca7d43642adda84ee7d29dd4df592609c00648b9711c2f3febeb1f0c465f3d12af083b8ae238416ff7d79952aeac7dd91765ef80cb5fd911838390378c24
7
- data.tar.gz: 1982eef48842069fd398d87617a9348ce703cbb9d439a78d2be51c75f3a6fa20dac9e613d1a5ca0744a2ee0861d83a24fac2dc1796de1229681209c79ef5a2a8
6
+ metadata.gz: c7b26e69c0f772ab764bbe875930cf275b0b03a32bb13aa7c4f7adc7e54d9805b1944b593ac8b0f244b2ae72ab357804d371c13198a23b4992e9edefb4491bc1
7
+ data.tar.gz: '00970c4e9fbad01d013a7dda89f69835a35e2fe6a8f8ad6784083df83672098c58fcc3cbc5f053af2c464314e8fe95306579d55be4c271cadf633c38c1a369f3'
@@ -5,7 +5,7 @@ module Square
5
5
  attr_accessor :config, :http_call_back
6
6
 
7
7
  def self.user_agent
8
- 'Square-Ruby-SDK/40.0.0.20241120 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}'
8
+ 'Square-Ruby-SDK/40.1.0.20241218 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}'
9
9
  end
10
10
 
11
11
  def self.user_agent_parameters
@@ -15,8 +15,8 @@ module Square
15
15
  # determined using the `created_at` field for each Payment. Default: The
16
16
  # current time.
17
17
  # @param [String] sort_order Optional parameter: The order in which results
18
- # are listed by `Payment.created_at`: - `ASC` - Oldest to newest. - `DESC` -
19
- # Newest to oldest (default).
18
+ # are listed by `ListPaymentsRequest.sort_field`: - `ASC` - Oldest to
19
+ # newest. - `DESC` - Newest to oldest (default).
20
20
  # @param [String] cursor Optional parameter: A pagination cursor returned by
21
21
  # a previous call to this endpoint. Provide this cursor to retrieve the next
22
22
  # set of results for the original query. For more information, see
@@ -53,6 +53,14 @@ module Square
53
53
  # set, payments without a value set in
54
54
  # `offline_payment_details.client_created_at` will not be returned.
55
55
  # Default: The current time.
56
+ # @param [String] updated_at_begin_time Optional parameter: Indicates the
57
+ # start of the time range to retrieve payments for, in RFC 3339 format. The
58
+ # range is determined using the `updated_at` field for each Payment.
59
+ # @param [String] updated_at_end_time Optional parameter: Indicates the end
60
+ # of the time range to retrieve payments for, in RFC 3339 format. The range
61
+ # is determined using the `updated_at` field for each Payment.
62
+ # @param [PaymentSortField] sort_field Optional parameter: The field used to
63
+ # sort results by. The default is `CREATED_AT`.
56
64
  # @return [ApiResponse] the complete http response with raw body and status code.
57
65
  def list_payments(begin_time: nil,
58
66
  end_time: nil,
@@ -65,7 +73,10 @@ module Square
65
73
  limit: nil,
66
74
  is_offline_payment: false,
67
75
  offline_begin_time: nil,
68
- offline_end_time: nil)
76
+ offline_end_time: nil,
77
+ updated_at_begin_time: nil,
78
+ updated_at_end_time: nil,
79
+ sort_field: nil)
69
80
  new_api_call_builder
70
81
  .request(new_request_builder(HttpMethodEnum::GET,
71
82
  '/v2/payments',
@@ -82,6 +93,9 @@ module Square
82
93
  .query_param(new_parameter(is_offline_payment, key: 'is_offline_payment'))
83
94
  .query_param(new_parameter(offline_begin_time, key: 'offline_begin_time'))
84
95
  .query_param(new_parameter(offline_end_time, key: 'offline_end_time'))
96
+ .query_param(new_parameter(updated_at_begin_time, key: 'updated_at_begin_time'))
97
+ .query_param(new_parameter(updated_at_end_time, key: 'updated_at_end_time'))
98
+ .query_param(new_parameter(sort_field, key: 'sort_field'))
85
99
  .header_param(new_parameter('application/json', key: 'accept'))
86
100
  .auth(Single.new('global')))
87
101
  .response(new_response_handler
@@ -92,10 +92,109 @@ module Square
92
92
  .execute
93
93
  end
94
94
 
95
+ # Lists jobs in a seller account. Results are sorted by title in ascending
96
+ # order.
97
+ # @param [String] cursor Optional parameter: The pagination cursor returned
98
+ # by the previous call to this endpoint. Provide this cursor to retrieve the
99
+ # next page of results for your original request. For more information, see
100
+ # [Pagination](https://developer.squareup.com/docs/build-basics/common-api-p
101
+ # atterns/pagination).
102
+ # @return [ApiResponse] the complete http response with raw body and status code.
103
+ def list_jobs(cursor: nil)
104
+ new_api_call_builder
105
+ .request(new_request_builder(HttpMethodEnum::GET,
106
+ '/v2/team-members/jobs',
107
+ 'default')
108
+ .query_param(new_parameter(cursor, key: 'cursor'))
109
+ .header_param(new_parameter('application/json', key: 'accept'))
110
+ .auth(Single.new('global')))
111
+ .response(new_response_handler
112
+ .deserializer(APIHelper.method(:json_deserialize))
113
+ .is_api_response(true)
114
+ .convertor(ApiResponse.method(:create)))
115
+ .execute
116
+ end
117
+
118
+ # Creates a job in a seller account. A job defines a title and tip
119
+ # eligibility. Note that
120
+ # compensation is defined in a [job assignment]($m/JobAssignment) in a team
121
+ # member's wage setting.
122
+ # @param [CreateJobRequest] body Required parameter: An object containing
123
+ # the fields to POST for the request. See the corresponding object
124
+ # definition for field details.
125
+ # @return [ApiResponse] the complete http response with raw body and status code.
126
+ def create_job(body:)
127
+ new_api_call_builder
128
+ .request(new_request_builder(HttpMethodEnum::POST,
129
+ '/v2/team-members/jobs',
130
+ 'default')
131
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
132
+ .body_param(new_parameter(body))
133
+ .header_param(new_parameter('application/json', key: 'accept'))
134
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
135
+ .auth(Single.new('global')))
136
+ .response(new_response_handler
137
+ .deserializer(APIHelper.method(:json_deserialize))
138
+ .is_api_response(true)
139
+ .convertor(ApiResponse.method(:create)))
140
+ .execute
141
+ end
142
+
143
+ # Retrieves a specified job.
144
+ # @param [String] job_id Required parameter: The ID of the job to
145
+ # retrieve.
146
+ # @return [ApiResponse] the complete http response with raw body and status code.
147
+ def retrieve_job(job_id:)
148
+ new_api_call_builder
149
+ .request(new_request_builder(HttpMethodEnum::GET,
150
+ '/v2/team-members/jobs/{job_id}',
151
+ 'default')
152
+ .template_param(new_parameter(job_id, key: 'job_id')
153
+ .should_encode(true))
154
+ .header_param(new_parameter('application/json', key: 'accept'))
155
+ .auth(Single.new('global')))
156
+ .response(new_response_handler
157
+ .deserializer(APIHelper.method(:json_deserialize))
158
+ .is_api_response(true)
159
+ .convertor(ApiResponse.method(:create)))
160
+ .execute
161
+ end
162
+
163
+ # Updates the title or tip eligibility of a job. Changes to the title
164
+ # propagate to all
165
+ # `JobAssignment`, `Shift`, and `TeamMemberWage` objects that reference the
166
+ # job ID. Changes to
167
+ # tip eligibility propagate to all `TeamMemberWage` objects that reference
168
+ # the job ID.
169
+ # @param [String] job_id Required parameter: The ID of the job to update.
170
+ # @param [UpdateJobRequest] body Required parameter: An object containing
171
+ # the fields to POST for the request. See the corresponding object
172
+ # definition for field details.
173
+ # @return [ApiResponse] the complete http response with raw body and status code.
174
+ def update_job(job_id:,
175
+ body:)
176
+ new_api_call_builder
177
+ .request(new_request_builder(HttpMethodEnum::PUT,
178
+ '/v2/team-members/jobs/{job_id}',
179
+ 'default')
180
+ .template_param(new_parameter(job_id, key: 'job_id')
181
+ .should_encode(true))
182
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
183
+ .body_param(new_parameter(body))
184
+ .header_param(new_parameter('application/json', key: 'accept'))
185
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
186
+ .auth(Single.new('global')))
187
+ .response(new_response_handler
188
+ .deserializer(APIHelper.method(:json_deserialize))
189
+ .is_api_response(true)
190
+ .convertor(ApiResponse.method(:create)))
191
+ .execute
192
+ end
193
+
95
194
  # Returns a paginated list of `TeamMember` objects for a business.
96
- # The list can be filtered by the following:
97
- # - location IDs
98
- # - `status`
195
+ # The list can be filtered by location IDs, `ACTIVE` or `INACTIVE` status,
196
+ # or whether
197
+ # the team member is the Square account owner.
99
198
  # @param [SearchTeamMembersRequest] body Required parameter: An object
100
199
  # containing the fields to POST for the request. See the corresponding
101
200
  # object definition for field details.
@@ -172,10 +271,13 @@ module Square
172
271
  end
173
272
 
174
273
  # Retrieves a `WageSetting` object for a team member specified
175
- # by `TeamMember.id`.
176
- # Learn about [Troubleshooting the Team
274
+ # by `TeamMember.id`. For more information, see
275
+ # [Troubleshooting the Team
177
276
  # API](https://developer.squareup.com/docs/team/troubleshooting#retrievewage
178
277
  # setting).
278
+ # Square recommends using [RetrieveTeamMember]($e/Team/RetrieveTeamMember)
279
+ # or [SearchTeamMembers]($e/Team/SearchTeamMembers)
280
+ # to get this information directly from the `TeamMember.wage_setting` field.
179
281
  # @param [String] team_member_id Required parameter: The ID of the team
180
282
  # member for which to retrieve the wage setting.
181
283
  # @return [ApiResponse] the complete http response with raw body and status code.
@@ -196,13 +298,17 @@ module Square
196
298
  end
197
299
 
198
300
  # Creates or updates a `WageSetting` object. The object is created if a
199
- # `WageSetting` with the specified `team_member_id` does not exist.
301
+ # `WageSetting` with the specified `team_member_id` doesn't exist.
200
302
  # Otherwise,
201
303
  # it fully replaces the `WageSetting` object for the team member.
202
- # The `WageSetting` is returned on a successful update.
203
- # Learn about [Troubleshooting the Team
304
+ # The `WageSetting` is returned on a successful update. For more
305
+ # information, see
306
+ # [Troubleshooting the Team
204
307
  # API](https://developer.squareup.com/docs/team/troubleshooting#create-or-up
205
308
  # date-a-wage-setting).
309
+ # Square recommends using [CreateTeamMember]($e/Team/CreateTeamMember) or
310
+ # [UpdateTeamMember]($e/Team/UpdateTeamMember)
311
+ # to manage the `TeamMember.wage_setting` field directly.
206
312
  # @param [String] team_member_id Required parameter: The ID of the team
207
313
  # member for which to update the `WageSetting` object.
208
314
  # @param [UpdateWageSettingRequest] body Required parameter: An object
data/lib/square/client.rb CHANGED
@@ -5,7 +5,7 @@ module Square
5
5
  attr_reader :config, :auth_managers
6
6
 
7
7
  def sdk_version
8
- '40.0.0.20241120'
8
+ '40.1.0.20241218'
9
9
  end
10
10
 
11
11
  def square_version
@@ -274,7 +274,7 @@ module Square
274
274
  retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
275
275
  retry_methods: %i[get put], http_callback: nil, environment: 'production',
276
276
  custom_url: 'https://connect.squareup.com', access_token: nil,
277
- bearer_auth_credentials: nil, square_version: '2024-11-20',
277
+ bearer_auth_credentials: nil, square_version: '2024-12-18',
278
278
  user_agent_detail: '', additional_headers: {}, config: nil
279
279
  )
280
280
  @config = if config.nil?
@@ -24,7 +24,7 @@ module Square
24
24
  retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
25
25
  retry_methods: %i[get put], http_callback: nil, environment: 'production',
26
26
  custom_url: 'https://connect.squareup.com', access_token: nil,
27
- bearer_auth_credentials: nil, square_version: '2024-11-20',
27
+ bearer_auth_credentials: nil, square_version: '2024-12-18',
28
28
  user_agent_detail: '', additional_headers: {}
29
29
  )
30
30
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: square.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 40.0.0.20241120
4
+ version: 40.1.0.20241218
5
5
  platform: ruby
6
6
  authors:
7
7
  - Square Developer Platform
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-20 00:00:00.000000000 Z
11
+ date: 2024-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: apimatic_core_interfaces
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.3.9
33
+ version: 0.3.11
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.3.9
40
+ version: 0.3.11
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: apimatic_faraday_client_adapter
43
43
  requirement: !ruby/object:Gem::Requirement