Class: FetchHive::Generated::AgentChatsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/fetch_hive/generated/api/agent_chats_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AgentChatsApi

Returns a new instance of AgentChatsApi.



19
20
21
# File 'lib/fetch_hive/generated/api/agent_chats_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/fetch_hive/generated/api/agent_chats_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#delete_public_workspaces_agents_chats(workspace_id, agent_id, id, opts = {}) ⇒ DeletePublicWorkspacesAgentsChats200Response

Delete a chat Permanently deletes a chat and all its messages.

Parameters:

  • workspace_id (String)

    Workspace UUID

  • agent_id (String)

    Agent UUID

  • id (String)

    Chat UUID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



29
30
31
32
# File 'lib/fetch_hive/generated/api/agent_chats_api.rb', line 29

def delete_public_workspaces_agents_chats(workspace_id, agent_id, id, opts = {})
  data, _status_code, _headers = delete_public_workspaces_agents_chats_with_http_info(workspace_id, agent_id, id, opts)
  data
end

#delete_public_workspaces_agents_chats_with_http_info(workspace_id, agent_id, id, opts = {}) ⇒ Array<(DeletePublicWorkspacesAgentsChats200Response, Integer, Hash)>

Delete a chat Permanently deletes a chat and all its messages.

Parameters:

  • workspace_id (String)

    Workspace UUID

  • agent_id (String)

    Agent UUID

  • id (String)

    Chat UUID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/fetch_hive/generated/api/agent_chats_api.rb', line 41

