Class: Algolia::AgentStudioClient

Inherits:
Object
  • Object
show all
Defined in:
lib/algolia/api/agent_studio_client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config = nil) ⇒ AgentStudioClient

Returns a new instance of AgentStudioClient.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/algolia/api/agent_studio_client.rb', line 12

def initialize(config = nil)
  raise "`config` is missing." if config.nil?
  raise "`app_id` is missing." if config.app_id.nil? || config.app_id == ""
  raise "`api_key` is missing." if config.api_key.nil? || config.api_key == ""

  if config.connect_timeout.nil?
    config.connect_timeout = 25000
  end

  if config.read_timeout.nil?
    config.read_timeout = 25000
  end

  if config.write_timeout.nil?
    config.write_timeout = 25000
  end

  @api_client = Algolia::ApiClient.new(config)
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



10
11
12
# File 'lib/algolia/api/agent_studio_client.rb', line 10

def api_client
  @api_client
end

Class Method Details

.create(app_id, api_key, opts = {}) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/algolia/api/agent_studio_client.rb', line 32

def self.create(app_id, api_key, opts = {})
  hosts = []
  hosts << Transport::StatefulHost.new("#{app_id}-dsn.algolia.net", accept: CallType::READ)
  hosts << Transport::StatefulHost.new("#{app_id}.algolia.net", accept: CallType::WRITE)

  hosts += 1
    .upto(3)
    .map do |i|
      Transport::StatefulHost.new("#{app_id}-#{i}.algolianet.com", accept: CallType::READ | CallType::WRITE)
    end
    .shuffle

  config = Algolia::Configuration.new(app_id, api_key, hosts, "AgentStudio", opts)
  new(config)
end

.create_with_config(config) ⇒ Object



48
49
50
# File 'lib/algolia/api/agent_studio_client.rb', line 48

def self.create_with_config(config)
  new(config)
end

Instance Method Details

#add_user_agent_segment(segment, version = nil) ⇒ Object



62
63
64
65
66
# File 'lib/algolia/api/agent_studio_client.rb', line 62

def add_user_agent_segment(segment, version = nil)
  @api_client.config.add_user_agent_segment(segment, version)

  self
end

#bulk_create_allowed_domains(agent_id, allowed_domain_bulk_insert, request_options = {}) ⇒ AllowedDomainListResponse

Add multiple allowed domain patterns. Duplicates are skipped.

Required API Key ACLs:

- editSettings

