Class: GustoEmbedded::Client
- Inherits:
-
Object
- Object
- GustoEmbedded::Client
- Extended by:
- T::Sig
- Defined in:
- lib/gusto_embedded/client.rb
Instance Attribute Summary collapse
-
#ach_transactions ⇒ Object
Returns the value of attribute ach_transactions.
-
#bank_accounts ⇒ Object
Returns the value of attribute bank_accounts.
-
#companies ⇒ Object
Returns the value of attribute companies.
-
#company_attachment ⇒ Object
Returns the value of attribute company_attachment.
-
#company_attachments ⇒ Object
Returns the value of attribute company_attachments.
-
#company_benefits ⇒ Object
Returns the value of attribute company_benefits.
-
#company_forms ⇒ Object
Returns the value of attribute company_forms.
-
#contractor_documents ⇒ Object
Returns the value of attribute contractor_documents.
-
#contractor_forms ⇒ Object
Returns the value of attribute contractor_forms.
-
#contractor_payment_groups ⇒ Object
Returns the value of attribute contractor_payment_groups.
-
#contractor_payment_method ⇒ Object
Returns the value of attribute contractor_payment_method.
-
#contractor_payment_methods ⇒ Object
Returns the value of attribute contractor_payment_methods.
-
#contractor_payments ⇒ Object
Returns the value of attribute contractor_payments.
-
#contractors ⇒ Object
Returns the value of attribute contractors.
-
#departments ⇒ Object
Returns the value of attribute departments.
-
#earning_types ⇒ Object
Returns the value of attribute earning_types.
-
#employee_addresses ⇒ Object
Returns the value of attribute employee_addresses.
-
#employee_benefits ⇒ Object
Returns the value of attribute employee_benefits.
-
#employee_employments ⇒ Object
Returns the value of attribute employee_employments.
-
#employee_forms ⇒ Object
Returns the value of attribute employee_forms.
-
#employee_payment_method ⇒ Object
Returns the value of attribute employee_payment_method.
-
#employee_payment_methods ⇒ Object
Returns the value of attribute employee_payment_methods.
-
#employee_tax_setup ⇒ Object
Returns the value of attribute employee_tax_setup.
-
#employees ⇒ Object
Returns the value of attribute employees.
-
#events ⇒ Object
Returns the value of attribute events.
-
#external_payrolls ⇒ Object
Returns the value of attribute external_payrolls.
-
#federal_tax_details ⇒ Object
Returns the value of attribute federal_tax_details.
-
#flows ⇒ Object
Returns the value of attribute flows.
-
#garnishments ⇒ Object
Returns the value of attribute garnishments.
-
#generated_documents ⇒ Object
Returns the value of attribute generated_documents.
-
#historical_employees ⇒ Object
Returns the value of attribute historical_employees.
-
#holiday_pay_policies ⇒ Object
Returns the value of attribute holiday_pay_policies.
-
#i9_verification ⇒ Object
Returns the value of attribute i9_verification.
-
#industry_selection ⇒ Object
Returns the value of attribute industry_selection.
-
#information_requests ⇒ Object
Returns the value of attribute information_requests.
-
#introspection ⇒ Object
Returns the value of attribute introspection.
-
#invoices ⇒ Object
Returns the value of attribute invoices.
-
#jobs_and_compensations ⇒ Object
Returns the value of attribute jobs_and_compensations.
-
#locations ⇒ Object
Returns the value of attribute locations.
-
#notifications ⇒ Object
Returns the value of attribute notifications.
-
#pay_schedules ⇒ Object
Returns the value of attribute pay_schedules.
-
#payment_configs ⇒ Object
Returns the value of attribute payment_configs.
-
#payroll_digests ⇒ Object
Returns the value of attribute payroll_digests.
-
#payrolls ⇒ Object
Returns the value of attribute payrolls.
-
#people_batches ⇒ Object
Returns the value of attribute people_batches.
-
#recovery_cases ⇒ Object
Returns the value of attribute recovery_cases.
-
#reimbursements ⇒ Object
Returns the value of attribute reimbursements.
-
#reports ⇒ Object
Returns the value of attribute reports.
-
#salary_estimates ⇒ Object
Returns the value of attribute salary_estimates.
-
#signatories ⇒ Object
Returns the value of attribute signatories.
-
#tax_requirements ⇒ Object
Returns the value of attribute tax_requirements.
-
#time_off_policies ⇒ Object
Returns the value of attribute time_off_policies.
-
#time_off_requests ⇒ Object
Returns the value of attribute time_off_requests.
-
#webhooks ⇒ Object
Returns the value of attribute webhooks.
-
#wire_in_requests ⇒ Object
Returns the value of attribute wire_in_requests.
Instance Method Summary collapse
- #get_url(base_url:, url_variables: nil) ⇒ Object
- #init_sdks ⇒ Object
-
#initialize(client: nil, retry_config: nil, timeout_ms: nil, security: nil, security_source: nil, server: nil, server_url: nil, url_params: nil) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(client: nil, retry_config: nil, timeout_ms: nil, security: nil, security_source: nil, server: nil, server_url: nil, url_params: nil) ⇒ Client
Returns a new instance of Client.
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 74 75 76 77 |
# File 'lib/gusto_embedded/client.rb', line 43 def initialize(client: nil, retry_config: nil, timeout_ms: nil, security: nil, security_source: nil, server: nil, server_url: nil, url_params: nil) = { request: { params_encoder: Faraday::FlatParamsEncoder } } [:request][:timeout] = (timeout_ms.to_f / 1000) unless timeout_ms.nil? client ||= Faraday.new(**) do |f| f.request :multipart, {} # f.response :logger, nil, { headers: true, bodies: true, errors: true } end if !server_url.nil? if !url_params.nil? server_url = Utils.template_url(server_url, url_params) end end raise StandardError, "Invalid server \"#{server}\"" if !server.nil? && !SERVERS.key?(server) hooks = SDKHooks::Hooks.new @sdk_configuration = SDKConfiguration.new( client, hooks, retry_config, timeout_ms, security, security_source, server_url, server ) @sdk_configuration = hooks.sdk_init(config: @sdk_configuration) init_sdks end |
Instance Attribute Details
#ach_transactions ⇒ Object
Returns the value of attribute ach_transactions.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def ach_transactions @ach_transactions end |
#bank_accounts ⇒ Object
Returns the value of attribute bank_accounts.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def bank_accounts @bank_accounts end |
#companies ⇒ Object
Returns the value of attribute companies.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def companies @companies end |
#company_attachment ⇒ Object
Returns the value of attribute company_attachment.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def @company_attachment end |
#company_attachments ⇒ Object
Returns the value of attribute company_attachments.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def @company_attachments end |
#company_benefits ⇒ Object
Returns the value of attribute company_benefits.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def company_benefits @company_benefits end |
#company_forms ⇒ Object
Returns the value of attribute company_forms.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def company_forms @company_forms end |
#contractor_documents ⇒ Object
Returns the value of attribute contractor_documents.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def contractor_documents @contractor_documents end |
#contractor_forms ⇒ Object
Returns the value of attribute contractor_forms.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def contractor_forms @contractor_forms end |
#contractor_payment_groups ⇒ Object
Returns the value of attribute contractor_payment_groups.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def contractor_payment_groups @contractor_payment_groups end |
#contractor_payment_method ⇒ Object
Returns the value of attribute contractor_payment_method.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def contractor_payment_method @contractor_payment_method end |
#contractor_payment_methods ⇒ Object
Returns the value of attribute contractor_payment_methods.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def contractor_payment_methods @contractor_payment_methods end |
#contractor_payments ⇒ Object
Returns the value of attribute contractor_payments.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def contractor_payments @contractor_payments end |
#contractors ⇒ Object
Returns the value of attribute contractors.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def contractors @contractors end |
#departments ⇒ Object
Returns the value of attribute departments.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def departments @departments end |
#earning_types ⇒ Object
Returns the value of attribute earning_types.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def earning_types @earning_types end |
#employee_addresses ⇒ Object
Returns the value of attribute employee_addresses.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def employee_addresses @employee_addresses end |
#employee_benefits ⇒ Object
Returns the value of attribute employee_benefits.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def employee_benefits @employee_benefits end |
#employee_employments ⇒ Object
Returns the value of attribute employee_employments.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def employee_employments @employee_employments end |
#employee_forms ⇒ Object
Returns the value of attribute employee_forms.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def employee_forms @employee_forms end |
#employee_payment_method ⇒ Object
Returns the value of attribute employee_payment_method.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def employee_payment_method @employee_payment_method end |
#employee_payment_methods ⇒ Object
Returns the value of attribute employee_payment_methods.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def employee_payment_methods @employee_payment_methods end |
#employee_tax_setup ⇒ Object
Returns the value of attribute employee_tax_setup.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def employee_tax_setup @employee_tax_setup end |
#employees ⇒ Object
Returns the value of attribute employees.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def employees @employees end |
#events ⇒ Object
Returns the value of attribute events.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def events @events end |
#external_payrolls ⇒ Object
Returns the value of attribute external_payrolls.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def external_payrolls @external_payrolls end |
#federal_tax_details ⇒ Object
Returns the value of attribute federal_tax_details.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def federal_tax_details @federal_tax_details end |
#flows ⇒ Object
Returns the value of attribute flows.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def flows @flows end |
#garnishments ⇒ Object
Returns the value of attribute garnishments.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def garnishments @garnishments end |
#generated_documents ⇒ Object
Returns the value of attribute generated_documents.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def generated_documents @generated_documents end |
#historical_employees ⇒ Object
Returns the value of attribute historical_employees.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def historical_employees @historical_employees end |
#holiday_pay_policies ⇒ Object
Returns the value of attribute holiday_pay_policies.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def holiday_pay_policies @holiday_pay_policies end |
#i9_verification ⇒ Object
Returns the value of attribute i9_verification.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def i9_verification @i9_verification end |
#industry_selection ⇒ Object
Returns the value of attribute industry_selection.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def industry_selection @industry_selection end |
#information_requests ⇒ Object
Returns the value of attribute information_requests.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def information_requests @information_requests end |
#introspection ⇒ Object
Returns the value of attribute introspection.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def introspection @introspection end |
#invoices ⇒ Object
Returns the value of attribute invoices.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def invoices @invoices end |
#jobs_and_compensations ⇒ Object
Returns the value of attribute jobs_and_compensations.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def jobs_and_compensations @jobs_and_compensations end |
#locations ⇒ Object
Returns the value of attribute locations.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def locations @locations end |
#notifications ⇒ Object
Returns the value of attribute notifications.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def notifications @notifications end |
#pay_schedules ⇒ Object
Returns the value of attribute pay_schedules.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def pay_schedules @pay_schedules end |
#payment_configs ⇒ Object
Returns the value of attribute payment_configs.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def payment_configs @payment_configs end |
#payroll_digests ⇒ Object
Returns the value of attribute payroll_digests.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def payroll_digests @payroll_digests end |
#payrolls ⇒ Object
Returns the value of attribute payrolls.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def payrolls @payrolls end |
#people_batches ⇒ Object
Returns the value of attribute people_batches.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def people_batches @people_batches end |
#recovery_cases ⇒ Object
Returns the value of attribute recovery_cases.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def recovery_cases @recovery_cases end |
#reimbursements ⇒ Object
Returns the value of attribute reimbursements.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def reimbursements @reimbursements end |
#reports ⇒ Object
Returns the value of attribute reports.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def reports @reports end |
#salary_estimates ⇒ Object
Returns the value of attribute salary_estimates.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def salary_estimates @salary_estimates end |
#signatories ⇒ Object
Returns the value of attribute signatories.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def signatories @signatories end |
#tax_requirements ⇒ Object
Returns the value of attribute tax_requirements.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def tax_requirements @tax_requirements end |
#time_off_policies ⇒ Object
Returns the value of attribute time_off_policies.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def time_off_policies @time_off_policies end |
#time_off_requests ⇒ Object
Returns the value of attribute time_off_requests.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def time_off_requests @time_off_requests end |
#webhooks ⇒ Object
Returns the value of attribute webhooks.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def webhooks @webhooks end |
#wire_in_requests ⇒ Object
Returns the value of attribute wire_in_requests.
19 20 21 |
# File 'lib/gusto_embedded/client.rb', line 19 def wire_in_requests @wire_in_requests end |
Instance Method Details
#get_url(base_url:, url_variables: nil) ⇒ Object
139 140 141 142 143 144 145 146 147 148 149 150 151 |
# File 'lib/gusto_embedded/client.rb', line 139 def get_url(base_url:, url_variables: nil) sd_base_url, = @sdk_configuration.get_server_details if base_url.nil? base_url = sd_base_url end if url_variables.nil? url_variables = end return Utils.template_url base_url, url_variables end |
#init_sdks ⇒ Object
80 81 82 83 84 85 86 87 88 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 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/gusto_embedded/client.rb', line 80 def init_sdks @introspection = Introspection.new(@sdk_configuration) @companies = Companies.new(@sdk_configuration) @invoices = Invoices.new(@sdk_configuration) @company_attachments = CompanyAttachments.new(@sdk_configuration) @company_attachment = CompanyAttachment.new(@sdk_configuration) @federal_tax_details = FederalTaxDetails.new(@sdk_configuration) @industry_selection = IndustrySelection.new(@sdk_configuration) @signatories = Signatories.new(@sdk_configuration) @flows = Flows.new(@sdk_configuration) @locations = Locations.new(@sdk_configuration) @bank_accounts = BankAccounts.new(@sdk_configuration) @external_payrolls = ExternalPayrolls.new(@sdk_configuration) @payment_configs = PaymentConfigs.new(@sdk_configuration) @pay_schedules = PaySchedules.new(@sdk_configuration) @employees = Employees.new(@sdk_configuration) @historical_employees = HistoricalEmployees.new(@sdk_configuration) @departments = Departments.new(@sdk_configuration) @employee_employments = EmployeeEmployments.new(@sdk_configuration) @employee_addresses = EmployeeAddresses.new(@sdk_configuration) @employee_tax_setup = EmployeeTaxSetup.new(@sdk_configuration) @employee_payment_methods = EmployeePaymentMethods.new(@sdk_configuration) @employee_payment_method = EmployeePaymentMethod.new(@sdk_configuration) @jobs_and_compensations = JobsAndCompensations.new(@sdk_configuration) @earning_types = EarningTypes.new(@sdk_configuration) @contractors = Contractors.new(@sdk_configuration) @contractor_payment_method = ContractorPaymentMethod.new(@sdk_configuration) @contractor_payment_methods = ContractorPaymentMethods.new(@sdk_configuration) @webhooks = Webhooks.new(@sdk_configuration) @contractor_forms = ContractorForms.new(@sdk_configuration) @contractor_documents = ContractorDocuments.new(@sdk_configuration) @employee_forms = EmployeeForms.new(@sdk_configuration) @payrolls = Payrolls.new(@sdk_configuration) @time_off_policies = TimeOffPolicies.new(@sdk_configuration) @contractor_payments = ContractorPayments.new(@sdk_configuration) @contractor_payment_groups = ContractorPaymentGroups.new(@sdk_configuration) @company_forms = CompanyForms.new(@sdk_configuration) @generated_documents = GeneratedDocuments.new(@sdk_configuration) @reports = Reports.new(@sdk_configuration) @company_benefits = CompanyBenefits.new(@sdk_configuration) @employee_benefits = EmployeeBenefits.new(@sdk_configuration) @garnishments = Garnishments.new(@sdk_configuration) @i9_verification = I9Verification.new(@sdk_configuration) @tax_requirements = TaxRequirements.new(@sdk_configuration) @holiday_pay_policies = HolidayPayPolicies.new(@sdk_configuration) @notifications = Notifications.new(@sdk_configuration) @events = Events.new(@sdk_configuration) @information_requests = InformationRequests.new(@sdk_configuration) @recovery_cases = RecoveryCases.new(@sdk_configuration) @ach_transactions = AchTransactions.new(@sdk_configuration) @wire_in_requests = WireInRequests.new(@sdk_configuration) @salary_estimates = SalaryEstimates.new(@sdk_configuration) @reimbursements = Reimbursements.new(@sdk_configuration) @people_batches = PeopleBatches.new(@sdk_configuration) @time_off_requests = TimeOffRequests.new(@sdk_configuration) @payroll_digests = PayrollDigests.new(@sdk_configuration) end |