Class: SquareConnect::V1EmployeesApi
- Inherits:
-
Object
- Object
- SquareConnect::V1EmployeesApi
- Defined in:
- lib/square_connect/api/v1_employees_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_employee(body, opts = {}) ⇒ V1Employee
Creates an employee for a business.
-
#create_employee_role(employee_role, opts = {}) ⇒ V1EmployeeRole
Creates an employee role you can then assign to employees.
-
#create_employee_role_with_http_info(employee_role, opts = {}) ⇒ Array<(V1EmployeeRole, Fixnum, Hash)>
Creates an employee role you can then assign to employees.
-
#create_employee_with_http_info(body, opts = {}) ⇒ Array<(V1Employee, Fixnum, Hash)>
Creates an employee for a business.
-
#create_timecard(body, opts = {}) ⇒ V1Timecard
Creates a timecard for an employee.
-
#create_timecard_with_http_info(body, opts = {}) ⇒ Array<(V1Timecard, Fixnum, Hash)>
Creates a timecard for an employee.
-
#delete_timecard(timecard_id, opts = {}) ⇒ Object
Deletes a timecard.
-
#delete_timecard_with_http_info(timecard_id, opts = {}) ⇒ Array<(Object, Fixnum, Hash)>
Deletes a timecard.
-
#initialize(api_client = ApiClient.default) ⇒ V1EmployeesApi
constructor
A new instance of V1EmployeesApi.
-
#list_cash_drawer_shifts(location_id, opts = {}) ⇒ Array<V1CashDrawerShift>
Provides the details for all of a location’s cash drawer shifts during a date range.
-
#list_cash_drawer_shifts_with_http_info(location_id, opts = {}) ⇒ Array<(Array<V1CashDrawerShift>, Fixnum, Hash)>
Provides the details for all of a location's cash drawer shifts during a date range.
-
#list_employee_roles(opts = {}) ⇒ Array<V1EmployeeRole>
Provides summary information for all of a business’s employee roles.
-
#list_employee_roles_with_http_info(opts = {}) ⇒ Array<(Array<V1EmployeeRole>, Fixnum, Hash)>
Provides summary information for all of a business's employee roles.
-
#list_employees(opts = {}) ⇒ Array<V1Employee>
Provides summary information for all of a business’s employees.
-
#list_employees_with_http_info(opts = {}) ⇒ Array<(Array<V1Employee>, Fixnum, Hash)>
Provides summary information for all of a business's employees.
-
#list_timecard_events(timecard_id, opts = {}) ⇒ Array<V1TimecardEvent>
Provides summary information for all events associated with a particular timecard.
-
#list_timecard_events_with_http_info(timecard_id, opts = {}) ⇒ Array<(Array<V1TimecardEvent>, Fixnum, Hash)>
Provides summary information for all events associated with a particular timecard.
-
#list_timecards(opts = {}) ⇒ Array<V1Timecard>
Provides summary information for all of a business’s employee timecards.
-
#list_timecards_with_http_info(opts = {}) ⇒ Array<(Array<V1Timecard>, Fixnum, Hash)>
Provides summary information for all of a business's employee timecards.
-
#retrieve_cash_drawer_shift(location_id, shift_id, opts = {}) ⇒ V1CashDrawerShift
Provides the details for a single cash drawer shift, including all events that occurred during the shift.
-
#retrieve_cash_drawer_shift_with_http_info(location_id, shift_id, opts = {}) ⇒ Array<(V1CashDrawerShift, Fixnum, Hash)>
Provides the details for a single cash drawer shift, including all events that occurred during the shift.
-
#retrieve_employee(employee_id, opts = {}) ⇒ V1Employee
Provides the details for a single employee.
-
#retrieve_employee_role(role_id, opts = {}) ⇒ V1EmployeeRole
Provides the details for a single employee role.
-
#retrieve_employee_role_with_http_info(role_id, opts = {}) ⇒ Array<(V1EmployeeRole, Fixnum, Hash)>
Provides the details for a single employee role.
-
#retrieve_employee_with_http_info(employee_id, opts = {}) ⇒ Array<(V1Employee, Fixnum, Hash)>
Provides the details for a single employee.
-
#retrieve_timecard(timecard_id, opts = {}) ⇒ V1Timecard
Provides the details for a single timecard.
-
#retrieve_timecard_with_http_info(timecard_id, opts = {}) ⇒ Array<(V1Timecard, Fixnum, Hash)>
Provides the details for a single timecard.
-
#update_employee(employee_id, body, opts = {}) ⇒ V1Employee
V1 UpdateEmployee.
-
#update_employee_role(role_id, body, opts = {}) ⇒ V1EmployeeRole
Modifies the details of an employee role.
-
#update_employee_role_with_http_info(role_id, body, opts = {}) ⇒ Array<(V1EmployeeRole, Fixnum, Hash)>
Modifies the details of an employee role.
-
#update_employee_with_http_info(employee_id, body, opts = {}) ⇒ Array<(V1Employee, Fixnum, Hash)>
V1 UpdateEmployee.
-
#update_timecard(timecard_id, body, opts = {}) ⇒ V1Timecard
Modifies a timecard’s details.
-
#update_timecard_with_http_info(timecard_id, body, opts = {}) ⇒ Array<(V1Timecard, Fixnum, Hash)>
Modifies a timecard's details.
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_client ⇒ Object
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
Creates an employee for a business. Creates an employee for a business.
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
Creates an employee role you can then assign to employees. Creates an employee role you can then assign to employees.
79 80 81 82 |
# File 'lib/square_connect/api/v1_employees_api.rb', line 79 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)>
Creates an employee role you can then assign to employees. Creates an employee role you can then assign to employees.
89 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 |
# File 'lib/square_connect/api/v1_employees_api.rb', line 89 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']) # 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)>
Creates an employee for a business. Creates an employee for a business.
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 |
# 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']) # 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
Creates a timecard for an employee. Each timecard corresponds to a single shift. Creates a timecard for an employee. Each timecard corresponds to a single shift.
133 134 135 136 |
# File 'lib/square_connect/api/v1_employees_api.rb', line 133 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)>
Creates a timecard for an employee. Each timecard corresponds to a single shift. Creates a timecard for an employee. Each timecard corresponds to a single shift.
143 144 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 |
# File 'lib/square_connect/api/v1_employees_api.rb', line 143 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']) # 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
Deletes a timecard. Deleted timecards are still accessible from Connect API endpoints, but the value of their deleted field is set to true. See Handling deleted timecards for more information. Deletes a timecard. Deleted timecards are still accessible from Connect API endpoints, but the value of their deleted field is set to true. See Handling deleted timecards for more information.
187 188 189 190 |
# File 'lib/square_connect/api/v1_employees_api.rb', line 187 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)>
Deletes a timecard. Deleted timecards are still accessible from Connect API endpoints, but the value of their deleted field is set to true. See Handling deleted timecards for more information. Deletes a timecard. Deleted timecards are still accessible from Connect API endpoints, but the value of their deleted field is set to true. See Handling deleted timecards for more information.
197 198 199 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 |
# File 'lib/square_connect/api/v1_employees_api.rb', line 197 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']) # 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>
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. 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.
244 245 246 247 |
# File 'lib/square_connect/api/v1_employees_api.rb', line 244 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)>
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. 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.
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 294 295 296 297 298 299 300 |
# File 'lib/square_connect/api/v1_employees_api.rb', line 257 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? if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order']) fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC' end # 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']) # 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>
Provides summary information for all of a business’s employee roles. Provides summary information for all of a business’s employee roles.
309 310 311 312 |
# File 'lib/square_connect/api/v1_employees_api.rb', line 309 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)>
Provides summary information for all of a business's employee roles. Provides summary information for all of a business's employee roles.
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 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 |
# File 'lib/square_connect/api/v1_employees_api.rb', line 321 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 if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order']) fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC' end if !opts[:'limit'].nil? && opts[:'limit'] > 200 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling V1EmployeesApi.list_employee_roles, must be smaller than or equal to 200.' 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']) # 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>
Provides summary information for all of a business’s employees. Provides summary information for all of a business’s employees.
381 382 383 384 |
# File 'lib/square_connect/api/v1_employees_api.rb', line 381 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)>
Provides summary information for all of a business's employees. Provides summary information for all of a business's employees.
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 441 442 443 444 445 446 447 448 449 450 451 452 453 |
# File 'lib/square_connect/api/v1_employees_api.rb', line 399 def list_employees_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1EmployeesApi.list_employees ..." end if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order']) fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC' end if opts[:'status'] && !['ACTIVE', 'INACTIVE'].include?(opts[:'status']) fail ArgumentError, 'invalid value for "status", must be one of ACTIVE, INACTIVE' end if !opts[:'limit'].nil? && opts[:'limit'] > 200 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling V1EmployeesApi.list_employees, must be smaller than or equal to 200.' 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']) # 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>
Provides summary information for all events associated with a particular timecard. Provides summary information for all events associated with a particular timecard.
460 461 462 463 |
# File 'lib/square_connect/api/v1_employees_api.rb', line 460 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)>
Provides summary information for all events associated with a particular timecard. Provides summary information for all events associated with a particular timecard.
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 496 497 498 499 500 501 502 503 504 505 506 507 |
# File 'lib/square_connect/api/v1_employees_api.rb', line 470 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']) # 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>
Provides summary information for all of a business’s employee timecards. Provides summary information for all of a business’s employee timecards.
524 525 526 527 |
# File 'lib/square_connect/api/v1_employees_api.rb', line 524 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)>
Provides summary information for all of a business's employee timecards. Provides summary information for all of a business's employee timecards.
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 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 |
# File 'lib/square_connect/api/v1_employees_api.rb', line 544 def list_timecards_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1EmployeesApi.list_timecards ..." end if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order']) fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC' end if !opts[:'limit'].nil? && opts[:'limit'] > 200 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling V1EmployeesApi.list_timecards, must be smaller than or equal to 200.' 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']) # 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
Provides the details for a single cash drawer shift, including all events that occurred during the shift. Provides the details for a single cash drawer shift, including all events that occurred during the shift.
605 606 607 608 |
# File 'lib/square_connect/api/v1_employees_api.rb', line 605 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)>
Provides the details for a single cash drawer shift, including all events that occurred during the shift. Provides the details for a single cash drawer shift, including all events that occurred during the shift.
616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 |
# File 'lib/square_connect/api/v1_employees_api.rb', line 616 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']) # 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
Provides the details for a single employee. Provides the details for a single employee.
662 663 664 665 |
# File 'lib/square_connect/api/v1_employees_api.rb', line 662 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
Provides the details for a single employee role. Provides the details for a single employee role.
716 717 718 719 |
# File 'lib/square_connect/api/v1_employees_api.rb', line 716 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)>
Provides the details for a single employee role. Provides the details for a single employee role.
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 754 755 756 757 758 759 760 761 762 763 |
# File 'lib/square_connect/api/v1_employees_api.rb', line 726 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']) # 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)>
Provides the details for a single employee. Provides the details for a single employee.
672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 |
# File 'lib/square_connect/api/v1_employees_api.rb', line 672 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']) # 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
Provides the details for a single timecard. Provides the details for a single timecard.
770 771 772 773 |
# File 'lib/square_connect/api/v1_employees_api.rb', line 770 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)>
Provides the details for a single timecard. Provides the details for a single timecard.
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 813 814 815 816 817 |
# File 'lib/square_connect/api/v1_employees_api.rb', line 780 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']) # 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
V1 UpdateEmployee
825 826 827 828 |
# File 'lib/square_connect/api/v1_employees_api.rb', line 825 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
Modifies the details of an employee role. Modifies the details of an employee role.
883 884 885 886 |
# File 'lib/square_connect/api/v1_employees_api.rb', line 883 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)>
Modifies the details of an employee role. Modifies the details of an employee role.
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 922 923 924 925 926 927 928 929 930 931 932 933 |
# File 'lib/square_connect/api/v1_employees_api.rb', line 894 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']) # 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)>
V1 UpdateEmployee
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 863 864 865 866 867 868 869 870 871 872 873 874 875 |
# File 'lib/square_connect/api/v1_employees_api.rb', line 836 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']) # 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
Modifies a timecard’s details. This creates an API_EDIT event for the timecard. You can view a timecard’s event history with the List Timecard Events endpoint. Modifies a timecard’s details. This creates an API_EDIT event for the timecard. You can view a timecard’s event history with the List Timecard Events endpoint.
941 942 943 944 |
# File 'lib/square_connect/api/v1_employees_api.rb', line 941 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)>
Modifies a timecard's details. This creates an API_EDIT event for the timecard. You can view a timecard's event history with the List Timecard Events endpoint. Modifies a timecard's details. This creates an API_EDIT event for the timecard. You can view a timecard's event history with the List Timecard Events endpoint.
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 981 982 983 984 985 986 987 988 989 990 991 |
# File 'lib/square_connect/api/v1_employees_api.rb', line 952 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']) # 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 |