Parameters:

  • agent_id (String)

    The agentId. (required)

  • allowed_domain_bulk_insert (AllowedDomainBulkInsert)

    (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (AllowedDomainListResponse)


123
124
125
126
127
128
129
# File 'lib/algolia/api/agent_studio_client.rb', line 123

def bulk_create_allowed_domains(agent_id, allowed_domain_bulk_insert, request_options = {})
  response = bulk_create_allowed_domains_with_http_info(agent_id, allowed_domain_bulk_insert, request_options)
  @api_client.deserialize(
    response.body,
    request_options[:debug_return_type] || "AgentStudio::AllowedDomainListResponse"
  )
end

#bulk_create_allowed_domains_with_http_info(agent_id, allowed_domain_bulk_insert, request_options = {}) ⇒ Http::Response

Add multiple allowed domain patterns. Duplicates are skipped.

Required API Key ACLs:

- editSettings

Parameters:

  • agent_id (String)

    The agentId. (required)

  • allowed_domain_bulk_insert (AllowedDomainBulkInsert)

    (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



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
# File 'lib/algolia/api/agent_studio_client.rb', line 76

def bulk_create_allowed_domains_with_http_info(agent_id, allowed_domain_bulk_insert, request_options = {})
  # verify the required parameter 'agent_id' is set
  if @api_client.config.client_side_validation && agent_id.nil?
    raise ArgumentError, "Parameter `agent_id` is required when calling `bulk_create_allowed_domains`."
  end
  # verify the required parameter 'agent_id' is not empty
  if @api_client.config.client_side_validation && agent_id.empty?
    raise ArgumentError, "Parameter `agent_id` is required when calling `bulk_create_allowed_domains`."
  end
  # verify the required parameter 'allowed_domain_bulk_insert' is set
  if @api_client.config.client_side_validation && allowed_domain_bulk_insert.nil?
    raise(
      ArgumentError,
      "Parameter `allowed_domain_bulk_insert` is required when calling `bulk_create_allowed_domains`."
    )
  end

  path = "/agent-studio/1/agents/{agentId}/allowed-domains/bulk".sub(
    "{" + "agentId" + "}",
    Transport.encode_uri(agent_id.to_s)
  )
  query_params = {}
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body] || @api_client.object_to_http_body(allowed_domain_bulk_insert)

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.bulk_create_allowed_domains",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:POST, path, new_options)
end

#bulk_delete_allowed_domains(agent_id, allowed_domain_bulk_delete, request_options = {}) ⇒ nil

Delete allowed domains by id list.

Required API Key ACLs:

- editSettings

Parameters:

  • agent_id (String)

    The agentId. (required)

  • allowed_domain_bulk_delete (AllowedDomainBulkDelete)

    (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (nil)


186
187
188
189
# File 'lib/algolia/api/agent_studio_client.rb', line 186

def bulk_delete_allowed_domains(agent_id, allowed_domain_bulk_delete, request_options = {})
  bulk_delete_allowed_domains_with_http_info(agent_id, allowed_domain_bulk_delete, request_options)
  nil
end

#bulk_delete_allowed_domains_with_http_info(agent_id, allowed_domain_bulk_delete, request_options = {}) ⇒ Http::Response

Delete allowed domains by id list.

Required API Key ACLs:

- editSettings

Parameters:

  • agent_id (String)

    The agentId. (required)

  • allowed_domain_bulk_delete (AllowedDomainBulkDelete)

    (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/algolia/api/agent_studio_client.rb', line 139

def bulk_delete_allowed_domains_with_http_info(agent_id, allowed_domain_bulk_delete, request_options = {})
  # verify the required parameter 'agent_id' is set
  if @api_client.config.client_side_validation && agent_id.nil?
    raise ArgumentError, "Parameter `agent_id` is required when calling `bulk_delete_allowed_domains`."
  end
  # verify the required parameter 'agent_id' is not empty
  if @api_client.config.client_side_validation && agent_id.empty?
    raise ArgumentError, "Parameter `agent_id` is required when calling `bulk_delete_allowed_domains`."
  end
  # verify the required parameter 'allowed_domain_bulk_delete' is set
  if @api_client.config.client_side_validation && allowed_domain_bulk_delete.nil?
    raise(
      ArgumentError,
      "Parameter `allowed_domain_bulk_delete` is required when calling `bulk_delete_allowed_domains`."
    )
  end

  path = "/agent-studio/1/agents/{agentId}/allowed-domains/bulk".sub(
    "{" + "agentId" + "}",
    Transport.encode_uri(agent_id.to_s)
  )
  query_params = {}
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body] || @api_client.object_to_http_body(allowed_domain_bulk_delete)

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.bulk_delete_allowed_domains",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:DELETE, path, new_options)
end

#create_agent(agent_config_create, request_options = {}) ⇒ AgentWithVersionResponse

Create a new agent.

Required API Key ACLs:

- editSettings

Parameters:

  • agent_config_create (AgentConfigCreate)

    (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (AgentWithVersionResponse)


230
231
232
233
234
235
236
# File 'lib/algolia/api/agent_studio_client.rb', line 230

def create_agent(agent_config_create, request_options = {})
  response = create_agent_with_http_info(agent_config_create, request_options)
  @api_client.deserialize(
    response.body,
    request_options[:debug_return_type] || "AgentStudio::AgentWithVersionResponse"
  )
end

#create_agent_allowed_domain(agent_id, allowed_domain_create, request_options = {}) ⇒ AllowedDomainResponse

Add a single allowed domain pattern (e.g. app.example.com or *.example.com).

Required API Key ACLs:

- editSettings

Parameters:

  • agent_id (String)

    The agentId. (required)

  • allowed_domain_create (AllowedDomainCreate)

    (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (AllowedDomainResponse)


290
291
292
293
294
295
296
# File 'lib/algolia/api/agent_studio_client.rb', line 290

def create_agent_allowed_domain(agent_id, allowed_domain_create, request_options = {})
  response = create_agent_allowed_domain_with_http_info(agent_id, allowed_domain_create, request_options)
  @api_client.deserialize(
    response.body,
    request_options[:debug_return_type] || "AgentStudio::AllowedDomainResponse"
  )
end

#create_agent_allowed_domain_with_http_info(agent_id, allowed_domain_create, request_options = {}) ⇒ Http::Response

Add a single allowed domain pattern (e.g. app.example.com or *.example.com).

Required API Key ACLs:

- editSettings

Parameters:

  • agent_id (String)

    The agentId. (required)

  • allowed_domain_create (AllowedDomainCreate)

    (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
# File 'lib/algolia/api/agent_studio_client.rb', line 246

def create_agent_allowed_domain_with_http_info(agent_id, allowed_domain_create, request_options = {})
  # verify the required parameter 'agent_id' is set
  if @api_client.config.client_side_validation && agent_id.nil?
    raise ArgumentError, "Parameter `agent_id` is required when calling `create_agent_allowed_domain`."
  end
  # verify the required parameter 'agent_id' is not empty
  if @api_client.config.client_side_validation && agent_id.empty?
    raise ArgumentError, "Parameter `agent_id` is required when calling `create_agent_allowed_domain`."
  end
  # verify the required parameter 'allowed_domain_create' is set
  if @api_client.config.client_side_validation && allowed_domain_create.nil?
    raise ArgumentError, "Parameter `allowed_domain_create` is required when calling `create_agent_allowed_domain`."
  end

  path = "/agent-studio/1/agents/{agentId}/allowed-domains".sub(
    "{" + "agentId" + "}",
    Transport.encode_uri(agent_id.to_s)
  )
  query_params = {}
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body] || @api_client.object_to_http_body(allowed_domain_create)

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.create_agent_allowed_domain",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:POST, path, new_options)
end

#create_agent_completion(agent_id, compatibility_mode, agent_completion_request, stream = nil, cache = nil, memory = nil, analytics = nil, x_algolia_secure_user_token = nil, request_options = {}) ⇒ Hash<String, Object>

Create a completion for the specified agent. This endpoint handles two types of requests: 1. Normal completion request: User message -> Agent response 2. Tool approval response: User approval -> Execute tool -> Agent response Tool Approval Flow (for MCP tools with requiresApproval: true): - Request 1: User sends message -> Agent requests tool call -> Return approval request - Request 2: User approves -> Execute tool -> Agent continues with result.

Required API Key ACLs:

- search

Parameters:

  • agent_id (String)

    The agentId. (required)

  • compatibility_mode (CompatibilityMode)

    Compatibility mode for the completion API. (required)

  • agent_completion_request (AgentCompletionRequest)

    (required)

  • stream (Boolean) (defaults to: nil)

    Whether to stream the response or not. (default to true)

  • cache (Boolean) (defaults to: nil)

    Use cached responses if available. (default to true)

  • memory (Boolean) (defaults to: nil)

    Set to false to disable memory (enabled by default).

  • analytics (Boolean) (defaults to: nil)

    Set to false to skip analytics for this completion (default: true). Disables Agent Studio BigQuery analytics, Algolia search analytics, click analytics, and query-suggestions training. Useful for offline-eval workflows. (default to true)

  • x_algolia_secure_user_token (String) (defaults to: nil)

    The X-Algolia-Secure-User-Token.

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (Hash<String, Object>)


385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
# File 'lib/algolia/api/agent_studio_client.rb', line 385

def create_agent_completion(
  agent_id,
  compatibility_mode,
  agent_completion_request,
  stream = nil,
  cache = nil,
  memory = nil,
  analytics = nil,
  x_algolia_secure_user_token = nil,
  request_options = {}
)
  response = create_agent_completion_with_http_info(
    agent_id,
    compatibility_mode,
    agent_completion_request,
    stream,
    cache,
    memory,
    analytics,
    x_algolia_secure_user_token,
    request_options
  )
  @api_client.deserialize(response.body, request_options[:debug_return_type] || "Hash<String, Object>")
end

#create_agent_completion_with_http_info(agent_id, compatibility_mode, agent_completion_request, stream = nil, cache = nil, memory = nil, analytics = nil, x_algolia_secure_user_token = nil, request_options = {}) ⇒ Http::Response

Create a completion for the specified agent. This endpoint handles two types of requests: 1. Normal completion request: User message -> Agent response 2. Tool approval response: User approval -> Execute tool -> Agent response Tool Approval Flow (for MCP tools with requiresApproval: true): - Request 1: User sends message -> Agent requests tool call -> Return approval request - Request 2: User approves -> Execute tool -> Agent continues with result.

Required API Key ACLs:

- search

Parameters:

  • agent_id (String)

    The agentId. (required)

  • compatibility_mode (CompatibilityMode)

    Compatibility mode for the completion API. (required)

  • agent_completion_request (AgentCompletionRequest)

    (required)

  • stream (Boolean) (defaults to: nil)

    Whether to stream the response or not. (default to true)

  • cache (Boolean) (defaults to: nil)

    Use cached responses if available. (default to true)

  • memory (Boolean) (defaults to: nil)

    Set to false to disable memory (enabled by default).

  • analytics (Boolean) (defaults to: nil)

    Set to false to skip analytics for this completion (default: true). Disables Agent Studio BigQuery analytics, Algolia search analytics, click analytics, and query-suggestions training. Useful for offline-eval workflows. (default to true)

  • x_algolia_secure_user_token (String) (defaults to: nil)

    The X-Algolia-Secure-User-Token.

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
# File 'lib/algolia/api/agent_studio_client.rb', line 312

def create_agent_completion_with_http_info(
  agent_id,
  compatibility_mode,
  agent_completion_request,
  stream = nil,
  cache = nil,
  memory = nil,
  analytics = nil,
  x_algolia_secure_user_token = nil,
  request_options = {}
)
  # verify the required parameter 'agent_id' is set
  if @api_client.config.client_side_validation && agent_id.nil?
    raise ArgumentError, "Parameter `agent_id` is required when calling `create_agent_completion`."
  end
  # verify the required parameter 'agent_id' is not empty
  if @api_client.config.client_side_validation && agent_id.empty?
    raise ArgumentError, "Parameter `agent_id` is required when calling `create_agent_completion`."
  end
  # verify the required parameter 'compatibility_mode' is set
  if @api_client.config.client_side_validation && compatibility_mode.nil?
    raise ArgumentError, "Parameter `compatibility_mode` is required when calling `create_agent_completion`."
  end
  # verify the required parameter 'agent_completion_request' is set
  if @api_client.config.client_side_validation && agent_completion_request.nil?
    raise ArgumentError, "Parameter `agent_completion_request` is required when calling `create_agent_completion`."
  end

  path = "/agent-studio/1/agents/{agentId}/completions".sub(
    "{" + "agentId" + "}",
    Transport.encode_uri(agent_id.to_s)
  )
  query_params = {}
  query_params[:compatibilityMode] = compatibility_mode
  query_params[:stream] = stream unless stream.nil?
  query_params[:cache] = cache unless cache.nil?
  query_params[:memory] = memory unless memory.nil?
  query_params[:analytics] = analytics unless analytics.nil?
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  unless x_algolia_secure_user_token.nil?
    header_params[:"X-Algolia-Secure-User-Token"] = x_algolia_secure_user_token
  end

  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body] || @api_client.object_to_http_body(agent_completion_request)

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.create_agent_completion",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:POST, path, new_options)
end

#create_agent_with_http_info(agent_config_create, request_options = {}) ⇒ Http::Response

Create a new agent.

Required API Key ACLs:

- editSettings

Parameters:

  • agent_config_create (AgentConfigCreate)

    (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'lib/algolia/api/agent_studio_client.rb', line 198

def create_agent_with_http_info(agent_config_create, request_options = {})
  # verify the required parameter 'agent_config_create' is set
  if @api_client.config.client_side_validation && agent_config_create.nil?
    raise ArgumentError, "Parameter `agent_config_create` is required when calling `create_agent`."
  end

  path = "/agent-studio/1/agents"
  query_params = {}
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body] || @api_client.object_to_http_body(agent_config_create)

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.create_agent",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:POST, path, new_options)
end

#create_feedback(feedback_creation_request, request_options = {}) ⇒ FeedbackResponse

Create new feedback entry.

Required API Key ACLs:

- search

Parameters:

  • feedback_creation_request (FeedbackCreationRequest)

    (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (FeedbackResponse)


449
450
451
452
# File 'lib/algolia/api/agent_studio_client.rb', line 449

def create_feedback(feedback_creation_request, request_options = {})
  response = create_feedback_with_http_info(feedback_creation_request, request_options)
  @api_client.deserialize(response.body, request_options[:debug_return_type] || "AgentStudio::FeedbackResponse")
end

#create_feedback_with_http_info(feedback_creation_request, request_options = {}) ⇒ Http::Response

Create new feedback entry.

Required API Key ACLs:

- search

Parameters:

  • feedback_creation_request (FeedbackCreationRequest)

    (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
# File 'lib/algolia/api/agent_studio_client.rb', line 417

def create_feedback_with_http_info(feedback_creation_request, request_options = {})
  # verify the required parameter 'feedback_creation_request' is set
  if @api_client.config.client_side_validation && feedback_creation_request.nil?
    raise ArgumentError, "Parameter `feedback_creation_request` is required when calling `create_feedback`."
  end

  path = "/agent-studio/1/feedback"
  query_params = {}
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body] || @api_client.object_to_http_body(feedback_creation_request)

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.create_feedback",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:POST, path, new_options)
end

#create_provider(provider_authentication_create, request_options = {}) ⇒ ProviderAuthenticationResponse

Create Provider.

Required API Key ACLs:

- editSettings

Parameters:

  • provider_authentication_create (ProviderAuthenticationCreate)

    (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (ProviderAuthenticationResponse)


493
494
495
496
497
498
499
# File 'lib/algolia/api/agent_studio_client.rb', line 493

def create_provider(provider_authentication_create, request_options = {})
  response = create_provider_with_http_info(provider_authentication_create, request_options)
  @api_client.deserialize(
    response.body,
    request_options[:debug_return_type] || "AgentStudio::ProviderAuthenticationResponse"
  )
end

#create_provider_with_http_info(provider_authentication_create, request_options = {}) ⇒ Http::Response

Create Provider.

Required API Key ACLs:

- editSettings

Parameters:

  • provider_authentication_create (ProviderAuthenticationCreate)

    (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
# File 'lib/algolia/api/agent_studio_client.rb', line 461

def create_provider_with_http_info(provider_authentication_create, request_options = {})
  # verify the required parameter 'provider_authentication_create' is set
  if @api_client.config.client_side_validation && provider_authentication_create.nil?
    raise ArgumentError, "Parameter `provider_authentication_create` is required when calling `create_provider`."
  end

  path = "/agent-studio/1/providers"
  query_params = {}
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body] || @api_client.object_to_http_body(provider_authentication_create)

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.create_provider",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:POST, path, new_options)
end

#create_secret_key(secret_key_create, request_options = {}) ⇒ SecretKeyResponse

Create Secret Key.

Required API Key ACLs:

- admin

Parameters:

  • secret_key_create (SecretKeyCreate)

    (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (SecretKeyResponse)


540
541
542
543
# File 'lib/algolia/api/agent_studio_client.rb', line 540

def create_secret_key(secret_key_create, request_options = {})
  response = create_secret_key_with_http_info(secret_key_create, request_options)
  @api_client.deserialize(response.body, request_options[:debug_return_type] || "AgentStudio::SecretKeyResponse")
end

#create_secret_key_with_http_info(secret_key_create, request_options = {}) ⇒ Http::Response

Create Secret Key.

Required API Key ACLs:

- admin

Parameters:

  • secret_key_create (SecretKeyCreate)

    (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
# File 'lib/algolia/api/agent_studio_client.rb', line 508

def create_secret_key_with_http_info(secret_key_create, request_options = {})
  # verify the required parameter 'secret_key_create' is set
  if @api_client.config.client_side_validation && secret_key_create.nil?
    raise ArgumentError, "Parameter `secret_key_create` is required when calling `create_secret_key`."
  end

  path = "/agent-studio/1/secret-keys"
  query_params = {}
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body] || @api_client.object_to_http_body(secret_key_create)

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.create_secret_key",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:POST, path, new_options)
end

#custom_delete(path, parameters = nil, request_options = {}) ⇒ Object

Parameters:

  • path (String)

    Path of the endpoint, for example ‘1/newFeature`. (required)

  • parameters (Hash<String, Object>) (defaults to: nil)

    Query parameters to apply to the current query.

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (Object)


587
588
589
590
# File 'lib/algolia/api/agent_studio_client.rb', line 587

def custom_delete(path, parameters = nil, request_options = {})
  response = custom_delete_with_http_info(path, parameters, request_options)
  @api_client.deserialize(response.body, request_options[:debug_return_type] || "Object")
end

#custom_delete_with_http_info(path, parameters = nil, request_options = {}) ⇒ Http::Response

Returns the response.

Parameters:

  • path (String)

    Path of the endpoint, for example ‘1/newFeature`. (required)

  • parameters (Hash<String, Object>) (defaults to: nil)

    Query parameters to apply to the current query.

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
# File 'lib/algolia/api/agent_studio_client.rb', line 551

def custom_delete_with_http_info(path, parameters = nil, request_options = {})
  # verify the required parameter 'path' is set
  if @api_client.config.client_side_validation && path.nil?
    raise ArgumentError, "Parameter `path` is required when calling `custom_delete`."
  end
  # verify the required parameter 'path' is not empty
  if @api_client.config.client_side_validation && path.empty?
    raise ArgumentError, "Parameter `path` is required when calling `custom_delete`."
  end

  path = "/agent-studio/{path}".sub("{" + "path" + "}", path.to_s)
  query_params = {}
  query_params = query_params.merge(parameters) unless parameters.nil?
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body]

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.custom_delete",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:DELETE, path, new_options)
end

#custom_get(path, parameters = nil, request_options = {}) ⇒ Object

Parameters:

  • path (String)

    Path of the endpoint, for example ‘1/newFeature`. (required)

  • parameters (Hash<String, Object>) (defaults to: nil)

    Query parameters to apply to the current query.

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (Object)


634
635
636
637
# File 'lib/algolia/api/agent_studio_client.rb', line 634

def custom_get(path, parameters = nil, request_options = {})
  response = custom_get_with_http_info(path, parameters, request_options)
  @api_client.deserialize(response.body, request_options[:debug_return_type] || "Object")
end

#custom_get_with_http_info(path, parameters = nil, request_options = {}) ⇒ Http::Response

Returns the response.

Parameters:

  • path (String)

    Path of the endpoint, for example ‘1/newFeature`. (required)

  • parameters (Hash<String, Object>) (defaults to: nil)

    Query parameters to apply to the current query.

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
# File 'lib/algolia/api/agent_studio_client.rb', line 598

def custom_get_with_http_info(path, parameters = nil, request_options = {})
  # verify the required parameter 'path' is set
  if @api_client.config.client_side_validation && path.nil?
    raise ArgumentError, "Parameter `path` is required when calling `custom_get`."
  end
  # verify the required parameter 'path' is not empty
  if @api_client.config.client_side_validation && path.empty?
    raise ArgumentError, "Parameter `path` is required when calling `custom_get`."
  end

  path = "/agent-studio/{path}".sub("{" + "path" + "}", path.to_s)
  query_params = {}
  query_params = query_params.merge(parameters) unless parameters.nil?
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body]

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.custom_get",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:GET, path, new_options)
end

#custom_post(path, parameters = nil, body = nil, request_options = {}) ⇒ Object

Parameters:

  • path (String)

    Path of the endpoint, for example ‘1/newFeature`. (required)

  • parameters (Hash<String, Object>) (defaults to: nil)

    Query parameters to apply to the current query.

  • body (Object) (defaults to: nil)

    Parameters to send with the custom request.

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (Object)


683
684
685
686
# File 'lib/algolia/api/agent_studio_client.rb', line 683

def custom_post(path, parameters = nil, body = nil, request_options = {})
  response = custom_post_with_http_info(path, parameters, body, request_options)
  @api_client.deserialize(response.body, request_options[:debug_return_type] || "Object")
end

#custom_post_with_http_info(path, parameters = nil, body = nil, request_options = {}) ⇒ Http::Response

Returns the response.

Parameters:

  • path (String)

    Path of the endpoint, for example ‘1/newFeature`. (required)

  • parameters (Hash<String, Object>) (defaults to: nil)

    Query parameters to apply to the current query.

  • body (Object) (defaults to: nil)

    Parameters to send with the custom request.

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
# File 'lib/algolia/api/agent_studio_client.rb', line 646

def custom_post_with_http_info(path, parameters = nil, body = nil, request_options = {})
  # verify the required parameter 'path' is set
  if @api_client.config.client_side_validation && path.nil?
    raise ArgumentError, "Parameter `path` is required when calling `custom_post`."
  end
  # verify the required parameter 'path' is not empty
  if @api_client.config.client_side_validation && path.empty?
    raise ArgumentError, "Parameter `path` is required when calling `custom_post`."
  end

  path = "/agent-studio/{path}".sub("{" + "path" + "}", path.to_s)
  query_params = {}
  query_params = query_params.merge(parameters) unless parameters.nil?
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body] || @api_client.object_to_http_body(body)

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.custom_post",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:POST, path, new_options)
end

#custom_put(path, parameters = nil, body = nil, request_options = {}) ⇒ Object

Parameters:

  • path (String)

    Path of the endpoint, for example ‘1/newFeature`. (required)

  • parameters (Hash<String, Object>) (defaults to: nil)

    Query parameters to apply to the current query.

  • body (Object) (defaults to: nil)

    Parameters to send with the custom request.

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (Object)


732
733
734
735
# File 'lib/algolia/api/agent_studio_client.rb', line 732

def custom_put(path, parameters = nil, body = nil, request_options = {})
  response = custom_put_with_http_info(path, parameters, body, request_options)
  @api_client.deserialize(response.body, request_options[:debug_return_type] || "Object")
end

#custom_put_with_http_info(path, parameters = nil, body = nil, request_options = {}) ⇒ Http::Response

Returns the response.

Parameters:

  • path (String)

    Path of the endpoint, for example ‘1/newFeature`. (required)

  • parameters (Hash<String, Object>) (defaults to: nil)

    Query parameters to apply to the current query.

  • body (Object) (defaults to: nil)

    Parameters to send with the custom request.

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
# File 'lib/algolia/api/agent_studio_client.rb', line 695

def custom_put_with_http_info(path, parameters = nil, body = nil, request_options = {})
  # verify the required parameter 'path' is set
  if @api_client.config.client_side_validation && path.nil?
    raise ArgumentError, "Parameter `path` is required when calling `custom_put`."
  end
  # verify the required parameter 'path' is not empty
  if @api_client.config.client_side_validation && path.empty?
    raise ArgumentError, "Parameter `path` is required when calling `custom_put`."
  end

  path = "/agent-studio/{path}".sub("{" + "path" + "}", path.to_s)
  query_params = {}
  query_params = query_params.merge(parameters) unless parameters.nil?
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body] || @api_client.object_to_http_body(body)

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.custom_put",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:PUT, path, new_options)
end

#delete_agent(agent_id, request_options = {}) ⇒ nil

Delete the specified agent.

Required API Key ACLs:

- editSettings

Parameters:

  • agent_id (String)

    The agentId. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (nil)


780
781
782
783
# File 'lib/algolia/api/agent_studio_client.rb', line 780

def delete_agent(agent_id, request_options = {})
  delete_agent_with_http_info(agent_id, request_options)
  nil
end

#delete_agent_conversations(agent_id, start_date = nil, end_date = nil, request_options = {}) ⇒ nil

Deletes the conversations matching the given filers.

Required API Key ACLs:

- logs

Parameters:

  • agent_id (String)

    The agentId. (required)

  • start_date (String) (defaults to: nil)

    Filter conversations created after this date (format: YYYY-MM-DD).

  • end_date (String) (defaults to: nil)

    Filter conversations created before this date (format: YYYY-MM-DD).

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (nil)


837
838
839
840
# File 'lib/algolia/api/agent_studio_client.rb', line 837

def delete_agent_conversations(agent_id, start_date = nil, end_date = nil, request_options = {})
  delete_agent_conversations_with_http_info(agent_id, start_date, end_date, request_options)
  nil
end

#delete_agent_conversations_with_http_info(agent_id, start_date = nil, end_date = nil, request_options = {}) ⇒ Http::Response

Deletes the conversations matching the given filers.

Required API Key ACLs:

- logs

Parameters:

  • agent_id (String)

    The agentId. (required)

  • start_date (String) (defaults to: nil)

    Filter conversations created after this date (format: YYYY-MM-DD).

  • end_date (String) (defaults to: nil)

    Filter conversations created before this date (format: YYYY-MM-DD).

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
# File 'lib/algolia/api/agent_studio_client.rb', line 794

def delete_agent_conversations_with_http_info(agent_id, start_date = nil, end_date = nil, request_options = {})
  # verify the required parameter 'agent_id' is set
  if @api_client.config.client_side_validation && agent_id.nil?
    raise ArgumentError, "Parameter `agent_id` is required when calling `delete_agent_conversations`."
  end
  # verify the required parameter 'agent_id' is not empty
  if @api_client.config.client_side_validation && agent_id.empty?
    raise ArgumentError, "Parameter `agent_id` is required when calling `delete_agent_conversations`."
  end

  path = "/agent-studio/1/agents/{agentId}/conversations".sub(
    "{" + "agentId" + "}",
    Transport.encode_uri(agent_id.to_s)
  )
  query_params = {}
  query_params[:startDate] = start_date unless start_date.nil?
  query_params[:endDate] = end_date unless end_date.nil?
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body]

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.delete_agent_conversations",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:DELETE, path, new_options)
end

#delete_agent_with_http_info(agent_id, request_options = {}) ⇒ Http::Response

Delete the specified agent.

Required API Key ACLs:

- editSettings

Parameters:

  • agent_id (String)

    The agentId. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
# File 'lib/algolia/api/agent_studio_client.rb', line 744

def delete_agent_with_http_info(agent_id, request_options = {})
  # verify the required parameter 'agent_id' is set
  if @api_client.config.client_side_validation && agent_id.nil?
    raise ArgumentError, "Parameter `agent_id` is required when calling `delete_agent`."
  end
  # verify the required parameter 'agent_id' is not empty
  if @api_client.config.client_side_validation && agent_id.empty?
    raise ArgumentError, "Parameter `agent_id` is required when calling `delete_agent`."
  end

  path = "/agent-studio/1/agents/{agentId}".sub("{" + "agentId" + "}", Transport.encode_uri(agent_id.to_s))
  query_params = {}
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body]

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.delete_agent",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:DELETE, path, new_options)
end

