algolia 3.40.0 → 3.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. checksums.yaml +4 -4
  2. data/.github/ISSUE_TEMPLATE/Bug_report.yml +1 -0
  3. data/CHANGELOG.md +9 -0
  4. data/Gemfile.lock +4 -4
  5. data/lib/algolia/api/agent_studio_client.rb +2361 -0
  6. data/lib/algolia/models/agent-studio/advanced_syntax_features.rb +34 -0
  7. data/lib/algolia/models/agent-studio/agent_completion_algolia_params.rb +221 -0
  8. data/lib/algolia/models/agent-studio/agent_completion_request.rb +247 -0
  9. data/lib/algolia/models/agent-studio/agent_config_create.rb +288 -0
  10. data/lib/algolia/models/agent-studio/agent_config_update.rb +294 -0
  11. data/lib/algolia/models/agent-studio/agent_status.rb +34 -0
  12. data/lib/algolia/models/agent-studio/agent_test_configuration.rb +271 -0
  13. data/lib/algolia/models/agent-studio/agent_with_version_response.rb +370 -0
  14. data/lib/algolia/models/agent-studio/algolia_display_results_tool_config.rb +254 -0
  15. data/lib/algolia/models/agent-studio/algolia_recommend_tool_config_input.rb +242 -0
  16. data/lib/algolia/models/agent-studio/algolia_recommend_tool_index_config.rb +228 -0
  17. data/lib/algolia/models/agent-studio/algolia_search_tool_config.rb +232 -0
  18. data/lib/algolia/models/agent-studio/algolia_search_tool_index_config.rb +249 -0
  19. data/lib/algolia/models/agent-studio/allowed_domain_bulk_delete.rb +212 -0
  20. data/lib/algolia/models/agent-studio/allowed_domain_bulk_insert.rb +212 -0
  21. data/lib/algolia/models/agent-studio/allowed_domain_create.rb +210 -0
  22. data/lib/algolia/models/agent-studio/allowed_domain_list_response.rb +211 -0
  23. data/lib/algolia/models/agent-studio/allowed_domain_response.rb +264 -0
  24. data/lib/algolia/models/agent-studio/alternatives_as_exact.rb +36 -0
  25. data/lib/algolia/models/agent-studio/anthropic_provider_input.rb +220 -0
  26. data/lib/algolia/models/agent-studio/application_config_patch.rb +209 -0
  27. data/lib/algolia/models/agent-studio/application_config_response.rb +208 -0
  28. data/lib/algolia/models/agent-studio/around_precision_union.rb +108 -0
  29. data/lib/algolia/models/agent-studio/around_radius_union.rb +108 -0
  30. data/lib/algolia/models/agent-studio/assistant_message_v4.rb +252 -0
  31. data/lib/algolia/models/agent-studio/assistant_message_v5.rb +228 -0
  32. data/lib/algolia/models/agent-studio/assistant_part_v4.rb +110 -0
  33. data/lib/algolia/models/agent-studio/assistant_part_v5.rb +110 -0
  34. data/lib/algolia/models/agent-studio/azure_open_ai_provider_input.rb +243 -0
  35. data/lib/algolia/models/agent-studio/base_provider_input.rb +209 -0
  36. data/lib/algolia/models/agent-studio/client_side_tool_config.rb +241 -0
  37. data/lib/algolia/models/agent-studio/client_tools_args_schema.rb +228 -0
  38. data/lib/algolia/models/agent-studio/compatibility_mode.rb +34 -0
  39. data/lib/algolia/models/agent-studio/conversation_base_response.rb +355 -0
  40. data/lib/algolia/models/agent-studio/conversation_full_response.rb +369 -0
  41. data/lib/algolia/models/agent-studio/conversation_metadata.rb +209 -0
  42. data/lib/algolia/models/agent-studio/distinct_union.rb +108 -0
  43. data/lib/algolia/models/agent-studio/episode.rb +243 -0
  44. data/lib/algolia/models/agent-studio/error_base.rb +207 -0
  45. data/lib/algolia/models/agent-studio/exact_on_single_word_query.rb +35 -0
  46. data/lib/algolia/models/agent-studio/facet_filters_union.rb +108 -0
  47. data/lib/algolia/models/agent-studio/facets.rb +208 -0
  48. data/lib/algolia/models/agent-studio/facets_param.rb +220 -0
  49. data/lib/algolia/models/agent-studio/facets_union.rb +108 -0
  50. data/lib/algolia/models/agent-studio/feedback_creation_request.rb +251 -0
  51. data/lib/algolia/models/agent-studio/feedback_response.rb +297 -0
  52. data/lib/algolia/models/agent-studio/ignore_plurals_union.rb +108 -0
  53. data/lib/algolia/models/agent-studio/index_search_parameters.rb +267 -0
  54. data/lib/algolia/models/agent-studio/inside_bounding_box_union.rb +108 -0
  55. data/lib/algolia/models/agent-studio/inside_polygon_union.rb +108 -0
  56. data/lib/algolia/models/agent-studio/location_item_union.rb +108 -0
  57. data/lib/algolia/models/agent-studio/mcp_server_tool_config.rb +276 -0
  58. data/lib/algolia/models/agent-studio/mcp_tool_config.rb +218 -0
  59. data/lib/algolia/models/agent-studio/memory_record.rb +368 -0
  60. data/lib/algolia/models/agent-studio/memory_type.rb +34 -0
  61. data/lib/algolia/models/agent-studio/message_part.rb +132 -0
  62. data/lib/algolia/models/agent-studio/message_response.rb +309 -0
  63. data/lib/algolia/models/agent-studio/message_role.rb +34 -0
  64. data/lib/algolia/models/agent-studio/message_v4.rb +117 -0
  65. data/lib/algolia/models/agent-studio/message_v5.rb +117 -0
  66. data/lib/algolia/models/agent-studio/messages_union.rb +108 -0
  67. data/lib/algolia/models/agent-studio/number_param.rb +230 -0
  68. data/lib/algolia/models/agent-studio/number_param_constraint.rb +219 -0
  69. data/lib/algolia/models/agent-studio/numeric_filters_union.rb +108 -0
  70. data/lib/algolia/models/agent-studio/open_ai_compatible_provider_input.rb +232 -0
  71. data/lib/algolia/models/agent-studio/open_ai_provider_input.rb +220 -0
  72. data/lib/algolia/models/agent-studio/optional_filters_union.rb +108 -0
  73. data/lib/algolia/models/agent-studio/optional_words_union.rb +108 -0
  74. data/lib/algolia/models/agent-studio/paginated_agents_response.rb +221 -0
  75. data/lib/algolia/models/agent-studio/paginated_conversations_response.rb +221 -0
  76. data/lib/algolia/models/agent-studio/paginated_provider_authentications_response.rb +221 -0
  77. data/lib/algolia/models/agent-studio/paginated_secret_keys_response.rb +221 -0
  78. data/lib/algolia/models/agent-studio/pagination_metadata.rb +241 -0
  79. data/lib/algolia/models/agent-studio/provider_authentication_create.rb +230 -0
  80. data/lib/algolia/models/agent-studio/provider_authentication_patch.rb +218 -0
  81. data/lib/algolia/models/agent-studio/provider_authentication_response.rb +274 -0
  82. data/lib/algolia/models/agent-studio/provider_input.rb +111 -0
  83. data/lib/algolia/models/agent-studio/provider_input_nullable.rb +111 -0
  84. data/lib/algolia/models/agent-studio/provider_name.rb +38 -0
  85. data/lib/algolia/models/agent-studio/query_type.rb +35 -0
  86. data/lib/algolia/models/agent-studio/re_ranking_apply_filter_union.rb +108 -0
  87. data/lib/algolia/models/agent-studio/reasoning_part.rb +219 -0
  88. data/lib/algolia/models/agent-studio/reasoning_part_v4.rb +217 -0
  89. data/lib/algolia/models/agent-studio/reasoning_part_v5.rb +217 -0
  90. data/lib/algolia/models/agent-studio/remove_stop_words_union.rb +108 -0
  91. data/lib/algolia/models/agent-studio/remove_words_if_no_results.rb +36 -0
  92. data/lib/algolia/models/agent-studio/search_parameters.rb +950 -0
  93. data/lib/algolia/models/agent-studio/search_parameters_overrides.rb +286 -0
  94. data/lib/algolia/models/agent-studio/secret_key_create.rb +222 -0
  95. data/lib/algolia/models/agent-studio/secret_key_patch.rb +223 -0
  96. data/lib/algolia/models/agent-studio/secret_key_response.rb +287 -0
  97. data/lib/algolia/models/agent-studio/start_part.rb +208 -0
  98. data/lib/algolia/models/agent-studio/start_step_part.rb +208 -0
  99. data/lib/algolia/models/agent-studio/step_start_part_v4.rb +206 -0
  100. data/lib/algolia/models/agent-studio/step_start_part_v5.rb +206 -0
  101. data/lib/algolia/models/agent-studio/string_array_param.rb +242 -0
  102. data/lib/algolia/models/agent-studio/string_array_param_constraint.rb +211 -0
  103. data/lib/algolia/models/agent-studio/supported_language.rb +169 -0
  104. data/lib/algolia/models/agent-studio/tag_filters_union.rb +108 -0
  105. data/lib/algolia/models/agent-studio/text_param.rb +220 -0
  106. data/lib/algolia/models/agent-studio/text_part.rb +216 -0
  107. data/lib/algolia/models/agent-studio/text_part_v4.rb +217 -0
  108. data/lib/algolia/models/agent-studio/text_part_v5.rb +217 -0
  109. data/lib/algolia/models/agent-studio/tool_approval_request_part.rb +285 -0
  110. data/lib/algolia/models/agent-studio/tool_call_part.rb +265 -0
  111. data/lib/algolia/models/agent-studio/tool_config.rb +108 -0
  112. data/lib/algolia/models/agent-studio/tool_config_input.rb +129 -0
  113. data/lib/algolia/models/agent-studio/tool_invocation_part_v4.rb +217 -0
  114. data/lib/algolia/models/agent-studio/tool_invocation_v4.rb +309 -0
  115. data/lib/algolia/models/agent-studio/tool_part_v5.rb +309 -0
  116. data/lib/algolia/models/agent-studio/tool_result_output.rb +221 -0
  117. data/lib/algolia/models/agent-studio/tool_result_output_type.rb +37 -0
  118. data/lib/algolia/models/agent-studio/tool_result_part.rb +254 -0
  119. data/lib/algolia/models/agent-studio/tool_state.rb +36 -0
  120. data/lib/algolia/models/agent-studio/typo_tolerance_enum.rb +36 -0
  121. data/lib/algolia/models/agent-studio/typo_tolerance_union.rb +108 -0
  122. data/lib/algolia/models/agent-studio/unknown_tool_config.rb +220 -0
  123. data/lib/algolia/models/agent-studio/user_data_response.rb +223 -0
  124. data/lib/algolia/models/agent-studio/user_message_metadata_v5.rb +209 -0
  125. data/lib/algolia/models/agent-studio/user_message_v4.rb +250 -0
  126. data/lib/algolia/models/agent-studio/user_message_v5.rb +237 -0
  127. data/lib/algolia/models/agent-studio/validation_error.rb +252 -0
  128. data/lib/algolia/models/agent-studio/vote_enum.rb +34 -0
  129. data/lib/algolia/version.rb +1 -1
  130. metadata +125 -1
