Class: SquareConnect::V1EmployeesApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ V1EmployeesApi

Returns a new instance of V1EmployeesApi.



16
17
18
# File 'lib/square_connect/api/v1_employees_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/v1_employees_api.rb', line 14

def api_client
  @api_client
end

Instance Method Details

#create_employee(body, opts = {}) ⇒ V1Employee

CreateEmployee

Use the CreateEmployee endpoint to add an employee to a Square account. Employees created with the Connect API have an initial status of `INACTIVE`. Inactive employees cannot sign in to Square Point of Sale until they are activated from the Square Dashboard. Employee status cannot be changed with the Connect API.  <aside class=\"important\"> Employee entities cannot be deleted. To disable employee profiles, set the employee's status to <code>INACTIVE</code> </aside>

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/v1_employees_api.rb', line 25

def create_employee(body, opts = {})
  data, _status_code, _headers = create_employee_with_http_info(body, opts)
  return data
end

#create_employee_role(employee_role, opts = {}) ⇒ V1EmployeeRole

CreateEmployeeRole Creates an employee role you can then assign to employees. Square accounts can include any number of roles that can be assigned to employees. These roles define the actions and permissions granted to an employee with that role. For example, an employee with a "Shift Manager" role might be able to issue refunds in Square Point of Sale, whereas an employee with a "Clerk" role might not. Roles are assigned with the [V1UpdateEmployee](#endpoint-v1updateemployee) endpoint. An employee can have only one role at a time. If an employee has no role, they have none of the permissions associated with roles. All employees can accept payments with Square Point of Sale.

Parameters:

  • employee_role

    An EmployeeRole object with a name and permissions, and an optional owner flag.

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

    the optional parameters

Returns:



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

def create_employee_role(employee_role, opts = {})
  data, _status_code, _headers = create_employee_role_with_http_info(employee_role, opts)
  return data
end

#create_employee_role_with_http_info(employee_role, opts = {}) ⇒ Array<(V1EmployeeRole, Fixnum, Hash)>

CreateEmployeeRole Creates an employee role you can then assign to employees. Square accounts can include any number of roles that can be assigned to employees. These roles define the actions and permissions granted to an employee with that role. For example, an employee with a &quot;Shift Manager&quot; role might be able to issue refunds in Square Point of Sale, whereas an employee with a &quot;Clerk&quot; role might not. Roles are assigned with the [V1UpdateEmployee](#endpoint-v1updateemployee) endpoint. An employee can have only one role at a time. If an employee has no role, they have none of the permissions associated with roles. All employees can accept payments with Square Point of Sale.

Parameters:

  • employee_role

    An EmployeeRole object with a name and permissions, and an optional owner flag.

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

    the optional parameters

Returns:

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

    V1EmployeeRole 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/v1_employees_api.rb', line 90

def create_employee_role_with_http_info(employee_role, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1EmployeesApi.create_employee_role ..."
  end
  # verify the required parameter 'employee_role' is set
  fail ArgumentError, "Missing the required parameter 'employee_role' when calling V1EmployeesApi.create_employee_role" if employee_role.nil?
  # resource path
  local_var_path = "/v1/me/roles".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(employee_role)
  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 => 'V1EmployeeRole')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1EmployeesApi#create_employee_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_employee_with_http_info(body, opts = {}) ⇒ Array<(V1Employee, Fixnum, Hash)>

CreateEmployee

Use the CreateEmployee endpoint to add an employee to a Square account. Employees created with the Connect API have an initial status of &#x60;INACTIVE&#x60;. Inactive employees cannot sign in to Square Point of Sale until they are activated from the Square Dashboard. Employee status cannot be changed with the Connect API.  &lt;aside class&#x3D;\&quot;important\&quot;&gt; Employee entities cannot be deleted. To disable employee profiles, set the employee&#39;s status to &lt;code&gt;INACTIVE&lt;/code&gt; &lt;/aside&gt;

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<(V1Employee, Fixnum, Hash)>)

    V1Employee 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/v1_employees_api.rb', line 35

def create_employee_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1EmployeesApi.create_employee ..."
  end
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling V1EmployeesApi.create_employee" if body.nil?
  # resource path
  local_var_path = "/v1/me/employees".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 => 'V1Employee')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1EmployeesApi#create_employee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_timecard(body, opts = {}) ⇒ V1Timecard