#delete_allowed_domain(domain_id, agent_id, request_options = {}) ⇒ nil

Remove an allowed domain by id.

Required API Key ACLs:

- editSettings

Parameters:

  • domain_id (String)

    The domainId. (required)

  • agent_id (String)

    The agentId. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (nil)


897
898
899
900
# File 'lib/algolia/api/agent_studio_client.rb', line 897

def delete_allowed_domain(domain_id, agent_id, request_options = {})
  delete_allowed_domain_with_http_info(domain_id, agent_id, request_options)
  nil
end

#delete_allowed_domain_with_http_info(domain_id, agent_id, request_options = {}) ⇒ Http::Response

Remove an allowed domain by id.

Required API Key ACLs:

- editSettings

Parameters:

  • domain_id (String)

    The domainId. (required)

  • agent_id (String)

    The agentId. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
# File 'lib/algolia/api/agent_studio_client.rb', line 850

def delete_allowed_domain_with_http_info(domain_id, agent_id, request_options = {})
  # verify the required parameter 'domain_id' is set
  if @api_client.config.client_side_validation && domain_id.nil?
    raise ArgumentError, "Parameter `domain_id` is required when calling `delete_allowed_domain`."
  end
  # verify the required parameter 'domain_id' is not empty
  if @api_client.config.client_side_validation && domain_id.empty?
    raise ArgumentError, "Parameter `domain_id` is required when calling `delete_allowed_domain`."
  end
  # verify the required parameter 'agent_id' is set
  if @api_client.config.client_side_validation && agent_id.nil?
    raise ArgumentError, "Parameter `agent_id` is required when calling `delete_allowed_domain`."
  end
  # verify the required parameter 'agent_id' is not empty
  if @api_client.config.client_side_validation && agent_id.empty?
    raise ArgumentError, "Parameter `agent_id` is required when calling `delete_allowed_domain`."
  end

  path = "/agent-studio/1/agents/{agentId}/allowed-domains/{domainId}"
    .sub("{" + "domainId" + "}", Transport.encode_uri(domain_id.to_s))
    .sub("{" + "agentId" + "}", Transport.encode_uri(agent_id.to_s))
  query_params = {}
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body]

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.delete_allowed_domain",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:DELETE, path, new_options)
end