@@ -0,0 +1,2361 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
4
+
5
+ require "openssl"
6
+ require "base64"
7
+
8
+ module Algolia
9
+ class AgentStudioClient
10
+ attr_accessor :api_client
11
+
12
+ def initialize(config = nil)
13
+ raise "`config` is missing." if config.nil?
14
+ raise "`app_id` is missing." if config.app_id.nil? || config.app_id == ""
15
+ raise "`api_key` is missing." if config.api_key.nil? || config.api_key == ""
16
+
17
+ if config.connect_timeout.nil?
18
+ config.connect_timeout = 25000
19
+ end
20
+
21
+ if config.read_timeout.nil?
22
+ config.read_timeout = 25000
23
+ end
24
+
25
+ if config.write_timeout.nil?
26
+ config.write_timeout = 25000
27
+ end
28
+
29
+ @api_client = Algolia::ApiClient.new(config)
30
+ end
31
+
32
+ def self.create(app_id, api_key, opts = {})
33
+ hosts = []
34
+ hosts << Transport::StatefulHost.new("#{app_id}-dsn.algolia.net", accept: CallType::READ)
35
+ hosts << Transport::StatefulHost.new("#{app_id}.algolia.net", accept: CallType::WRITE)
36
+
37
+ hosts += 1
38
+ .upto(3)
39
+ .map do |i|
40
+ Transport::StatefulHost.new("#{app_id}-#{i}.algolianet.com", accept: CallType::READ | CallType::WRITE)
41
+ end
42
+ .shuffle
43
+
44
+ config = Algolia::Configuration.new(app_id, api_key, hosts, "AgentStudio", opts)
45
+ new(config)
46
+ end
47
+
48
+ def self.create_with_config(config)
49
+ new(config)
50
+ end
51
+
52
+ # Helper method to switch the API key used to authenticate the requests.
53
+ #
54
+ # @param api_key [String] the new API key to use.
55
+ # @return [void]
56
+ def set_client_api_key(api_key)
57
+ @api_client.set_client_api_key(api_key)
58
+
59
+ self
60
+ end
61
+
62
+ def add_user_agent_segment(segment, version = nil)
63
+ @api_client.config.add_user_agent_segment(segment, version)
64
+
65
+ self
66
+ end
67
+
68
+ # Add multiple allowed domain patterns. Duplicates are skipped.
69
+ #
70
+ # Required API Key ACLs:
71
+ # - editSettings
72
+ # @param agent_id [String] The agentId. (required)
73
+ # @param allowed_domain_bulk_insert [AllowedDomainBulkInsert] (required)
74
+ # @param 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)
75
+ # @return [Http::Response] the response
76
+ def bulk_create_allowed_domains_with_http_info(agent_id, allowed_domain_bulk_insert, request_options = {})
77
+ # verify the required parameter 'agent_id' is set
78
+ if @api_client.config.client_side_validation && agent_id.nil?
79
+ raise ArgumentError, "Parameter `agent_id` is required when calling `bulk_create_allowed_domains`."
80
+ end
81
+ # verify the required parameter 'agent_id' is not empty
82
+ if @api_client.config.client_side_validation && agent_id.empty?
83
+ raise ArgumentError, "Parameter `agent_id` is required when calling `bulk_create_allowed_domains`."
84
+ end
85
+ # verify the required parameter 'allowed_domain_bulk_insert' is set
86
+ if @api_client.config.client_side_validation && allowed_domain_bulk_insert.nil?
87
+ raise(
88
+ ArgumentError,
89
+ "Parameter `allowed_domain_bulk_insert` is required when calling `bulk_create_allowed_domains`."
90
+ )
91
+ end
92
+
93
+ path = "/agent-studio/1/agents/{agentId}/allowed-domains/bulk".sub(
94
+ "{" + "agentId" + "}",
95
+ Transport.encode_uri(agent_id.to_s)
96
+ )
97
+ query_params = {}
98
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
99
+ header_params = {}
100
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
101
+
102
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(allowed_domain_bulk_insert)
103
+
104
+ new_options = request_options.merge(
105
+ :operation => :"AgentStudioClient.bulk_create_allowed_domains",
106
+ :header_params => header_params,
107
+ :query_params => query_params,
108
+ :body => post_body,
109
+ :use_read_transporter => false
110
+ )
111
+
112
+ @api_client.call_api(:POST, path, new_options)
113
+ end
114
+
115
+ # Add multiple allowed domain patterns. Duplicates are skipped.
116
+ #
117
+ # Required API Key ACLs:
118
+ # - editSettings
119
+ # @param agent_id [String] The agentId. (required)
120
+ # @param allowed_domain_bulk_insert [AllowedDomainBulkInsert] (required)
121
+ # @param 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)
122
+ # @return [AllowedDomainListResponse]
123
+ def bulk_create_allowed_domains(agent_id, allowed_domain_bulk_insert, request_options = {})
124
+ response = bulk_create_allowed_domains_with_http_info(agent_id, allowed_domain_bulk_insert, request_options)
125
+ @api_client.deserialize(
126
+ response.body,
127
+ request_options[:debug_return_type] || "AgentStudio::AllowedDomainListResponse"
128
+ )
129
+ end
130
+
131
+ # Delete allowed domains by id list.
132
+ #
133
+ # Required API Key ACLs:
134
+ # - editSettings
135
+ # @param agent_id [String] The agentId. (required)
136
+ # @param allowed_domain_bulk_delete [AllowedDomainBulkDelete] (required)
137
+ # @param 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)
138
+ # @return [Http::Response] the response
139
+ def bulk_delete_allowed_domains_with_http_info(agent_id, allowed_domain_bulk_delete, request_options = {})
140
+ # verify the required parameter 'agent_id' is set
141
+ if @api_client.config.client_side_validation && agent_id.nil?
142
+ raise ArgumentError, "Parameter `agent_id` is required when calling `bulk_delete_allowed_domains`."
143
+ end
144
+ # verify the required parameter 'agent_id' is not empty
145
+ if @api_client.config.client_side_validation && agent_id.empty?
146
+ raise ArgumentError, "Parameter `agent_id` is required when calling `bulk_delete_allowed_domains`."
147
+ end
148
+ # verify the required parameter 'allowed_domain_bulk_delete' is set
149
+ if @api_client.config.client_side_validation && allowed_domain_bulk_delete.nil?
150
+ raise(
151
+ ArgumentError,
152
+ "Parameter `allowed_domain_bulk_delete` is required when calling `bulk_delete_allowed_domains`."
153
+ )
154
+ end
155
+
156
+ path = "/agent-studio/1/agents/{agentId}/allowed-domains/bulk".sub(
157
+ "{" + "agentId" + "}",
158
+ Transport.encode_uri(agent_id.to_s)
159
+ )
160
+ query_params = {}
161
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
162
+ header_params = {}
163
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
164
+
165
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(allowed_domain_bulk_delete)
166
+
167
+ new_options = request_options.merge(
168
+ :operation => :"AgentStudioClient.bulk_delete_allowed_domains",
169
+ :header_params => header_params,
170
+ :query_params => query_params,
171
+ :body => post_body,
172
+ :use_read_transporter => false
173
+ )
174
+
175
+ @api_client.call_api(:DELETE, path, new_options)
176
+ end
177
+
178
+ # Delete allowed domains by id list.
179
+ #
180
+ # Required API Key ACLs:
181
+ # - editSettings
182
+ # @param agent_id [String] The agentId. (required)
183
+ # @param allowed_domain_bulk_delete [AllowedDomainBulkDelete] (required)
184
+ # @param 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)
185
+ # @return [nil]
186
+ def bulk_delete_allowed_domains(agent_id, allowed_domain_bulk_delete, request_options = {})
187
+ bulk_delete_allowed_domains_with_http_info(agent_id, allowed_domain_bulk_delete, request_options)
188
+ nil
189
+ end
190
+
191
+ # Create a new agent.
192
+ #
193
+ # Required API Key ACLs:
194
+ # - editSettings
195
+ # @param agent_config_create [AgentConfigCreate] (required)
196
+ # @param 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)
197
+ # @return [Http::Response] the response
198
+ def create_agent_with_http_info(agent_config_create, request_options = {})
199
+ # verify the required parameter 'agent_config_create' is set
200
+ if @api_client.config.client_side_validation && agent_config_create.nil?
201
+ raise ArgumentError, "Parameter `agent_config_create` is required when calling `create_agent`."
202
+ end
203
+
204
+ path = "/agent-studio/1/agents"
205
+ query_params = {}
206
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
207
+ header_params = {}
208
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
209
+
210
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(agent_config_create)
211
+
212
+ new_options = request_options.merge(
213
+ :operation => :"AgentStudioClient.create_agent",
214
+ :header_params => header_params,
215
+ :query_params => query_params,
216
+ :body => post_body,
217
+ :use_read_transporter => false
218
+ )
219
+
220
+ @api_client.call_api(:POST, path, new_options)
221
+ end
222
+
223
+ # Create a new agent.
224
+ #
225
+ # Required API Key ACLs:
226
+ # - editSettings
227
+ # @param agent_config_create [AgentConfigCreate] (required)
228
+ # @param 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)
229
+ # @return [AgentWithVersionResponse]
230
+ def create_agent(agent_config_create, request_options = {})
231
+ response = create_agent_with_http_info(agent_config_create, request_options)
232
+ @api_client.deserialize(
233
+ response.body,
234
+ request_options[:debug_return_type] || "AgentStudio::AgentWithVersionResponse"
235
+ )
236
+ end
237
+
238
+ # Add a single allowed domain pattern (e.g. https://app.example.com or *.example.com).
239
+ #
240
+ # Required API Key ACLs:
241
+ # - editSettings
242
+ # @param agent_id [String] The agentId. (required)
243
+ # @param allowed_domain_create [AllowedDomainCreate] (required)
244
+ # @param 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)
245
+ # @return [Http::Response] the response
246
+ def create_agent_allowed_domain_with_http_info(agent_id, allowed_domain_create, request_options = {})
247
+ # verify the required parameter 'agent_id' is set
248
+ if @api_client.config.client_side_validation && agent_id.nil?
249
+ raise ArgumentError, "Parameter `agent_id` is required when calling `create_agent_allowed_domain`."
250
+ end
251
+ # verify the required parameter 'agent_id' is not empty
252
+ if @api_client.config.client_side_validation && agent_id.empty?
253
+ raise ArgumentError, "Parameter `agent_id` is required when calling `create_agent_allowed_domain`."
254
+ end
255
+ # verify the required parameter 'allowed_domain_create' is set
256
+ if @api_client.config.client_side_validation && allowed_domain_create.nil?
257
+ raise ArgumentError, "Parameter `allowed_domain_create` is required when calling `create_agent_allowed_domain`."
258
+ end
259
+
260
+ path = "/agent-studio/1/agents/{agentId}/allowed-domains".sub(
261
+ "{" + "agentId" + "}",
262
+ Transport.encode_uri(agent_id.to_s)
263
+ )
264
+ query_params = {}
265
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
266
+ header_params = {}
267
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
268
+
269
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(allowed_domain_create)
270
+
271
+ new_options = request_options.merge(
272
+ :operation => :"AgentStudioClient.create_agent_allowed_domain",
273
+ :header_params => header_params,
274
+ :query_params => query_params,
275
+ :body => post_body,
276
+ :use_read_transporter => false
277
+ )
278
+
279
+ @api_client.call_api(:POST, path, new_options)
280
+ end
281
+
282
+ # Add a single allowed domain pattern (e.g. https://app.example.com or *.example.com).
283
+ #
284
+ # Required API Key ACLs:
285
+ # - editSettings
286
+ # @param agent_id [String] The agentId. (required)
287
+ # @param allowed_domain_create [AllowedDomainCreate] (required)
288
+ # @param 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)
289
+ # @return [AllowedDomainResponse]
290
+ def create_agent_allowed_domain(agent_id, allowed_domain_create, request_options = {})
291
+ response = create_agent_allowed_domain_with_http_info(agent_id, allowed_domain_create, request_options)
292
+ @api_client.deserialize(
293
+ response.body,
294
+ request_options[:debug_return_type] || "AgentStudio::AllowedDomainResponse"
295
+ )
296
+ end
297
+
298
+ # 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.
299
+ #
300
+ # Required API Key ACLs:
301
+ # - search
302
+ # @param agent_id [String] The agentId. (required)
303
+ # @param compatibility_mode [CompatibilityMode] Compatibility mode for the completion API. (required)
304
+ # @param agent_completion_request [AgentCompletionRequest] (required)
305
+ # @param stream [Boolean] Whether to stream the response or not. (default to true)
306
+ # @param cache [Boolean] Use cached responses if available. (default to true)
307
+ # @param memory [Boolean] Set to false to disable memory (enabled by default).
308
+ # @param analytics [Boolean] 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)
309
+ # @param x_algolia_secure_user_token [String] The X-Algolia-Secure-User-Token.
310
+ # @param 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)
311
+ # @return [Http::Response] the response
312
+ def create_agent_completion_with_http_info(
313
+ agent_id,
314
+ compatibility_mode,
315
+ agent_completion_request,
316
+ stream = nil,
317
+ cache = nil,
318
+ memory = nil,
319
+ analytics = nil,
320
+ x_algolia_secure_user_token = nil,
321
+ request_options = {}
322
+ )
323
+ # verify the required parameter 'agent_id' is set
324
+ if @api_client.config.client_side_validation && agent_id.nil?
325
+ raise ArgumentError, "Parameter `agent_id` is required when calling `create_agent_completion`."
326
+ end
327
+ # verify the required parameter 'agent_id' is not empty
328
+ if @api_client.config.client_side_validation && agent_id.empty?
329
+ raise ArgumentError, "Parameter `agent_id` is required when calling `create_agent_completion`."
330
+ end
331
+ # verify the required parameter 'compatibility_mode' is set
332
+ if @api_client.config.client_side_validation && compatibility_mode.nil?
333
+ raise ArgumentError, "Parameter `compatibility_mode` is required when calling `create_agent_completion`."
334
+ end
335
+ # verify the required parameter 'agent_completion_request' is set
336
+ if @api_client.config.client_side_validation && agent_completion_request.nil?
337
+ raise ArgumentError, "Parameter `agent_completion_request` is required when calling `create_agent_completion`."
338
+ end
339
+
340
+ path = "/agent-studio/1/agents/{agentId}/completions".sub(
341
+ "{" + "agentId" + "}",
342
+ Transport.encode_uri(agent_id.to_s)
343
+ )
344
+ query_params = {}
345
+ query_params[:compatibilityMode] = compatibility_mode
346
+ query_params[:stream] = stream unless stream.nil?
347
+ query_params[:cache] = cache unless cache.nil?
348
+ query_params[:memory] = memory unless memory.nil?
349
+ query_params[:analytics] = analytics unless analytics.nil?
350
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
351
+ header_params = {}
352
+ unless x_algolia_secure_user_token.nil?
353
+ header_params[:"X-Algolia-Secure-User-Token"] = x_algolia_secure_user_token
354
+ end
355
+
356
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
357
+
358
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(agent_completion_request)
359
+
360
+ new_options = request_options.merge(
361
+ :operation => :"AgentStudioClient.create_agent_completion",
362
+ :header_params => header_params,
363
+ :query_params => query_params,
364
+ :body => post_body,
365
+ :use_read_transporter => false
366
+ )
367
+
368
+ @api_client.call_api(:POST, path, new_options)
369
+ end
370
+
371
+ # 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.
372
+ #
373
+ # Required API Key ACLs:
374
+ # - search
375
+ # @param agent_id [String] The agentId. (required)
376
+ # @param compatibility_mode [CompatibilityMode] Compatibility mode for the completion API. (required)
377
+ # @param agent_completion_request [AgentCompletionRequest] (required)
378
+ # @param stream [Boolean] Whether to stream the response or not. (default to true)
379
+ # @param cache [Boolean] Use cached responses if available. (default to true)
380
+ # @param memory [Boolean] Set to false to disable memory (enabled by default).
381
+ # @param analytics [Boolean] 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)
382
+ # @param x_algolia_secure_user_token [String] The X-Algolia-Secure-User-Token.
383
+ # @param 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)
384
+ # @return [Hash<String, Object>]
385
+ def create_agent_completion(
386
+ agent_id,
387
+ compatibility_mode,
388
+ agent_completion_request,
389
+ stream = nil,
390
+ cache = nil,
391
+ memory = nil,
392
+ analytics = nil,
393
+ x_algolia_secure_user_token = nil,
394
+ request_options = {}
395
+ )
396
+ response = create_agent_completion_with_http_info(
397
+ agent_id,
398
+ compatibility_mode,
399
+ agent_completion_request,
400
+ stream,
401
+ cache,
402
+ memory,
403
+ analytics,
404
+ x_algolia_secure_user_token,
405
+ request_options
406
+ )
407
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "Hash<String, Object>")
408
+ end
409
+
410
+ # Create new feedback entry.
411
+ #
412
+ # Required API Key ACLs:
413
+ # - search
414
+ # @param feedback_creation_request [FeedbackCreationRequest] (required)
415
+ # @param 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)
416
+ # @return [Http::Response] the response
417
+ def create_feedback_with_http_info(feedback_creation_request, request_options = {})
418
+ # verify the required parameter 'feedback_creation_request' is set
419
+ if @api_client.config.client_side_validation && feedback_creation_request.nil?
420
+ raise ArgumentError, "Parameter `feedback_creation_request` is required when calling `create_feedback`."
421
+ end
422
+
423
+ path = "/agent-studio/1/feedback"
424
+ query_params = {}
425
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
426
+ header_params = {}
427
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
428
+
429
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(feedback_creation_request)
430
+
431
+ new_options = request_options.merge(
432
+ :operation => :"AgentStudioClient.create_feedback",
433
+ :header_params => header_params,
434
+ :query_params => query_params,
435
+ :body => post_body,
436
+ :use_read_transporter => false
437
+ )
438
+
439
+ @api_client.call_api(:POST, path, new_options)
440
+ end
441
+
442
+ # Create new feedback entry.
443
+ #
444
+ # Required API Key ACLs:
445
+ # - search
446
+ # @param feedback_creation_request [FeedbackCreationRequest] (required)
447
+ # @param 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)
448
+ # @return [FeedbackResponse]
449
+ def create_feedback(feedback_creation_request, request_options = {})
450
+ response = create_feedback_with_http_info(feedback_creation_request, request_options)
451
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "AgentStudio::FeedbackResponse")
452
+ end
453
+
454
+ # Create Provider.
455
+ #
456
+ # Required API Key ACLs:
457
+ # - editSettings
458
+ # @param provider_authentication_create [ProviderAuthenticationCreate] (required)
459
+ # @param 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)
460
+ # @return [Http::Response] the response
461
+ def create_provider_with_http_info(provider_authentication_create, request_options = {})
462
+ # verify the required parameter 'provider_authentication_create' is set
463
+ if @api_client.config.client_side_validation && provider_authentication_create.nil?
464
+ raise ArgumentError, "Parameter `provider_authentication_create` is required when calling `create_provider`."
465
+ end
466
+
467
+ path = "/agent-studio/1/providers"
468
+ query_params = {}
469
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
470
+ header_params = {}
471
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
472
+
473
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(provider_authentication_create)
474
+
475
+ new_options = request_options.merge(
476
+ :operation => :"AgentStudioClient.create_provider",
477
+ :header_params => header_params,
478
+ :query_params => query_params,
479
+ :body => post_body,
480
+ :use_read_transporter => false
481
+ )
482
+
483
+ @api_client.call_api(:POST, path, new_options)
484
+ end
485
+
486
+ # Create Provider.
487
+ #
488
+ # Required API Key ACLs:
489
+ # - editSettings
490
+ # @param provider_authentication_create [ProviderAuthenticationCreate] (required)
491
+ # @param 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)
492
+ # @return [ProviderAuthenticationResponse]
493
+ def create_provider(provider_authentication_create, request_options = {})
494
+ response = create_provider_with_http_info(provider_authentication_create, request_options)
495
+ @api_client.deserialize(
496
+ response.body,
497
+ request_options[:debug_return_type] || "AgentStudio::ProviderAuthenticationResponse"
498
+ )
499
+ end
500
+
501
+ # Create Secret Key.
502
+ #
503
+ # Required API Key ACLs:
504
+ # - admin
505
+ # @param secret_key_create [SecretKeyCreate] (required)
506
+ # @param 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)
507
+ # @return [Http::Response] the response
508
+ def create_secret_key_with_http_info(secret_key_create, request_options = {})
509
+ # verify the required parameter 'secret_key_create' is set
510
+ if @api_client.config.client_side_validation && secret_key_create.nil?
511
+ raise ArgumentError, "Parameter `secret_key_create` is required when calling `create_secret_key`."
512
+ end
513
+
514
+ path = "/agent-studio/1/secret-keys"
515
+ query_params = {}
516
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
517
+ header_params = {}
518
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
519
+
520
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(secret_key_create)
521
+
522
+ new_options = request_options.merge(
523
+ :operation => :"AgentStudioClient.create_secret_key",
524
+ :header_params => header_params,
525
+ :query_params => query_params,
526
+ :body => post_body,
527
+ :use_read_transporter => false
528
+ )
529
+
530
+ @api_client.call_api(:POST, path, new_options)
531
+ end
532
+
533
+ # Create Secret Key.
534
+ #
535
+ # Required API Key ACLs:
536
+ # - admin
537
+ # @param secret_key_create [SecretKeyCreate] (required)
538
+ # @param 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)
539
+ # @return [SecretKeyResponse]
540
+ def create_secret_key(secret_key_create, request_options = {})
541
+ response = create_secret_key_with_http_info(secret_key_create, request_options)
542
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "AgentStudio::SecretKeyResponse")
543
+ end
544
+
545
+ # This method lets you send requests to the Algolia REST API.
546
+
547
+ # @param path [String] Path of the endpoint, for example `1/newFeature`. (required)
548
+ # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
549
+ # @param 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)
550
+ # @return [Http::Response] the response
551
+ def custom_delete_with_http_info(path, parameters = nil, request_options = {})
552
+ # verify the required parameter 'path' is set
553
+ if @api_client.config.client_side_validation && path.nil?
554
+ raise ArgumentError, "Parameter `path` is required when calling `custom_delete`."
555
+ end
556
+ # verify the required parameter 'path' is not empty
557
+ if @api_client.config.client_side_validation && path.empty?
558
+ raise ArgumentError, "Parameter `path` is required when calling `custom_delete`."
559
+ end
560
+
561
+ path = "/agent-studio/{path}".sub("{" + "path" + "}", path.to_s)
562
+ query_params = {}
563
+ query_params = query_params.merge(parameters) unless parameters.nil?
564
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
565
+ header_params = {}
566
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
567
+
568
+ post_body = request_options[:debug_body]
569
+
570
+ new_options = request_options.merge(
571
+ :operation => :"AgentStudioClient.custom_delete",
572
+ :header_params => header_params,
573
+ :query_params => query_params,
574
+ :body => post_body,
575
+ :use_read_transporter => false
576
+ )
577
+
578
+ @api_client.call_api(:DELETE, path, new_options)
579
+ end
580
+
581
+ # This method lets you send requests to the Algolia REST API.
582
+
583
+ # @param path [String] Path of the endpoint, for example `1/newFeature`. (required)
584
+ # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
585
+ # @param 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)
586
+ # @return [Object]
587
+ def custom_delete(path, parameters = nil, request_options = {})
588
+ response = custom_delete_with_http_info(path, parameters, request_options)
589
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "Object")
590
+ end
591
+
592
+ # This method lets you send requests to the Algolia REST API.
593
+
594
+ # @param path [String] Path of the endpoint, for example `1/newFeature`. (required)
595
+ # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
596
+ # @param 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)
597
+ # @return [Http::Response] the response
598
+ def custom_get_with_http_info(path, parameters = nil, request_options = {})
599
+ # verify the required parameter 'path' is set
600
+ if @api_client.config.client_side_validation && path.nil?
601
+ raise ArgumentError, "Parameter `path` is required when calling `custom_get`."
602
+ end
603
+ # verify the required parameter 'path' is not empty
604
+ if @api_client.config.client_side_validation && path.empty?
605
+ raise ArgumentError, "Parameter `path` is required when calling `custom_get`."
606
+ end
607
+
608
+ path = "/agent-studio/{path}".sub("{" + "path" + "}", path.to_s)
609
+ query_params = {}
610
+ query_params = query_params.merge(parameters) unless parameters.nil?
611
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
612
+ header_params = {}
613
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
614
+
615
+ post_body = request_options[:debug_body]
616
+
617
+ new_options = request_options.merge(
618
+ :operation => :"AgentStudioClient.custom_get",
619
+ :header_params => header_params,
620
+ :query_params => query_params,
621
+ :body => post_body,
622
+ :use_read_transporter => false
623
+ )
624
+
625
+ @api_client.call_api(:GET, path, new_options)
626
+ end
627
+
628
+ # This method lets you send requests to the Algolia REST API.
629
+
630
+ # @param path [String] Path of the endpoint, for example `1/newFeature`. (required)
631
+ # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
632
+ # @param 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)
633
+ # @return [Object]
634
+ def custom_get(path, parameters = nil, request_options = {})
635
+ response = custom_get_with_http_info(path, parameters, request_options)
636
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "Object")
637
+ end
638
+
639
+ # This method lets you send requests to the Algolia REST API.
640
+
641
+ # @param path [String] Path of the endpoint, for example `1/newFeature`. (required)
642
+ # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
643
+ # @param body [Object] Parameters to send with the custom request.
644
+ # @param 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)
645
+ # @return [Http::Response] the response
646
+ def custom_post_with_http_info(path, parameters = nil, body = nil, request_options = {})
647
+ # verify the required parameter 'path' is set
648
+ if @api_client.config.client_side_validation && path.nil?
649
+ raise ArgumentError, "Parameter `path` is required when calling `custom_post`."
650
+ end
651
+ # verify the required parameter 'path' is not empty
652
+ if @api_client.config.client_side_validation && path.empty?
653
+ raise ArgumentError, "Parameter `path` is required when calling `custom_post`."
654
+ end
655
+
656
+ path = "/agent-studio/{path}".sub("{" + "path" + "}", path.to_s)
657
+ query_params = {}
658
+ query_params = query_params.merge(parameters) unless parameters.nil?
659
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
660
+ header_params = {}
661
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
662
+
663
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(body)
664
+
665
+ new_options = request_options.merge(
666
+ :operation => :"AgentStudioClient.custom_post",
667
+ :header_params => header_params,
668
+ :query_params => query_params,
669
+ :body => post_body,
670
+ :use_read_transporter => false
671
+ )
672
+
673
+ @api_client.call_api(:POST, path, new_options)
674
+ end
675
+
676
+ # This method lets you send requests to the Algolia REST API.
677
+
678
+ # @param path [String] Path of the endpoint, for example `1/newFeature`. (required)
679
+ # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
680
+ # @param body [Object] Parameters to send with the custom request.
681
+ # @param 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)
682
+ # @return [Object]
683
+ def custom_post(path, parameters = nil, body = nil, request_options = {})
684
+ response = custom_post_with_http_info(path, parameters, body, request_options)
685
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "Object")
686
+ end
687
+
688
+ # This method lets you send requests to the Algolia REST API.
689
+
690
+ # @param path [String] Path of the endpoint, for example `1/newFeature`. (required)
691
+ # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
692
+ # @param body [Object] Parameters to send with the custom request.
693
+ # @param 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)
694
+ # @return [Http::Response] the response
695
+ def custom_put_with_http_info(path, parameters = nil, body = nil, request_options = {})
696
+ # verify the required parameter 'path' is set
697
+ if @api_client.config.client_side_validation && path.nil?
698
+ raise ArgumentError, "Parameter `path` is required when calling `custom_put`."
699
+ end
700
+ # verify the required parameter 'path' is not empty
701
+ if @api_client.config.client_side_validation && path.empty?
702
+ raise ArgumentError, "Parameter `path` is required when calling `custom_put`."
703
+ end
704
+
705
+ path = "/agent-studio/{path}".sub("{" + "path" + "}", path.to_s)
706
+ query_params = {}
707
+ query_params = query_params.merge(parameters) unless parameters.nil?
708
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
709
+ header_params = {}
710
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
711
+
712
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(body)
713
+
714
+ new_options = request_options.merge(
715
+ :operation => :"AgentStudioClient.custom_put",
716
+ :header_params => header_params,
717
+ :query_params => query_params,
718
+ :body => post_body,
719
+ :use_read_transporter => false
720
+ )
721
+
722
+ @api_client.call_api(:PUT, path, new_options)
723
+ end
724
+
725
+ # This method lets you send requests to the Algolia REST API.
726
+
727
+ # @param path [String] Path of the endpoint, for example `1/newFeature`. (required)
728
+ # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
729
+ # @param body [Object] Parameters to send with the custom request.
730
+ # @param 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)
731
+ # @return [Object]
732
+ def custom_put(path, parameters = nil, body = nil, request_options = {})
733
+ response = custom_put_with_http_info(path, parameters, body, request_options)
734
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "Object")
735
+ end
736
+
737
+ # Delete the specified agent.
738
+ #
739
+ # Required API Key ACLs:
740
+ # - editSettings
741
+ # @param agent_id [String] The agentId. (required)
742
+ # @param 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)
743
+ # @return [Http::Response] the response
744
+ def delete_agent_with_http_info(agent_id, request_options = {})
745
+ # verify the required parameter 'agent_id' is set
746
+ if @api_client.config.client_side_validation && agent_id.nil?
747
+ raise ArgumentError, "Parameter `agent_id` is required when calling `delete_agent`."
748
+ end
749
+ # verify the required parameter 'agent_id' is not empty
750
+ if @api_client.config.client_side_validation && agent_id.empty?
751
+ raise ArgumentError, "Parameter `agent_id` is required when calling `delete_agent`."
752
+ end
753
+
754
+ path = "/agent-studio/1/agents/{agentId}".sub("{" + "agentId" + "}", Transport.encode_uri(agent_id.to_s))
755
+ query_params = {}
756
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
757
+ header_params = {}
758
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
759
+
760
+ post_body = request_options[:debug_body]
761
+
762
+ new_options = request_options.merge(
763
+ :operation => :"AgentStudioClient.delete_agent",
764
+ :header_params => header_params,
765
+ :query_params => query_params,
766
+ :body => post_body,
767
+ :use_read_transporter => false
768
+ )
769
+
770
+ @api_client.call_api(:DELETE, path, new_options)
771
+ end
772
+
773
+ # Delete the specified agent.
774
+ #
775
+ # Required API Key ACLs:
776
+ # - editSettings
777
+ # @param agent_id [String] The agentId. (required)
778
+ # @param 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)
779
+ # @return [nil]
780
+ def delete_agent(agent_id, request_options = {})
781
+ delete_agent_with_http_info(agent_id, request_options)
782
+ nil
783
+ end
784
+
785
+ # Deletes the conversations matching the given filers.
786
+ #
787
+ # Required API Key ACLs:
788
+ # - logs
789
+ # @param agent_id [String] The agentId. (required)
790
+ # @param start_date [String] Filter conversations created after this date (format: YYYY-MM-DD).
791
+ # @param end_date [String] Filter conversations created before this date (format: YYYY-MM-DD).
792
+ # @param 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)
793
+ # @return [Http::Response] the response
794
+ def delete_agent_conversations_with_http_info(agent_id, start_date = nil, end_date = nil, request_options = {})
795
+ # verify the required parameter 'agent_id' is set
796
+ if @api_client.config.client_side_validation && agent_id.nil?
797
+ raise ArgumentError, "Parameter `agent_id` is required when calling `delete_agent_conversations`."
798
+ end
799
+ # verify the required parameter 'agent_id' is not empty
800
+ if @api_client.config.client_side_validation && agent_id.empty?
801
+ raise ArgumentError, "Parameter `agent_id` is required when calling `delete_agent_conversations`."
802
+ end
803
+
804
+ path = "/agent-studio/1/agents/{agentId}/conversations".sub(
805
+ "{" + "agentId" + "}",
806
+ Transport.encode_uri(agent_id.to_s)
807
+ )
808
+ query_params = {}
809
+ query_params[:startDate] = start_date unless start_date.nil?
810
+ query_params[:endDate] = end_date unless end_date.nil?
811
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
812
+ header_params = {}
813
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
814
+
815
+ post_body = request_options[:debug_body]
816
+
817
+ new_options = request_options.merge(
818
+ :operation => :"AgentStudioClient.delete_agent_conversations",
819
+ :header_params => header_params,
820
+ :query_params => query_params,
821
+ :body => post_body,
822
+ :use_read_transporter => false
823
+ )
824
+
825
+ @api_client.call_api(:DELETE, path, new_options)
826
+ end
827
+
828
+ # Deletes the conversations matching the given filers.
829
+ #
830
+ # Required API Key ACLs:
831
+ # - logs
832
+ # @param agent_id [String] The agentId. (required)
833
+ # @param start_date [String] Filter conversations created after this date (format: YYYY-MM-DD).
834
+ # @param end_date [String] Filter conversations created before this date (format: YYYY-MM-DD).
835
+ # @param 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)
836
+ # @return [nil]
837
+ def delete_agent_conversations(agent_id, start_date = nil, end_date = nil, request_options = {})
838
+ delete_agent_conversations_with_http_info(agent_id, start_date, end_date, request_options)
839
+ nil
840
+ end
841
+
842
+ # Remove an allowed domain by id.
843
+ #
844
+ # Required API Key ACLs:
845
+ # - editSettings
846
+ # @param domain_id [String] The domainId. (required)
847
+ # @param agent_id [String] The agentId. (required)
848
+ # @param 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)
849
+ # @return [Http::Response] the response
850
+ def delete_allowed_domain_with_http_info(domain_id, agent_id, request_options = {})
851
+ # verify the required parameter 'domain_id' is set
852
+ if @api_client.config.client_side_validation && domain_id.nil?
853
+ raise ArgumentError, "Parameter `domain_id` is required when calling `delete_allowed_domain`."
854
+ end
855
+ # verify the required parameter 'domain_id' is not empty
856
+ if @api_client.config.client_side_validation && domain_id.empty?
857
+ raise ArgumentError, "Parameter `domain_id` is required when calling `delete_allowed_domain`."
858
+ end
859
+ # verify the required parameter 'agent_id' is set
860
+ if @api_client.config.client_side_validation && agent_id.nil?
861
+ raise ArgumentError, "Parameter `agent_id` is required when calling `delete_allowed_domain`."
862
+ end
863
+ # verify the required parameter 'agent_id' is not empty
864
+ if @api_client.config.client_side_validation && agent_id.empty?
865
+ raise ArgumentError, "Parameter `agent_id` is required when calling `delete_allowed_domain`."
866
+ end
867
+
868
+ path = "/agent-studio/1/agents/{agentId}/allowed-domains/{domainId}"
869
+ .sub("{" + "domainId" + "}", Transport.encode_uri(domain_id.to_s))
870
+ .sub("{" + "agentId" + "}", Transport.encode_uri(agent_id.to_s))
871
+ query_params = {}
872
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
873
+ header_params = {}
874
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
875
+
876
+ post_body = request_options[:debug_body]
877
+
878
+ new_options = request_options.merge(
879
+ :operation => :"AgentStudioClient.delete_allowed_domain",
880
+ :header_params => header_params,
881
+ :query_params => query_params,
882
+ :body => post_body,
883
+ :use_read_transporter => false
884
+ )
885
+
886
+ @api_client.call_api(:DELETE, path, new_options)
887
+ end
888
+
889
+ # Remove an allowed domain by id.
890
+ #
891
+ # Required API Key ACLs:
892
+ # - editSettings
893
+ # @param domain_id [String] The domainId. (required)
894
+ # @param agent_id [String] The agentId. (required)
895
+ # @param 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)
896
+ # @return [nil]
897
+ def delete_allowed_domain(domain_id, agent_id, request_options = {})
898
+ delete_allowed_domain_with_http_info(domain_id, agent_id, request_options)
899
+ nil
900
+ end
901
+
902
+ # Deletes the conversation with the given ID.
903
+ #
904
+ # Required API Key ACLs:
905
+ # - logs
906
+ # @param conversation_id [String] The conversationId. (required)
907
+ # @param agent_id [String] The agentId. (required)
908
+ # @param 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)
909
+ # @return [Http::Response] the response
910
+ def delete_conversation_with_http_info(conversation_id, agent_id, request_options = {})
911
+ # verify the required parameter 'conversation_id' is set
912
+ if @api_client.config.client_side_validation && conversation_id.nil?
913
+ raise ArgumentError, "Parameter `conversation_id` is required when calling `delete_conversation`."
914
+ end
915
+ # verify the required parameter 'conversation_id' is not empty
916
+ if @api_client.config.client_side_validation && conversation_id.empty?
917
+ raise ArgumentError, "Parameter `conversation_id` is required when calling `delete_conversation`."
918
+ end
919
+ # verify the required parameter 'agent_id' is set
920
+ if @api_client.config.client_side_validation && agent_id.nil?
921
+ raise ArgumentError, "Parameter `agent_id` is required when calling `delete_conversation`."
922
+ end
923
+ # verify the required parameter 'agent_id' is not empty
924
+ if @api_client.config.client_side_validation && agent_id.empty?
925
+ raise ArgumentError, "Parameter `agent_id` is required when calling `delete_conversation`."
926
+ end
927
+
928
+ path = "/agent-studio/1/agents/{agentId}/conversations/{conversationId}"
929
+ .sub("{" + "conversationId" + "}", Transport.encode_uri(conversation_id.to_s))
930
+ .sub("{" + "agentId" + "}", Transport.encode_uri(agent_id.to_s))
931
+ query_params = {}
932
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
933
+ header_params = {}
934
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
935
+
936
+ post_body = request_options[:debug_body]
937
+
938
+ new_options = request_options.merge(
939
+ :operation => :"AgentStudioClient.delete_conversation",
940
+ :header_params => header_params,
941
+ :query_params => query_params,
942
+ :body => post_body,
943
+ :use_read_transporter => false
944
+ )
945
+
946
+ @api_client.call_api(:DELETE, path, new_options)
947
+ end
948
+
949
+ # Deletes the conversation with the given ID.
950
+ #
951
+ # Required API Key ACLs:
952
+ # - logs
953
+ # @param conversation_id [String] The conversationId. (required)
954
+ # @param agent_id [String] The agentId. (required)
955
+ # @param 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)
956
+ # @return [nil]
957
+ def delete_conversation(conversation_id, agent_id, request_options = {})
958
+ delete_conversation_with_http_info(conversation_id, agent_id, request_options)
959
+ nil
960
+ end
961
+
962
+ # Delete Provider.
963
+ #
964
+ # Required API Key ACLs:
965
+ # - editSettings
966
+ # @param provider_id [String] The providerId. (required)
967
+ # @param 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)
968
+ # @return [Http::Response] the response
969
+ def delete_provider_with_http_info(provider_id, request_options = {})
970
+ # verify the required parameter 'provider_id' is set
971
+ if @api_client.config.client_side_validation && provider_id.nil?
972
+ raise ArgumentError, "Parameter `provider_id` is required when calling `delete_provider`."
973
+ end
974
+ # verify the required parameter 'provider_id' is not empty
975
+ if @api_client.config.client_side_validation && provider_id.empty?
976
+ raise ArgumentError, "Parameter `provider_id` is required when calling `delete_provider`."
977
+ end
978
+
979
+ path = "/agent-studio/1/providers/{providerId}".sub(
980
+ "{" + "providerId" + "}",
981
+ Transport.encode_uri(provider_id.to_s)
982
+ )
983
+ query_params = {}
984
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
985
+ header_params = {}
986
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
987
+
988
+ post_body = request_options[:debug_body]
989
+
990
+ new_options = request_options.merge(
991
+ :operation => :"AgentStudioClient.delete_provider",
992
+ :header_params => header_params,
993
+ :query_params => query_params,
994
+ :body => post_body,
995
+ :use_read_transporter => false
996
+ )
997
+
998
+ @api_client.call_api(:DELETE, path, new_options)
999
+ end
1000
+
1001
+ # Delete Provider.
1002
+ #
1003
+ # Required API Key ACLs:
1004
+ # - editSettings
1005
+ # @param provider_id [String] The providerId. (required)
1006
+ # @param 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)
1007
+ # @return [nil]
1008
+ def delete_provider(provider_id, request_options = {})
1009
+ delete_provider_with_http_info(provider_id, request_options)
1010
+ nil
1011
+ end
1012
+
1013
+ # Delete Secret Key.
1014
+ #
1015
+ # Required API Key ACLs:
1016
+ # - admin
1017
+ # @param secret_key_id [String] The secretKeyId. (required)
1018
+ # @param 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)
1019
+ # @return [Http::Response] the response
1020
+ def delete_secret_key_with_http_info(secret_key_id, request_options = {})
1021
+ # verify the required parameter 'secret_key_id' is set
1022
+ if @api_client.config.client_side_validation && secret_key_id.nil?
1023
+ raise ArgumentError, "Parameter `secret_key_id` is required when calling `delete_secret_key`."
1024
+ end
1025
+ # verify the required parameter 'secret_key_id' is not empty
1026
+ if @api_client.config.client_side_validation && secret_key_id.empty?
1027
+ raise ArgumentError, "Parameter `secret_key_id` is required when calling `delete_secret_key`."
1028
+ end
1029
+
1030
+ path = "/agent-studio/1/secret-keys/{secretKeyId}".sub(
1031
+ "{" + "secretKeyId" + "}",
1032
+ Transport.encode_uri(secret_key_id.to_s)
1033
+ )
1034
+ query_params = {}
1035
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1036
+ header_params = {}
1037
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1038
+
1039
+ post_body = request_options[:debug_body]
1040
+
1041
+ new_options = request_options.merge(
1042
+ :operation => :"AgentStudioClient.delete_secret_key",
1043
+ :header_params => header_params,
1044
+ :query_params => query_params,
1045
+ :body => post_body,
1046
+ :use_read_transporter => false
1047
+ )
1048
+
1049
+ @api_client.call_api(:DELETE, path, new_options)
1050
+ end
1051
+
1052
+ # Delete Secret Key.
1053
+ #
1054
+ # Required API Key ACLs:
1055
+ # - admin
1056
+ # @param secret_key_id [String] The secretKeyId. (required)
1057
+ # @param 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)
1058
+ # @return [nil]
1059
+ def delete_secret_key(secret_key_id, request_options = {})
1060
+ delete_secret_key_with_http_info(secret_key_id, request_options)
1061
+ nil
1062
+ end
1063
+
1064
+ # Permanently deletes all messages for the given user token. Does not delete conversations.
1065
+ #
1066
+ # Required API Key ACLs:
1067
+ # - logs
1068
+ # @param user_token [String] The userToken. (required)
1069
+ # @param 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)
1070
+ # @return [Http::Response] the response
1071
+ def delete_user_data_with_http_info(user_token, request_options = {})
1072
+ # verify the required parameter 'user_token' is set
1073
+ if @api_client.config.client_side_validation && user_token.nil?
1074
+ raise ArgumentError, "Parameter `user_token` is required when calling `delete_user_data`."
1075
+ end
1076
+ # verify the required parameter 'user_token' is not empty
1077
+ if @api_client.config.client_side_validation && user_token.empty?
1078
+ raise ArgumentError, "Parameter `user_token` is required when calling `delete_user_data`."
1079
+ end
1080
+
1081
+ path = "/agent-studio/1/user-data/{userToken}".sub("{" + "userToken" + "}", Transport.encode_uri(user_token.to_s))
1082
+ query_params = {}
1083
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1084
+ header_params = {}
1085
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1086
+
1087
+ post_body = request_options[:debug_body]
1088
+
1089
+ new_options = request_options.merge(
1090
+ :operation => :"AgentStudioClient.delete_user_data",
1091
+ :header_params => header_params,
1092
+ :query_params => query_params,
1093
+ :body => post_body,
1094
+ :use_read_transporter => false
1095
+ )
1096
+
1097
+ @api_client.call_api(:DELETE, path, new_options)
1098
+ end
1099
+
1100
+ # Permanently deletes all messages for the given user token. Does not delete conversations.
1101
+ #
1102
+ # Required API Key ACLs:
1103
+ # - logs
1104
+ # @param user_token [String] The userToken. (required)
1105
+ # @param 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)
1106
+ # @return [nil]
1107
+ def delete_user_data(user_token, request_options = {})
1108
+ delete_user_data_with_http_info(user_token, request_options)
1109
+ nil
1110
+ end
1111
+
1112
+ # Exports all conversations based on the passed filters.
1113
+ #
1114
+ # Required API Key ACLs:
1115
+ # - logs
1116
+ # @param agent_id [String] The agentId. (required)
1117
+ # @param start_date [String] Filter conversations created after this date (format: YYYY-MM-DD).
1118
+ # @param end_date [String] Filter conversations created before this date (format: YYYY-MM-DD).
1119
+ # @param 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)
1120
+ # @return [Http::Response] the response
1121
+ def export_conversations_with_http_info(agent_id, start_date = nil, end_date = nil, request_options = {})
1122
+ # verify the required parameter 'agent_id' is set
1123
+ if @api_client.config.client_side_validation && agent_id.nil?
1124
+ raise ArgumentError, "Parameter `agent_id` is required when calling `export_conversations`."
1125
+ end
1126
+ # verify the required parameter 'agent_id' is not empty
1127
+ if @api_client.config.client_side_validation && agent_id.empty?
1128
+ raise ArgumentError, "Parameter `agent_id` is required when calling `export_conversations`."
1129
+ end
1130
+
1131
+ path = "/agent-studio/1/agents/{agentId}/conversations/export".sub(
1132
+ "{" + "agentId" + "}",
1133
+ Transport.encode_uri(agent_id.to_s)
1134
+ )
1135
+ query_params = {}
1136
+ query_params[:startDate] = start_date unless start_date.nil?
1137
+ query_params[:endDate] = end_date unless end_date.nil?
1138
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1139
+ header_params = {}
1140
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1141
+
1142
+ post_body = request_options[:debug_body]
1143
+
1144
+ new_options = request_options.merge(
1145
+ :operation => :"AgentStudioClient.export_conversations",
1146
+ :header_params => header_params,
1147
+ :query_params => query_params,
1148
+ :body => post_body,
1149
+ :use_read_transporter => false
1150
+ )
1151
+
1152
+ @api_client.call_api(:GET, path, new_options)
1153
+ end
1154
+
1155
+ # Exports all conversations based on the passed filters.
1156
+ #
1157
+ # Required API Key ACLs:
1158
+ # - logs
1159
+ # @param agent_id [String] The agentId. (required)
1160
+ # @param start_date [String] Filter conversations created after this date (format: YYYY-MM-DD).
1161
+ # @param end_date [String] Filter conversations created before this date (format: YYYY-MM-DD).
1162
+ # @param 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)
1163
+ # @return [Array<ConversationFullResponse>]
1164
+ def export_conversations(agent_id, start_date = nil, end_date = nil, request_options = {})
1165
+ response = export_conversations_with_http_info(agent_id, start_date, end_date, request_options)
1166
+ @api_client.deserialize(
1167
+ response.body,
1168
+ request_options[:debug_return_type] || "Array<AgentStudio::ConversationFullResponse>"
1169
+ )
1170
+ end
1171
+
1172
+ # Retrieve details of the specified agent.
1173
+ #
1174
+ # Required API Key ACLs:
1175
+ # - settings
1176
+ # @param agent_id [String] The agentId. (required)
1177
+ # @param 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)
1178
+ # @return [Http::Response] the response
1179
+ def get_agent_with_http_info(agent_id, request_options = {})
1180
+ # verify the required parameter 'agent_id' is set
1181
+ if @api_client.config.client_side_validation && agent_id.nil?
1182
+ raise ArgumentError, "Parameter `agent_id` is required when calling `get_agent`."
1183
+ end
1184
+ # verify the required parameter 'agent_id' is not empty
1185
+ if @api_client.config.client_side_validation && agent_id.empty?
1186
+ raise ArgumentError, "Parameter `agent_id` is required when calling `get_agent`."
1187
+ end
1188
+
1189
+ path = "/agent-studio/1/agents/{agentId}".sub("{" + "agentId" + "}", Transport.encode_uri(agent_id.to_s))
1190
+ query_params = {}
1191
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1192
+ header_params = {}
1193
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1194
+
1195
+ post_body = request_options[:debug_body]
1196
+
1197
+ new_options = request_options.merge(
1198
+ :operation => :"AgentStudioClient.get_agent",
1199
+ :header_params => header_params,
1200
+ :query_params => query_params,
1201
+ :body => post_body,
1202
+ :use_read_transporter => false
1203
+ )
1204
+
1205
+ @api_client.call_api(:GET, path, new_options)
1206
+ end
1207
+
1208
+ # Retrieve details of the specified agent.
1209
+ #
1210
+ # Required API Key ACLs:
1211
+ # - settings
1212
+ # @param agent_id [String] The agentId. (required)
1213
+ # @param 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)
1214
+ # @return [AgentWithVersionResponse]
1215
+ def get_agent(agent_id, request_options = {})
1216
+ response = get_agent_with_http_info(agent_id, request_options)
1217
+ @api_client.deserialize(
1218
+ response.body,
1219
+ request_options[:debug_return_type] || "AgentStudio::AgentWithVersionResponse"
1220
+ )
1221
+ end
1222
+
1223
+ # Get a single allowed domain by id.
1224
+ #
1225
+ # Required API Key ACLs:
1226
+ # - settings
1227
+ # @param domain_id [String] The domainId. (required)
1228
+ # @param agent_id [String] The agentId. (required)
1229
+ # @param 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)
1230
+ # @return [Http::Response] the response
1231
+ def get_allowed_domain_with_http_info(domain_id, agent_id, request_options = {})
1232
+ # verify the required parameter 'domain_id' is set
1233
+ if @api_client.config.client_side_validation && domain_id.nil?
1234
+ raise ArgumentError, "Parameter `domain_id` is required when calling `get_allowed_domain`."
1235
+ end
1236
+ # verify the required parameter 'domain_id' is not empty
1237
+ if @api_client.config.client_side_validation && domain_id.empty?
1238
+ raise ArgumentError, "Parameter `domain_id` is required when calling `get_allowed_domain`."
1239
+ end
1240
+ # verify the required parameter 'agent_id' is set
1241
+ if @api_client.config.client_side_validation && agent_id.nil?
1242
+ raise ArgumentError, "Parameter `agent_id` is required when calling `get_allowed_domain`."
1243
+ end
1244
+ # verify the required parameter 'agent_id' is not empty
1245
+ if @api_client.config.client_side_validation && agent_id.empty?
1246
+ raise ArgumentError, "Parameter `agent_id` is required when calling `get_allowed_domain`."
1247
+ end
1248
+
1249
+ path = "/agent-studio/1/agents/{agentId}/allowed-domains/{domainId}"
1250
+ .sub("{" + "domainId" + "}", Transport.encode_uri(domain_id.to_s))
1251
+ .sub("{" + "agentId" + "}", Transport.encode_uri(agent_id.to_s))
1252
+ query_params = {}
1253
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1254
+ header_params = {}
1255
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1256
+
1257
+ post_body = request_options[:debug_body]
1258
+
1259
+ new_options = request_options.merge(
1260
+ :operation => :"AgentStudioClient.get_allowed_domain",
1261
+ :header_params => header_params,
1262
+ :query_params => query_params,
1263
+ :body => post_body,
1264
+ :use_read_transporter => false
1265
+ )
1266
+
1267
+ @api_client.call_api(:GET, path, new_options)
1268
+ end
1269
+
1270
+ # Get a single allowed domain by id.
1271
+ #
1272
+ # Required API Key ACLs:
1273
+ # - settings
1274
+ # @param domain_id [String] The domainId. (required)
1275
+ # @param agent_id [String] The agentId. (required)
1276
+ # @param 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)
1277
+ # @return [AllowedDomainResponse]
1278
+ def get_allowed_domain(domain_id, agent_id, request_options = {})
1279
+ response = get_allowed_domain_with_http_info(domain_id, agent_id, request_options)
1280
+ @api_client.deserialize(
1281
+ response.body,
1282
+ request_options[:debug_return_type] || "AgentStudio::AllowedDomainResponse"
1283
+ )
1284
+ end
1285
+
1286
+ # Get Configuration.
1287
+ #
1288
+ # Required API Key ACLs:
1289
+ # - logs
1290
+ # @param 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)
1291
+ # @return [Http::Response] the response
1292
+ def get_configuration_with_http_info(request_options = {})
1293
+ path = "/agent-studio/1/configuration"
1294
+ query_params = {}
1295
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1296
+ header_params = {}
1297
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1298
+
1299
+ post_body = request_options[:debug_body]
1300
+
1301
+ new_options = request_options.merge(
1302
+ :operation => :"AgentStudioClient.get_configuration",
1303
+ :header_params => header_params,
1304
+ :query_params => query_params,
1305
+ :body => post_body,
1306
+ :use_read_transporter => false
1307
+ )
1308
+
1309
+ @api_client.call_api(:GET, path, new_options)
1310
+ end
1311
+
1312
+ # Get Configuration.
1313
+ #
1314
+ # Required API Key ACLs:
1315
+ # - logs
1316
+ # @param 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)
1317
+ # @return [ApplicationConfigResponse]
1318
+ def get_configuration(request_options = {})
1319
+ response = get_configuration_with_http_info(request_options)
1320
+ @api_client.deserialize(
1321
+ response.body,
1322
+ request_options[:debug_return_type] || "AgentStudio::ApplicationConfigResponse"
1323
+ )
1324
+ end
1325
+
1326
+ # Retrieves the conversation and its messages for the given ID.
1327
+ #
1328
+ # Required API Key ACLs:
1329
+ # - logs
1330
+ # @param conversation_id [String] The conversationId. (required)
1331
+ # @param agent_id [String] The agentId. (required)
1332
+ # @param include_feedback [Boolean] Include feedback for the conversation. (default to false)
1333
+ # @param x_algolia_secure_user_token [String] The X-Algolia-Secure-User-Token.
1334
+ # @param 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)
1335
+ # @return [Http::Response] the response
1336
+ def get_conversation_with_http_info(
1337
+ conversation_id,
1338
+ agent_id,
1339
+ include_feedback = nil,
1340
+ x_algolia_secure_user_token = nil,
1341
+ request_options = {}
1342
+ )
1343
+ # verify the required parameter 'conversation_id' is set
1344
+ if @api_client.config.client_side_validation && conversation_id.nil?
1345
+ raise ArgumentError, "Parameter `conversation_id` is required when calling `get_conversation`."
1346
+ end
1347
+ # verify the required parameter 'conversation_id' is not empty
1348
+ if @api_client.config.client_side_validation && conversation_id.empty?
1349
+ raise ArgumentError, "Parameter `conversation_id` is required when calling `get_conversation`."
1350
+ end
1351
+ # verify the required parameter 'agent_id' is set
1352
+ if @api_client.config.client_side_validation && agent_id.nil?
1353
+ raise ArgumentError, "Parameter `agent_id` is required when calling `get_conversation`."
1354
+ end
1355
+ # verify the required parameter 'agent_id' is not empty
1356
+ if @api_client.config.client_side_validation && agent_id.empty?
1357
+ raise ArgumentError, "Parameter `agent_id` is required when calling `get_conversation`."
1358
+ end
1359
+
1360
+ path = "/agent-studio/1/agents/{agentId}/conversations/{conversationId}"
1361
+ .sub("{" + "conversationId" + "}", Transport.encode_uri(conversation_id.to_s))
1362
+ .sub("{" + "agentId" + "}", Transport.encode_uri(agent_id.to_s))
1363
+ query_params = {}
1364
+ query_params[:includeFeedback] = include_feedback unless include_feedback.nil?
1365
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1366
+ header_params = {}
1367
+ unless x_algolia_secure_user_token.nil?
1368
+ header_params[:"X-Algolia-Secure-User-Token"] = x_algolia_secure_user_token
1369
+ end
1370
+
1371
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1372
+
1373
+ post_body = request_options[:debug_body]
1374
+
1375
+ new_options = request_options.merge(
1376
+ :operation => :"AgentStudioClient.get_conversation",
1377
+ :header_params => header_params,
1378
+ :query_params => query_params,
1379
+ :body => post_body,
1380
+ :use_read_transporter => false
1381
+ )
1382
+
1383
+ @api_client.call_api(:GET, path, new_options)
1384
+ end
1385
+
1386
+ # Retrieves the conversation and its messages for the given ID.
1387
+ #
1388
+ # Required API Key ACLs:
1389
+ # - logs
1390
+ # @param conversation_id [String] The conversationId. (required)
1391
+ # @param agent_id [String] The agentId. (required)
1392
+ # @param include_feedback [Boolean] Include feedback for the conversation. (default to false)
1393
+ # @param x_algolia_secure_user_token [String] The X-Algolia-Secure-User-Token.
1394
+ # @param 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)
1395
+ # @return [ConversationFullResponse]
1396
+ def get_conversation(
1397
+ conversation_id,
1398
+ agent_id,
1399
+ include_feedback = nil,
1400
+ x_algolia_secure_user_token = nil,
1401
+ request_options = {}
1402
+ )
1403
+ response = get_conversation_with_http_info(
1404
+ conversation_id,
1405
+ agent_id,
1406
+ include_feedback,
1407
+ x_algolia_secure_user_token,
1408
+ request_options
1409
+ )
1410
+ @api_client.deserialize(
1411
+ response.body,
1412
+ request_options[:debug_return_type] || "AgentStudio::ConversationFullResponse"
1413
+ )
1414
+ end
1415
+
1416
+ # Get Provider.
1417
+ #
1418
+ # Required API Key ACLs:
1419
+ # - settings
1420
+ # @param provider_id [String] The providerId. (required)
1421
+ # @param 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)
1422
+ # @return [Http::Response] the response
1423
+ def get_provider_with_http_info(provider_id, request_options = {})
1424
+ # verify the required parameter 'provider_id' is set
1425
+ if @api_client.config.client_side_validation && provider_id.nil?
1426
+ raise ArgumentError, "Parameter `provider_id` is required when calling `get_provider`."
1427
+ end
1428
+ # verify the required parameter 'provider_id' is not empty
1429
+ if @api_client.config.client_side_validation && provider_id.empty?
1430
+ raise ArgumentError, "Parameter `provider_id` is required when calling `get_provider`."
1431
+ end
1432
+
1433
+ path = "/agent-studio/1/providers/{providerId}".sub(
1434
+ "{" + "providerId" + "}",
1435
+ Transport.encode_uri(provider_id.to_s)
1436
+ )
1437
+ query_params = {}
1438
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1439
+ header_params = {}
1440
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1441
+
1442
+ post_body = request_options[:debug_body]
1443
+
1444
+ new_options = request_options.merge(
1445
+ :operation => :"AgentStudioClient.get_provider",
1446
+ :header_params => header_params,
1447
+ :query_params => query_params,
1448
+ :body => post_body,
1449
+ :use_read_transporter => false
1450
+ )
1451
+
1452
+ @api_client.call_api(:GET, path, new_options)
1453
+ end
1454
+
1455
+ # Get Provider.
1456
+ #
1457
+ # Required API Key ACLs:
1458
+ # - settings
1459
+ # @param provider_id [String] The providerId. (required)
1460
+ # @param 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)
1461
+ # @return [ProviderAuthenticationResponse]
1462
+ def get_provider(provider_id, request_options = {})
1463
+ response = get_provider_with_http_info(provider_id, request_options)
1464
+ @api_client.deserialize(
1465
+ response.body,
1466
+ request_options[:debug_return_type] || "AgentStudio::ProviderAuthenticationResponse"
1467
+ )
1468
+ end
1469
+
1470
+ # Get Secret Key.
1471
+ #
1472
+ # Required API Key ACLs:
1473
+ # - settings
1474
+ # @param secret_key_id [String] The secretKeyId. (required)
1475
+ # @param 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)
1476
+ # @return [Http::Response] the response
1477
+ def get_secret_key_with_http_info(secret_key_id, request_options = {})
1478
+ # verify the required parameter 'secret_key_id' is set
1479
+ if @api_client.config.client_side_validation && secret_key_id.nil?
1480
+ raise ArgumentError, "Parameter `secret_key_id` is required when calling `get_secret_key`."
1481
+ end
1482
+ # verify the required parameter 'secret_key_id' is not empty
1483
+ if @api_client.config.client_side_validation && secret_key_id.empty?
1484
+ raise ArgumentError, "Parameter `secret_key_id` is required when calling `get_secret_key`."
1485
+ end
1486
+
1487
+ path = "/agent-studio/1/secret-keys/{secretKeyId}".sub(
1488
+ "{" + "secretKeyId" + "}",
1489
+ Transport.encode_uri(secret_key_id.to_s)
1490
+ )
1491
+ query_params = {}
1492
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1493
+ header_params = {}
1494
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1495
+
1496
+ post_body = request_options[:debug_body]
1497
+
1498
+ new_options = request_options.merge(
1499
+ :operation => :"AgentStudioClient.get_secret_key",
1500
+ :header_params => header_params,
1501
+ :query_params => query_params,
1502
+ :body => post_body,
1503
+ :use_read_transporter => false
1504
+ )
1505
+
1506
+ @api_client.call_api(:GET, path, new_options)
1507
+ end
1508
+
1509
+ # Get Secret Key.
1510
+ #
1511
+ # Required API Key ACLs:
1512
+ # - settings
1513
+ # @param secret_key_id [String] The secretKeyId. (required)
1514
+ # @param 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)
1515
+ # @return [SecretKeyResponse]
1516
+ def get_secret_key(secret_key_id, request_options = {})
1517
+ response = get_secret_key_with_http_info(secret_key_id, request_options)
1518
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "AgentStudio::SecretKeyResponse")
1519
+ end
1520
+
1521
+ # Retrieves all memories, conversations and their messages for the given user token.
1522
+ #
1523
+ # Required API Key ACLs:
1524
+ # - logs
1525
+ # @param user_token [String] The userToken. (required)
1526
+ # @param 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)
1527
+ # @return [Http::Response] the response
1528
+ def get_user_data_with_http_info(user_token, request_options = {})
1529
+ # verify the required parameter 'user_token' is set
1530
+ if @api_client.config.client_side_validation && user_token.nil?
1531
+ raise ArgumentError, "Parameter `user_token` is required when calling `get_user_data`."
1532
+ end
1533
+ # verify the required parameter 'user_token' is not empty
1534
+ if @api_client.config.client_side_validation && user_token.empty?
1535
+ raise ArgumentError, "Parameter `user_token` is required when calling `get_user_data`."
1536
+ end
1537
+
1538
+ path = "/agent-studio/1/user-data/{userToken}".sub("{" + "userToken" + "}", Transport.encode_uri(user_token.to_s))
1539
+ query_params = {}
1540
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1541
+ header_params = {}
1542
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1543
+
1544
+ post_body = request_options[:debug_body]
1545
+
1546
+ new_options = request_options.merge(
1547
+ :operation => :"AgentStudioClient.get_user_data",
1548
+ :header_params => header_params,
1549
+ :query_params => query_params,
1550
+ :body => post_body,
1551
+ :use_read_transporter => false
1552
+ )
1553
+
1554
+ @api_client.call_api(:GET, path, new_options)
1555
+ end
1556
+
1557
+ # Retrieves all memories, conversations and their messages for the given user token.
1558
+ #
1559
+ # Required API Key ACLs:
1560
+ # - logs
1561
+ # @param user_token [String] The userToken. (required)
1562
+ # @param 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)
1563
+ # @return [UserDataResponse]
1564
+ def get_user_data(user_token, request_options = {})
1565
+ response = get_user_data_with_http_info(user_token, request_options)
1566
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "AgentStudio::UserDataResponse")
1567
+ end
1568
+
1569
+ # Invalidate cached completions for this agent. Filter with `before` (exclusive).
1570
+ #
1571
+ # Required API Key ACLs:
1572
+ # - editSettings
1573
+ # @param agent_id [String] The agentId. (required)
1574
+ # @param before [String] Delete entries strictly before this date (exclusive, YYYY-MM-DD).
1575
+ # @param 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)
1576
+ # @return [Http::Response] the response
1577
+ def invalidate_agent_cache_with_http_info(agent_id, before = nil, request_options = {})
1578
+ # verify the required parameter 'agent_id' is set
1579
+ if @api_client.config.client_side_validation && agent_id.nil?
1580
+ raise ArgumentError, "Parameter `agent_id` is required when calling `invalidate_agent_cache`."
1581
+ end
1582
+ # verify the required parameter 'agent_id' is not empty
1583
+ if @api_client.config.client_side_validation && agent_id.empty?
1584
+ raise ArgumentError, "Parameter `agent_id` is required when calling `invalidate_agent_cache`."
1585
+ end
1586
+
1587
+ path = "/agent-studio/1/agents/{agentId}/cache".sub("{" + "agentId" + "}", Transport.encode_uri(agent_id.to_s))
1588
+ query_params = {}
1589
+ query_params[:before] = before unless before.nil?
1590
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1591
+ header_params = {}
1592
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1593
+
1594
+ post_body = request_options[:debug_body]
1595
+
1596
+ new_options = request_options.merge(
1597
+ :operation => :"AgentStudioClient.invalidate_agent_cache",
1598
+ :header_params => header_params,
1599
+ :query_params => query_params,
1600
+ :body => post_body,
1601
+ :use_read_transporter => false
1602
+ )
1603
+
1604
+ @api_client.call_api(:DELETE, path, new_options)
1605
+ end
1606
+
1607
+ # Invalidate cached completions for this agent. Filter with `before` (exclusive).
1608
+ #
1609
+ # Required API Key ACLs:
1610
+ # - editSettings
1611
+ # @param agent_id [String] The agentId. (required)
1612
+ # @param before [String] Delete entries strictly before this date (exclusive, YYYY-MM-DD).
1613
+ # @param 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)
1614
+ # @return [nil]
1615
+ def invalidate_agent_cache(agent_id, before = nil, request_options = {})
1616
+ invalidate_agent_cache_with_http_info(agent_id, before, request_options)
1617
+ nil
1618
+ end
1619
+
1620
+ # List all allowed domain patterns for this agent.
1621
+ #
1622
+ # Required API Key ACLs:
1623
+ # - settings
1624
+ # @param agent_id [String] The agentId. (required)
1625
+ # @param 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)
1626
+ # @return [Http::Response] the response
1627
+ def list_agent_allowed_domains_with_http_info(agent_id, request_options = {})
1628
+ # verify the required parameter 'agent_id' is set
1629
+ if @api_client.config.client_side_validation && agent_id.nil?
1630
+ raise ArgumentError, "Parameter `agent_id` is required when calling `list_agent_allowed_domains`."
1631
+ end
1632
+ # verify the required parameter 'agent_id' is not empty
1633
+ if @api_client.config.client_side_validation && agent_id.empty?
1634
+ raise ArgumentError, "Parameter `agent_id` is required when calling `list_agent_allowed_domains`."
1635
+ end
1636
+
1637
+ path = "/agent-studio/1/agents/{agentId}/allowed-domains".sub(
1638
+ "{" + "agentId" + "}",
1639
+ Transport.encode_uri(agent_id.to_s)
1640
+ )
1641
+ query_params = {}
1642
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1643
+ header_params = {}
1644
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1645
+
1646
+ post_body = request_options[:debug_body]
1647
+
1648
+ new_options = request_options.merge(
1649
+ :operation => :"AgentStudioClient.list_agent_allowed_domains",
1650
+ :header_params => header_params,
1651
+ :query_params => query_params,
1652
+ :body => post_body,
1653
+ :use_read_transporter => false
1654
+ )
1655
+
1656
+ @api_client.call_api(:GET, path, new_options)
1657
+ end
1658
+
1659
+ # List all allowed domain patterns for this agent.
1660
+ #
1661
+ # Required API Key ACLs:
1662
+ # - settings
1663
+ # @param agent_id [String] The agentId. (required)
1664
+ # @param 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)
1665
+ # @return [AllowedDomainListResponse]
1666
+ def list_agent_allowed_domains(agent_id, request_options = {})
1667
+ response = list_agent_allowed_domains_with_http_info(agent_id, request_options)
1668
+ @api_client.deserialize(
1669
+ response.body,
1670
+ request_options[:debug_return_type] || "AgentStudio::AllowedDomainListResponse"
1671
+ )
1672
+ end
1673
+
1674
+ # Retrieves the conversations for the given agent ID.
1675
+ #
1676
+ # Required API Key ACLs:
1677
+ # - logs
1678
+ # @param agent_id [String] The agentId. (required)
1679
+ # @param start_date [String] Filter conversations created after this date (format: YYYY-MM-DD).
1680
+ # @param end_date [String] Filter conversations created before this date (format: YYYY-MM-DD).
1681
+ # @param include_feedback [Boolean] Include feedback per conversation.
1682
+ # @param feedback_vote [Integer] Filter by feedback value (requires includeFeedback=true).
1683
+ # @param page [Integer] Page number. (default to 1)
1684
+ # @param limit [Integer] Items per page. (default to 20)
1685
+ # @param x_algolia_secure_user_token [String] The X-Algolia-Secure-User-Token.
1686
+ # @param 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)
1687
+ # @return [Http::Response] the response
1688
+ def list_agent_conversations_with_http_info(
1689
+ agent_id,
1690
+ start_date = nil,
1691
+ end_date = nil,
1692
+ include_feedback = nil,
1693
+ feedback_vote = nil,
1694
+ page = nil,
1695
+ limit = nil,
1696
+ x_algolia_secure_user_token = nil,
1697
+ request_options = {}
1698
+ )
1699
+ # verify the required parameter 'agent_id' is set
1700
+ if @api_client.config.client_side_validation && agent_id.nil?
1701
+ raise ArgumentError, "Parameter `agent_id` is required when calling `list_agent_conversations`."
1702
+ end
1703
+ # verify the required parameter 'agent_id' is not empty
1704
+ if @api_client.config.client_side_validation && agent_id.empty?
1705
+ raise ArgumentError, "Parameter `agent_id` is required when calling `list_agent_conversations`."
1706
+ end
1707
+
1708
+ path = "/agent-studio/1/agents/{agentId}/conversations".sub(
1709
+ "{" + "agentId" + "}",
1710
+ Transport.encode_uri(agent_id.to_s)
1711
+ )
1712
+ query_params = {}
1713
+ query_params[:startDate] = start_date unless start_date.nil?
1714
+ query_params[:endDate] = end_date unless end_date.nil?
1715
+ query_params[:includeFeedback] = include_feedback unless include_feedback.nil?
1716
+ query_params[:feedbackVote] = feedback_vote unless feedback_vote.nil?
1717
+ query_params[:page] = page unless page.nil?
1718
+ query_params[:limit] = limit unless limit.nil?
1719
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1720
+ header_params = {}
1721
+ unless x_algolia_secure_user_token.nil?
1722
+ header_params[:"X-Algolia-Secure-User-Token"] = x_algolia_secure_user_token
1723
+ end
1724
+
1725
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1726
+
1727
+ post_body = request_options[:debug_body]
1728
+
1729
+ new_options = request_options.merge(
1730
+ :operation => :"AgentStudioClient.list_agent_conversations",
1731
+ :header_params => header_params,
1732
+ :query_params => query_params,
1733
+ :body => post_body,
1734
+ :use_read_transporter => false
1735
+ )
1736
+
1737
+ @api_client.call_api(:GET, path, new_options)
1738
+ end
1739
+
1740
+ # Retrieves the conversations for the given agent ID.
1741
+ #
1742
+ # Required API Key ACLs:
1743
+ # - logs
1744
+ # @param agent_id [String] The agentId. (required)
1745
+ # @param start_date [String] Filter conversations created after this date (format: YYYY-MM-DD).
1746
+ # @param end_date [String] Filter conversations created before this date (format: YYYY-MM-DD).
1747
+ # @param include_feedback [Boolean] Include feedback per conversation.
1748
+ # @param feedback_vote [Integer] Filter by feedback value (requires includeFeedback=true).
1749
+ # @param page [Integer] Page number. (default to 1)
1750
+ # @param limit [Integer] Items per page. (default to 20)
1751
+ # @param x_algolia_secure_user_token [String] The X-Algolia-Secure-User-Token.
1752
+ # @param 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)
1753
+ # @return [PaginatedConversationsResponse]
1754
+ def list_agent_conversations(
1755
+ agent_id,
1756
+ start_date = nil,
1757
+ end_date = nil,
1758
+ include_feedback = nil,
1759
+ feedback_vote = nil,
1760
+ page = nil,
1761
+ limit = nil,
1762
+ x_algolia_secure_user_token = nil,
1763
+ request_options = {}
1764
+ )
1765
+ response = list_agent_conversations_with_http_info(
1766
+ agent_id,
1767
+ start_date,
1768
+ end_date,
1769
+ include_feedback,
1770
+ feedback_vote,
1771
+ page,
1772
+ limit,
1773
+ x_algolia_secure_user_token,
1774
+ request_options
1775
+ )
1776
+ @api_client.deserialize(
1777
+ response.body,
1778
+ request_options[:debug_return_type] || "AgentStudio::PaginatedConversationsResponse"
1779
+ )
1780
+ end
1781
+
1782
+ # List all agents with pagination and filtering.
1783
+ #
1784
+ # Required API Key ACLs:
1785
+ # - settings
1786
+ # @param page [Integer] Page number. (default to 1)
1787
+ # @param limit [Integer] Items per page. (default to 10)
1788
+ # @param provider_id [String] Filter by provider id.
1789
+ # @param 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)
1790
+ # @return [Http::Response] the response
1791
+ def list_agents_with_http_info(page = nil, limit = nil, provider_id = nil, request_options = {})
1792
+ path = "/agent-studio/1/agents"
1793
+ query_params = {}
1794
+ query_params[:page] = page unless page.nil?
1795
+ query_params[:limit] = limit unless limit.nil?
1796
+ query_params[:providerId] = provider_id unless provider_id.nil?
1797
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1798
+ header_params = {}
1799
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1800
+
1801
+ post_body = request_options[:debug_body]
1802
+
1803
+ new_options = request_options.merge(
1804
+ :operation => :"AgentStudioClient.list_agents",
1805
+ :header_params => header_params,
1806
+ :query_params => query_params,
1807
+ :body => post_body,
1808
+ :use_read_transporter => false
1809
+ )
1810
+
1811
+ @api_client.call_api(:GET, path, new_options)
1812
+ end
1813
+
1814
+ # List all agents with pagination and filtering.
1815
+ #
1816
+ # Required API Key ACLs:
1817
+ # - settings
1818
+ # @param page [Integer] Page number. (default to 1)
1819
+ # @param limit [Integer] Items per page. (default to 10)
1820
+ # @param provider_id [String] Filter by provider id.
1821
+ # @param 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)
1822
+ # @return [PaginatedAgentsResponse]
1823
+ def list_agents(page = nil, limit = nil, provider_id = nil, request_options = {})
1824
+ response = list_agents_with_http_info(page, limit, provider_id, request_options)
1825
+ @api_client.deserialize(
1826
+ response.body,
1827
+ request_options[:debug_return_type] || "AgentStudio::PaginatedAgentsResponse"
1828
+ )
1829
+ end
1830
+
1831
+ # Get Provider Models.
1832
+ #
1833
+ # Required API Key ACLs:
1834
+ # - settings
1835
+ # @param 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)
1836
+ # @return [Http::Response] the response
1837
+ def list_models_with_http_info(request_options = {})
1838
+ path = "/agent-studio/1/providers/models"
1839
+ query_params = {}
1840
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1841
+ header_params = {}
1842
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1843
+
1844
+ post_body = request_options[:debug_body]
1845
+
1846
+ new_options = request_options.merge(
1847
+ :operation => :"AgentStudioClient.list_models",
1848
+ :header_params => header_params,
1849
+ :query_params => query_params,
1850
+ :body => post_body,
1851
+ :use_read_transporter => false
1852
+ )
1853
+
1854
+ @api_client.call_api(:GET, path, new_options)
1855
+ end
1856
+
1857
+ # Get Provider Models.
1858
+ #
1859
+ # Required API Key ACLs:
1860
+ # - settings
1861
+ # @param 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)
1862
+ # @return [Hash<String, Array<String>>]
1863
+ def list_models(request_options = {})
1864
+ response = list_models_with_http_info(request_options)
1865
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "Hash<String, Array<String>>")
1866
+ end
1867
+
1868
+ # Get available models for a specific provider.
1869
+ #
1870
+ # Required API Key ACLs:
1871
+ # - settings
1872
+ # @param provider_id [String] The providerId. (required)
1873
+ # @param 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)
1874
+ # @return [Http::Response] the response
1875
+ def list_provider_models_with_http_info(provider_id, request_options = {})
1876
+ # verify the required parameter 'provider_id' is set
1877
+ if @api_client.config.client_side_validation && provider_id.nil?
1878
+ raise ArgumentError, "Parameter `provider_id` is required when calling `list_provider_models`."
1879
+ end
1880
+ # verify the required parameter 'provider_id' is not empty
1881
+ if @api_client.config.client_side_validation && provider_id.empty?
1882
+ raise ArgumentError, "Parameter `provider_id` is required when calling `list_provider_models`."
1883
+ end
1884
+
1885
+ path = "/agent-studio/1/providers/{providerId}/models".sub(
1886
+ "{" + "providerId" + "}",
1887
+ Transport.encode_uri(provider_id.to_s)
1888
+ )
1889
+ query_params = {}
1890
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1891
+ header_params = {}
1892
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1893
+
1894
+ post_body = request_options[:debug_body]
1895
+
1896
+ new_options = request_options.merge(
1897
+ :operation => :"AgentStudioClient.list_provider_models",
1898
+ :header_params => header_params,
1899
+ :query_params => query_params,
1900
+ :body => post_body,
1901
+ :use_read_transporter => false
1902
+ )
1903
+
1904
+ @api_client.call_api(:GET, path, new_options)
1905
+ end
1906
+
1907
+ # Get available models for a specific provider.
1908
+ #
1909
+ # Required API Key ACLs:
1910
+ # - settings
1911
+ # @param provider_id [String] The providerId. (required)
1912
+ # @param 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)
1913
+ # @return [Array<String>]
1914
+ def list_provider_models(provider_id, request_options = {})
1915
+ response = list_provider_models_with_http_info(provider_id, request_options)
1916
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "Array<AgentStudio::>")
1917
+ end
1918
+
1919
+ # List Providers.
1920
+ #
1921
+ # Required API Key ACLs:
1922
+ # - settings
1923
+ # @param page [Integer] Page number. (default to 1)
1924
+ # @param limit [Integer] Items per page. (default to 10)
1925
+ # @param 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)
1926
+ # @return [Http::Response] the response
1927
+ def list_providers_with_http_info(page = nil, limit = nil, request_options = {})
1928
+ path = "/agent-studio/1/providers"
1929
+ query_params = {}
1930
+ query_params[:page] = page unless page.nil?
1931
+ query_params[:limit] = limit unless limit.nil?
1932
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1933
+ header_params = {}
1934
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1935
+
1936
+ post_body = request_options[:debug_body]
1937
+
1938
+ new_options = request_options.merge(
1939
+ :operation => :"AgentStudioClient.list_providers",
1940
+ :header_params => header_params,
1941
+ :query_params => query_params,
1942
+ :body => post_body,
1943
+ :use_read_transporter => false
1944
+ )
1945
+
1946
+ @api_client.call_api(:GET, path, new_options)
1947
+ end
1948
+
1949
+ # List Providers.
1950
+ #
1951
+ # Required API Key ACLs:
1952
+ # - settings
1953
+ # @param page [Integer] Page number. (default to 1)
1954
+ # @param limit [Integer] Items per page. (default to 10)
1955
+ # @param 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)
1956
+ # @return [PaginatedProviderAuthenticationsResponse]
1957
+ def list_providers(page = nil, limit = nil, request_options = {})
1958
+ response = list_providers_with_http_info(page, limit, request_options)
1959
+ @api_client.deserialize(
1960
+ response.body,
1961
+ request_options[:debug_return_type] || "AgentStudio::PaginatedProviderAuthenticationsResponse"
1962
+ )
1963
+ end
1964
+
1965
+ # List Secret Keys.
1966
+ #
1967
+ # Required API Key ACLs:
1968
+ # - settings
1969
+ # @param page [Integer] Page number. (default to 1)
1970
+ # @param limit [Integer] Items per page. (default to 10)
1971
+ # @param 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)
1972
+ # @return [Http::Response] the response
1973
+ def list_secret_keys_with_http_info(page = nil, limit = nil, request_options = {})
1974
+ path = "/agent-studio/1/secret-keys"
1975
+ query_params = {}
1976
+ query_params[:page] = page unless page.nil?
1977
+ query_params[:limit] = limit unless limit.nil?
1978
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1979
+ header_params = {}
1980
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1981
+
1982
+ post_body = request_options[:debug_body]
1983
+
1984
+ new_options = request_options.merge(
1985
+ :operation => :"AgentStudioClient.list_secret_keys",
1986
+ :header_params => header_params,
1987
+ :query_params => query_params,
1988
+ :body => post_body,
1989
+ :use_read_transporter => false
1990
+ )
1991
+
1992
+ @api_client.call_api(:GET, path, new_options)
1993
+ end
1994
+
1995
+ # List Secret Keys.
1996
+ #
1997
+ # Required API Key ACLs:
1998
+ # - settings
1999
+ # @param page [Integer] Page number. (default to 1)
2000
+ # @param limit [Integer] Items per page. (default to 10)
2001
+ # @param 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)
2002
+ # @return [PaginatedSecretKeysResponse]
2003
+ def list_secret_keys(page = nil, limit = nil, request_options = {})
2004
+ response = list_secret_keys_with_http_info(page, limit, request_options)
2005
+ @api_client.deserialize(
2006
+ response.body,
2007
+ request_options[:debug_return_type] || "AgentStudio::PaginatedSecretKeysResponse"
2008
+ )
2009
+ end
2010
+
2011
+ # Publish the specified agent.
2012
+ #
2013
+ # Required API Key ACLs:
2014
+ # - editSettings
2015
+ # @param agent_id [String] The agentId. (required)
2016
+ # @param 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)
2017
+ # @return [Http::Response] the response
2018
+ def publish_agent_with_http_info(agent_id, request_options = {})
2019
+ # verify the required parameter 'agent_id' is set
2020
+ if @api_client.config.client_side_validation && agent_id.nil?
2021
+ raise ArgumentError, "Parameter `agent_id` is required when calling `publish_agent`."
2022
+ end
2023
+ # verify the required parameter 'agent_id' is not empty
2024
+ if @api_client.config.client_side_validation && agent_id.empty?
2025
+ raise ArgumentError, "Parameter `agent_id` is required when calling `publish_agent`."
2026
+ end
2027
+
2028
+ path = "/agent-studio/1/agents/{agentId}/publish".sub("{" + "agentId" + "}", Transport.encode_uri(agent_id.to_s))
2029
+ query_params = {}
2030
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
2031
+ header_params = {}
2032
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
2033
+
2034
+ post_body = request_options[:debug_body]
2035
+
2036
+ new_options = request_options.merge(
2037
+ :operation => :"AgentStudioClient.publish_agent",
2038
+ :header_params => header_params,
2039
+ :query_params => query_params,
2040
+ :body => post_body,
2041
+ :use_read_transporter => false
2042
+ )
2043
+
2044
+ @api_client.call_api(:POST, path, new_options)
2045
+ end
2046
+
2047
+ # Publish the specified agent.
2048
+ #
2049
+ # Required API Key ACLs:
2050
+ # - editSettings
2051
+ # @param agent_id [String] The agentId. (required)
2052
+ # @param 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)
2053
+ # @return [AgentWithVersionResponse]
2054
+ def publish_agent(agent_id, request_options = {})
2055
+ response = publish_agent_with_http_info(agent_id, request_options)
2056
+ @api_client.deserialize(
2057
+ response.body,
2058
+ request_options[:debug_return_type] || "AgentStudio::AgentWithVersionResponse"
2059
+ )
2060
+ end
2061
+
2062
+ # Unpublish the specified agent.
2063
+ #
2064
+ # Required API Key ACLs:
2065
+ # - editSettings
2066
+ # @param agent_id [String] The agentId. (required)
2067
+ # @param 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)
2068
+ # @return [Http::Response] the response
2069
+ def unpublish_agent_with_http_info(agent_id, request_options = {})
2070
+ # verify the required parameter 'agent_id' is set
2071
+ if @api_client.config.client_side_validation && agent_id.nil?
2072
+ raise ArgumentError, "Parameter `agent_id` is required when calling `unpublish_agent`."
2073
+ end
2074
+ # verify the required parameter 'agent_id' is not empty
2075
+ if @api_client.config.client_side_validation && agent_id.empty?
2076
+ raise ArgumentError, "Parameter `agent_id` is required when calling `unpublish_agent`."
2077
+ end
2078
+
2079
+ path = "/agent-studio/1/agents/{agentId}/unpublish".sub(
2080
+ "{" + "agentId" + "}",
2081
+ Transport.encode_uri(agent_id.to_s)
2082
+ )
2083
+ query_params = {}
2084
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
2085
+ header_params = {}
2086
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
2087
+
2088
+ post_body = request_options[:debug_body]
2089
+
2090
+ new_options = request_options.merge(
2091
+ :operation => :"AgentStudioClient.unpublish_agent",
2092
+ :header_params => header_params,
2093
+ :query_params => query_params,
2094
+ :body => post_body,
2095
+ :use_read_transporter => false
2096
+ )
2097
+
2098
+ @api_client.call_api(:POST, path, new_options)
2099
+ end
2100
+
2101
+ # Unpublish the specified agent.
2102
+ #
2103
+ # Required API Key ACLs:
2104
+ # - editSettings
2105
+ # @param agent_id [String] The agentId. (required)
2106
+ # @param 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)
2107
+ # @return [AgentWithVersionResponse]
2108
+ def unpublish_agent(agent_id, request_options = {})
2109
+ response = unpublish_agent_with_http_info(agent_id, request_options)
2110
+ @api_client.deserialize(
2111
+ response.body,
2112
+ request_options[:debug_return_type] || "AgentStudio::AgentWithVersionResponse"
2113
+ )
2114
+ end
2115
+
2116
+ # Update the specified agent.
2117
+ #
2118
+ # Required API Key ACLs:
2119
+ # - editSettings
2120
+ # @param agent_id [String] The agentId. (required)
2121
+ # @param agent_config_update [AgentConfigUpdate] (required)
2122
+ # @param 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)
2123
+ # @return [Http::Response] the response
2124
+ def update_agent_with_http_info(agent_id, agent_config_update, request_options = {})
2125
+ # verify the required parameter 'agent_id' is set
2126
+ if @api_client.config.client_side_validation && agent_id.nil?
2127
+ raise ArgumentError, "Parameter `agent_id` is required when calling `update_agent`."
2128
+ end
2129
+ # verify the required parameter 'agent_id' is not empty
2130
+ if @api_client.config.client_side_validation && agent_id.empty?
2131
+ raise ArgumentError, "Parameter `agent_id` is required when calling `update_agent`."
2132
+ end
2133
+ # verify the required parameter 'agent_config_update' is set
2134
+ if @api_client.config.client_side_validation && agent_config_update.nil?
2135
+ raise ArgumentError, "Parameter `agent_config_update` is required when calling `update_agent`."
2136
+ end
2137
+
2138
+ path = "/agent-studio/1/agents/{agentId}".sub("{" + "agentId" + "}", Transport.encode_uri(agent_id.to_s))
2139
+ query_params = {}
2140
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
2141
+ header_params = {}
2142
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
2143
+
2144
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(agent_config_update)
2145
+
2146
+ new_options = request_options.merge(
2147
+ :operation => :"AgentStudioClient.update_agent",
2148
+ :header_params => header_params,
2149
+ :query_params => query_params,
2150
+ :body => post_body,
2151
+ :use_read_transporter => false
2152
+ )
2153
+
2154
+ @api_client.call_api(:PATCH, path, new_options)
2155
+ end
2156
+
2157
+ # Update the specified agent.
2158
+ #
2159
+ # Required API Key ACLs:
2160
+ # - editSettings
2161
+ # @param agent_id [String] The agentId. (required)
2162
+ # @param agent_config_update [AgentConfigUpdate] (required)
2163
+ # @param 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)
2164
+ # @return [AgentWithVersionResponse]
2165
+ def update_agent(agent_id, agent_config_update, request_options = {})
2166
+ response = update_agent_with_http_info(agent_id, agent_config_update, request_options)
2167
+ @api_client.deserialize(
2168
+ response.body,
2169
+ request_options[:debug_return_type] || "AgentStudio::AgentWithVersionResponse"
2170
+ )
2171
+ end
2172
+
2173
+ # Patch Configuration.
2174
+ #
2175
+ # Required API Key ACLs:
2176
+ # - logs
2177
+ # @param application_config_patch [ApplicationConfigPatch] (required)
2178
+ # @param 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)
2179
+ # @return [Http::Response] the response
2180
+ def update_configuration_with_http_info(application_config_patch, request_options = {})
2181
+ # verify the required parameter 'application_config_patch' is set
2182
+ if @api_client.config.client_side_validation && application_config_patch.nil?
2183
+ raise ArgumentError, "Parameter `application_config_patch` is required when calling `update_configuration`."
2184
+ end
2185
+
2186
+ path = "/agent-studio/1/configuration"
2187
+ query_params = {}
2188
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
2189
+ header_params = {}
2190
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
2191
+
2192
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(application_config_patch)
2193
+
2194
+ new_options = request_options.merge(
2195
+ :operation => :"AgentStudioClient.update_configuration",
2196
+ :header_params => header_params,
2197
+ :query_params => query_params,
2198
+ :body => post_body,
2199
+ :use_read_transporter => false
2200
+ )
2201
+
2202
+ @api_client.call_api(:PATCH, path, new_options)
2203
+ end
2204
+
2205
+ # Patch Configuration.
2206
+ #
2207
+ # Required API Key ACLs:
2208
+ # - logs
2209
+ # @param application_config_patch [ApplicationConfigPatch] (required)
2210
+ # @param 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)
2211
+ # @return [ApplicationConfigResponse]
2212
+ def update_configuration(application_config_patch, request_options = {})
2213
+ response = update_configuration_with_http_info(application_config_patch, request_options)
2214
+ @api_client.deserialize(
2215
+ response.body,
2216
+ request_options[:debug_return_type] || "AgentStudio::ApplicationConfigResponse"
2217
+ )
2218
+ end
2219
+
2220
+ # Update Provider.
2221
+ #
2222
+ # Required API Key ACLs:
2223
+ # - editSettings
2224
+ # @param provider_id [String] The providerId. (required)
2225
+ # @param provider_authentication_patch [ProviderAuthenticationPatch] (required)
2226
+ # @param 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)
2227
+ # @return [Http::Response] the response
2228
+ def update_provider_with_http_info(provider_id, provider_authentication_patch, request_options = {})
2229
+ # verify the required parameter 'provider_id' is set
2230
+ if @api_client.config.client_side_validation && provider_id.nil?
2231
+ raise ArgumentError, "Parameter `provider_id` is required when calling `update_provider`."
2232
+ end
2233
+ # verify the required parameter 'provider_id' is not empty
2234
+ if @api_client.config.client_side_validation && provider_id.empty?
2235
+ raise ArgumentError, "Parameter `provider_id` is required when calling `update_provider`."
2236
+ end
2237
+ # verify the required parameter 'provider_authentication_patch' is set
2238
+ if @api_client.config.client_side_validation && provider_authentication_patch.nil?
2239
+ raise ArgumentError, "Parameter `provider_authentication_patch` is required when calling `update_provider`."
2240
+ end
2241
+
2242
+ path = "/agent-studio/1/providers/{providerId}".sub(
2243
+ "{" + "providerId" + "}",
2244
+ Transport.encode_uri(provider_id.to_s)
2245
+ )
2246
+ query_params = {}
2247
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
2248
+ header_params = {}
2249
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
2250
+
2251
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(provider_authentication_patch)
2252
+
2253
+ new_options = request_options.merge(
2254
+ :operation => :"AgentStudioClient.update_provider",
2255
+ :header_params => header_params,
2256
+ :query_params => query_params,
2257
+ :body => post_body,
2258
+ :use_read_transporter => false
2259
+ )
2260
+
2261
+ @api_client.call_api(:PATCH, path, new_options)
2262
+ end
2263
+
2264
+ # Update Provider.
2265
+ #
2266
+ # Required API Key ACLs:
2267
+ # - editSettings
2268
+ # @param provider_id [String] The providerId. (required)
2269
+ # @param provider_authentication_patch [ProviderAuthenticationPatch] (required)
2270
+ # @param 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)
2271
+ # @return [ProviderAuthenticationResponse]
2272
+ def update_provider(provider_id, provider_authentication_patch, request_options = {})
2273
+ response = update_provider_with_http_info(provider_id, provider_authentication_patch, request_options)
2274
+ @api_client.deserialize(
2275
+ response.body,
2276
+ request_options[:debug_return_type] || "AgentStudio::ProviderAuthenticationResponse"
2277
+ )
2278
+ end
2279
+
2280
+ # Patch Secret Key.
2281
+ #
2282
+ # Required API Key ACLs:
2283
+ # - admin
2284
+ # @param secret_key_id [String] The secretKeyId. (required)
2285
+ # @param secret_key_patch [SecretKeyPatch] (required)
2286
+ # @param 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)
2287
+ # @return [Http::Response] the response
2288
+ def update_secret_key_with_http_info(secret_key_id, secret_key_patch, request_options = {})
2289
+ # verify the required parameter 'secret_key_id' is set
2290
+ if @api_client.config.client_side_validation && secret_key_id.nil?
2291
+ raise ArgumentError, "Parameter `secret_key_id` is required when calling `update_secret_key`."
2292
+ end
2293
+ # verify the required parameter 'secret_key_id' is not empty
2294
+ if @api_client.config.client_side_validation && secret_key_id.empty?
2295
+ raise ArgumentError, "Parameter `secret_key_id` is required when calling `update_secret_key`."
2296
+ end
2297
+ # verify the required parameter 'secret_key_patch' is set
2298
+ if @api_client.config.client_side_validation && secret_key_patch.nil?
2299
+ raise ArgumentError, "Parameter `secret_key_patch` is required when calling `update_secret_key`."
2300
+ end
2301
+
2302
+ path = "/agent-studio/1/secret-keys/{secretKeyId}".sub(
2303
+ "{" + "secretKeyId" + "}",
2304
+ Transport.encode_uri(secret_key_id.to_s)
2305
+ )
2306
+ query_params = {}
2307
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
2308
+ header_params = {}
2309
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
2310
+
2311
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(secret_key_patch)
2312
+
2313
+ new_options = request_options.merge(
2314
+ :operation => :"AgentStudioClient.update_secret_key",
2315
+ :header_params => header_params,
2316
+ :query_params => query_params,
2317
+ :body => post_body,
2318
+ :use_read_transporter => false
2319
+ )
2320
+
2321
+ @api_client.call_api(:PATCH, path, new_options)
2322
+ end
2323
+
2324
+ # Patch Secret Key.
2325
+ #
2326
+ # Required API Key ACLs:
2327
+ # - admin
2328
+ # @param secret_key_id [String] The secretKeyId. (required)
2329
+ # @param secret_key_patch [SecretKeyPatch] (required)
2330
+ # @param 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)
2331
+ # @return [SecretKeyResponse]
2332
+ def update_secret_key(secret_key_id, secret_key_patch, request_options = {})
2333
+ response = update_secret_key_with_http_info(secret_key_id, secret_key_patch, request_options)
2334
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "AgentStudio::SecretKeyResponse")
2335
+ end
2336
+
2337
+ # Helper: Forges a secured user token (JWT) for Agent Studio authenticated requests.
2338
+ #
2339
+ # @param secret_key [String] The secret key to sign the token with.
2340
+ # @param secret_key_id [String] The key ID to include in the JWT header (kid).
2341
+ # @param user_id [String] The user identifier to include as the subject (sub) claim.
2342
+ # @param expires_in [Integer] The token expiration in seconds from now. Defaults to 86400 (24 hours).
2343
+ # @return [String] The signed JWT token.
2344
+ def forge_secured_user_token(secret_key, secret_key_id, user_id, expires_in = 86400)
2345
+ header = Base64.urlsafe_encode64(
2346
+ "{\"alg\":\"HS256\",\"typ\":\"JWT\",\"kid\":\"" + secret_key_id + "\"}",
2347
+ padding: false
2348
+ )
2349
+ payload = Base64.urlsafe_encode64(
2350
+ "{\"sub\":\"" + user_id + "\",\"exp\":" + (Time.now.to_i + expires_in).to_s + "}",
2351
+ padding: false
2352
+ )
2353
+ signature = Base64.urlsafe_encode64(
2354
+ OpenSSL::HMAC.digest("SHA256", secret_key, header + "." + payload),
2355
+ padding: false
2356
+ )
2357
+
2358
+ header + "." + payload + "." + signature
2359
+ end
2360
+ end
2361
+ end