def delete_public_workspaces_agents_chats_with_http_info(workspace_id, agent_id, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentChatsApi.delete_public_workspaces_agents_chats ...'
  end
  # verify the required parameter 'workspace_id' is set
  if @api_client.config.client_side_validation && workspace_id.nil?
    fail ArgumentError, "Missing the required parameter 'workspace_id' when calling AgentChatsApi.delete_public_workspaces_agents_chats"
  end
  # verify the required parameter 'agent_id' is set
  if @api_client.config.client_side_validation && agent_id.nil?
    fail ArgumentError, "Missing the required parameter 'agent_id' when calling AgentChatsApi.delete_public_workspaces_agents_chats"
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling AgentChatsApi.delete_public_workspaces_agents_chats"
  end
  # resource path
  local_var_path = '/public/workspaces/{workspace_id}/agents/{agent_id}/chats/{id}'.sub('{workspace_id}', CGI.escape(workspace_id.to_s)).sub('{agent_id}', CGI.escape(agent_id.to_s)).sub('{id}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'DeletePublicWorkspacesAgentsChats200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearer_auth']

  new_options = opts.merge(
    :operation => :"AgentChatsApi.delete_public_workspaces_agents_chats",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AgentChatsApi#delete_public_workspaces_agents_chats\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_public_workspaces_agents_chats(workspace_id, agent_id, id, opts = {}) ⇒ GetPublicWorkspacesAgentsChats200Response

Get a chat Returns a single chat belonging to the agent in the requested workspace.

Parameters:

  • workspace_id (String)

    Workspace UUID

  • agent_id (String)

    Agent UUID

  • id (String)

    Chat UUID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



104
105
106
107
# File 'lib/fetch_hive/generated/api/agent_chats_api.rb', line 104

def get_public_workspaces_agents_chats(workspace_id, agent_id, id, opts = {})
  data, _status_code, _headers = get_public_workspaces_agents_chats_with_http_info(workspace_id, agent_id, id, opts)
  data
end

#get_public_workspaces_agents_chats_with_http_info(workspace_id, agent_id, id, opts = {}) ⇒ Array<(GetPublicWorkspacesAgentsChats200Response, Integer, Hash)>

Get a chat Returns a single chat belonging to the agent in the requested workspace.

Parameters:

  • workspace_id (String)

    Workspace UUID

  • agent_id (String)

    Agent UUID

  • id (String)

    Chat UUID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/fetch_hive/generated/api/agent_chats_api.rb', line 116

def get_public_workspaces_agents_chats_with_http_info(workspace_id, agent_id, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentChatsApi.get_public_workspaces_agents_chats ...'
  end
  # verify the required parameter 'workspace_id' is set
  if @api_client.config.client_side_validation && workspace_id.nil?
    fail ArgumentError, "Missing the required parameter 'workspace_id' when calling AgentChatsApi.get_public_workspaces_agents_chats"
  end
  # verify the required parameter 'agent_id' is set
  if @api_client.config.client_side_validation && agent_id.nil?
    fail ArgumentError, "Missing the required parameter 'agent_id' when calling AgentChatsApi.get_public_workspaces_agents_chats"
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling AgentChatsApi.get_public_workspaces_agents_chats"
  end
  # resource path
  local_var_path = '/public/workspaces/{workspace_id}/agents/{agent_id}/chats/{id}'.sub('{workspace_id}', CGI.escape(workspace_id.to_s)).sub('{agent_id}', CGI.escape(agent_id.to_s)).sub('{id}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetPublicWorkspacesAgentsChats200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearer_auth']

  new_options = opts.merge(
    :operation => :"AgentChatsApi.get_public_workspaces_agents_chats",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AgentChatsApi#get_public_workspaces_agents_chats\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#patch_public_workspaces_agents_chats(workspace_id, agent_id, id, patch_public_workspaces_agents_chats_request, opts = {}) ⇒ PatchPublicWorkspacesAgentsChats200Response

Update a chat Updates a chat name in the requested workspace.

Parameters:

  • workspace_id (String)

    Workspace UUID

  • agent_id (String)

    Agent UUID

  • id (String)

    Chat UUID

  • patch_public_workspaces_agents_chats_request (PatchPublicWorkspacesAgentsChatsRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



180
181
182
183
# File 'lib/fetch_hive/generated/api/agent_chats_api.rb', line 180

def patch_public_workspaces_agents_chats(workspace_id, agent_id, id, patch_public_workspaces_agents_chats_request, opts = {})
  data, _status_code, _headers = patch_public_workspaces_agents_chats_with_http_info(workspace_id, agent_id, id, patch_public_workspaces_agents_chats_request, opts)
  data
end

#patch_public_workspaces_agents_chats_clear_messages(workspace_id, agent_id, id, opts = {}) ⇒ PatchPublicWorkspacesAgentsChatsClearMessages200Response

Clear all messages in a chat Destroys all messages in the chat and resets the last message content.

Parameters:

  • workspace_id (String)

    Workspace UUID

  • agent_id (String)

    Agent UUID

  • id (String)

    Chat UUID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



265
266
267
268
# File 'lib/fetch_hive/generated/api/agent_chats_api.rb', line 265

def patch_public_workspaces_agents_chats_clear_messages(workspace_id, agent_id, id, opts = {})
  data, _status_code, _headers = patch_public_workspaces_agents_chats_clear_messages_with_http_info(workspace_id, agent_id, id, opts)
  data
end

#patch_public_workspaces_agents_chats_clear_messages_with_http_info(workspace_id, agent_id, id, opts = {}) ⇒ Array<(PatchPublicWorkspacesAgentsChatsClearMessages200Response, Integer, Hash)>

Clear all messages in a chat Destroys all messages in the chat and resets the last message content.

Parameters:

  • workspace_id (String)

    Workspace UUID

  • agent_id (String)

    Agent UUID

  • id (String)

    Chat UUID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
# File 'lib/fetch_hive/generated/api/agent_chats_api.rb', line 277

def patch_public_workspaces_agents_chats_clear_messages_with_http_info(workspace_id, agent_id, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentChatsApi.patch_public_workspaces_agents_chats_clear_messages ...'
  end
  # verify the required parameter 'workspace_id' is set
  if @api_client.config.client_side_validation && workspace_id.nil?
    fail ArgumentError, "Missing the required parameter 'workspace_id' when calling AgentChatsApi.patch_public_workspaces_agents_chats_clear_messages"
  end
  # verify the required parameter 'agent_id' is set
  if @api_client.config.client_side_validation && agent_id.nil?
    fail ArgumentError, "Missing the required parameter 'agent_id' when calling AgentChatsApi.patch_public_workspaces_agents_chats_clear_messages"
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling AgentChatsApi.patch_public_workspaces_agents_chats_clear_messages"
  end
  # resource path
  local_var_path = '/public/workspaces/{workspace_id}/agents/{agent_id}/chats/{id}/clear_messages'.sub('{workspace_id}', CGI.escape(workspace_id.to_s)).sub('{agent_id}', CGI.escape(agent_id.to_s)).sub('{id}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'PatchPublicWorkspacesAgentsChatsClearMessages200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearer_auth']

  new_options = opts.merge(
    :operation => :"AgentChatsApi.patch_public_workspaces_agents_chats_clear_messages",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AgentChatsApi#patch_public_workspaces_agents_chats_clear_messages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#patch_public_workspaces_agents_chats_with_http_info(workspace_id, agent_id, id, patch_public_workspaces_agents_chats_request, opts = {}) ⇒ Array<(PatchPublicWorkspacesAgentsChats200Response, Integer, Hash)>

Update a chat Updates a chat name in the requested workspace.

Parameters:

  • workspace_id (String)

    Workspace UUID

  • agent_id (String)

    Agent UUID

  • id (String)

    Chat UUID

  • patch_public_workspaces_agents_chats_request (PatchPublicWorkspacesAgentsChatsRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
# File 'lib/fetch_hive/generated/api/agent_chats_api.rb', line 193

def patch_public_workspaces_agents_chats_with_http_info(workspace_id, agent_id, id, patch_public_workspaces_agents_chats_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentChatsApi.patch_public_workspaces_agents_chats ...'
  end
  # verify the required parameter 'workspace_id' is set
  if @api_client.config.client_side_validation && workspace_id.nil?
    fail ArgumentError, "Missing the required parameter 'workspace_id' when calling AgentChatsApi.patch_public_workspaces_agents_chats"
  end
  # verify the required parameter 'agent_id' is set
  if @api_client.config.client_side_validation && agent_id.nil?
    fail ArgumentError, "Missing the required parameter 'agent_id' when calling AgentChatsApi.patch_public_workspaces_agents_chats"
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling AgentChatsApi.patch_public_workspaces_agents_chats"
  end
  # verify the required parameter 'patch_public_workspaces_agents_chats_request' is set
  if @api_client.config.client_side_validation && patch_public_workspaces_agents_chats_request.nil?
    fail ArgumentError, "Missing the required parameter 'patch_public_workspaces_agents_chats_request' when calling AgentChatsApi.patch_public_workspaces_agents_chats"
  end
  # resource path
  local_var_path = '/public/workspaces/{workspace_id}/agents/{agent_id}/chats/{id}'.sub('{workspace_id}', CGI.escape(workspace_id.to_s)).sub('{agent_id}', CGI.escape(agent_id.to_s)).sub('{id}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(patch_public_workspaces_agents_chats_request)

  # return_type
  return_type = opts[:debug_return_type] || 'PatchPublicWorkspacesAgentsChats200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearer_auth']

  new_options = opts.merge(
    :operation => :"AgentChatsApi.patch_public_workspaces_agents_chats",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AgentChatsApi#patch_public_workspaces_agents_chats\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_public_workspaces_agents_chats(workspace_id, agent_id, post_public_workspaces_agents_chats_request, opts = {}) ⇒ PostPublicWorkspacesAgentsChats200Response

Create a chat Creates a new chat session for the agent in the requested workspace.

Parameters:

  • workspace_id (String)

    Workspace UUID

  • agent_id (String)

    Agent UUID

  • post_public_workspaces_agents_chats_request (PostPublicWorkspacesAgentsChatsRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



340
341
342
343
# File 'lib/fetch_hive/generated/api/agent_chats_api.rb', line 340

def post_public_workspaces_agents_chats(workspace_id, agent_id, post_public_workspaces_agents_chats_request, opts = {})
  data, _status_code, _headers = post_public_workspaces_agents_chats_with_http_info(workspace_id, agent_id, post_public_workspaces_agents_chats_request, opts)
  data
end

#post_public_workspaces_agents_chats_with_http_info(workspace_id, agent_id, post_public_workspaces_agents_chats_request, opts = {}) ⇒ Array<(PostPublicWorkspacesAgentsChats200Response, Integer, Hash)>

Create a chat Creates a new chat session for the agent in the requested workspace.

Parameters:

  • workspace_id (String)

    Workspace UUID

  • agent_id (String)

    Agent UUID

  • post_public_workspaces_agents_chats_request (PostPublicWorkspacesAgentsChatsRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
# File 'lib/fetch_hive/generated/api/agent_chats_api.rb', line 352

def post_public_workspaces_agents_chats_with_http_info(workspace_id, agent_id, post_public_workspaces_agents_chats_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentChatsApi.post_public_workspaces_agents_chats ...'
  end
  # verify the required parameter 'workspace_id' is set
  if @api_client.config.client_side_validation && workspace_id.nil?
    fail ArgumentError, "Missing the required parameter 'workspace_id' when calling AgentChatsApi.post_public_workspaces_agents_chats"
  end
  # verify the required parameter 'agent_id' is set
  if @api_client.config.client_side_validation && agent_id.nil?
    fail ArgumentError, "Missing the required parameter 'agent_id' when calling AgentChatsApi.post_public_workspaces_agents_chats"
  end
  # verify the required parameter 'post_public_workspaces_agents_chats_request' is set
  if @api_client.config.client_side_validation && post_public_workspaces_agents_chats_request.nil?
    fail ArgumentError, "Missing the required parameter 'post_public_workspaces_agents_chats_request' when calling AgentChatsApi.post_public_workspaces_agents_chats"
  end
  # resource path
  local_var_path = '/public/workspaces/{workspace_id}/agents/{agent_id}/chats'.sub('{workspace_id}', CGI.escape(workspace_id.to_s)).sub('{agent_id}', CGI.escape(agent_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(post_public_workspaces_agents_chats_request)

  # return_type
  return_type = opts[:debug_return_type] || 'PostPublicWorkspacesAgentsChats200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearer_auth']

  new_options = opts.merge(
    :operation => :"AgentChatsApi.post_public_workspaces_agents_chats",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AgentChatsApi#post_public_workspaces_agents_chats\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end