#delete_conversation(conversation_id, agent_id, request_options = {}) ⇒ nil

Deletes the conversation with the given ID.

Required API Key ACLs:

- logs

Parameters:

  • conversation_id (String)

    The conversationId. (required)

  • agent_id (String)

    The agentId. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (nil)


957
958
959
960
# File 'lib/algolia/api/agent_studio_client.rb', line 957

def delete_conversation(conversation_id, agent_id, request_options = {})
  delete_conversation_with_http_info(conversation_id, agent_id, request_options)
  nil
end

#delete_conversation_with_http_info(conversation_id, agent_id, request_options = {}) ⇒ Http::Response

Deletes the conversation with the given ID.

Required API Key ACLs:

- logs

Parameters:

  • conversation_id (String)

    The conversationId. (required)

  • agent_id (String)

    The agentId. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
# File 'lib/algolia/api/agent_studio_client.rb', line 910

def delete_conversation_with_http_info(conversation_id, agent_id, request_options = {})
  # verify the required parameter 'conversation_id' is set
  if @api_client.config.client_side_validation && conversation_id.nil?
    raise ArgumentError, "Parameter `conversation_id` is required when calling `delete_conversation`."
  end
  # verify the required parameter 'conversation_id' is not empty
  if @api_client.config.client_side_validation && conversation_id.empty?
    raise ArgumentError, "Parameter `conversation_id` is required when calling `delete_conversation`."
  end
  # verify the required parameter 'agent_id' is set
  if @api_client.config.client_side_validation && agent_id.nil?
    raise ArgumentError, "Parameter `agent_id` is required when calling `delete_conversation`."
  end
  # verify the required parameter 'agent_id' is not empty
  if @api_client.config.client_side_validation && agent_id.empty?
    raise ArgumentError, "Parameter `agent_id` is required when calling `delete_conversation`."
  end

  path = "/agent-studio/1/agents/{agentId}/conversations/{conversationId}"
    .sub("{" + "conversationId" + "}", Transport.encode_uri(conversation_id.to_s))
    .sub("{" + "agentId" + "}", Transport.encode_uri(agent_id.to_s))
  query_params = {}
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body]

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.delete_conversation",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:DELETE, path, new_options)
end

#delete_provider(provider_id, request_options = {}) ⇒ nil

Delete Provider.

Required API Key ACLs:

- editSettings

Parameters:

  • provider_id (String)

    The providerId. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (nil)


1008
1009
1010
1011
# File 'lib/algolia/api/agent_studio_client.rb', line 1008

def delete_provider(provider_id, request_options = {})
  delete_provider_with_http_info(provider_id, request_options)
  nil
end

#delete_provider_with_http_info(provider_id, request_options = {}) ⇒ Http::Response

Delete Provider.

Required API Key ACLs:

- editSettings

Parameters:

  • provider_id (String)

    The providerId. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
# File 'lib/algolia/api/agent_studio_client.rb', line 969

def delete_provider_with_http_info(provider_id, request_options = {})
  # verify the required parameter 'provider_id' is set
  if @api_client.config.client_side_validation && provider_id.nil?
    raise ArgumentError, "Parameter `provider_id` is required when calling `delete_provider`."
  end
  # verify the required parameter 'provider_id' is not empty
  if @api_client.config.client_side_validation && provider_id.empty?
    raise ArgumentError, "Parameter `provider_id` is required when calling `delete_provider`."
  end

  path = "/agent-studio/1/providers/{providerId}".sub(
    "{" + "providerId" + "}",
    Transport.encode_uri(provider_id.to_s)
  )
  query_params = {}
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body]

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.delete_provider",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:DELETE, path, new_options)
end

#delete_secret_key(secret_key_id, request_options = {}) ⇒ nil

Delete Secret Key.

Required API Key ACLs:

- admin

Parameters:

  • secret_key_id (String)

    The secretKeyId. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (nil)


1059
1060
1061
1062
# File 'lib/algolia/api/agent_studio_client.rb', line 1059

def delete_secret_key(secret_key_id, request_options = {})
  delete_secret_key_with_http_info(secret_key_id, request_options)
  nil
end

#delete_secret_key_with_http_info(secret_key_id, request_options = {}) ⇒ Http::Response

Delete Secret Key.

Required API Key ACLs:

- admin

Parameters:

  • secret_key_id (String)

    The secretKeyId. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
# File 'lib/algolia/api/agent_studio_client.rb', line 1020

def delete_secret_key_with_http_info(secret_key_id, request_options = {})
  # verify the required parameter 'secret_key_id' is set
  if @api_client.config.client_side_validation && secret_key_id.nil?
    raise ArgumentError, "Parameter `secret_key_id` is required when calling `delete_secret_key`."
  end
  # verify the required parameter 'secret_key_id' is not empty
  if @api_client.config.client_side_validation && secret_key_id.empty?
    raise ArgumentError, "Parameter `secret_key_id` is required when calling `delete_secret_key`."
  end

  path = "/agent-studio/1/secret-keys/{secretKeyId}".sub(
    "{" + "secretKeyId" + "}",
    Transport.encode_uri(secret_key_id.to_s)
  )
  query_params = {}
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body]

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.delete_secret_key",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:DELETE, path, new_options)
end

#delete_user_data(user_token, request_options = {}) ⇒ nil

Permanently deletes all messages for the given user token. Does not delete conversations.

Required API Key ACLs:

- logs

Parameters:

  • user_token (String)

    The userToken. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (nil)


1107
1108
1109
1110
# File 'lib/algolia/api/agent_studio_client.rb', line 1107

def delete_user_data(user_token, request_options = {})
  delete_user_data_with_http_info(user_token, request_options)
  nil
end

#delete_user_data_with_http_info(user_token, request_options = {}) ⇒ Http::Response

Permanently deletes all messages for the given user token. Does not delete conversations.

Required API Key ACLs:

- logs

Parameters:

  • user_token (String)

    The userToken. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
# File 'lib/algolia/api/agent_studio_client.rb', line 1071

def delete_user_data_with_http_info(user_token, request_options = {})
  # verify the required parameter 'user_token' is set
  if @api_client.config.client_side_validation && user_token.nil?
    raise ArgumentError, "Parameter `user_token` is required when calling `delete_user_data`."
  end
  # verify the required parameter 'user_token' is not empty
  if @api_client.config.client_side_validation && user_token.empty?
    raise ArgumentError, "Parameter `user_token` is required when calling `delete_user_data`."
  end

  path = "/agent-studio/1/user-data/{userToken}".sub("{" + "userToken" + "}", Transport.encode_uri(user_token.to_s))
  query_params = {}
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body]

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.delete_user_data",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:DELETE, path, new_options)
end

#export_conversations(agent_id, start_date = nil, end_date = nil, request_options = {}) ⇒ Array<ConversationFullResponse>

Exports all conversations based on the passed filters.

Required API Key ACLs:

- logs

Parameters:

  • agent_id (String)

    The agentId. (required)

  • start_date (String) (defaults to: nil)

    Filter conversations created after this date (format: YYYY-MM-DD).

  • end_date (String) (defaults to: nil)

    Filter conversations created before this date (format: YYYY-MM-DD).

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (Array<ConversationFullResponse>)


1164
1165
1166
1167
1168
1169
1170
# File 'lib/algolia/api/agent_studio_client.rb', line 1164

def export_conversations(agent_id, start_date = nil, end_date = nil, request_options = {})
  response = export_conversations_with_http_info(agent_id, start_date, end_date, request_options)
  @api_client.deserialize(
    response.body,
    request_options[:debug_return_type] || "Array<AgentStudio::ConversationFullResponse>"
  )
end

#export_conversations_with_http_info(agent_id, start_date = nil, end_date = nil, request_options = {}) ⇒ Http::Response

Exports all conversations based on the passed filters.

Required API Key ACLs:

- logs

Parameters:

  • agent_id (String)

    The agentId. (required)

  • start_date (String) (defaults to: nil)

    Filter conversations created after this date (format: YYYY-MM-DD).

  • end_date (String) (defaults to: nil)

    Filter conversations created before this date (format: YYYY-MM-DD).

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
# File 'lib/algolia/api/agent_studio_client.rb', line 1121