CreateTimecard Creates a timecard for an employee and clocks them in with an ‘API_CREATE` event and a `clockin_time` set to the current time unless the request provides a different value. To import timecards from another system (rather than clocking someone in). Specify the `clockin_time` and* `clockout_time` in the request. Timecards correspond to exactly one shift for a given employee, bounded by the `clockin_time` and `clockout_time` fields. An employee is considered clocked in if they have a timecard that doesn’t have a ‘clockout_time` set. An employee that is currently clocked in cannot be clocked in a second time.

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:



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

def create_timecard(body, opts = {})
  data, _status_code, _headers = create_timecard_with_http_info(body, opts)
  return data
end

#create_timecard_with_http_info(body, opts = {}) ⇒ Array<(V1Timecard, Fixnum, Hash)>

CreateTimecard Creates a timecard for an employee and clocks them in with an &#x60;API_CREATE&#x60; event and a &#x60;clockin_time&#x60; set to the current time unless the request provides a different value. To import timecards from another system (rather than clocking someone in). Specify the &#x60;clockin_time&#x60; and* &#x60;clockout_time&#x60; in the request. Timecards correspond to exactly one shift for a given employee, bounded by the &#x60;clockin_time&#x60; and &#x60;clockout_time&#x60; fields. An employee is considered clocked in if they have a timecard that doesn&#39;t have a &#x60;clockout_time&#x60; set. An employee that is currently clocked in cannot be clocked in a second time.

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<(V1Timecard, Fixnum, Hash)>)

    V1Timecard 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/v1_employees_api.rb', line 145

def create_timecard_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1EmployeesApi.create_timecard ..."
  end
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling V1EmployeesApi.create_timecard" if body.nil?
  # resource path
  local_var_path = "/v1/me/timecards".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 => 'V1Timecard')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1EmployeesApi#create_timecard\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_timecard(timecard_id, opts = {}) ⇒ Object

