Class: SquareConnect::LaborApi

Inherits:
Object
  • Object
show all
Defined in:
lib/square_connect/api/labor_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ LaborApi

Returns a new instance of LaborApi.



16
17
18
# File 'lib/square_connect/api/labor_api.rb', line 16

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



14
15
16
# File 'lib/square_connect/api/labor_api.rb', line 14

def api_client
  @api_client
end

Instance Method Details

#create_break_type(body, opts = {}) ⇒ CreateBreakTypeResponse

CreateBreakType Creates a new ‘BreakType`. A `BreakType` is a template for creating `Break` objects. You must provide the following values in your request to this endpoint: - `location_id` - `break_name` - `expected_duration` - `is_paid` You can only have 3 `BreakType` instances per location. If you attempt to add a 4th `BreakType` for a location, an `INVALID_REQUEST_ERROR` "Exceeded limit of 3 breaks per location." is returned.

Parameters:

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



25
26
27
28
# File 'lib/square_connect/api/labor_api.rb', line 25

def create_break_type(body, opts = {})
  data, _status_code, _headers = create_break_type_with_http_info(body, opts)
  return data
end

#create_break_type_with_http_info(body, opts = {}) ⇒ Array<(CreateBreakTypeResponse, Fixnum, Hash)>

CreateBreakType Creates a new &#x60;BreakType&#x60;. A &#x60;BreakType&#x60; is a template for creating &#x60;Break&#x60; objects. You must provide the following values in your request to this endpoint: - &#x60;location_id&#x60; - &#x60;break_name&#x60; - &#x60;expected_duration&#x60; - &#x60;is_paid&#x60; You can only have 3 &#x60;BreakType&#x60; instances per location. If you attempt to add a 4th &#x60;BreakType&#x60; for a location, an &#x60;INVALID_REQUEST_ERROR&#x60; &quot;Exceeded limit of 3 breaks per location.&quot; is returned.

Parameters:

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreateBreakTypeResponse, Fixnum, Hash)>)

    CreateBreakTypeResponse data, response status code and response headers



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/square_connect/api/labor_api.rb', line 35

def create_break_type_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LaborApi.create_break_type ..."
  end
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling LaborApi.create_break_type" if body.nil?
  # resource path
  local_var_path = "/v2/labor/break-types".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CreateBreakTypeResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LaborApi#create_break_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_shift(body, opts = {}) ⇒ CreateShiftResponse

CreateShift Creates a new ‘Shift`. A `Shift` represents a complete work day for a single employee. You must provide the following values in your request to this endpoint: - `location_id` - `employee_id` - `start_at` An attempt to create a new `Shift` can result in a `BAD_REQUEST` error when: - The `status` of the new `Shift` is `OPEN` and the employee has another shift with an `OPEN` status. - The `start_at` date is in the future - the `start_at` or `end_at` overlaps another shift for the same employee - If `Break`s are set in the request, a break `start_at` must not be before the `Shift.start_at`. A break `end_at` must not be after the `Shift.end_at`

Parameters:

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



80
81
82
83
# File 'lib/square_connect/api/labor_api.rb', line 80

def create_shift(body, opts = {})
  data, _status_code, _headers = create_shift_with_http_info(body, opts)
  return data
end

#create_shift_with_http_info(body, opts = {}) ⇒ Array<(CreateShiftResponse, Fixnum, Hash)>

CreateShift Creates a new &#x60;Shift&#x60;. A &#x60;Shift&#x60; represents a complete work day for a single employee. You must provide the following values in your request to this endpoint: - &#x60;location_id&#x60; - &#x60;employee_id&#x60; - &#x60;start_at&#x60; An attempt to create a new &#x60;Shift&#x60; can result in a &#x60;BAD_REQUEST&#x60; error when: - The &#x60;status&#x60; of the new &#x60;Shift&#x60; is &#x60;OPEN&#x60; and the employee has another shift with an &#x60;OPEN&#x60; status. - The &#x60;start_at&#x60; date is in the future - the &#x60;start_at&#x60; or &#x60;end_at&#x60; overlaps another shift for the same employee - If &#x60;Break&#x60;s are set in the request, a break &#x60;start_at&#x60; must not be before the &#x60;Shift.start_at&#x60;. A break &#x60;end_at&#x60; must not be after the &#x60;Shift.end_at&#x60;

Parameters:

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreateShiftResponse, Fixnum, Hash)>)

    CreateShiftResponse data, response status code and response headers



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/square_connect/api/labor_api.rb', line 90