def export_conversations_with_http_info(agent_id, start_date = nil, end_date = nil, request_options = {})
  # verify the required parameter 'agent_id' is set
  if @api_client.config.client_side_validation && agent_id.nil?
    raise ArgumentError, "Parameter `agent_id` is required when calling `export_conversations`."
  end
  # verify the required parameter 'agent_id' is not empty
  if @api_client.config.client_side_validation && agent_id.empty?
    raise ArgumentError, "Parameter `agent_id` is required when calling `export_conversations`."
  end

  path = "/agent-studio/1/agents/{agentId}/conversations/export".sub(
    "{" + "agentId" + "}",
    Transport.encode_uri(agent_id.to_s)
  )
  query_params = {}
  query_params[:startDate] = start_date unless start_date.nil?
  query_params[:endDate] = end_date unless end_date.nil?
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body]

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.export_conversations",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:GET, path, new_options)
end

#forge_secured_user_token(secret_key, secret_key_id, user_id, expires_in = 86400) ⇒ String

Helper: Forges a secured user token (JWT) for Agent Studio authenticated requests.

Parameters:

  • secret_key (String)

    The secret key to sign the token with.

  • secret_key_id (String)

    The key ID to include in the JWT header (kid).

  • user_id (String)

    The user identifier to include as the subject (sub) claim.

  • expires_in (Integer) (defaults to: 86400)

    The token expiration in seconds from now. Defaults to 86400 (24 hours).

Returns:

  • (String)

    The signed JWT token.



2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
# File 'lib/algolia/api/agent_studio_client.rb', line 2344

def forge_secured_user_token(secret_key, secret_key_id, user_id, expires_in = 86400)
  header = Base64.urlsafe_encode64(
    "{\"alg\":\"HS256\",\"typ\":\"JWT\",\"kid\":\"" + secret_key_id + "\"}",
    padding: false
  )
  payload = Base64.urlsafe_encode64(
    "{\"sub\":\"" + user_id + "\",\"exp\":" + (Time.now.to_i + expires_in).to_s + "}",
    padding: false
  )
  signature = Base64.urlsafe_encode64(
    OpenSSL::HMAC.digest("SHA256", secret_key, header + "." + payload),
    padding: false
  )

  header + "." + payload + "." + signature
end

#get_agent(agent_id, request_options = {}) ⇒ AgentWithVersionResponse

Retrieve details of the specified agent.

Required API Key ACLs:

- settings

Parameters:

  • agent_id (String)

    The agentId. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (AgentWithVersionResponse)


1215
1216
1217
1218
1219
1220
1221
# File 'lib/algolia/api/agent_studio_client.rb', line 1215

def get_agent(agent_id, request_options = {})
  response = get_agent_with_http_info(agent_id, request_options)
  @api_client.deserialize(
    response.body,
    request_options[:debug_return_type] || "AgentStudio::AgentWithVersionResponse"
  )
end

#get_agent_with_http_info(agent_id, request_options = {}) ⇒ Http::Response

Retrieve details of the specified agent.

Required API Key ACLs:

- settings

Parameters:

  • agent_id (String)

    The agentId. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
# File 'lib/algolia/api/agent_studio_client.rb', line 1179

def get_agent_with_http_info(agent_id, request_options = {})
  # verify the required parameter 'agent_id' is set
  if @api_client.config.client_side_validation && agent_id.nil?
    raise ArgumentError, "Parameter `agent_id` is required when calling `get_agent`."
  end
  # verify the required parameter 'agent_id' is not empty
  if @api_client.config.client_side_validation && agent_id.empty?
    raise ArgumentError, "Parameter `agent_id` is required when calling `get_agent`."
  end

  path = "/agent-studio/1/agents/{agentId}".sub("{" + "agentId" + "}", Transport.encode_uri(agent_id.to_s))
  query_params = {}
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body]

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.get_agent",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:GET, path, new_options)
end

#get_allowed_domain(domain_id, agent_id, request_options = {}) ⇒ AllowedDomainResponse

Get a single allowed domain by id.

Required API Key ACLs:

- settings

Parameters:

  • domain_id (String)

    The domainId. (required)

  • agent_id (String)

    The agentId. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (AllowedDomainResponse)


1278
1279
1280
1281
1282
1283
1284
# File 'lib/algolia/api/agent_studio_client.rb', line 1278

def get_allowed_domain(domain_id, agent_id, request_options = {})
  response = get_allowed_domain_with_http_info(domain_id, agent_id, request_options)
  @api_client.deserialize(
    response.body,
    request_options[:debug_return_type] || "AgentStudio::AllowedDomainResponse"
  )
end

#get_allowed_domain_with_http_info(domain_id, agent_id, request_options = {}) ⇒ Http::Response

Get a single allowed domain by id.

Required API Key ACLs:

- settings

Parameters:

  • domain_id (String)

    The domainId. (required)

  • agent_id (String)

    The agentId. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
# File 'lib/algolia/api/agent_studio_client.rb', line 1231

def get_allowed_domain_with_http_info(domain_id, agent_id, request_options = {})
  # verify the required parameter 'domain_id' is set
  if @api_client.config.client_side_validation && domain_id.nil?
    raise ArgumentError, "Parameter `domain_id` is required when calling `get_allowed_domain`."
  end
  # verify the required parameter 'domain_id' is not empty
  if @api_client.config.client_side_validation && domain_id.empty?
    raise ArgumentError, "Parameter `domain_id` is required when calling `get_allowed_domain`."
  end
  # verify the required parameter 'agent_id' is set
  if @api_client.config.client_side_validation && agent_id.nil?
    raise ArgumentError, "Parameter `agent_id` is required when calling `get_allowed_domain`."
  end
  # verify the required parameter 'agent_id' is not empty
  if @api_client.config.client_side_validation && agent_id.empty?
    raise ArgumentError, "Parameter `agent_id` is required when calling `get_allowed_domain`."
  end

  path = "/agent-studio/1/agents/{agentId}/allowed-domains/{domainId}"
    .sub("{" + "domainId" + "}", Transport.encode_uri(domain_id.to_s))
    .sub("{" + "agentId" + "}", Transport.encode_uri(agent_id.to_s))
  query_params = {}
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body]

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.get_allowed_domain",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:GET, path, new_options)
end

#get_configuration(request_options = {}) ⇒ ApplicationConfigResponse

Get Configuration.

Required API Key ACLs:

- logs

Parameters:

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (ApplicationConfigResponse)


1318
1319
1320
1321
1322
1323
1324
# File 'lib/algolia/api/agent_studio_client.rb', line 1318

def get_configuration(request_options = {})
  response = get_configuration_with_http_info(request_options)
  @api_client.deserialize(
    response.body,
    request_options[:debug_return_type] || "AgentStudio::ApplicationConfigResponse"
  )
end

#get_configuration_with_http_info(request_options = {}) ⇒ Http::Response

Get Configuration.

Required API Key ACLs:

- logs

Parameters:

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
# File 'lib/algolia/api/agent_studio_client.rb', line 1292

def get_configuration_with_http_info(request_options = {})
  path = "/agent-studio/1/configuration"
  query_params = {}
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body]

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.get_configuration",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:GET, path, new_options)
end

#get_conversation(conversation_id, agent_id, include_feedback = nil, x_algolia_secure_user_token = nil, request_options = {}) ⇒ ConversationFullResponse

Retrieves the conversation and its messages for the given ID.

Required API Key ACLs:

- logs

Parameters:

  • conversation_id (String)

    The conversationId. (required)

  • agent_id (String)

    The agentId. (required)

  • include_feedback (Boolean) (defaults to: nil)

    Include feedback for the conversation. (default to false)

  • x_algolia_secure_user_token (String) (defaults to: nil)

    The X-Algolia-Secure-User-Token.

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (ConversationFullResponse)


1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
# File 'lib/algolia/api/agent_studio_client.rb', line 1396

def get_conversation(
  conversation_id,
  agent_id,
  include_feedback = nil,
  x_algolia_secure_user_token = nil,
  request_options = {}
)
  response = get_conversation_with_http_info(
    conversation_id,
    agent_id,
    include_feedback,
    x_algolia_secure_user_token,
    request_options
  )
  @api_client.deserialize(
    response.body,
    request_options[:debug_return_type] || "AgentStudio::ConversationFullResponse"
  )
end

#get_conversation_with_http_info(conversation_id, agent_id, include_feedback = nil, x_algolia_secure_user_token = nil, request_options = {}) ⇒ Http::Response

Retrieves the conversation and its messages for the given ID.

Required API Key ACLs:

- logs

Parameters:

  • conversation_id (String)

    The conversationId. (required)

  • agent_id (String)

    The agentId. (required)

  • include_feedback (Boolean) (defaults to: nil)

    Include feedback for the conversation. (default to false)

  • x_algolia_secure_user_token (String) (defaults to: nil)

    The X-Algolia-Secure-User-Token.

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
# File 'lib/algolia/api/agent_studio_client.rb', line 1336

def get_conversation_with_http_info(
  conversation_id,
  agent_id,
  include_feedback = nil,
  x_algolia_secure_user_token = nil,
  request_options = {}
)
  # verify the required parameter 'conversation_id' is set
  if @api_client.config.client_side_validation && conversation_id.nil?
    raise ArgumentError, "Parameter `conversation_id` is required when calling `get_conversation`."
  end
  # verify the required parameter 'conversation_id' is not empty
  if @api_client.config.client_side_validation && conversation_id.empty?
    raise ArgumentError, "Parameter `conversation_id` is required when calling `get_conversation`."
  end
  # verify the required parameter 'agent_id' is set
  if @api_client.config.client_side_validation && agent_id.nil?
    raise ArgumentError, "Parameter `agent_id` is required when calling `get_conversation`."
  end
  # verify the required parameter 'agent_id' is not empty
  if @api_client.config.client_side_validation && agent_id.empty?
    raise ArgumentError, "Parameter `agent_id` is required when calling `get_conversation`."
  end

  path = "/agent-studio/1/agents/{agentId}/conversations/{conversationId}"
    .sub("{" + "conversationId" + "}", Transport.encode_uri(conversation_id.to_s))
    .sub("{" + "agentId" + "}", Transport.encode_uri(agent_id.to_s))
  query_params = {}
  query_params[:includeFeedback] = include_feedback unless include_feedback.nil?
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  unless x_algolia_secure_user_token.nil?
    header_params[:"X-Algolia-Secure-User-Token"] = x_algolia_secure_user_token
  end

  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body]

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.get_conversation",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:GET, path, new_options)
end

#get_provider(provider_id, request_options = {}) ⇒ ProviderAuthenticationResponse

Get Provider.

Required API Key ACLs:

- settings

Parameters:

  • provider_id (String)

    The providerId. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (ProviderAuthenticationResponse)


1462
1463
1464
1465
1466
1467
1468
# File 'lib/algolia/api/agent_studio_client.rb', line 1462