DeleteTimecard Deletes a timecard. Timecards can also be deleted through the Square Dashboard. Deleted timecards are still accessible through Connect API endpoints, but cannot be modified. The ‘deleted` field of the `Timecard` object indicates whether the timecard has been deleted. Note*: By default, deleted timecards appear alongside valid timecards in results returned by the [ListTimecards](#endpoint-v1employees-listtimecards) endpoint. To filter deleted timecards, include the `deleted` query parameter in the list request. <aside> Only approved accounts can manage their employees with Square. Unapproved accounts cannot use employee management features with the API. </aside>

Parameters:

  • timecard_id

    The ID of the timecard to delete.

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

    the optional parameters

Returns:

  • (Object)


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

def delete_timecard(timecard_id, opts = {})
  data, _status_code, _headers = delete_timecard_with_http_info(timecard_id, opts)
  return data
end

#delete_timecard_with_http_info(timecard_id, opts = {}) ⇒ Array<(Object, Fixnum, Hash)>

DeleteTimecard Deletes a timecard. Timecards can also be deleted through the Square Dashboard. Deleted timecards are still accessible through Connect API endpoints, but cannot be modified. The &#x60;deleted&#x60; field of the &#x60;Timecard&#x60; object indicates whether the timecard has been deleted. Note*: By default, deleted timecards appear alongside valid timecards in results returned by the [ListTimecards](#endpoint-v1employees-listtimecards) endpoint. To filter deleted timecards, include the &#x60;deleted&#x60; query parameter in the list request. &lt;aside&gt; Only approved accounts can manage their employees with Square. Unapproved accounts cannot use employee management features with the API. &lt;/aside&gt;

Parameters:

  • timecard_id

    The ID of the timecard to delete.

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

    the optional parameters

Returns:

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

    Object 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/v1_employees_api.rb', line 200

def delete_timecard_with_http_info(timecard_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1EmployeesApi.delete_timecard ..."
  end
  # verify the required parameter 'timecard_id' is set
  fail ArgumentError, "Missing the required parameter 'timecard_id' when calling V1EmployeesApi.delete_timecard" if timecard_id.nil?
  # resource path
  local_var_path = "/v1/me/timecards/{timecard_id}".sub('{format}','json').sub('{' + 'timecard_id' + '}', timecard_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 => 'Object')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1EmployeesApi#delete_timecard\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_cash_drawer_shifts(location_id, opts = {}) ⇒ Array<V1CashDrawerShift>

ListCashDrawerShifts Provides the details for all of a location’s cash drawer shifts during a date range. The date range you specify cannot exceed 90 days.

Parameters:

  • location_id

    The ID of the location to list cash drawer shifts for.

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

    the optional parameters

Options Hash (opts):

  • :order (String)

    The order in which cash drawer shifts are listed in the response, based on their created_at field. Default value: ASC

  • :begin_time (String)

    The beginning of the requested reporting period, in ISO 8601 format. Default value: The current time minus 90 days.

  • :end_time (String)

    The beginning of the requested reporting period, in ISO 8601 format. Default value: The current time.

Returns:



248
249
250
251
# File 'lib/square_connect/api/v1_employees_api.rb', line 248

def list_cash_drawer_shifts(location_id, opts = {})
  data, _status_code, _headers = list_cash_drawer_shifts_with_http_info(location_id, opts)
  return data
end

#list_cash_drawer_shifts_with_http_info(location_id, opts = {}) ⇒ Array<(Array<V1CashDrawerShift>, Fixnum, Hash)>

ListCashDrawerShifts Provides the details for all of a location&#39;s cash drawer shifts during a date range. The date range you specify cannot exceed 90 days.

Parameters:

  • location_id

    The ID of the location to list cash drawer shifts for.

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

    the optional parameters

Options Hash (opts):

  • :order (String)

    The order in which cash drawer shifts are listed in the response, based on their created_at field. Default value: ASC

  • :begin_time (String)

    The beginning of the requested reporting period, in ISO 8601 format. Default value: The current time minus 90 days.

  • :end_time (String)

    The beginning of the requested reporting period, in ISO 8601 format. Default value: The current time.

Returns:

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

    Array<V1CashDrawerShift> data, response status code and response headers



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
294
295
296
297
298
299
300
301
302
# File 'lib/square_connect/api/v1_employees_api.rb', line 261

def list_cash_drawer_shifts_with_http_info(location_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1EmployeesApi.list_cash_drawer_shifts ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1EmployeesApi.list_cash_drawer_shifts" if location_id.nil?
  # resource path
  local_var_path = "/v1/{location_id}/cash-drawer-shifts".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'begin_time'] = opts[:'begin_time'] if !opts[:'begin_time'].nil?
  query_params[:'end_time'] = opts[:'end_time'] if !opts[:'end_time'].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 => 'Array<V1CashDrawerShift>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1EmployeesApi#list_cash_drawer_shifts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_employee_roles(opts = {}) ⇒ Array<V1EmployeeRole>

ListEmployeeRoles Provides summary information for all of a business’s employee roles.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :order (String)

    The order in which employees are listed in the response, based on their created_at field.Default value: ASC

  • :limit (Integer)

    The maximum integer number of employee entities to return in a single response. Default 100, maximum 200.

  • :batch_token (String)

    A pagination cursor to retrieve the next set of results for your original query to the endpoint.

Returns:



311
312
313
314
# File 'lib/square_connect/api/v1_employees_api.rb', line 311

def list_employee_roles(opts = {})
  data, _status_code, _headers = list_employee_roles_with_http_info(opts)
  return data
end

#list_employee_roles_with_http_info(opts = {}) ⇒ Array<(Array<V1EmployeeRole>, Fixnum, Hash)>

ListEmployeeRoles Provides summary information for all of a business&#39;s employee roles.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :order (String)

    The order in which employees are listed in the response, based on their created_at field.Default value: ASC

  • :limit (Integer)

    The maximum integer number of employee entities to return in a single response. Default 100, maximum 200.

  • :batch_token (String)

    A pagination cursor to retrieve the next set of results for your original query to the endpoint.

Returns:

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

    Array<V1EmployeeRole> data, response status code and response headers



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
349
350
351
352
353
354
355
356
357
358
359
360
361
362
# File 'lib/square_connect/api/v1_employees_api.rb', line 323

def list_employee_roles_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1EmployeesApi.list_employee_roles ..."
  end
  # resource path
  local_var_path = "/v1/me/roles".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'batch_token'] = opts[:'batch_token'] if !opts[:'batch_token'].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 => 'Array<V1EmployeeRole>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1EmployeesApi#list_employee_roles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_employees(opts = {}) ⇒ Array<V1Employee>

ListEmployees Provides summary information for all of a business’s employees.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :order (String)

    The order in which employees are listed in the response, based on their created_at field. Default value: ASC

  • :begin_updated_at (String)

    If filtering results by their updated_at field, the beginning of the requested reporting period, in ISO 8601 format

  • :end_updated_at (String)

    If filtering results by there updated_at field, the end of the requested reporting period, in ISO 8601 format.

  • :begin_created_at (String)

    If filtering results by their created_at field, the beginning of the requested reporting period, in ISO 8601 format.

  • :end_created_at (String)

    If filtering results by their created_at field, the end of the requested reporting period, in ISO 8601 format.

  • :status (String)

    If provided, the endpoint returns only employee entities with the specified status (ACTIVE or INACTIVE).

  • :external_id (String)

    If provided, the endpoint returns only employee entities with the specified external_id.

  • :limit (Integer)

    The maximum integer number of employee entities to return in a single response. Default 100, maximum 200.

  • :batch_token (String)

    A pagination cursor to retrieve the next set of results for your original query to the endpoint.

Returns:



377
378
379
380
# File 'lib/square_connect/api/v1_employees_api.rb', line 377

def list_employees(opts = {})
  data, _status_code, _headers = list_employees_with_http_info(opts)
  return data
end

#list_employees_with_http_info(opts = {}) ⇒ Array<(Array<V1Employee>, Fixnum, Hash)>

ListEmployees Provides summary information for all of a business&#39;s employees.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :order (String)

    The order in which employees are listed in the response, based on their created_at field. Default value: ASC

  • :begin_updated_at (String)

    If filtering results by their updated_at field, the beginning of the requested reporting period, in ISO 8601 format

  • :end_updated_at (String)

    If filtering results by there updated_at field, the end of the requested reporting period, in ISO 8601 format.

  • :begin_created_at (String)

    If filtering results by their created_at field, the beginning of the requested reporting period, in ISO 8601 format.

  • :end_created_at (String)

    If filtering results by their created_at field, the end of the requested reporting period, in ISO 8601 format.

  • :status (String)

    If provided, the endpoint returns only employee entities with the specified status (ACTIVE or INACTIVE).

  • :external_id (String)

    If provided, the endpoint returns only employee entities with the specified external_id.

  • :limit (Integer)

    The maximum integer number of employee entities to return in a single response. Default 100, maximum 200.

  • :batch_token (String)

    A pagination cursor to retrieve the next set of results for your original query to the endpoint.

Returns:

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

    Array<V1Employee> data, response status code and response headers



395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
# File 'lib/square_connect/api/v1_employees_api.rb', line 395

def list_employees_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1EmployeesApi.list_employees ..."
  end
  # resource path
  local_var_path = "/v1/me/employees".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'begin_updated_at'] = opts[:'begin_updated_at'] if !opts[:'begin_updated_at'].nil?
  query_params[:'end_updated_at'] = opts[:'end_updated_at'] if !opts[:'end_updated_at'].nil?
  query_params[:'begin_created_at'] = opts[:'begin_created_at'] if !opts[:'begin_created_at'].nil?
  query_params[:'end_created_at'] = opts[:'end_created_at'] if !opts[:'end_created_at'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'external_id'] = opts[:'external_id'] if !opts[:'external_id'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'batch_token'] = opts[:'batch_token'] if !opts[:'batch_token'].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 => 'Array<V1Employee>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1EmployeesApi#list_employees\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_timecard_events(timecard_id, opts = {}) ⇒ Array<V1TimecardEvent>

ListTimecardEvents Provides summary information for all events associated with a particular timecard. <aside> Only approved accounts can manage their employees with Square. Unapproved accounts cannot use employee management features with the API. </aside>

Parameters:

  • timecard_id

    The ID of the timecard to list events for.

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

    the optional parameters

Returns:



447
448
449
450
# File 'lib/square_connect/api/v1_employees_api.rb', line 447

def list_timecard_events(timecard_id, opts = {})
  data, _status_code, _headers = list_timecard_events_with_http_info(timecard_id, opts)
  return data
end

#list_timecard_events_with_http_info(timecard_id, opts = {}) ⇒ Array<(Array<V1TimecardEvent>, Fixnum, Hash)>

ListTimecardEvents Provides summary information for all events associated with a particular timecard. &lt;aside&gt; Only approved accounts can manage their employees with Square. Unapproved accounts cannot use employee management features with the API. &lt;/aside&gt;

Parameters:

  • timecard_id

    The ID of the timecard to list events for.

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

    the optional parameters

Returns:

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

    Array<V1TimecardEvent> data, response status code and response headers



457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
# File 'lib/square_connect/api/v1_employees_api.rb', line 457

def list_timecard_events_with_http_info(timecard_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1EmployeesApi.list_timecard_events ..."
  end
  # verify the required parameter 'timecard_id' is set
  fail ArgumentError, "Missing the required parameter 'timecard_id' when calling V1EmployeesApi.list_timecard_events" if timecard_id.nil?
  # resource path
  local_var_path = "/v1/me/timecards/{timecard_id}/events".sub('{format}','json').sub('{' + 'timecard_id' + '}', timecard_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 => 'Array<V1TimecardEvent>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1EmployeesApi#list_timecard_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_timecards(opts = {}) ⇒ Array<V1Timecard>

ListTimecards Provides summary information for all of a business’s employee timecards.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :order (String)

    The order in which timecards are listed in the response, based on their created_at field.

  • :employee_id (String)

    If provided, the endpoint returns only timecards for the employee with the specified ID.

  • :begin_clockin_time (String)

    If filtering results by their clockin_time field, the beginning of the requested reporting period, in ISO 8601 format.

  • :end_clockin_time (String)

    If filtering results by their clockin_time field, the end of the requested reporting period, in ISO 8601 format.

  • :begin_clockout_time (String)

    If filtering results by their clockout_time field, the beginning of the requested reporting period, in ISO 8601 format.

  • :end_clockout_time (String)

    If filtering results by their clockout_time field, the end of the requested reporting period, in ISO 8601 format.

  • :begin_updated_at (String)

    If filtering results by their updated_at field, the beginning of the requested reporting period, in ISO 8601 format.

  • :end_updated_at (String)

    If filtering results by their updated_at field, the end of the requested reporting period, in ISO 8601 format.

  • :deleted (BOOLEAN)

    If true, only deleted timecards are returned. If false, only valid timecards are returned.If you don&#39;t provide this parameter, both valid and deleted timecards are returned.

  • :limit (Integer)

    The maximum integer number of employee entities to return in a single response. Default 100, maximum 200.

  • :batch_token (String)

    A pagination cursor to retrieve the next set of results for your original query to the endpoint.

Returns:



512
513
514
515
# File 'lib/square_connect/api/v1_employees_api.rb', line 512

def list_timecards(opts = {})
  data, _status_code, _headers = list_timecards_with_http_info(opts)
  return data
end

#list_timecards_with_http_info(opts = {}) ⇒ Array<(Array<V1Timecard>, Fixnum, Hash)>

ListTimecards Provides summary information for all of a business&#39;s employee timecards.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :order (String)

    The order in which timecards are listed in the response, based on their created_at field.

  • :employee_id (String)

    If provided, the endpoint returns only timecards for the employee with the specified ID.

  • :begin_clockin_time (String)

    If filtering results by their clockin_time field, the beginning of the requested reporting period, in ISO 8601 format.

  • :end_clockin_time (String)

    If filtering results by their clockin_time field, the end of the requested reporting period, in ISO 8601 format.

  • :begin_clockout_time (String)

    If filtering results by their clockout_time field, the beginning of the requested reporting period, in ISO 8601 format.

  • :end_clockout_time (String)

    If filtering results by their clockout_time field, the end of the requested reporting period, in ISO 8601 format.

  • :begin_updated_at (String)

    If filtering results by their updated_at field, the beginning of the requested reporting period, in ISO 8601 format.

  • :end_updated_at (String)

    If filtering results by their updated_at field, the end of the requested reporting period, in ISO 8601 format.

  • :deleted (BOOLEAN)

    If true, only deleted timecards are returned. If false, only valid timecards are returned.If you don&#39;t provide this parameter, both valid and deleted timecards are returned.

  • :limit (Integer)

    The maximum integer number of employee entities to return in a single response. Default 100, maximum 200.

  • :batch_token (String)

    A pagination cursor to retrieve the next set of results for your original query to the endpoint.

Returns:

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

    Array<V1Timecard> data, response status code and response headers



532
533
534
535
536
537
538
539
540
541
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
# File 'lib/square_connect/api/v1_employees_api.rb', line 532

def list_timecards_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1EmployeesApi.list_timecards ..."
  end
  # resource path
  local_var_path = "/v1/me/timecards".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'employee_id'] = opts[:'employee_id'] if !opts[:'employee_id'].nil?
  query_params[:'begin_clockin_time'] = opts[:'begin_clockin_time'] if !opts[:'begin_clockin_time'].nil?
  query_params[:'end_clockin_time'] = opts[:'end_clockin_time'] if !opts[:'end_clockin_time'].nil?
  query_params[:'begin_clockout_time'] = opts[:'begin_clockout_time'] if !opts[:'begin_clockout_time'].nil?
  query_params[:'end_clockout_time'] = opts[:'end_clockout_time'] if !opts[:'end_clockout_time'].nil?
  query_params[:'begin_updated_at'] = opts[:'begin_updated_at'] if !opts[:'begin_updated_at'].nil?
  query_params[:'end_updated_at'] = opts[:'end_updated_at'] if !opts[:'end_updated_at'].nil?
  query_params[:'deleted'] = opts[:'deleted'] if !opts[:'deleted'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'batch_token'] = opts[:'batch_token'] if !opts[:'batch_token'].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 => 'Array<V1Timecard>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1EmployeesApi#list_timecards\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#retrieve_cash_drawer_shift(location_id, shift_id, opts = {}) ⇒ V1CashDrawerShift

RetrieveCashDrawerShift Provides the details for a single cash drawer shift, including all events that occurred during the shift.

Parameters:

  • location_id

    The ID of the location to list cash drawer shifts for.

  • shift_id

    The shift&#39;s ID.

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

    the optional parameters

Returns:



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

def retrieve_cash_drawer_shift(location_id, shift_id, opts = {})
  data, _status_code, _headers = retrieve_cash_drawer_shift_with_http_info(location_id, shift_id, opts)
  return data
end

#retrieve_cash_drawer_shift_with_http_info(location_id, shift_id, opts = {}) ⇒ Array<(V1CashDrawerShift, Fixnum, Hash)>

RetrieveCashDrawerShift Provides the details for a single cash drawer shift, including all events that occurred during the shift.

Parameters:

  • location_id

    The ID of the location to list cash drawer shifts for.

  • shift_id

    The shift&#39;s ID.

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

    the optional parameters

Returns:

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

    V1CashDrawerShift data, response status code and response headers



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
636
637
638
# File 'lib/square_connect/api/v1_employees_api.rb', line 598

def retrieve_cash_drawer_shift_with_http_info(location_id, shift_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1EmployeesApi.retrieve_cash_drawer_shift ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1EmployeesApi.retrieve_cash_drawer_shift" if location_id.nil?
  # verify the required parameter 'shift_id' is set
  fail ArgumentError, "Missing the required parameter 'shift_id' when calling V1EmployeesApi.retrieve_cash_drawer_shift" if shift_id.nil?
  # resource path
  local_var_path = "/v1/{location_id}/cash-drawer-shifts/{shift_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'shift_id' + '}', shift_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 => 'V1CashDrawerShift')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1EmployeesApi#retrieve_cash_drawer_shift\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#retrieve_employee(employee_id, opts = {}) ⇒ V1Employee

RetrieveEmployee Provides the details for a single employee.

Parameters:

  • employee_id

    The employee&#39;s ID.

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

    the optional parameters

Returns:



645
646
647
648
# File 'lib/square_connect/api/v1_employees_api.rb', line 645

def retrieve_employee(employee_id, opts = {})
  data, _status_code, _headers = retrieve_employee_with_http_info(employee_id, opts)
  return data
end

#retrieve_employee_role(role_id, opts = {}) ⇒ V1EmployeeRole

RetrieveEmployeeRole Provides the details for a single employee role.

Parameters:

  • role_id

    The role&#39;s ID.

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

    the optional parameters

Returns:



700
701
702
703
# File 'lib/square_connect/api/v1_employees_api.rb', line 700

def retrieve_employee_role(role_id, opts = {})
  data, _status_code, _headers = retrieve_employee_role_with_http_info(role_id, opts)
  return data
end

#retrieve_employee_role_with_http_info(role_id, opts = {}) ⇒ Array<(V1EmployeeRole, Fixnum, Hash)>

RetrieveEmployeeRole Provides the details for a single employee role.

Parameters:

  • role_id

    The role&#39;s ID.

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

    the optional parameters

Returns:

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

    V1EmployeeRole data, response status code and response headers



710
711
712
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
# File 'lib/square_connect/api/v1_employees_api.rb', line 710

def retrieve_employee_role_with_http_info(role_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1EmployeesApi.retrieve_employee_role ..."
  end
  # verify the required parameter 'role_id' is set
  fail ArgumentError, "Missing the required parameter 'role_id' when calling V1EmployeesApi.retrieve_employee_role" if role_id.nil?
  # resource path
  local_var_path = "/v1/me/roles/{role_id}".sub('{format}','json').sub('{' + 'role_id' + '}', role_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 => 'V1EmployeeRole')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1EmployeesApi#retrieve_employee_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#retrieve_employee_with_http_info(employee_id, opts = {}) ⇒ Array<(V1Employee, Fixnum, Hash)>

RetrieveEmployee Provides the details for a single employee.

Parameters:

  • employee_id

    The employee&#39;s ID.

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

    the optional parameters

Returns:

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

    V1Employee data, response status code and response headers



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
# File 'lib/square_connect/api/v1_employees_api.rb', line 655

def retrieve_employee_with_http_info(employee_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1EmployeesApi.retrieve_employee ..."
  end
  # verify the required parameter 'employee_id' is set
  fail ArgumentError, "Missing the required parameter 'employee_id' when calling V1EmployeesApi.retrieve_employee" if employee_id.nil?
  # resource path
  local_var_path = "/v1/me/employees/{employee_id}".sub('{format}','json').sub('{' + 'employee_id' + '}', employee_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 => 'V1Employee')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1EmployeesApi#retrieve_employee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#retrieve_timecard(timecard_id, opts = {}) ⇒ V1Timecard

RetrieveTimecard Provides the details for a single timecard. <aside> Only approved accounts can manage their employees with Square. Unapproved accounts cannot use employee management features with the API. </aside>

Parameters:

  • timecard_id

    The timecard&#39;s ID.

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

    the optional parameters

Returns:



755
756
757
758
# File 'lib/square_connect/api/v1_employees_api.rb', line 755

def retrieve_timecard(timecard_id, opts = {})
  data, _status_code, _headers = retrieve_timecard_with_http_info(timecard_id, opts)
  return data
end

#retrieve_timecard_with_http_info(timecard_id, opts = {}) ⇒ Array<(V1Timecard, Fixnum, Hash)>

RetrieveTimecard Provides the details for a single timecard. &lt;aside&gt; Only approved accounts can manage their employees with Square. Unapproved accounts cannot use employee management features with the API. &lt;/aside&gt;

Parameters:

  • timecard_id

    The timecard&#39;s ID.

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

    the optional parameters

Returns:

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

    V1Timecard data, response status code and response headers



765
766
767
768
769
770
771
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
# File 'lib/square_connect/api/v1_employees_api.rb', line 765

def retrieve_timecard_with_http_info(timecard_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1EmployeesApi.retrieve_timecard ..."
  end
  # verify the required parameter 'timecard_id' is set
  fail ArgumentError, "Missing the required parameter 'timecard_id' when calling V1EmployeesApi.retrieve_timecard" if timecard_id.nil?
  # resource path
  local_var_path = "/v1/me/timecards/{timecard_id}".sub('{format}','json').sub('{' + 'timecard_id' + '}', timecard_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 => 'V1Timecard')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1EmployeesApi#retrieve_timecard\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_employee(employee_id, body, opts = {}) ⇒ V1Employee

UpdateEmployee

Parameters:

  • employee_id

    The ID of the role to modify.

  • 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:



811
812
813
814
# File 'lib/square_connect/api/v1_employees_api.rb', line 811

def update_employee(employee_id, body, opts = {})
  data, _status_code, _headers = update_employee_with_http_info(employee_id, body, opts)
  return data
end

#update_employee_role(role_id, body, opts = {}) ⇒ V1EmployeeRole

UpdateEmployeeRole Modifies the details of an employee role.

Parameters:

  • role_id

    The ID of the role to modify.

  • 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:



870
871
872
873
# File 'lib/square_connect/api/v1_employees_api.rb', line 870

def update_employee_role(role_id, body, opts = {})
  data, _status_code, _headers = update_employee_role_with_http_info(role_id, body, opts)
  return data
end

#update_employee_role_with_http_info(role_id, body, opts = {}) ⇒ Array<(V1EmployeeRole, Fixnum, Hash)>

UpdateEmployeeRole Modifies the details of an employee role.

Parameters:

  • role_id

    The ID of the role to modify.

  • 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<(V1EmployeeRole, Fixnum, Hash)>)

    V1EmployeeRole data, response status code and response headers



881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
# File 'lib/square_connect/api/v1_employees_api.rb', line 881

def update_employee_role_with_http_info(role_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1EmployeesApi.update_employee_role ..."
  end
  # verify the required parameter 'role_id' is set
  fail ArgumentError, "Missing the required parameter 'role_id' when calling V1EmployeesApi.update_employee_role" if role_id.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling V1EmployeesApi.update_employee_role" if body.nil?
  # resource path
  local_var_path = "/v1/me/roles/{role_id}".sub('{format}','json').sub('{' + 'role_id' + '}', role_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 => 'V1EmployeeRole')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1EmployeesApi#update_employee_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_employee_with_http_info(employee_id, body, opts = {}) ⇒ Array<(V1Employee, Fixnum, Hash)>

UpdateEmployee

Parameters:

  • employee_id

    The ID of the role to modify.

  • 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<(V1Employee, Fixnum, Hash)>)

    V1Employee data, response status code and response headers



822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
# File 'lib/square_connect/api/v1_employees_api.rb', line 822

def update_employee_with_http_info(employee_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1EmployeesApi.update_employee ..."
  end
  # verify the required parameter 'employee_id' is set
  fail ArgumentError, "Missing the required parameter 'employee_id' when calling V1EmployeesApi.update_employee" if employee_id.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling V1EmployeesApi.update_employee" if body.nil?
  # resource path
  local_var_path = "/v1/me/employees/{employee_id}".sub('{format}','json').sub('{' + 'employee_id' + '}', employee_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 => 'V1Employee')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1EmployeesApi#update_employee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_timecard(timecard_id, body, opts = {}) ⇒ V1Timecard

UpdateTimecard Modifies the details of a timecard with an ‘API_EDIT` event for the timecard. Updating an active timecard with a `clockout_time` clocks the employee out.

