Class: GustoEmbedded::Client

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/gusto_embedded/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client: nil, security: nil, security_source: nil, server: nil, server_url: nil, url_params: nil) ⇒ Client

Returns a new instance of Client.

Raises:

  • (StandardError)


28
29
30
31
32
33
34
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
# File 'lib/gusto_embedded/client.rb', line 28

def initialize(client: nil, security: nil, security_source: nil, server: nil, server_url: nil, url_params: nil)
  ## Instantiates the SDK configuring it with the provided parameters.
  # @param [T.nilable(Faraday::Request)] client The faraday HTTP client to use for all operations
  # @param [T.nilable(::GustoEmbedded::Shared::Security)] security: The security details required for authentication
  # @param [T.proc.returns(T.nilable(::GustoEmbedded::Shared::Security))] security_source: A function that returns security details required for authentication
  # @param [T.nilable(::Symbol)] server The server identifier to use for all operations
  # @param [T.nilable(::String)] server_url The server URL to use for all operations
  # @param [T.nilable(::Hash<::Symbol, ::String>)] url_params Parameters to optionally template the server URL with

  if client.nil?
    client = Faraday.new(request: {
                      params_encoder: Faraday::FlatParamsEncoder
                    }) do |f|
      f.request :multipart, {}
      # f.response :logger
    end
  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)
  @sdk_configuration = SDKConfiguration.new(
    client,
    security,
    security_source,
    server_url,
    server
  )
  init_sdks
end

Instance Attribute Details

#ach_transactionsObject

Returns the value of attribute ach_transactions.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def ach_transactions
  @ach_transactions
end

#bank_accountsObject

Returns the value of attribute bank_accounts.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def bank_accounts
  @bank_accounts
end

#companiesObject

Returns the value of attribute companies.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def companies
  @companies
end

#companies_suspensionsObject

Returns the value of attribute companies_suspensions.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def companies_suspensions
  @companies_suspensions
end

#company_attachmentObject

Returns the value of attribute company_attachment.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def company_attachment
  @company_attachment
end

#company_attachmentsObject

Returns the value of attribute company_attachments.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def company_attachments
  @company_attachments
end

#company_benefitsObject

Returns the value of attribute company_benefits.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def company_benefits
  @company_benefits
end

#company_formsObject

Returns the value of attribute company_forms.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def company_forms
  @company_forms
end

#contractor_documentsObject

Returns the value of attribute contractor_documents.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def contractor_documents
  @contractor_documents
end

#contractor_formsObject

Returns the value of attribute contractor_forms.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def contractor_forms
  @contractor_forms
end

#contractor_payment_groupsObject

Returns the value of attribute contractor_payment_groups.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def contractor_payment_groups
  @contractor_payment_groups
end

#contractor_payment_methodObject

Returns the value of attribute contractor_payment_method.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def contractor_payment_method
  @contractor_payment_method
end

#contractor_payment_methodsObject

Returns the value of attribute contractor_payment_methods.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def contractor_payment_methods
  @contractor_payment_methods
end

#contractor_paymentsObject

Returns the value of attribute contractor_payments.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def contractor_payments
  @contractor_payments
end

#contractorsObject

Returns the value of attribute contractors.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def contractors
  @contractors
end

#departmentsObject

Returns the value of attribute departments.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def departments
  @departments
end

#earning_typesObject

Returns the value of attribute earning_types.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def earning_types
  @earning_types
end

#employee_addressesObject

Returns the value of attribute employee_addresses.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def employee_addresses
  @employee_addresses
end

#employee_benefitsObject

Returns the value of attribute employee_benefits.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def employee_benefits
  @employee_benefits
end

#employee_employmentsObject

Returns the value of attribute employee_employments.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def employee_employments
  @employee_employments
end

#employee_formsObject

Returns the value of attribute employee_forms.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def employee_forms
  @employee_forms
end

#employee_payment_methodObject

Returns the value of attribute employee_payment_method.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def employee_payment_method
  @employee_payment_method
end

#employee_payment_methodsObject

Returns the value of attribute employee_payment_methods.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def employee_payment_methods
  @employee_payment_methods