def get_provider(provider_id, request_options = {})
  response = get_provider_with_http_info(provider_id, request_options)
  @api_client.deserialize(
    response.body,
    request_options[:debug_return_type] || "AgentStudio::ProviderAuthenticationResponse"
  )
end

#get_provider_with_http_info(provider_id, request_options = {}) ⇒ Http::Response

Get Provider.

Required API Key ACLs:

- settings

Parameters:

  • provider_id (String)

    The providerId. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
# File 'lib/algolia/api/agent_studio_client.rb', line 1423

def get_provider_with_http_info(provider_id, request_options = {})
  # verify the required parameter 'provider_id' is set
  if @api_client.config.client_side_validation && provider_id.nil?
    raise ArgumentError, "Parameter `provider_id` is required when calling `get_provider`."
  end
  # verify the required parameter 'provider_id' is not empty
  if @api_client.config.client_side_validation && provider_id.empty?
    raise ArgumentError, "Parameter `provider_id` is required when calling `get_provider`."
  end

  path = "/agent-studio/1/providers/{providerId}".sub(
    "{" + "providerId" + "}",
    Transport.encode_uri(provider_id.to_s)
  )
  query_params = {}
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body]

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.get_provider",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:GET, path, new_options)
end

#get_secret_key(secret_key_id, request_options = {}) ⇒ SecretKeyResponse

Get Secret Key.

Required API Key ACLs:

- settings

Parameters:

  • secret_key_id (String)

    The secretKeyId. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (SecretKeyResponse)


1516
1517
1518
1519
# File 'lib/algolia/api/agent_studio_client.rb', line 1516

def get_secret_key(secret_key_id, request_options = {})
  response = get_secret_key_with_http_info(secret_key_id, request_options)
  @api_client.deserialize(response.body, request_options[:debug_return_type] || "AgentStudio::SecretKeyResponse")
end

#get_secret_key_with_http_info(secret_key_id, request_options = {}) ⇒ Http::Response

Get Secret Key.

Required API Key ACLs:

- settings

Parameters:

  • secret_key_id (String)

    The secretKeyId. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
# File 'lib/algolia/api/agent_studio_client.rb', line 1477

def get_secret_key_with_http_info(secret_key_id, request_options = {})
  # verify the required parameter 'secret_key_id' is set
  if @api_client.config.client_side_validation && secret_key_id.nil?
    raise ArgumentError, "Parameter `secret_key_id` is required when calling `get_secret_key`."
  end
  # verify the required parameter 'secret_key_id' is not empty
  if @api_client.config.client_side_validation && secret_key_id.empty?
    raise ArgumentError, "Parameter `secret_key_id` is required when calling `get_secret_key`."
  end

  path = "/agent-studio/1/secret-keys/{secretKeyId}".sub(
    "{" + "secretKeyId" + "}",
    Transport.encode_uri(secret_key_id.to_s)
  )
  query_params = {}
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body]

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.get_secret_key",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:GET, path, new_options)
end

#get_user_data(user_token, request_options = {}) ⇒ UserDataResponse

Retrieves all memories, conversations and their messages for the given user token.

Required API Key ACLs:

- logs

Parameters:

  • user_token (String)

    The userToken. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (UserDataResponse)


1564
1565
1566
1567
# File 'lib/algolia/api/agent_studio_client.rb', line 1564

def get_user_data(user_token, request_options = {})
  response = get_user_data_with_http_info(user_token, request_options)
  @api_client.deserialize(response.body, request_options[:debug_return_type] || "AgentStudio::UserDataResponse")
end

#get_user_data_with_http_info(user_token, request_options = {}) ⇒ Http::Response

Retrieves all memories, conversations and their messages for the given user token.

Required API Key ACLs:

- logs

Parameters:

  • user_token (String)

    The userToken. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
# File 'lib/algolia/api/agent_studio_client.rb', line 1528

def get_user_data_with_http_info(user_token, request_options = {})
  # verify the required parameter 'user_token' is set
  if @api_client.config.client_side_validation && user_token.nil?
    raise ArgumentError, "Parameter `user_token` is required when calling `get_user_data`."
  end
  # verify the required parameter 'user_token' is not empty
  if @api_client.config.client_side_validation && user_token.empty?
    raise ArgumentError, "Parameter `user_token` is required when calling `get_user_data`."
  end

  path = "/agent-studio/1/user-data/{userToken}".sub("{" + "userToken" + "}", Transport.encode_uri(user_token.to_s))
  query_params = {}
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body]

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.get_user_data",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:GET, path, new_options)
end

#invalidate_agent_cache(agent_id, before = nil, request_options = {}) ⇒ nil

Invalidate cached completions for this agent. Filter with ‘before` (exclusive).

Required API Key ACLs:

- editSettings

Parameters:

  • agent_id (String)

    The agentId. (required)

  • before (String) (defaults to: nil)

    Delete entries strictly before this date (exclusive, YYYY-MM-DD).

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (nil)


1615
1616
1617
1618
# File 'lib/algolia/api/agent_studio_client.rb', line 1615

def invalidate_agent_cache(agent_id, before = nil, request_options = {})
  invalidate_agent_cache_with_http_info(agent_id, before, request_options)
  nil
end

#invalidate_agent_cache_with_http_info(agent_id, before = nil, request_options = {}) ⇒ Http::Response

Invalidate cached completions for this agent. Filter with ‘before` (exclusive).

Required API Key ACLs:

- editSettings

Parameters:

  • agent_id (String)

    The agentId. (required)

  • before (String) (defaults to: nil)

    Delete entries strictly before this date (exclusive, YYYY-MM-DD).

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
# File 'lib/algolia/api/agent_studio_client.rb', line 1577

def invalidate_agent_cache_with_http_info(agent_id, before = nil, request_options = {})
  # verify the required parameter 'agent_id' is set
  if @api_client.config.client_side_validation && agent_id.nil?
    raise ArgumentError, "Parameter `agent_id` is required when calling `invalidate_agent_cache`."
  end
  # verify the required parameter 'agent_id' is not empty
  if @api_client.config.client_side_validation && agent_id.empty?
    raise ArgumentError, "Parameter `agent_id` is required when calling `invalidate_agent_cache`."
  end

  path = "/agent-studio/1/agents/{agentId}/cache".sub("{" + "agentId" + "}", Transport.encode_uri(agent_id.to_s))
  query_params = {}
  query_params[:before] = before unless before.nil?
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body]

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.invalidate_agent_cache",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:DELETE, path, new_options)
end

#list_agent_allowed_domains(agent_id, request_options = {}) ⇒ AllowedDomainListResponse

List all allowed domain patterns for this agent.

Required API Key ACLs:

- settings

Parameters:

  • agent_id (String)

    The agentId. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (AllowedDomainListResponse)


1666
1667
1668
1669
1670
1671
1672
# File 'lib/algolia/api/agent_studio_client.rb', line 1666

def list_agent_allowed_domains(agent_id, request_options = {})
  response = list_agent_allowed_domains_with_http_info(agent_id, request_options)
  @api_client.deserialize(
    response.body,
    request_options[:debug_return_type] || "AgentStudio::AllowedDomainListResponse"
  )
end

#list_agent_allowed_domains_with_http_info(agent_id, request_options = {}) ⇒ Http::Response

List all allowed domain patterns for this agent.

Required API Key ACLs:

- settings

Parameters:

  • agent_id (String)

    The agentId. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
# File 'lib/algolia/api/agent_studio_client.rb', line 1627

def list_agent_allowed_domains_with_http_info(agent_id, request_options = {})
  # verify the required parameter 'agent_id' is set
  if @api_client.config.client_side_validation && agent_id.nil?
    raise ArgumentError, "Parameter `agent_id` is required when calling `list_agent_allowed_domains`."
  end
  # verify the required parameter 'agent_id' is not empty
  if @api_client.config.client_side_validation && agent_id.empty?
    raise ArgumentError, "Parameter `agent_id` is required when calling `list_agent_allowed_domains`."
  end

  path = "/agent-studio/1/agents/{agentId}/allowed-domains".sub(
    "{" + "agentId" + "}",
    Transport.encode_uri(agent_id.to_s)
  )
  query_params = {}
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body]

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.list_agent_allowed_domains",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:GET, path, new_options)
end

#list_agent_conversations(agent_id, start_date = nil, end_date = nil, include_feedback = nil, feedback_vote = nil, page = nil, limit = nil, x_algolia_secure_user_token = nil, request_options = {}) ⇒ PaginatedConversationsResponse

Retrieves the conversations for the given agent ID.

Required API Key ACLs:

- logs

Parameters:

  • agent_id (String)

    The agentId. (required)

  • start_date (String) (defaults to: nil)

    Filter conversations created after this date (format: YYYY-MM-DD).

  • end_date (String) (defaults to: nil)

    Filter conversations created before this date (format: YYYY-MM-DD).

  • include_feedback (Boolean) (defaults to: nil)

    Include feedback per conversation.

  • feedback_vote (Integer) (defaults to: nil)

    Filter by feedback value (requires includeFeedback=true).

  • page (Integer) (defaults to: nil)

    Page number. (default to 1)

  • limit (Integer) (defaults to: nil)

    Items per page. (default to 20)

  • x_algolia_secure_user_token (String) (defaults to: nil)

    The X-Algolia-Secure-User-Token.

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (PaginatedConversationsResponse)


1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
# File 'lib/algolia/api/agent_studio_client.rb', line 1754

def list_agent_conversations(
  agent_id,
  start_date = nil,
  end_date = nil,
  include_feedback = nil,
  feedback_vote = nil,
  page = nil,
  limit = nil,
  x_algolia_secure_user_token = nil,
  request_options = {}
)
  response = list_agent_conversations_with_http_info(
    agent_id,
    start_date,
    end_date,
    include_feedback,
    feedback_vote,
    page,
    limit,
    x_algolia_secure_user_token,
    request_options
  )
  @api_client.deserialize(
    response.body,
    request_options[:debug_return_type] || "AgentStudio::PaginatedConversationsResponse"
  )
end

#list_agent_conversations_with_http_info(agent_id, start_date = nil, end_date = nil, include_feedback = nil, feedback_vote = nil, page = nil, limit = nil, x_algolia_secure_user_token = nil, request_options = {}) ⇒ Http::Response

Retrieves the conversations for the given agent ID.

Required API Key ACLs:

- logs

