Class: Merge::AsyncClient

Inherits:
Object
  • Object
show all
Defined in:
lib/merge_ruby_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key:, base_url: nil, environment: Merge::Environment::PRODUCTION, max_retries: nil, timeout_in_seconds: nil, account_token: nil) ⇒ Merge::AsyncClient

Parameters:

  • base_url (String) (defaults to: nil)
  • environment (Merge::Environment) (defaults to: Merge::Environment::PRODUCTION)
  • max_retries (Long) (defaults to: nil)

    The number of times to retry a failed request, defaults to 2.

  • timeout_in_seconds (Long) (defaults to: nil)
  • api_key (String)
  • account_token (String) (defaults to: nil)

    Token identifying the end user.



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/merge_ruby_client.rb', line 75

def initialize(api_key:, base_url: nil, environment: Merge::Environment::PRODUCTION, max_retries: nil,
               timeout_in_seconds: nil, account_token: nil)
  @async_request_client = Merge::AsyncRequestClient.new(
    base_url: base_url,
    environment: environment,
    max_retries: max_retries,
    timeout_in_seconds: timeout_in_seconds,
    api_key: api_key,
    account_token: 
  )
  @ats = Merge::Ats::AsyncClient.new(request_client: @async_request_client)
  @crm = Merge::Crm::AsyncClient.new(request_client: @async_request_client)
  @filestorage = Merge::Filestorage::AsyncClient.new(request_client: @async_request_client)
  @hris = Merge::Hris::AsyncClient.new(request_client: @async_request_client)
  @ticketing = Merge::Ticketing::AsyncClient.new(request_client: @async_request_client)
  @accounting = Merge::Accounting::AsyncClient.new(request_client: @async_request_client)
end

Instance Attribute Details

#accountingMerge::Accounting::AsyncClient (readonly)



66
67
68
# File 'lib/merge_ruby_client.rb', line 66

def accounting
  @accounting
end

#atsMerge::Ats::AsyncClient (readonly)



56
57
58
# File 'lib/merge_ruby_client.rb', line 56

def ats
  @ats
end

#crmMerge::Crm::AsyncClient (readonly)



58
59
60
# File 'lib/merge_ruby_client.rb', line 58

def crm
  @crm
end

#filestorageMerge::Filestorage::AsyncClient (readonly)



60
61
62
# File 'lib/merge_ruby_client.rb', line 60

def filestorage
  @filestorage
end

#hrisMerge::Hris::AsyncClient (readonly)



62
63
64
# File 'lib/merge_ruby_client.rb', line 62

def hris
  @hris
end

#ticketingMerge::Ticketing::AsyncClient (readonly)



64
65
66
# File 'lib/merge_ruby_client.rb', line 64

def ticketing
  @ticketing
end