Class: Gusto::EmployeesClient
- Inherits:
-
Object
- Object
- Gusto::EmployeesClient
- Defined in:
- lib/fern_gusto/employees/client.rb
Instance Attribute Summary collapse
- #adresses ⇒ Gusto::Employees::AdressesClient readonly
- #benefits ⇒ Gusto::Employees::BenefitsClient readonly
- #employments ⇒ Gusto::Employees::EmploymentsClient readonly
- #forms ⇒ Gusto::Employees::FormsClient readonly
- #garnishments ⇒ Gusto::Employees::GarnishmentsClient readonly
- #jobs_and_compensations ⇒ Gusto::Employees::JobsAndCompensationsClient readonly
- #payment_method ⇒ Gusto::Employees::PaymentMethodClient readonly
- #request_client ⇒ Gusto::RequestClient readonly
- #tax_setup ⇒ Gusto::Employees::TaxSetupClient readonly
Instance Method Summary collapse
-
#delete(employee_id:, request_options: nil) ⇒ Object
api.employees.delete(employee_id: “employee_id”).
-
#get(employee_id:, include: nil, request_options: nil) ⇒ Object
api.employees.get(employee_id: “employee_id”).
-
#get_custom_fields(employee_id:, page: nil, per: nil, request_options: nil) ⇒ Object
api.employees.get_custom_fields(employee_id: “employee_id”).
-
#get_onboarding_status(employee_id:, request_options: nil) ⇒ Object
api.employees.get_onboarding_status(employee_id: “employee_id”).
-
#get_time_off_activities(employee_uuid:, time_off_type:, request_options: nil) ⇒ Object
api.employees.get_time_off_activities(employee_uuid: “employee_uuid”, time_off_type: “time_off_type”).
- #initialize(request_client:) ⇒ Gusto::EmployeesClient constructor
-
#update(employee_id:, version:, first_name: nil, middle_initial: nil, last_name: nil, preferred_first_name: nil, date_of_birth: nil, email: nil, ssn: nil, two_percent_shareholder: nil, request_options: nil) ⇒ Object
).
-
#update_onboarding_status(employee_id:, onboarding_status:, request_options: nil) ⇒ Object
api.employees.update_onboarding_status(employee_id: “employee_id”, onboarding_status: “onboarding_status”).
Constructor Details
#initialize(request_client:) ⇒ Gusto::EmployeesClient
49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/fern_gusto/employees/client.rb', line 49 def initialize(request_client:) @request_client = request_client @employments = Gusto::Employees::EmploymentsClient.new(request_client: request_client) @adresses = Gusto::Employees::AdressesClient.new(request_client: request_client) @tax_setup = Gusto::Employees::TaxSetupClient.new(request_client: request_client) @payment_method = Gusto::Employees::PaymentMethodClient.new(request_client: request_client) @jobs_and_compensations = Gusto::Employees::JobsAndCompensationsClient.new(request_client: request_client) @forms = Gusto::Employees::FormsClient.new(request_client: request_client) @benefits = Gusto::Employees::BenefitsClient.new(request_client: request_client) @garnishments = Gusto::Employees::GarnishmentsClient.new(request_client: request_client) end |
Instance Attribute Details
#adresses ⇒ Gusto::Employees::AdressesClient (readonly)
32 33 34 |
# File 'lib/fern_gusto/employees/client.rb', line 32 def adresses @adresses end |
#benefits ⇒ Gusto::Employees::BenefitsClient (readonly)
42 43 44 |
# File 'lib/fern_gusto/employees/client.rb', line 42 def benefits @benefits end |
#employments ⇒ Gusto::Employees::EmploymentsClient (readonly)
30 31 32 |
# File 'lib/fern_gusto/employees/client.rb', line 30 def employments @employments end |
#forms ⇒ Gusto::Employees::FormsClient (readonly)
40 41 42 |
# File 'lib/fern_gusto/employees/client.rb', line 40 def forms @forms end |
#garnishments ⇒ Gusto::Employees::GarnishmentsClient (readonly)
44 45 46 |
# File 'lib/fern_gusto/employees/client.rb', line 44 def garnishments @garnishments end |
#jobs_and_compensations ⇒ Gusto::Employees::JobsAndCompensationsClient (readonly)
38 39 40 |
# File 'lib/fern_gusto/employees/client.rb', line 38 def jobs_and_compensations @jobs_and_compensations end |
#payment_method ⇒ Gusto::Employees::PaymentMethodClient (readonly)
36 37 38 |
# File 'lib/fern_gusto/employees/client.rb', line 36 def payment_method @payment_method end |
#request_client ⇒ Gusto::RequestClient (readonly)
28 29 30 |
# File 'lib/fern_gusto/employees/client.rb', line 28 def request_client @request_client end |
#tax_setup ⇒ Gusto::Employees::TaxSetupClient (readonly)
34 35 36 |
# File 'lib/fern_gusto/employees/client.rb', line 34 def tax_setup @tax_setup end |
Instance Method Details
#delete(employee_id:, request_options: nil) ⇒ Object
api.employees.delete(employee_id: “employee_id”)
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 |
# File 'lib/fern_gusto/employees/client.rb', line 170 def delete(employee_id:, request_options: nil) response = @request_client.conn.delete do | req | unless &.timeout_in_seconds.nil? req..timeout = .timeout_in_seconds end unless &.token.nil? req.headers["Authorization"] = .token end unless &.gusto_api_version.nil? req.headers["X-Gusto-API-Version"] = .gusto_api_version end req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact unless .nil? || &.additional_query_parameters.nil? req.params = { **(&.additional_query_parameters || {}) }.compact end unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/v1/employees/#{employee_id}" end end |
#get(employee_id:, include: nil, request_options: nil) ⇒ Object
api.employees.get(employee_id: “employee_id”)
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/fern_gusto/employees/client.rb', line 78 def get(employee_id:, include: nil, request_options: nil) response = @request_client.conn.get do | req | unless &.timeout_in_seconds.nil? req..timeout = .timeout_in_seconds end unless &.token.nil? req.headers["Authorization"] = .token end unless &.gusto_api_version.nil? req.headers["X-Gusto-API-Version"] = .gusto_api_version end req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.params = { **(&.additional_query_parameters || {}), "include": include }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/v1/employees/#{employee_id}" end Gusto::Employees::Employee.from_json(json_object: response.body) end |
#get_custom_fields(employee_id:, page: nil, per: nil, request_options: nil) ⇒ Object
api.employees.get_custom_fields(employee_id: “employee_id”)
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 |
# File 'lib/fern_gusto/employees/client.rb', line 207 def get_custom_fields(employee_id:, page: nil, per: nil, request_options: nil) response = @request_client.conn.get do | req | unless &.timeout_in_seconds.nil? req..timeout = .timeout_in_seconds end unless &.token.nil? req.headers["Authorization"] = .token end unless &.gusto_api_version.nil? req.headers["X-Gusto-API-Version"] = .gusto_api_version end req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.params = { **(&.additional_query_parameters || {}), "page": page, "per": per }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/v1/employees/#{employee_id}/custom_fields" end Gusto::Employees::EmployeesGetCustomFieldsResponse.from_json(json_object: response.body) end |
#get_onboarding_status(employee_id:, request_options: nil) ⇒ Object
api.employees.get_onboarding_status(employee_id: “employee_id”)
304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 |
# File 'lib/fern_gusto/employees/client.rb', line 304 def get_onboarding_status(employee_id:, request_options: nil) response = @request_client.conn.get do | req | unless &.timeout_in_seconds.nil? req..timeout = .timeout_in_seconds end unless &.token.nil? req.headers["Authorization"] = .token end unless &.gusto_api_version.nil? req.headers["X-Gusto-API-Version"] = .gusto_api_version end req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact unless .nil? || &.additional_query_parameters.nil? req.params = { **(&.additional_query_parameters || {}) }.compact end unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/v1/employees/#{employee_id}/onboarding_status" end Gusto::Employees::EmployeeOnboardingInfo.from_json(json_object: response.body) end |
#get_time_off_activities(employee_uuid:, time_off_type:, request_options: nil) ⇒ Object
api.employees.get_time_off_activities(employee_uuid: “employee_uuid”, time_off_type: “time_off_type”)
396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 |
# File 'lib/fern_gusto/employees/client.rb', line 396 def get_time_off_activities(employee_uuid:, time_off_type:, request_options: nil) response = @request_client.conn.get do | req | unless &.timeout_in_seconds.nil? req..timeout = .timeout_in_seconds end unless &.token.nil? req.headers["Authorization"] = .token end unless &.gusto_api_version.nil? req.headers["X-Gusto-API-Version"] = .gusto_api_version end req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.params = { **(&.additional_query_parameters || {}), "time_off_type": time_off_type }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/v1/employees/#{employee_uuid}/time_off_activities" end Gusto::TimeOffActivity.from_json(json_object: response.body) end |
#update(employee_id:, version:, first_name: nil, middle_initial: nil, last_name: nil, preferred_first_name: nil, date_of_birth: nil, email: nil, ssn: nil, two_percent_shareholder: nil, request_options: nil) ⇒ Object
)
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
# File 'lib/fern_gusto/employees/client.rb', line 134 def update(employee_id:, version:, first_name: nil, middle_initial: nil, last_name: nil, preferred_first_name: nil, date_of_birth: nil, email: nil, ssn: nil, two_percent_shareholder: nil, request_options: nil) response = @request_client.conn.put do | req | unless &.timeout_in_seconds.nil? req..timeout = .timeout_in_seconds end unless &.token.nil? req.headers["Authorization"] = .token end unless &.gusto_api_version.nil? req.headers["X-Gusto-API-Version"] = .gusto_api_version end req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact unless .nil? || &.additional_query_parameters.nil? req.params = { **(&.additional_query_parameters || {}) }.compact end req.body = { **(&.additional_body_parameters || {}), version: version, first_name: first_name, middle_initial: middle_initial, last_name: last_name, preferred_first_name: preferred_first_name, date_of_birth: date_of_birth, email: email, ssn: ssn, two_percent_shareholder: two_percent_shareholder }.compact req.url "#{@request_client.get_url(request_options: )}/v1/employees/#{employee_id}" end Gusto::Employees::Employee.from_json(json_object: response.body) end |
#update_onboarding_status(employee_id:, onboarding_status:, request_options: nil) ⇒ Object
api.employees.update_onboarding_status(employee_id: “employee_id”, onboarding_status: “onboarding_status”)
362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 |
# File 'lib/fern_gusto/employees/client.rb', line 362 def update_onboarding_status(employee_id:, onboarding_status:, request_options: nil) response = @request_client.conn.put do | req | unless &.timeout_in_seconds.nil? req..timeout = .timeout_in_seconds end unless &.token.nil? req.headers["Authorization"] = .token end unless &.gusto_api_version.nil? req.headers["X-Gusto-API-Version"] = .gusto_api_version end req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact unless .nil? || &.additional_query_parameters.nil? req.params = { **(&.additional_query_parameters || {}) }.compact end req.body = { **(&.additional_body_parameters || {}), onboarding_status: onboarding_status }.compact req.url "#{@request_client.get_url(request_options: )}/v1/employees/#{employee_id}/onboarding_status" end Gusto::Employees::EmployeeOnboardingInfo.from_json(json_object: response.body) end |