Parameters:

  • agent_id (String)

    The agentId. (required)

  • start_date (String) (defaults to: nil)

    Filter conversations created after this date (format: YYYY-MM-DD).

  • end_date (String) (defaults to: nil)

    Filter conversations created before this date (format: YYYY-MM-DD).

  • include_feedback (Boolean) (defaults to: nil)

    Include feedback per conversation.

  • feedback_vote (Integer) (defaults to: nil)

    Filter by feedback value (requires includeFeedback=true).

  • page (Integer) (defaults to: nil)

    Page number. (default to 1)

  • limit (Integer) (defaults to: nil)

    Items per page. (default to 20)

  • x_algolia_secure_user_token (String) (defaults to: nil)

    The X-Algolia-Secure-User-Token.

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
# File 'lib/algolia/api/agent_studio_client.rb', line 1688

def list_agent_conversations_with_http_info(
  agent_id,
  start_date = nil,
  end_date = nil,
  include_feedback = nil,
  feedback_vote = nil,
  page = nil,
  limit = nil,
  x_algolia_secure_user_token = nil,
  request_options = {}
)
  # verify the required parameter 'agent_id' is set
  if @api_client.config.client_side_validation && agent_id.nil?
    raise ArgumentError, "Parameter `agent_id` is required when calling `list_agent_conversations`."
  end
  # verify the required parameter 'agent_id' is not empty
  if @api_client.config.client_side_validation && agent_id.empty?
    raise ArgumentError, "Parameter `agent_id` is required when calling `list_agent_conversations`."
  end

  path = "/agent-studio/1/agents/{agentId}/conversations".sub(
    "{" + "agentId" + "}",
    Transport.encode_uri(agent_id.to_s)
  )
  query_params = {}
  query_params[:startDate] = start_date unless start_date.nil?
  query_params[:endDate] = end_date unless end_date.nil?
  query_params[:includeFeedback] = include_feedback unless include_feedback.nil?
  query_params[:feedbackVote] = feedback_vote unless feedback_vote.nil?
  query_params[:page] = page unless page.nil?
  query_params[:limit] = limit unless limit.nil?
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  unless x_algolia_secure_user_token.nil?
    header_params[:"X-Algolia-Secure-User-Token"] = x_algolia_secure_user_token
  end

  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body]

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.list_agent_conversations",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:GET, path, new_options)
end

#list_agents(page = nil, limit = nil, provider_id = nil, request_options = {}) ⇒ PaginatedAgentsResponse

List all agents with pagination and filtering.

Required API Key ACLs:

- settings

Parameters:

  • page (Integer) (defaults to: nil)

    Page number. (default to 1)

  • limit (Integer) (defaults to: nil)

    Items per page. (default to 10)

  • provider_id (String) (defaults to: nil)

    Filter by provider id.

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (PaginatedAgentsResponse)


1823
1824
1825
1826
1827
1828
1829
# File 'lib/algolia/api/agent_studio_client.rb', line 1823

def list_agents(page = nil, limit = nil, provider_id = nil, request_options = {})
  response = list_agents_with_http_info(page, limit, provider_id, request_options)
  @api_client.deserialize(
    response.body,
    request_options[:debug_return_type] || "AgentStudio::PaginatedAgentsResponse"
  )
end

#list_agents_with_http_info(page = nil, limit = nil, provider_id = nil, request_options = {}) ⇒ Http::Response

List all agents with pagination and filtering.

Required API Key ACLs:

- settings

Parameters:

  • page (Integer) (defaults to: nil)

    Page number. (default to 1)

  • limit (Integer) (defaults to: nil)

    Items per page. (default to 10)

  • provider_id (String) (defaults to: nil)

    Filter by provider id.

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
# File 'lib/algolia/api/agent_studio_client.rb', line 1791

def list_agents_with_http_info(page = nil, limit = nil, provider_id = nil, request_options = {})
  path = "/agent-studio/1/agents"
  query_params = {}
  query_params[:page] = page unless page.nil?
  query_params[:limit] = limit unless limit.nil?
  query_params[:providerId] = provider_id unless provider_id.nil?
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body]

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.list_agents",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:GET, path, new_options)
end

#list_models(request_options = {}) ⇒ Hash<String, Array<String>>

Get Provider Models.

Required API Key ACLs:

- settings

Parameters:

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (Hash<String, Array<String>>)


1863
1864
1865
1866
# File 'lib/algolia/api/agent_studio_client.rb', line 1863

def list_models(request_options = {})
  response = list_models_with_http_info(request_options)
  @api_client.deserialize(response.body, request_options[:debug_return_type] || "Hash<String, Array<String>>")
end

#list_models_with_http_info(request_options = {}) ⇒ Http::Response

Get Provider Models.

Required API Key ACLs:

- settings

Parameters:

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
# File 'lib/algolia/api/agent_studio_client.rb', line 1837

def list_models_with_http_info(request_options = {})
  path = "/agent-studio/1/providers/models"
  query_params = {}
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body]

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.list_models",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:GET, path, new_options)
end

#list_provider_models(provider_id, request_options = {}) ⇒ Array<String>

Get available models for a specific provider.

Required API Key ACLs:

- settings

Parameters:

  • provider_id (String)

    The providerId. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (Array<String>)


1914
1915
1916
1917
# File 'lib/algolia/api/agent_studio_client.rb', line 1914

def list_provider_models(provider_id, request_options = {})
  response = list_provider_models_with_http_info(provider_id, request_options)
  @api_client.deserialize(response.body, request_options[:debug_return_type] || "Array<AgentStudio::>")
end

#list_provider_models_with_http_info(provider_id, request_options = {}) ⇒ Http::Response

Get available models for a specific provider.

Required API Key ACLs:

- settings

Parameters:

  • provider_id (String)

    The providerId. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
# File 'lib/algolia/api/agent_studio_client.rb', line 1875

def list_provider_models_with_http_info(provider_id, request_options = {})
  # verify the required parameter 'provider_id' is set
  if @api_client.config.client_side_validation && provider_id.nil?
    raise ArgumentError, "Parameter `provider_id` is required when calling `list_provider_models`."
  end
  # verify the required parameter 'provider_id' is not empty
  if @api_client.config.client_side_validation && provider_id.empty?
    raise ArgumentError, "Parameter `provider_id` is required when calling `list_provider_models`."
  end

  path = "/agent-studio/1/providers/{providerId}/models".sub(
    "{" + "providerId" + "}",
    Transport.encode_uri(provider_id.to_s)
  )
  query_params = {}
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body]

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.list_provider_models",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:GET, path, new_options)
end

#list_providers(page = nil, limit = nil, request_options = {}) ⇒ PaginatedProviderAuthenticationsResponse

List Providers.

Required API Key ACLs:

- settings

Parameters:

  • page (Integer) (defaults to: nil)

    Page number. (default to 1)

  • limit (Integer) (defaults to: nil)

    Items per page. (default to 10)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (PaginatedProviderAuthenticationsResponse)


1957
1958
1959
1960
1961
1962
1963
# File 'lib/algolia/api/agent_studio_client.rb', line 1957

def list_providers(page = nil, limit = nil, request_options = {})
  response = list_providers_with_http_info(page, limit, request_options)
  @api_client.deserialize(
    response.body,
    request_options[:debug_return_type] || "AgentStudio::PaginatedProviderAuthenticationsResponse"
  )
end

#list_providers_with_http_info(page = nil, limit = nil, request_options = {}) ⇒ Http::Response

List Providers.

Required API Key ACLs:

- settings

Parameters:

  • page (Integer) (defaults to: nil)

    Page number. (default to 1)

  • limit (Integer) (defaults to: nil)

    Items per page. (default to 10)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
# File 'lib/algolia/api/agent_studio_client.rb', line 1927

def list_providers_with_http_info(page = nil, limit = nil, request_options = {})
  path = "/agent-studio/1/providers"
  query_params = {}
  query_params[:page] = page unless page.nil?
  query_params[:limit] = limit unless limit.nil?
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body]

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.list_providers",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:GET, path, new_options)
end

#list_secret_keys(page = nil, limit = nil, request_options = {}) ⇒ PaginatedSecretKeysResponse

List Secret Keys.

Required API Key ACLs:

- settings

Parameters:

  • page (Integer) (defaults to: nil)

    Page number. (default to 1)

  • limit (Integer) (defaults to: nil)

    Items per page. (default to 10)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (PaginatedSecretKeysResponse)


2003
2004
2005
2006
2007
2008
2009
# File 'lib/algolia/api/agent_studio_client.rb', line 2003

def list_secret_keys(page = nil, limit = nil, request_options = {})
  response = list_secret_keys_with_http_info(page, limit, request_options)
  @api_client.deserialize(
    response.body,
    request_options[:debug_return_type] || "AgentStudio::PaginatedSecretKeysResponse"
  )
end

#list_secret_keys_with_http_info(page = nil, limit = nil, request_options = {}) ⇒ Http::Response

List Secret Keys.

Required API Key ACLs:

- settings

Parameters:

  • page (Integer) (defaults to: nil)

    Page number. (default to 1)

  • limit (Integer) (defaults to: nil)

    Items per page. (default to 10)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
# File 'lib/algolia/api/agent_studio_client.rb', line 1973

def list_secret_keys_with_http_info(page = nil, limit = nil, request_options = {})
  path = "/agent-studio/1/secret-keys"
  query_params = {}
  query_params[:page] = page unless page.nil?
  query_params[:limit] = limit unless limit.nil?
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body]

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.list_secret_keys",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:GET, path, new_options)
end

#publish_agent(agent_id, request_options = {}) ⇒ AgentWithVersionResponse

Publish the specified agent.

Required API Key ACLs:

- editSettings

Parameters:

  • agent_id (String)

    The agentId. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (AgentWithVersionResponse)


2054
2055
2056
2057
2058
2059
2060
# File 'lib/algolia/api/agent_studio_client.rb', line 2054

def publish_agent(agent_id, request_options = {})
  response = publish_agent_with_http_info(agent_id, request_options)
  @api_client.deserialize(
    response.body,
    request_options[:debug_return_type] || "AgentStudio::AgentWithVersionResponse"
  )
end

#publish_agent_with_http_info(agent_id, request_options = {}) ⇒ Http::Response

Publish the specified agent.

Required API Key ACLs:

- editSettings

Parameters:

  • agent_id (String)

    The agentId. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
# File 'lib/algolia/api/agent_studio_client.rb', line 2018