def create_shift_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LaborApi.create_shift ..."
  end
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling LaborApi.create_shift" if body.nil?
  # resource path
  local_var_path = "/v2/labor/shifts".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CreateShiftResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LaborApi#create_shift\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_break_type(id, opts = {}) ⇒ DeleteBreakTypeResponse

DeleteBreakType Deletes an existing ‘BreakType`. A `BreakType` can be deleted even if it is referenced from a `Shift`.

Parameters:

  • id

    UUID for the &#x60;BreakType&#x60; being deleted.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



135
136
137
138
# File 'lib/square_connect/api/labor_api.rb', line 135

def delete_break_type(id, opts = {})
  data, _status_code, _headers = delete_break_type_with_http_info(id, opts)
  return data
end

#delete_break_type_with_http_info(id, opts = {}) ⇒ Array<(DeleteBreakTypeResponse, Fixnum, Hash)>

DeleteBreakType Deletes an existing &#x60;BreakType&#x60;. A &#x60;BreakType&#x60; can be deleted even if it is referenced from a &#x60;Shift&#x60;.

Parameters:

  • id

    UUID for the &#x60;BreakType&#x60; being deleted.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(DeleteBreakTypeResponse, Fixnum, Hash)>)

    DeleteBreakTypeResponse data, response status code and response headers



145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# File 'lib/square_connect/api/labor_api.rb', line 145

def delete_break_type_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LaborApi.delete_break_type ..."
  end
  # verify the required parameter 'id' is set
  fail ArgumentError, "Missing the required parameter 'id' when calling LaborApi.delete_break_type" if id.nil?
  # resource path
  local_var_path = "/v2/labor/break-types/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'DeleteBreakTypeResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LaborApi#delete_break_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_shift(id, opts = {}) ⇒ DeleteShiftResponse

DeleteShift Deletes a ‘Shift`.

Parameters:

  • id

    UUID for the &#x60;Shift&#x60; being deleted.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



190
191
192
193
# File 'lib/square_connect/api/labor_api.rb', line 190

def delete_shift(id, opts = {})
  data, _status_code, _headers = delete_shift_with_http_info(id, opts)
  return data
end

#delete_shift_with_http_info(id, opts = {}) ⇒ Array<(DeleteShiftResponse, Fixnum, Hash)>

DeleteShift Deletes a &#x60;Shift&#x60;.

Parameters:

  • id

    UUID for the &#x60;Shift&#x60; being deleted.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(DeleteShiftResponse, Fixnum, Hash)>)

    DeleteShiftResponse data, response status code and response headers



200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
# File 'lib/square_connect/api/labor_api.rb', line 200

def delete_shift_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LaborApi.delete_shift ..."
  end
  # verify the required parameter 'id' is set
  fail ArgumentError, "Missing the required parameter 'id' when calling LaborApi.delete_shift" if id.nil?
  # resource path
  local_var_path = "/v2/labor/shifts/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'DeleteShiftResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LaborApi#delete_shift\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_break_type(id, opts = {}) ⇒ GetBreakTypeResponse

GetBreakType Returns a single ‘BreakType` specified by id.

Parameters:

  • id

    UUID for the &#x60;BreakType&#x60; being retrieved.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



245
246
247
248
# File 'lib/square_connect/api/labor_api.rb', line 245

def get_break_type(id, opts = {})
  data, _status_code, _headers = get_break_type_with_http_info(id, opts)
  return data
end

#get_break_type_with_http_info(id, opts = {}) ⇒ Array<(GetBreakTypeResponse, Fixnum, Hash)>

GetBreakType Returns a single &#x60;BreakType&#x60; specified by id.

Parameters:

  • id

    UUID for the &#x60;BreakType&#x60; being retrieved.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetBreakTypeResponse, Fixnum, Hash)>)

    GetBreakTypeResponse data, response status code and response headers



255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
# File 'lib/square_connect/api/labor_api.rb', line 255

def get_break_type_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LaborApi.get_break_type ..."
  end
  # verify the required parameter 'id' is set
  fail ArgumentError, "Missing the required parameter 'id' when calling LaborApi.get_break_type" if id.nil?
  # resource path
  local_var_path = "/v2/labor/break-types/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GetBreakTypeResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LaborApi#get_break_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_employee_wage(id, opts = {}) ⇒ GetEmployeeWageResponse

GetEmployeeWage Returns a single ‘EmployeeWage` specified by id.