end

#employee_tax_setupObject

Returns the value of attribute employee_tax_setup.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def employee_tax_setup
  @employee_tax_setup
end

#employeesObject

Returns the value of attribute employees.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def employees
  @employees
end

#eventsObject

Returns the value of attribute events.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def events
  @events
end

#external_payrollsObject

Returns the value of attribute external_payrolls.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def external_payrolls
  @external_payrolls
end

#federal_tax_detailsObject

Returns the value of attribute federal_tax_details.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def federal_tax_details
  @federal_tax_details
end

#flowsObject

Returns the value of attribute flows.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def flows
  @flows
end

#garnishmentsObject

Returns the value of attribute garnishments.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def garnishments
  @garnishments
end

#generated_documentsObject

Returns the value of attribute generated_documents.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def generated_documents
  @generated_documents
end

#historical_employeesObject

Returns the value of attribute historical_employees.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def historical_employees
  @historical_employees
end

#holiday_pay_policiesObject

Returns the value of attribute holiday_pay_policies.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def holiday_pay_policies
  @holiday_pay_policies
end

#i9_verificationObject

Returns the value of attribute i9_verification.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def i9_verification
  @i9_verification
end

#industry_selectionObject

Returns the value of attribute industry_selection.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def industry_selection
  @industry_selection
end

#introspectionObject

Returns the value of attribute introspection.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def introspection
  @introspection
end

#invoicesObject

Returns the value of attribute invoices.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def invoices
  @invoices
end

#jobs_and_compensationsObject

Returns the value of attribute jobs_and_compensations.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def jobs_and_compensations
  @jobs_and_compensations
end

#locationsObject

Returns the value of attribute locations.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def locations
  @locations
end

#notificationsObject

Returns the value of attribute notifications.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def notifications
  @notifications
end

#pay_schedulesObject

Returns the value of attribute pay_schedules.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def pay_schedules
  @pay_schedules
end

#payment_configsObject

Returns the value of attribute payment_configs.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def payment_configs
  @payment_configs
end

#payrollsObject

Returns the value of attribute payrolls.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def payrolls
  @payrolls
end

#recovery_casesObject

Returns the value of attribute recovery_cases.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def recovery_cases
  @recovery_cases
end

#reportsObject

Returns the value of attribute reports.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def reports
  @reports
end

#signatoriesObject

Returns the value of attribute signatories.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def signatories
  @signatories
end

#tax_requirementsObject

Returns the value of attribute tax_requirements.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def tax_requirements
  @tax_requirements
end

#time_off_policiesObject

Returns the value of attribute time_off_policies.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def time_off_policies
  @time_off_policies
end

#webhooksObject

Returns the value of attribute webhooks.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def webhooks
  @webhooks
end

#wire_in_requestsObject

Returns the value of attribute wire_in_requests.



16
17
18
# File 'lib/gusto_embedded/client.rb', line 16

def wire_in_requests
  @wire_in_requests
end

Instance Method Details

#init_sdksObject



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
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
# File 'lib/gusto_embedded/client.rb', line 64

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_method = EmployeePaymentMethod.new(@sdk_configuration)
  @employee_payment_methods = EmployeePaymentMethods.new(@sdk_configuration)
  @jobs_and_compensations = JobsAndCompensations.new(@sdk_configuration)
  @earning_types = EarningTypes.new(@sdk_configuration)
  @contractors = Contractors.new(@sdk_configuration)
  @contractor_payment_methods = ContractorPaymentMethods.new(@sdk_configuration)
  @contractor_payment_method = ContractorPaymentMethod.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)
  @companies_suspensions = CompaniesSuspensions.new(@sdk_configuration)
  @holiday_pay_policies = HolidayPayPolicies.new(@sdk_configuration)
  @notifications = Notifications.new(@sdk_configuration)
  @events = Events.new(@sdk_configuration)
  @recovery_cases = RecoveryCases.new(@sdk_configuration)
  @ach_transactions = AchTransactions.new(@sdk_configuration)
  @wire_in_requests = WireInRequests.new(@sdk_configuration)
end