def publish_agent_with_http_info(agent_id, request_options = {})
  # verify the required parameter 'agent_id' is set
  if @api_client.config.client_side_validation && agent_id.nil?
    raise ArgumentError, "Parameter `agent_id` is required when calling `publish_agent`."
  end
  # verify the required parameter 'agent_id' is not empty
  if @api_client.config.client_side_validation && agent_id.empty?
    raise ArgumentError, "Parameter `agent_id` is required when calling `publish_agent`."
  end

  path = "/agent-studio/1/agents/{agentId}/publish".sub("{" + "agentId" + "}", Transport.encode_uri(agent_id.to_s))
  query_params = {}
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body]

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.publish_agent",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:POST, path, new_options)
end

#set_client_api_key(api_key) ⇒ void

This method returns an undefined value.

Helper method to switch the API key used to authenticate the requests.

Parameters:

  • api_key (String)

    the new API key to use.



56
57
58
59
60
# File 'lib/algolia/api/agent_studio_client.rb', line 56

def set_client_api_key(api_key)
  @api_client.set_client_api_key(api_key)

  self
end

#unpublish_agent(agent_id, request_options = {}) ⇒ AgentWithVersionResponse

Unpublish the specified agent.

Required API Key ACLs:

- editSettings

Parameters:

  • agent_id (String)

    The agentId. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (AgentWithVersionResponse)


2108
2109
2110
2111
2112
2113
2114
# File 'lib/algolia/api/agent_studio_client.rb', line 2108

def unpublish_agent(agent_id, request_options = {})
  response = unpublish_agent_with_http_info(agent_id, request_options)
  @api_client.deserialize(
    response.body,
    request_options[:debug_return_type] || "AgentStudio::AgentWithVersionResponse"
  )
end

#unpublish_agent_with_http_info(agent_id, request_options = {}) ⇒ Http::Response

Unpublish the specified agent.

Required API Key ACLs:

- editSettings

Parameters:

  • agent_id (String)

    The agentId. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
# File 'lib/algolia/api/agent_studio_client.rb', line 2069

def unpublish_agent_with_http_info(agent_id, request_options = {})
  # verify the required parameter 'agent_id' is set
  if @api_client.config.client_side_validation && agent_id.nil?
    raise ArgumentError, "Parameter `agent_id` is required when calling `unpublish_agent`."
  end
  # verify the required parameter 'agent_id' is not empty
  if @api_client.config.client_side_validation && agent_id.empty?
    raise ArgumentError, "Parameter `agent_id` is required when calling `unpublish_agent`."
  end

  path = "/agent-studio/1/agents/{agentId}/unpublish".sub(
    "{" + "agentId" + "}",
    Transport.encode_uri(agent_id.to_s)
  )
  query_params = {}
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body]

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.unpublish_agent",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:POST, path, new_options)
end

#update_agent(agent_id, agent_config_update, request_options = {}) ⇒ AgentWithVersionResponse

Update the specified agent.

Required API Key ACLs:

- editSettings

Parameters:

  • agent_id (String)

    The agentId. (required)

  • agent_config_update (AgentConfigUpdate)

    (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (AgentWithVersionResponse)


2165
2166
2167
2168
2169
2170
2171
# File 'lib/algolia/api/agent_studio_client.rb', line 2165

def update_agent(agent_id, agent_config_update, request_options = {})
  response = update_agent_with_http_info(agent_id, agent_config_update, request_options)
  @api_client.deserialize(
    response.body,
    request_options[:debug_return_type] || "AgentStudio::AgentWithVersionResponse"
  )
end

#update_agent_with_http_info(agent_id, agent_config_update, request_options = {}) ⇒ Http::Response

Update the specified agent.

Required API Key ACLs:

- editSettings

Parameters:

  • agent_id (String)

    The agentId. (required)

  • agent_config_update (AgentConfigUpdate)

    (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
# File 'lib/algolia/api/agent_studio_client.rb', line 2124

def update_agent_with_http_info(agent_id, agent_config_update, request_options = {})
  # verify the required parameter 'agent_id' is set
  if @api_client.config.client_side_validation && agent_id.nil?
    raise ArgumentError, "Parameter `agent_id` is required when calling `update_agent`."
  end
  # verify the required parameter 'agent_id' is not empty
  if @api_client.config.client_side_validation && agent_id.empty?
    raise ArgumentError, "Parameter `agent_id` is required when calling `update_agent`."
  end
  # verify the required parameter 'agent_config_update' is set
  if @api_client.config.client_side_validation && agent_config_update.nil?
    raise ArgumentError, "Parameter `agent_config_update` is required when calling `update_agent`."
  end

  path = "/agent-studio/1/agents/{agentId}".sub("{" + "agentId" + "}", Transport.encode_uri(agent_id.to_s))
  query_params = {}
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body] || @api_client.object_to_http_body(agent_config_update)

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.update_agent",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:PATCH, path, new_options)
end

#update_configuration(application_config_patch, request_options = {}) ⇒ ApplicationConfigResponse

Patch Configuration.

Required API Key ACLs:

- logs

Parameters:

  • application_config_patch (ApplicationConfigPatch)

    (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (ApplicationConfigResponse)


2212
2213
2214
2215
2216
2217
2218
# File 'lib/algolia/api/agent_studio_client.rb', line 2212

def update_configuration(application_config_patch, request_options = {})
  response = update_configuration_with_http_info(application_config_patch, request_options)
  @api_client.deserialize(
    response.body,
    request_options[:debug_return_type] || "AgentStudio::ApplicationConfigResponse"
  )
end

#update_configuration_with_http_info(application_config_patch, request_options = {}) ⇒ Http::Response

Patch Configuration.

Required API Key ACLs:

- logs

Parameters:

  • application_config_patch (ApplicationConfigPatch)

    (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
# File 'lib/algolia/api/agent_studio_client.rb', line 2180

def update_configuration_with_http_info(application_config_patch, request_options = {})
  # verify the required parameter 'application_config_patch' is set
  if @api_client.config.client_side_validation && application_config_patch.nil?
    raise ArgumentError, "Parameter `application_config_patch` is required when calling `update_configuration`."
  end

  path = "/agent-studio/1/configuration"
  query_params = {}
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body] || @api_client.object_to_http_body(application_config_patch)

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.update_configuration",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:PATCH, path, new_options)
end

#update_provider(provider_id, provider_authentication_patch, request_options = {}) ⇒ ProviderAuthenticationResponse

Update Provider.

Required API Key ACLs:

- editSettings

Parameters:

  • provider_id (String)

    The providerId. (required)

  • provider_authentication_patch (ProviderAuthenticationPatch)

    (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (ProviderAuthenticationResponse)


2272
2273
2274
2275
2276
2277
2278
# File 'lib/algolia/api/agent_studio_client.rb', line 2272

def update_provider(provider_id, provider_authentication_patch, request_options = {})
  response = update_provider_with_http_info(provider_id, provider_authentication_patch, request_options)
  @api_client.deserialize(
    response.body,
    request_options[:debug_return_type] || "AgentStudio::ProviderAuthenticationResponse"
  )
end

#update_provider_with_http_info(provider_id, provider_authentication_patch, request_options = {}) ⇒ Http::Response

Update Provider.

Required API Key ACLs:

- editSettings

Parameters:

  • provider_id (String)

    The providerId. (required)

  • provider_authentication_patch (ProviderAuthenticationPatch)

    (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
# File 'lib/algolia/api/agent_studio_client.rb', line 2228

def update_provider_with_http_info(provider_id, provider_authentication_patch, request_options = {})
  # verify the required parameter 'provider_id' is set
  if @api_client.config.client_side_validation && provider_id.nil?
    raise ArgumentError, "Parameter `provider_id` is required when calling `update_provider`."
  end
  # verify the required parameter 'provider_id' is not empty
  if @api_client.config.client_side_validation && provider_id.empty?
    raise ArgumentError, "Parameter `provider_id` is required when calling `update_provider`."
  end
  # verify the required parameter 'provider_authentication_patch' is set
  if @api_client.config.client_side_validation && provider_authentication_patch.nil?
    raise ArgumentError, "Parameter `provider_authentication_patch` is required when calling `update_provider`."
  end

  path = "/agent-studio/1/providers/{providerId}".sub(
    "{" + "providerId" + "}",
    Transport.encode_uri(provider_id.to_s)
  )
  query_params = {}
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body] || @api_client.object_to_http_body(provider_authentication_patch)

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.update_provider",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:PATCH, path, new_options)
end

#update_secret_key(secret_key_id, secret_key_patch, request_options = {}) ⇒ SecretKeyResponse

Patch Secret Key.

Required API Key ACLs:

- admin

Parameters:

  • secret_key_id (String)

    The secretKeyId. (required)

  • secret_key_patch (SecretKeyPatch)

    (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (SecretKeyResponse)


2332
2333
2334
2335
# File 'lib/algolia/api/agent_studio_client.rb', line 2332

def update_secret_key(secret_key_id, secret_key_patch, request_options = {})
  response = update_secret_key_with_http_info(secret_key_id, secret_key_patch, request_options)
  @api_client.deserialize(response.body, request_options[:debug_return_type] || "AgentStudio::SecretKeyResponse")
end

#update_secret_key_with_http_info(secret_key_id, secret_key_patch, request_options = {}) ⇒ Http::Response

Patch Secret Key.

Required API Key ACLs:

- admin

Parameters:

  • secret_key_id (String)

    The secretKeyId. (required)

  • secret_key_patch (SecretKeyPatch)

    (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
# File 'lib/algolia/api/agent_studio_client.rb', line 2288

def update_secret_key_with_http_info(secret_key_id, secret_key_patch, request_options = {})
  # verify the required parameter 'secret_key_id' is set
  if @api_client.config.client_side_validation && secret_key_id.nil?
    raise ArgumentError, "Parameter `secret_key_id` is required when calling `update_secret_key`."
  end
  # verify the required parameter 'secret_key_id' is not empty
  if @api_client.config.client_side_validation && secret_key_id.empty?
    raise ArgumentError, "Parameter `secret_key_id` is required when calling `update_secret_key`."
  end
  # verify the required parameter 'secret_key_patch' is set
  if @api_client.config.client_side_validation && secret_key_patch.nil?
    raise ArgumentError, "Parameter `secret_key_patch` is required when calling `update_secret_key`."
  end

  path = "/agent-studio/1/secret-keys/{secretKeyId}".sub(
    "{" + "secretKeyId" + "}",
    Transport.encode_uri(secret_key_id.to_s)
  )
  query_params = {}
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body] || @api_client.object_to_http_body(secret_key_patch)

  new_options = request_options.merge(
    :operation => :"AgentStudioClient.update_secret_key",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:PATCH, path, new_options)
end