Class: Vapi::AsyncClient

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::AsyncClient

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)


90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/vapi_server_sdk.rb', line 90

def initialize(token:, base_url: nil, environment: Vapi::Environment::DEFAULT, max_retries: nil,
               timeout_in_seconds: nil)
  @async_request_client = Vapi::AsyncRequestClient.new(
    base_url: base_url,
    environment: environment,
    max_retries: max_retries,
    timeout_in_seconds: timeout_in_seconds,
    token: token
  )
  @calls = Vapi::AsyncCallsClient.new(request_client: @async_request_client)
  @assistants = Vapi::AsyncAssistantsClient.new(request_client: @async_request_client)
  @phone_numbers = Vapi::AsyncPhoneNumbersClient.new(request_client: @async_request_client)
  @squads = Vapi::AsyncSquadsClient.new(request_client: @async_request_client)
  @blocks = Vapi::AsyncBlocksClient.new(request_client: @async_request_client)
  @tools = Vapi::AsyncToolsClient.new(request_client: @async_request_client)
  @files = Vapi::AsyncFilesClient.new(request_client: @async_request_client)
  @analytics = Vapi::AsyncAnalyticsClient.new(request_client: @async_request_client)
  @logs = Vapi::AsyncLogsClient.new(request_client: @async_request_client)
end

Instance Attribute Details

#analyticsVapi::AsyncAnalyticsClient (readonly)



80
81
82
# File 'lib/vapi_server_sdk.rb', line 80

def analytics
  @analytics
end

#assistantsVapi::AsyncAssistantsClient (readonly)



68
69
70
# File 'lib/vapi_server_sdk.rb', line 68

def assistants
  @assistants
end

#blocksVapi::AsyncBlocksClient (readonly)



74
75
76
# File 'lib/vapi_server_sdk.rb', line 74

def blocks
  @blocks
end

#callsVapi::AsyncCallsClient (readonly)



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

def calls
  @calls
end

#filesVapi::AsyncFilesClient (readonly)



78
79
80
# File 'lib/vapi_server_sdk.rb', line 78

def files
  @files
end

#logsVapi::AsyncLogsClient (readonly)



82
83
84
# File 'lib/vapi_server_sdk.rb', line 82

def logs
  @logs
end

#phone_numbersVapi::AsyncPhoneNumbersClient (readonly)



70
71
72
# File 'lib/vapi_server_sdk.rb', line 70

def phone_numbers
  @phone_numbers
end

#squadsVapi::AsyncSquadsClient (readonly)



72
73
74
# File 'lib/vapi_server_sdk.rb', line 72

def squads
  @squads
end

#toolsVapi::AsyncToolsClient (readonly)



76
77
78
# File 'lib/vapi_server_sdk.rb', line 76

def tools
  @tools
end