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)


132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# File 'lib/vapi_server_sdk.rb', line 132

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)
  @chats = Vapi::AsyncChatsClient.new(request_client: @async_request_client)
  @campaigns = Vapi::AsyncCampaignsClient.new(request_client: @async_request_client)
  @sessions = Vapi::AsyncSessionsClient.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)
  @tools = Vapi::AsyncToolsClient.new(request_client: @async_request_client)
  @files = Vapi::AsyncFilesClient.new(request_client: @async_request_client)
  @knowledge_bases = Vapi::AsyncKnowledgeBasesClient.new(request_client: @async_request_client)
  @workflow = Vapi::AsyncWorkflowClient.new(request_client: @async_request_client)
  @squads = Vapi::AsyncSquadsClient.new(request_client: @async_request_client)
  @test_suites = Vapi::AsyncTestSuitesClient.new(request_client: @async_request_client)
  @test_suite_tests = Vapi::AsyncTestSuiteTestsClient.new(request_client: @async_request_client)
  @test_suite_runs = Vapi::AsyncTestSuiteRunsClient.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)



122
123
124
# File 'lib/vapi_server_sdk.rb', line 122

def analytics
  @analytics
end

#assistantsVapi::AsyncAssistantsClient (readonly)



102
103
104
# File 'lib/vapi_server_sdk.rb', line 102

def assistants
  @assistants
end

#callsVapi::AsyncCallsClient (readonly)



94
95
96
# File 'lib/vapi_server_sdk.rb', line 94

def calls
  @calls
end

#campaignsVapi::AsyncCampaignsClient (readonly)



98
99
100
# File 'lib/vapi_server_sdk.rb', line 98

def campaigns
  @campaigns
end

#chatsVapi::AsyncChatsClient (readonly)



96
97
98
# File 'lib/vapi_server_sdk.rb', line 96

def chats
  @chats
end

#filesVapi::AsyncFilesClient (readonly)



108
109
110
# File 'lib/vapi_server_sdk.rb', line 108

def files
  @files
end

#knowledge_basesVapi::AsyncKnowledgeBasesClient (readonly)



110
111
112
# File 'lib/vapi_server_sdk.rb', line 110

def knowledge_bases
  @knowledge_bases
end

#logsVapi::AsyncLogsClient (readonly)



124
125
126
# File 'lib/vapi_server_sdk.rb', line 124

def logs
  @logs
end

#phone_numbersVapi::AsyncPhoneNumbersClient (readonly)



104
105
106
# File 'lib/vapi_server_sdk.rb', line 104

def phone_numbers
  @phone_numbers
end

#sessionsVapi::AsyncSessionsClient (readonly)



100
101
102
# File 'lib/vapi_server_sdk.rb', line 100

def sessions
  @sessions
end

#squadsVapi::AsyncSquadsClient (readonly)



114
115
116
# File 'lib/vapi_server_sdk.rb', line 114

def squads
  @squads
end

#test_suite_runsVapi::AsyncTestSuiteRunsClient (readonly)



120
121
122
# File 'lib/vapi_server_sdk.rb', line 120

def test_suite_runs
  @test_suite_runs
end

#test_suite_testsVapi::AsyncTestSuiteTestsClient (readonly)



118
119
120
# File 'lib/vapi_server_sdk.rb', line 118

def test_suite_tests
  @test_suite_tests
end

#test_suitesVapi::AsyncTestSuitesClient (readonly)



116
117
118
# File 'lib/vapi_server_sdk.rb', line 116

def test_suites
  @test_suites
end

#toolsVapi::AsyncToolsClient (readonly)



106
107
108
# File 'lib/vapi_server_sdk.rb', line 106

def tools
  @tools
end

#workflowVapi::AsyncWorkflowClient (readonly)



112
113
114
# File 'lib/vapi_server_sdk.rb', line 112

def workflow
  @workflow
end