Parameters:

  • id

    UUID for the &#x60;EmployeeWage&#x60; being retrieved.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



300
301
302
303
# File 'lib/square_connect/api/labor_api.rb', line 300

def get_employee_wage(id, opts = {})
  data, _status_code, _headers = get_employee_wage_with_http_info(id, opts)
  return data
end

#get_employee_wage_with_http_info(id, opts = {}) ⇒ Array<(GetEmployeeWageResponse, Fixnum, Hash)>

GetEmployeeWage Returns a single &#x60;EmployeeWage&#x60; specified by id.

Parameters:

  • id

    UUID for the &#x60;EmployeeWage&#x60; being retrieved.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetEmployeeWageResponse, Fixnum, Hash)>)

    GetEmployeeWageResponse data, response status code and response headers



310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
# File 'lib/square_connect/api/labor_api.rb', line 310

def get_employee_wage_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LaborApi.get_employee_wage ..."
  end
  # verify the required parameter 'id' is set
  fail ArgumentError, "Missing the required parameter 'id' when calling LaborApi.get_employee_wage" if id.nil?
  # resource path
  local_var_path = "/v2/labor/employee-wages/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GetEmployeeWageResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LaborApi#get_employee_wage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_shift(id, opts = {}) ⇒ GetShiftResponse

GetShift Returns a single ‘Shift` specified by id.

Parameters:

  • id

    UUID for the &#x60;Shift&#x60; being retrieved.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



355
356
357
358
# File 'lib/square_connect/api/labor_api.rb', line 355

def get_shift(id, opts = {})
  data, _status_code, _headers = get_shift_with_http_info(id, opts)
  return data
end

#get_shift_with_http_info(id, opts = {}) ⇒ Array<(GetShiftResponse, Fixnum, Hash)>

GetShift Returns a single &#x60;Shift&#x60; specified by id.

Parameters:

  • id

    UUID for the &#x60;Shift&#x60; being retrieved.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetShiftResponse, Fixnum, Hash)>)

    GetShiftResponse data, response status code and response headers



365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
# File 'lib/square_connect/api/labor_api.rb', line 365

def get_shift_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LaborApi.get_shift ..."
  end
  # verify the required parameter 'id' is set
  fail ArgumentError, "Missing the required parameter 'id' when calling LaborApi.get_shift" if id.nil?
  # resource path
  local_var_path = "/v2/labor/shifts/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GetShiftResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LaborApi#get_shift\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_break_types(opts = {}) ⇒ ListBreakTypesResponse

ListBreakTypes Returns a paginated list of ‘BreakType` instances for a business.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :location_id (String)

    Filter Break Types returned to only those that are associated with the specified location.

  • :limit (Integer)

    Maximum number of Break Types to return per page. Can range between 1 and 200. The default is the maximum at 200.

  • :cursor (String)

    Pointer to the next page of Break Type results to fetch.

Returns:



412
413
414
415
# File 'lib/square_connect/api/labor_api.rb', line 412

def list_break_types(opts = {})
  data, _status_code, _headers = list_break_types_with_http_info(opts)
  return data
end

#list_break_types_with_http_info(opts = {}) ⇒ Array<(ListBreakTypesResponse, Fixnum, Hash)>

ListBreakTypes Returns a paginated list of &#x60;BreakType&#x60; instances for a business.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :location_id (String)

    Filter Break Types returned to only those that are associated with the specified location.

  • :limit (Integer)

    Maximum number of Break Types to return per page. Can range between 1 and 200. The default is the maximum at 200.

  • :cursor (String)

    Pointer to the next page of Break Type results to fetch.

Returns:

  • (Array<(ListBreakTypesResponse, Fixnum, Hash)>)

    ListBreakTypesResponse data, response status code and response headers



424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
# File 'lib/square_connect/api/labor_api.rb', line 424

