Class: Vapi::Client

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token:, base_url: nil, environment: Vapi::Environment::DEFAULT, max_retries: nil, timeout_in_seconds: nil) ⇒ Vapi::Client

Parameters:

  • base_url (String) (defaults to: nil)
  • environment (Vapi::Environment) (defaults to: Vapi::Environment::DEFAULT)
  • 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)
  • token (String)


43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/vapi_server_sdk.rb', line 43

def initialize(token:, base_url: nil, environment: Vapi::Environment::DEFAULT, max_retries: nil,
               timeout_in_seconds: nil)
  @request_client = Vapi::RequestClient.new(
    base_url: base_url,
    environment: environment,
    max_retries: max_retries,
    timeout_in_seconds: timeout_in_seconds,
    token: token
  )
  @calls = Vapi::CallsClient.new(request_client: @request_client)
  @assistants = Vapi::AssistantsClient.new(request_client: @request_client)
  @phone_numbers = Vapi::PhoneNumbersClient.new(request_client: @request_client)
  @squads = Vapi::SquadsClient.new(request_client: @request_client)
  @blocks = Vapi::BlocksClient.new(request_client: @request_client)
  @tools = Vapi::ToolsClient.new(request_client: @request_client)
  @files = Vapi::FilesClient.new(request_client: @request_client)
  @analytics = Vapi::AnalyticsClient.new(request_client: @request_client)
  @logs = Vapi::LogsClient.new(request_client: @request_client)
end

Instance Attribute Details

#analyticsVapi::AnalyticsClient (readonly)



33
34
35
# File 'lib/vapi_server_sdk.rb', line 33

def analytics
  @analytics
end

#assistantsVapi::AssistantsClient (readonly)



21
22
23
# File 'lib/vapi_server_sdk.rb', line 21

def assistants
  @assistants
end

#blocksVapi::BlocksClient (readonly)

Returns:



27
28
29
# File 'lib/vapi_server_sdk.rb', line 27

def blocks
  @blocks
end

#callsVapi::CallsClient (readonly)

Returns:



19
20
21
# File 'lib/vapi_server_sdk.rb', line 19

def calls
  @calls
end

#filesVapi::FilesClient (readonly)

Returns:



31
32
33
# File 'lib/vapi_server_sdk.rb', line 31

def files
  @files
end

#logsVapi::LogsClient (readonly)

Returns:



35
36
37
# File 'lib/vapi_server_sdk.rb', line 35

def logs
  @logs
end

#phone_numbersVapi::PhoneNumbersClient (readonly)



23
24
25
# File 'lib/vapi_server_sdk.rb', line 23

def phone_numbers
  @phone_numbers
end

#squadsVapi::SquadsClient (readonly)

Returns:



25
26
27
# File 'lib/vapi_server_sdk.rb', line 25

def squads
  @squads
end

#toolsVapi::ToolsClient (readonly)

Returns:



29
30
31
# File 'lib/vapi_server_sdk.rb', line 29

def tools
  @tools
end