Parameters:

  • timecard_id

    TThe ID of the timecard to modify.

  • 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:



929
930
931
932
# File 'lib/square_connect/api/v1_employees_api.rb', line 929

def update_timecard(timecard_id, body, opts = {})
  data, _status_code, _headers = update_timecard_with_http_info(timecard_id, body, opts)
  return data
end

#update_timecard_with_http_info(timecard_id, body, opts = {}) ⇒ Array<(V1Timecard, Fixnum, Hash)>

UpdateTimecard Modifies the details of a timecard with an &#x60;API_EDIT&#x60; event for the timecard. Updating an active timecard with a &#x60;clockout_time&#x60; clocks the employee out.

Parameters:

  • timecard_id

    TThe ID of the timecard to modify.

  • 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<(V1Timecard, Fixnum, Hash)>)

    V1Timecard data, response status code and response headers



940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
# File 'lib/square_connect/api/v1_employees_api.rb', line 940

def update_timecard_with_http_info(timecard_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1EmployeesApi.update_timecard ..."
  end
  # verify the required parameter 'timecard_id' is set
  fail ArgumentError, "Missing the required parameter 'timecard_id' when calling V1EmployeesApi.update_timecard" if timecard_id.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling V1EmployeesApi.update_timecard" if body.nil?
  # resource path
  local_var_path = "/v1/me/timecards/{timecard_id}".sub('{format}','json').sub('{' + 'timecard_id' + '}', timecard_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 => 'V1Timecard')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1EmployeesApi#update_timecard\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end