def list_break_types_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LaborApi.list_break_types ..."
  end
  # resource path
  local_var_path = "/v2/labor/break-types".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'location_id'] = opts[:'location_id'] if !opts[:'location_id'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ListBreakTypesResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LaborApi#list_break_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_employee_wages(opts = {}) ⇒ ListEmployeeWagesResponse

ListEmployeeWages Returns a paginated list of ‘EmployeeWage` instances for a business.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :employee_id (String)

    Filter wages returned to only those that are associated with the specified employee.

  • :limit (Integer)

    Maximum number of Employee Wages to return per page. Can range between 1 and 200. The default is the maximum at 200.

  • :cursor (String)

    Pointer to the next page of Employee Wage results to fetch.

Returns:



472
473
474
475
# File 'lib/square_connect/api/labor_api.rb', line 472

def list_employee_wages(opts = {})
  data, _status_code, _headers = list_employee_wages_with_http_info(opts)
  return data
end

#list_employee_wages_with_http_info(opts = {}) ⇒ Array<(ListEmployeeWagesResponse, Fixnum, Hash)>

ListEmployeeWages Returns a paginated list of &#x60;EmployeeWage&#x60; instances for a business.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :employee_id (String)

    Filter wages returned to only those that are associated with the specified employee.

  • :limit (Integer)

    Maximum number of Employee Wages to return per page. Can range between 1 and 200. The default is the maximum at 200.

  • :cursor (String)

    Pointer to the next page of Employee Wage results to fetch.

Returns:

  • (Array<(ListEmployeeWagesResponse, Fixnum, Hash)>)

    ListEmployeeWagesResponse data, response status code and response headers



484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
# File 'lib/square_connect/api/labor_api.rb', line 484

def list_employee_wages_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LaborApi.list_employee_wages ..."
  end
  # resource path
  local_var_path = "/v2/labor/employee-wages".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'employee_id'] = opts[:'employee_id'] if !opts[:'employee_id'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ListEmployeeWagesResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LaborApi#list_employee_wages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_workweek_configs(opts = {}) ⇒ ListWorkweekConfigsResponse

ListWorkweekConfigs Returns a list of ‘WorkweekConfig` instances for a business.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Maximum number of Workweek Configs to return per page.

  • :cursor (String)

    Pointer to the next page of Workweek Config results to fetch.

Returns:



531
532
533
534
# File 'lib/square_connect/api/labor_api.rb', line 531

def list_workweek_configs(opts = {})
  data, _status_code, _headers = list_workweek_configs_with_http_info(opts)
  return data
end

#list_workweek_configs_with_http_info(opts = {}) ⇒ Array<(ListWorkweekConfigsResponse, Fixnum, Hash)>

ListWorkweekConfigs Returns a list of &#x60;WorkweekConfig&#x60; instances for a business.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Maximum number of Workweek Configs to return per page.

  • :cursor (String)

    Pointer to the next page of Workweek Config results to fetch.

Returns:



542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
# File 'lib/square_connect/api/labor_api.rb', line 542

def list_workweek_configs_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LaborApi.list_workweek_configs ..."
  end
  # resource path
  local_var_path = "/v2/labor/workweek-configs".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ListWorkweekConfigsResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LaborApi#list_workweek_configs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#search_shifts(body, opts = {}) ⇒ SearchShiftsResponse

SearchShifts Returns a paginated list of ‘Shift` records for a business. The list to be returned can be filtered by: - Location IDs and - employee IDs and - shift status (`OPEN`, `CLOSED`) and - shift start and - shift end and - work day details The list can be sorted by: - `start_at` - `end_at` - `created_at` - `updated_at`

Parameters:

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



587
588
589
590
# File 'lib/square_connect/api/labor_api.rb', line 587

def search_shifts(body, opts = {})
  data, _status_code, _headers = search_shifts_with_http_info(body, opts)
  return data
end

#search_shifts_with_http_info(body, opts = {}) ⇒ Array<(SearchShiftsResponse, Fixnum, Hash)>

SearchShifts Returns a paginated list of &#x60;Shift&#x60; records for a business. The list to be returned can be filtered by: - Location IDs and - employee IDs and - shift status (&#x60;OPEN&#x60;, &#x60;CLOSED&#x60;) and - shift start and - shift end and - work day details The list can be sorted by: - &#x60;start_at&#x60; - &#x60;end_at&#x60; - &#x60;created_at&#x60; - &#x60;updated_at&#x60;

Parameters:

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(SearchShiftsResponse, Fixnum, Hash)>)

    SearchShiftsResponse data, response status code and response headers



597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
# File 'lib/square_connect/api/labor_api.rb', line 597

def search_shifts_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LaborApi.search_shifts ..."
  end
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling LaborApi.search_shifts" if body.nil?
  # resource path
  local_var_path = "/v2/labor/shifts/search".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SearchShiftsResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LaborApi#search_shifts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_break_type(id, body, opts = {}) ⇒ UpdateBreakTypeResponse

UpdateBreakType Updates an existing ‘BreakType`.

Parameters:

  • id

    UUID for the &#x60;BreakType&#x60; being updated.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



643
644
645
646
# File 'lib/square_connect/api/labor_api.rb', line 643

def update_break_type(id, body, opts = {})
  data, _status_code, _headers = update_break_type_with_http_info(id, body, opts)
  return data
end

#update_break_type_with_http_info(id, body, opts = {}) ⇒ Array<(UpdateBreakTypeResponse, Fixnum, Hash)>

UpdateBreakType Updates an existing &#x60;BreakType&#x60;.

Parameters:

  • id

    UUID for the &#x60;BreakType&#x60; being updated.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(UpdateBreakTypeResponse, Fixnum, Hash)>)

    UpdateBreakTypeResponse data, response status code and response headers



654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
# File 'lib/square_connect/api/labor_api.rb', line 654

def update_break_type_with_http_info(id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LaborApi.update_break_type ..."
  end
  # verify the required parameter 'id' is set
  fail ArgumentError, "Missing the required parameter 'id' when calling LaborApi.update_break_type" if id.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling LaborApi.update_break_type" if body.nil?
  # resource path
  local_var_path = "/v2/labor/break-types/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'UpdateBreakTypeResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LaborApi#update_break_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_shift(id, body, opts = {}) ⇒ UpdateShiftResponse

UpdateShift Updates an existing ‘Shift`. When adding a `Break` to a `Shift`, any earlier `Breaks` in the `Shift` have the `end_at` property set to a valid RFC-3339 datetime string. When closing a `Shift`, all `Break` instances in the shift must be complete with `end_at` set on each `Break`.

Parameters:

  • id

    ID of the object being updated.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



702
703
704
705
# File 'lib/square_connect/api/labor_api.rb', line 702

def update_shift(id, body, opts = {})
  data, _status_code, _headers = update_shift_with_http_info(id, body, opts)
  return data
end

#update_shift_with_http_info(id, body, opts = {}) ⇒ Array<(UpdateShiftResponse, Fixnum, Hash)>

UpdateShift Updates an existing &#x60;Shift&#x60;. When adding a &#x60;Break&#x60; to a &#x60;Shift&#x60;, any earlier &#x60;Breaks&#x60; in the &#x60;Shift&#x60; have the &#x60;end_at&#x60; property set to a valid RFC-3339 datetime string. When closing a &#x60;Shift&#x60;, all &#x60;Break&#x60; instances in the shift must be complete with &#x60;end_at&#x60; set on each &#x60;Break&#x60;.

Parameters:

  • id

    ID of the object being updated.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(UpdateShiftResponse, Fixnum, Hash)>)

    UpdateShiftResponse data, response status code and response headers



713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
# File 'lib/square_connect/api/labor_api.rb', line 713

def update_shift_with_http_info(id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LaborApi.update_shift ..."
  end
  # verify the required parameter 'id' is set
  fail ArgumentError, "Missing the required parameter 'id' when calling LaborApi.update_shift" if id.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling LaborApi.update_shift" if body.nil?
  # resource path
  local_var_path = "/v2/labor/shifts/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'UpdateShiftResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LaborApi#update_shift\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_workweek_config(id, body, opts = {}) ⇒ UpdateWorkweekConfigResponse

UpdateWorkweekConfig Updates a ‘WorkweekConfig`.

Parameters:

  • id

    UUID for the &#x60;WorkweekConfig&#x60; object being updated.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



761
762
763
764
# File 'lib/square_connect/api/labor_api.rb', line 761

def update_workweek_config(id, body, opts = {})
  data, _status_code, _headers = update_workweek_config_with_http_info(id, body, opts)
  return data
end

#update_workweek_config_with_http_info(id, body, opts = {}) ⇒ Array<(UpdateWorkweekConfigResponse, Fixnum, Hash)>

UpdateWorkweekConfig Updates a &#x60;WorkweekConfig&#x60;.

Parameters:

  • id

    UUID for the &#x60;WorkweekConfig&#x60; object being updated.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
# File 'lib/square_connect/api/labor_api.rb', line 772

def update_workweek_config_with_http_info(id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LaborApi.update_workweek_config ..."
  end
  # verify the required parameter 'id' is set
  fail ArgumentError, "Missing the required parameter 'id' when calling LaborApi.update_workweek_config" if id.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling LaborApi.update_workweek_config" if body.nil?
  # resource path
  local_var_path = "/v2/labor/workweek-configs/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'UpdateWorkweekConfigResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LaborApi#update_workweek_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end