Class: LaunchDarklyApi::AIConfigsBetaApi

Inherits:
Object
  • Object
show all
Defined in:
lib/launchdarkly_api/api/ai_configs_beta_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AIConfigsBetaApi

Returns a new instance of AIConfigsBetaApi.



19
20
21
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 19

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#delete_ai_config(ld_api_version, project_key, config_key, opts = {}) ⇒ nil

Delete AI Config Delete an existing AI Config.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • config_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


29
30
31
32
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 29

def delete_ai_config(ld_api_version, project_key, config_key, opts = {})
  delete_ai_config_with_http_info(ld_api_version, project_key, config_key, opts)
  nil
end

#delete_ai_config_variation(ld_api_version, project_key, config_key, variation_key, opts = {}) ⇒ nil

Delete AI Config variation Delete a specific variation of an AI Config by config key and variation key.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • config_key (String)
  • variation_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


111
112
113
114
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 111

def delete_ai_config_variation(ld_api_version, project_key, config_key, variation_key, opts = {})
  delete_ai_config_variation_with_http_info(ld_api_version, project_key, config_key, variation_key, opts)
  nil
end

#delete_ai_config_variation_with_http_info(ld_api_version, project_key, config_key, variation_key, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete AI Config variation Delete a specific variation of an AI Config by config key and variation key.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • config_key (String)
  • variation_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 124

def delete_ai_config_variation_with_http_info(ld_api_version, project_key, config_key, variation_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIConfigsBetaApi.delete_ai_config_variation ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling AIConfigsBetaApi.delete_ai_config_variation"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AIConfigsBetaApi.delete_ai_config_variation"
  end
  # verify the required parameter 'config_key' is set
  if @api_client.config.client_side_validation && config_key.nil?
    fail ArgumentError, "Missing the required parameter 'config_key' when calling AIConfigsBetaApi.delete_ai_config_variation"
  end
  # verify the required parameter 'variation_key' is set
  if @api_client.config.client_side_validation && variation_key.nil?
    fail ArgumentError, "Missing the required parameter 'variation_key' when calling AIConfigsBetaApi.delete_ai_config_variation"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/{configKey}/variations/{variationKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'configKey' + '}', CGI.escape(config_key.to_s)).sub('{' + 'variationKey' + '}', CGI.escape(variation_key.to_s))

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

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

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

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

  # return_type
  return_type = opts[:debug_return_type]

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

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

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

#delete_ai_config_with_http_info(ld_api_version, project_key, config_key, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete AI Config Delete an existing AI Config.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • config_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



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

def delete_ai_config_with_http_info(ld_api_version, project_key, config_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIConfigsBetaApi.delete_ai_config ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling AIConfigsBetaApi.delete_ai_config"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AIConfigsBetaApi.delete_ai_config"
  end
  # verify the required parameter 'config_key' is set
  if @api_client.config.client_side_validation && config_key.nil?
    fail ArgumentError, "Missing the required parameter 'config_key' when calling AIConfigsBetaApi.delete_ai_config"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/{configKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'configKey' + '}', CGI.escape(config_key.to_s))

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

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

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

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

  # return_type
  return_type = opts[:debug_return_type]

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

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

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

#delete_ai_tool(ld_api_version, project_key, tool_key, opts = {}) ⇒ nil

Delete AI tool Delete an existing AI tool.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • tool_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


197
198
199
200
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 197

def delete_ai_tool(ld_api_version, project_key, tool_key, opts = {})
  delete_ai_tool_with_http_info(ld_api_version, project_key, tool_key, opts)
  nil
end

#delete_ai_tool_with_http_info(ld_api_version, project_key, tool_key, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete AI tool Delete an existing AI tool.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • tool_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 209

def delete_ai_tool_with_http_info(ld_api_version, project_key, tool_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIConfigsBetaApi.delete_ai_tool ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling AIConfigsBetaApi.delete_ai_tool"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AIConfigsBetaApi.delete_ai_tool"
  end
  # verify the required parameter 'tool_key' is set
  if @api_client.config.client_side_validation && tool_key.nil?
    fail ArgumentError, "Missing the required parameter 'tool_key' when calling AIConfigsBetaApi.delete_ai_tool"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-tools/{toolKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'toolKey' + '}', CGI.escape(tool_key.to_s))

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

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

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

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

  # return_type
  return_type = opts[:debug_return_type]

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

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

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

#delete_model_config(ld_api_version, project_key, model_config_key, opts = {}) ⇒ nil

Delete an AI model config Delete an AI model config.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • model_config_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


278
279
280
281
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 278

def delete_model_config(ld_api_version, project_key, model_config_key, opts = {})
  delete_model_config_with_http_info(ld_api_version, project_key, model_config_key, opts)
  nil
end

#delete_model_config_with_http_info(ld_api_version, project_key, model_config_key, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete an AI model config Delete an AI model config.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • model_config_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 290

def delete_model_config_with_http_info(ld_api_version, project_key, model_config_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIConfigsBetaApi.delete_model_config ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling AIConfigsBetaApi.delete_model_config"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AIConfigsBetaApi.delete_model_config"
  end
  # verify the required parameter 'model_config_key' is set
  if @api_client.config.client_side_validation && model_config_key.nil?
    fail ArgumentError, "Missing the required parameter 'model_config_key' when calling AIConfigsBetaApi.delete_model_config"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/model-configs/{modelConfigKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'modelConfigKey' + '}', CGI.escape(model_config_key.to_s))

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

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

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

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

  # return_type
  return_type = opts[:debug_return_type]

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

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

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

#delete_restricted_models(ld_api_version, project_key, restricted_models_request, opts = {}) ⇒ nil

Remove AI models from the restricted list Remove AI models, by key, from the restricted list.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • restricted_models_request (RestrictedModelsRequest)

    List of AI model keys to remove from the restricted list

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

    the optional parameters

Returns:

  • (nil)


359
360
361
362
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 359

def delete_restricted_models(ld_api_version, project_key, restricted_models_request, opts = {})
  delete_restricted_models_with_http_info(ld_api_version, project_key, restricted_models_request, opts)
  nil
end

#delete_restricted_models_with_http_info(ld_api_version, project_key, restricted_models_request, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Remove AI models from the restricted list Remove AI models, by key, from the restricted list.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • restricted_models_request (RestrictedModelsRequest)

    List of AI model keys to remove from the restricted list

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

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 371

def delete_restricted_models_with_http_info(ld_api_version, project_key, restricted_models_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIConfigsBetaApi.delete_restricted_models ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling AIConfigsBetaApi.delete_restricted_models"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AIConfigsBetaApi.delete_restricted_models"
  end
  # verify the required parameter 'restricted_models_request' is set
  if @api_client.config.client_side_validation && restricted_models_request.nil?
    fail ArgumentError, "Missing the required parameter 'restricted_models_request' when calling AIConfigsBetaApi.delete_restricted_models"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/model-configs/restricted'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s))

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

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

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

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

  # return_type
  return_type = opts[:debug_return_type]

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

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

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

#get_ai_config(ld_api_version, project_key, config_key, opts = {}) ⇒ AIConfig

Get AI Config Retrieve a specific AI Config by its key.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • config_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



445
446
447
448
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 445

def get_ai_config(ld_api_version, project_key, config_key, opts = {})
  data, _status_code, _headers = get_ai_config_with_http_info(ld_api_version, project_key, config_key, opts)
  data
end

#get_ai_config_metrics(ld_api_version, project_key, config_key, from, to, env, opts = {}) ⇒ Metrics

Get AI Config metrics Retrieve usage metrics for an AI Config by config key.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • config_key (String)
  • from (Integer)

    The starting time, as milliseconds since epoch (inclusive).

  • to (Integer)

    The ending time, as milliseconds since epoch (exclusive). May not be more than 100 days after &#x60;from&#x60;.

  • env (String)

    An environment key. Only metrics from this environment will be included.

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

    the optional parameters

Returns:



529
530
531
532
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 529

def get_ai_config_metrics(ld_api_version, project_key, config_key, from, to, env, opts = {})
  data, _status_code, _headers = get_ai_config_metrics_with_http_info(ld_api_version, project_key, config_key, from, to, env, opts)
  data
end

#get_ai_config_metrics_by_variation(ld_api_version, project_key, config_key, from, to, env, opts = {}) ⇒ Array<MetricByVariation>

Get AI Config metrics by variation Retrieve usage metrics for an AI Config by config key, with results split by variation.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • config_key (String)
  • from (Integer)

    The starting time, as milliseconds since epoch (inclusive).

  • to (Integer)

    The ending time, as milliseconds since epoch (exclusive). May not be more than 100 days after &#x60;from&#x60;.

  • env (String)

    An environment key. Only metrics from this environment will be included.

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

    the optional parameters

Returns:



631
632
633
634
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 631

def get_ai_config_metrics_by_variation(ld_api_version, project_key, config_key, from, to, env, opts = {})
  data, _status_code, _headers = get_ai_config_metrics_by_variation_with_http_info(ld_api_version, project_key, config_key, from, to, env, opts)
  data
end

#get_ai_config_metrics_by_variation_with_http_info(ld_api_version, project_key, config_key, from, to, env, opts = {}) ⇒ Array<(Array<MetricByVariation>, Integer, Hash)>

Get AI Config metrics by variation Retrieve usage metrics for an AI Config by config key, with results split by variation.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • config_key (String)
  • from (Integer)

    The starting time, as milliseconds since epoch (inclusive).

  • to (Integer)

    The ending time, as milliseconds since epoch (exclusive). May not be more than 100 days after &#x60;from&#x60;.

  • env (String)

    An environment key. Only metrics from this environment will be included.

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

    the optional parameters

Returns:

  • (Array<(Array<MetricByVariation>, Integer, Hash)>)

    Array<MetricByVariation> data, response status code and response headers



646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 646

def get_ai_config_metrics_by_variation_with_http_info(ld_api_version, project_key, config_key, from, to, env, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIConfigsBetaApi.get_ai_config_metrics_by_variation ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling AIConfigsBetaApi.get_ai_config_metrics_by_variation"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AIConfigsBetaApi.get_ai_config_metrics_by_variation"
  end
  # verify the required parameter 'config_key' is set
  if @api_client.config.client_side_validation && config_key.nil?
    fail ArgumentError, "Missing the required parameter 'config_key' when calling AIConfigsBetaApi.get_ai_config_metrics_by_variation"
  end
  # verify the required parameter 'from' is set
  if @api_client.config.client_side_validation && from.nil?
    fail ArgumentError, "Missing the required parameter 'from' when calling AIConfigsBetaApi.get_ai_config_metrics_by_variation"
  end
  # verify the required parameter 'to' is set
  if @api_client.config.client_side_validation && to.nil?
    fail ArgumentError, "Missing the required parameter 'to' when calling AIConfigsBetaApi.get_ai_config_metrics_by_variation"
  end
  # verify the required parameter 'env' is set
  if @api_client.config.client_side_validation && env.nil?
    fail ArgumentError, "Missing the required parameter 'env' when calling AIConfigsBetaApi.get_ai_config_metrics_by_variation"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/{configKey}/metrics-by-variation'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'configKey' + '}', CGI.escape(config_key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'from'] = from
  query_params[:'to'] = to
  query_params[:'env'] = env

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

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

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

  # return_type
  return_type = opts[:debug_return_type] || 'Array<MetricByVariation>'

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

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

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

#get_ai_config_metrics_with_http_info(ld_api_version, project_key, config_key, from, to, env, opts = {}) ⇒ Array<(Metrics, Integer, Hash)>

Get AI Config metrics Retrieve usage metrics for an AI Config by config key.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • config_key (String)
  • from (Integer)

    The starting time, as milliseconds since epoch (inclusive).

  • to (Integer)

    The ending time, as milliseconds since epoch (exclusive). May not be more than 100 days after &#x60;from&#x60;.

  • env (String)

    An environment key. Only metrics from this environment will be included.

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

    the optional parameters

Returns:

  • (Array<(Metrics, Integer, Hash)>)

    Metrics data, response status code and response headers



544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 544

def get_ai_config_metrics_with_http_info(ld_api_version, project_key, config_key, from, to, env, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIConfigsBetaApi.get_ai_config_metrics ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling AIConfigsBetaApi.get_ai_config_metrics"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AIConfigsBetaApi.get_ai_config_metrics"
  end
  # verify the required parameter 'config_key' is set
  if @api_client.config.client_side_validation && config_key.nil?
    fail ArgumentError, "Missing the required parameter 'config_key' when calling AIConfigsBetaApi.get_ai_config_metrics"
  end
  # verify the required parameter 'from' is set
  if @api_client.config.client_side_validation && from.nil?
    fail ArgumentError, "Missing the required parameter 'from' when calling AIConfigsBetaApi.get_ai_config_metrics"
  end
  # verify the required parameter 'to' is set
  if @api_client.config.client_side_validation && to.nil?
    fail ArgumentError, "Missing the required parameter 'to' when calling AIConfigsBetaApi.get_ai_config_metrics"
  end
  # verify the required parameter 'env' is set
  if @api_client.config.client_side_validation && env.nil?
    fail ArgumentError, "Missing the required parameter 'env' when calling AIConfigsBetaApi.get_ai_config_metrics"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/{configKey}/metrics'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'configKey' + '}', CGI.escape(config_key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'from'] = from
  query_params[:'to'] = to
  query_params[:'env'] = env

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

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

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

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

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

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

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

#get_ai_config_targeting(ld_api_version, project_key, config_key, opts = {}) ⇒ AIConfigTargeting

Show an AI Config’s targeting Retrieves a specific AI Config’s targeting by its key

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • config_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



730
731
732
733
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 730

def get_ai_config_targeting(ld_api_version, project_key, config_key, opts = {})
  data, _status_code, _headers = get_ai_config_targeting_with_http_info(ld_api_version, project_key, config_key, opts)
  data
end

#get_ai_config_targeting_with_http_info(ld_api_version, project_key, config_key, opts = {}) ⇒ Array<(AIConfigTargeting, Integer, Hash)>

Show an AI Config&#39;s targeting Retrieves a specific AI Config&#39;s targeting by its key

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • config_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(AIConfigTargeting, Integer, Hash)>)

    AIConfigTargeting data, response status code and response headers



742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 742

def get_ai_config_targeting_with_http_info(ld_api_version, project_key, config_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIConfigsBetaApi.get_ai_config_targeting ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling AIConfigsBetaApi.get_ai_config_targeting"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AIConfigsBetaApi.get_ai_config_targeting"
  end
  # verify the required parameter 'config_key' is set
  if @api_client.config.client_side_validation && config_key.nil?
    fail ArgumentError, "Missing the required parameter 'config_key' when calling AIConfigsBetaApi.get_ai_config_targeting"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/{configKey}/targeting'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'configKey' + '}', CGI.escape(config_key.to_s))

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

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

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

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

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

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

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

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

#get_ai_config_variation(ld_api_version, project_key, config_key, variation_key, opts = {}) ⇒ AIConfigVariationsResponse

Get AI Config variation Get an AI Config variation by key. The response includes all variation versions for the given variation key.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • config_key (String)
  • variation_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



812
813
814
815
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 812

def get_ai_config_variation(ld_api_version, project_key, config_key, variation_key, opts = {})
  data, _status_code, _headers = get_ai_config_variation_with_http_info(ld_api_version, project_key, config_key, variation_key, opts)
  data
end

#get_ai_config_variation_with_http_info(ld_api_version, project_key, config_key, variation_key, opts = {}) ⇒ Array<(AIConfigVariationsResponse, Integer, Hash)>

Get AI Config variation Get an AI Config variation by key. The response includes all variation versions for the given variation key.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • config_key (String)
  • variation_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(AIConfigVariationsResponse, Integer, Hash)>)

    AIConfigVariationsResponse data, response status code and response headers



825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 825

def get_ai_config_variation_with_http_info(ld_api_version, project_key, config_key, variation_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIConfigsBetaApi.get_ai_config_variation ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling AIConfigsBetaApi.get_ai_config_variation"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AIConfigsBetaApi.get_ai_config_variation"
  end
  # verify the required parameter 'config_key' is set
  if @api_client.config.client_side_validation && config_key.nil?
    fail ArgumentError, "Missing the required parameter 'config_key' when calling AIConfigsBetaApi.get_ai_config_variation"
  end
  # verify the required parameter 'variation_key' is set
  if @api_client.config.client_side_validation && variation_key.nil?
    fail ArgumentError, "Missing the required parameter 'variation_key' when calling AIConfigsBetaApi.get_ai_config_variation"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/{configKey}/variations/{variationKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'configKey' + '}', CGI.escape(config_key.to_s)).sub('{' + 'variationKey' + '}', CGI.escape(variation_key.to_s))

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

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

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

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

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

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

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

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

#get_ai_config_with_http_info(ld_api_version, project_key, config_key, opts = {}) ⇒ Array<(AIConfig, Integer, Hash)>

Get AI Config Retrieve a specific AI Config by its key.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • config_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(AIConfig, Integer, Hash)>)

    AIConfig data, response status code and response headers



457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 457

def get_ai_config_with_http_info(ld_api_version, project_key, config_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIConfigsBetaApi.get_ai_config ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling AIConfigsBetaApi.get_ai_config"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AIConfigsBetaApi.get_ai_config"
  end
  # verify the required parameter 'config_key' is set
  if @api_client.config.client_side_validation && config_key.nil?
    fail ArgumentError, "Missing the required parameter 'config_key' when calling AIConfigsBetaApi.get_ai_config"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/{configKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'configKey' + '}', CGI.escape(config_key.to_s))

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

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

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

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

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

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

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

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

#get_ai_configs(ld_api_version, project_key, opts = {}) ⇒ AIConfigs

List AI Configs Get a list of all AI Configs in the given project.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

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

    the optional parameters

Options Hash (opts):

  • :sort (String)

    A sort to apply to the list of AI Configs.

  • :limit (Integer)

    The number of AI Configs to return.

  • :offset (Integer)

    Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query &#x60;limit&#x60;.

  • :filter (String)

    A filter to apply to the list of AI Configs.

Returns:



901
902
903
904
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 901

def get_ai_configs(ld_api_version, project_key, opts = {})
  data, _status_code, _headers = get_ai_configs_with_http_info(ld_api_version, project_key, opts)
  data
end

#get_ai_configs_with_http_info(ld_api_version, project_key, opts = {}) ⇒ Array<(AIConfigs, Integer, Hash)>

List AI Configs Get a list of all AI Configs in the given project.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

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

    the optional parameters

Options Hash (opts):

  • :sort (String)

    A sort to apply to the list of AI Configs.

  • :limit (Integer)

    The number of AI Configs to return.

  • :offset (Integer)

    Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query &#x60;limit&#x60;.

  • :filter (String)

    A filter to apply to the list of AI Configs.

Returns:

  • (Array<(AIConfigs, Integer, Hash)>)

    AIConfigs data, response status code and response headers



916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 916

def get_ai_configs_with_http_info(ld_api_version, project_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIConfigsBetaApi.get_ai_configs ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling AIConfigsBetaApi.get_ai_configs"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AIConfigsBetaApi.get_ai_configs"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?

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

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

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

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

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

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

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

#get_ai_tool(ld_api_version, project_key, tool_key, opts = {}) ⇒ AITool

Get AI tool Retrieve a specific AI tool by its key.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • tool_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



985
986
987
988
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 985

def get_ai_tool(ld_api_version, project_key, tool_key, opts = {})
  data, _status_code, _headers = get_ai_tool_with_http_info(ld_api_version, project_key, tool_key, opts)
  data
end

#get_ai_tool_with_http_info(ld_api_version, project_key, tool_key, opts = {}) ⇒ Array<(AITool, Integer, Hash)>

Get AI tool Retrieve a specific AI tool by its key.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • tool_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(AITool, Integer, Hash)>)

    AITool data, response status code and response headers



997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 997

def get_ai_tool_with_http_info(ld_api_version, project_key, tool_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIConfigsBetaApi.get_ai_tool ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling AIConfigsBetaApi.get_ai_tool"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AIConfigsBetaApi.get_ai_tool"
  end
  # verify the required parameter 'tool_key' is set
  if @api_client.config.client_side_validation && tool_key.nil?
    fail ArgumentError, "Missing the required parameter 'tool_key' when calling AIConfigsBetaApi.get_ai_tool"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-tools/{toolKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'toolKey' + '}', CGI.escape(tool_key.to_s))

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

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

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

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

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

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

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

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

#get_model_config(ld_api_version, project_key, model_config_key, opts = {}) ⇒ ModelConfig

Get AI model config Get an AI model config by key.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • model_config_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1066
1067
1068
1069
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 1066

def get_model_config(ld_api_version, project_key, model_config_key, opts = {})
  data, _status_code, _headers = get_model_config_with_http_info(ld_api_version, project_key, model_config_key, opts)
  data
end

#get_model_config_with_http_info(ld_api_version, project_key, model_config_key, opts = {}) ⇒ Array<(ModelConfig, Integer, Hash)>

Get AI model config Get an AI model config by key.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • model_config_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ModelConfig, Integer, Hash)>)

    ModelConfig data, response status code and response headers



1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 1078

def get_model_config_with_http_info(ld_api_version, project_key, model_config_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIConfigsBetaApi.get_model_config ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling AIConfigsBetaApi.get_model_config"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AIConfigsBetaApi.get_model_config"
  end
  # verify the required parameter 'model_config_key' is set
  if @api_client.config.client_side_validation && model_config_key.nil?
    fail ArgumentError, "Missing the required parameter 'model_config_key' when calling AIConfigsBetaApi.get_model_config"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/model-configs/{modelConfigKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'modelConfigKey' + '}', CGI.escape(model_config_key.to_s))

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

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

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

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

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

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

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

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

#list_ai_tool_versions(ld_api_version, project_key, tool_key, opts = {}) ⇒ AITools

List AI tool versions Get a list of all versions of an AI tool in the given project.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • tool_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sort (String)

    A sort to apply to the list of AI Configs.

  • :limit (Integer)

    The number of AI Configs to return.

  • :offset (Integer)

    Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query &#x60;limit&#x60;.

Returns:



1150
1151
1152
1153
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 1150

def list_ai_tool_versions(ld_api_version, project_key, tool_key, opts = {})
  data, _status_code, _headers = list_ai_tool_versions_with_http_info(ld_api_version, project_key, tool_key, opts)
  data
end

#list_ai_tool_versions_with_http_info(ld_api_version, project_key, tool_key, opts = {}) ⇒ Array<(AITools, Integer, Hash)>

List AI tool versions Get a list of all versions of an AI tool in the given project.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • tool_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sort (String)

    A sort to apply to the list of AI Configs.

  • :limit (Integer)

    The number of AI Configs to return.

  • :offset (Integer)

    Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query &#x60;limit&#x60;.

Returns:

  • (Array<(AITools, Integer, Hash)>)

    AITools data, response status code and response headers



1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 1165

def list_ai_tool_versions_with_http_info(ld_api_version, project_key, tool_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIConfigsBetaApi.list_ai_tool_versions ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling AIConfigsBetaApi.list_ai_tool_versions"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AIConfigsBetaApi.list_ai_tool_versions"
  end
  # verify the required parameter 'tool_key' is set
  if @api_client.config.client_side_validation && tool_key.nil?
    fail ArgumentError, "Missing the required parameter 'tool_key' when calling AIConfigsBetaApi.list_ai_tool_versions"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-tools/{toolKey}/versions'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'toolKey' + '}', CGI.escape(tool_key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?

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

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

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

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

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

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

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

#list_ai_tools(ld_api_version, project_key, opts = {}) ⇒ AITools

List AI tools Get a list of all AI tools in the given project.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

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

    the optional parameters

Options Hash (opts):

  • :sort (String)

    A sort to apply to the list of AI Configs.

  • :limit (Integer)

    The number of AI Configs to return.

  • :offset (Integer)

    Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query &#x60;limit&#x60;.

  • :filter (String)

    A filter to apply to the list of AI Configs.

Returns:



1240
1241
1242
1243
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 1240

def list_ai_tools(ld_api_version, project_key, opts = {})
  data, _status_code, _headers = list_ai_tools_with_http_info(ld_api_version, project_key, opts)
  data
end

#list_ai_tools_with_http_info(ld_api_version, project_key, opts = {}) ⇒ Array<(AITools, Integer, Hash)>

List AI tools Get a list of all AI tools in the given project.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

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

    the optional parameters

Options Hash (opts):

  • :sort (String)

    A sort to apply to the list of AI Configs.

  • :limit (Integer)

    The number of AI Configs to return.

  • :offset (Integer)

    Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query &#x60;limit&#x60;.

  • :filter (String)

    A filter to apply to the list of AI Configs.

Returns:

  • (Array<(AITools, Integer, Hash)>)

    AITools data, response status code and response headers



1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 1255

def list_ai_tools_with_http_info(ld_api_version, project_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIConfigsBetaApi.list_ai_tools ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling AIConfigsBetaApi.list_ai_tools"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AIConfigsBetaApi.list_ai_tools"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-tools'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?

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

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

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

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

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

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

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

#list_model_configs(ld_api_version, project_key, opts = {}) ⇒ Array<ModelConfig>

List AI model configs Get all AI model configs for a project.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

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

    the optional parameters

Options Hash (opts):

  • :restricted (Boolean)

    Whether to return only restricted models

Returns:



1324
1325
1326
1327
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 1324

def list_model_configs(ld_api_version, project_key, opts = {})
  data, _status_code, _headers = list_model_configs_with_http_info(ld_api_version, project_key, opts)
  data
end

#list_model_configs_with_http_info(ld_api_version, project_key, opts = {}) ⇒ Array<(Array<ModelConfig>, Integer, Hash)>

List AI model configs Get all AI model configs for a project.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

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

    the optional parameters

Options Hash (opts):

  • :restricted (Boolean)

    Whether to return only restricted models

Returns:

  • (Array<(Array<ModelConfig>, Integer, Hash)>)

    Array<ModelConfig> data, response status code and response headers



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

def list_model_configs_with_http_info(ld_api_version, project_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIConfigsBetaApi.list_model_configs ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling AIConfigsBetaApi.list_model_configs"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AIConfigsBetaApi.list_model_configs"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/model-configs'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'restricted'] = opts[:'restricted'] if !opts[:'restricted'].nil?

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

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

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

  # return_type
  return_type = opts[:debug_return_type] || 'Array<ModelConfig>'

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

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

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

#patch_ai_config(ld_api_version, project_key, config_key, opts = {}) ⇒ AIConfig

Update AI Config Edit an existing AI Config. The request body must be a JSON object of the fields to update. The values you include replace the existing values for the fields. Here’s an example: “‘ { "description": "Example updated description", "tags": ["new-tag"] } “`

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • config_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :ai_config_patch (AIConfigPatch)

    AI Config object to update

Returns:



1403
1404
1405
1406
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 1403

def patch_ai_config(ld_api_version, project_key, config_key, opts = {})
  data, _status_code, _headers = patch_ai_config_with_http_info(ld_api_version, project_key, config_key, opts)
  data
end

#patch_ai_config_targeting(ld_api_version, project_key, config_key, opts = {}) ⇒ AIConfigTargeting

Update AI Config targeting Perform a partial update to an AI Config’s targeting. The request body must be a valid semantic patch. ### Using semantic patches on an AI Config To make a semantic patch request, you must append ‘domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](launchdarkly.com/docs/api#updates-using-semantic-patch). The body of a semantic patch request for updating an AI Config’s targeting takes the following properties: * ‘comment` (string): (Optional) A description of the update. * `environmentKey` (string): The key of the LaunchDarkly environment. * `instructions` (array): (Required) A list of actions the update should perform. Each action in the list must be an object with a `kind` property that indicates the instruction. If the action requires parameters, you must include those parameters as additional fields in the object. The body of a single semantic patch can contain many different instructions. ### Instructions Semantic patch requests support the following `kind` instructions for updating AI Configs. <details> <summary>Click to expand instructions for <strong>working with targeting and variations</strong> for AI Configs</summary> #### addClauses Adds the given clauses to the rule indicated by `ruleId`. ##### Parameters - `ruleId`: ID of a rule in the AI Config. - `clauses`: Array of clause objects, with `contextKind` (string), `attribute` (string), `op` (string), `negate` (boolean), and `values` (array of strings, numbers, or dates) properties. The `contextKind`, `attribute`, and `values` are case sensitive. The `op` must be lower-case. Here’s an example: “‘json { "environmentKey": "environment-key-123abc", "instructions": [{ "kind": "addClauses", "ruleId": "a902ef4a-2faf-4eaf-88e1-ecc356708a29", "clauses": [{ "contextKind": "user", "attribute": "country", "op": "in", "negate": false, "values": ["USA", "Canada"] }] }] } “` #### addRule Adds a new targeting rule to the AI Config. The rule may contain `clauses` and serve the variation that `variationId` indicates, or serve a percentage rollout that `rolloutWeights`, `rolloutBucketBy`, and `rolloutContextKind` indicate. If you set `beforeRuleId`, this adds the new rule before the indicated rule. Otherwise, adds the new rule to the end of the list. ##### Parameters - `clauses`: Array of clause objects, with `contextKind` (string), `attribute` (string), `op` (string), `negate` (boolean), and `values` (array of strings, numbers, or dates) properties. The `contextKind`, `attribute`, and `values` are case sensitive. The `op` must be lower-case. - `beforeRuleId`: (Optional) ID of a rule. - Either - `variationId`: ID of a variation. or - `rolloutWeights`: (Optional) Map of `variationId` to weight, in thousandths of a percent (0-100000). - `rolloutBucketBy`: (Optional) Context attribute available in the specified `rolloutContextKind`. - `rolloutContextKind`: (Optional) Context kind, defaults to `user` Here’s an example that uses a ‘variationId`: “`json { "environmentKey": "environment-key-123abc", "instructions": [{ "kind": "addRule", "variationId": "2f43f67c-3e4e-4945-a18a-26559378ca00", "clauses": [{ "contextKind": "organization", "attribute": "located_in", "op": "in", "negate": false, "values": ["Sweden", "Norway"] }] }] } “` Here’s an example that uses a percentage rollout: “‘json { "environmentKey": "environment-key-123abc", "instructions": [{ "kind": "addRule", "clauses": [{ "contextKind": "organization", "attribute": "located_in", "op": "in", "negate": false, "values": ["Sweden", "Norway"] }], "rolloutContextKind": "organization", "rolloutWeights": { "2f43f67c-3e4e-4945-a18a-26559378ca00": 15000, // serve 15% this variation "e5830889-1ec5-4b0c-9cc9-c48790090c43": 85000 // serve 85% this variation } }] } “` #### addTargets Adds context keys to the individual context targets for the context kind that `contextKind` specifies and the variation that `variationId` specifies. Returns an error if this causes the AI Config to target the same context key in multiple variations. ##### Parameters - `values`: List of context keys. - `contextKind`: (Optional) Context kind to target, defaults to `user` - `variationId`: ID of a variation. Here’s an example: “‘json { "environmentKey": "environment-key-123abc", "instructions": [{ "kind": "addTargets", "values": ["context-key-123abc", "context-key-456def"], "variationId": "2f43f67c-3e4e-4945-a18a-26559378ca00" }] } “` #### addValuesToClause Adds `values` to the values of the clause that `ruleId` and `clauseId` indicate. Does not update the context kind, attribute, or operator. ##### Parameters - `ruleId`: ID of a rule in the AI Config. - `clauseId`: ID of a clause in that rule. - `values`: Array of strings, case sensitive. Here’s an example: “‘json { "environmentKey": "environment-key-123abc", "instructions": [{ "kind": "addValuesToClause", "ruleId": "a902ef4a-2faf-4eaf-88e1-ecc356708a29", "clauseId": "10a58772-3121-400f-846b-b8a04e8944ed", "values": ["beta_testers"] }] } “` #### clearTargets Removes all individual targets from the variation that `variationId` specifies. This includes both user and non-user targets. ##### Parameters - `variationId`: ID of a variation. Here’s an example: “‘json { "environmentKey": "environment-key-123abc", "instructions": [ { "kind": "clearTargets", "variationId": "2f43f67c-3e4e-4945-a18a-26559378ca00" } ] } “` #### removeClauses Removes the clauses specified by `clauseIds` from the rule indicated by `ruleId`. ##### Parameters - `ruleId`: ID of a rule. - `clauseIds`: Array of IDs of clauses in the rule. Here’s an example: “‘json { "environmentKey": "environment-key-123abc", "instructions": [{ "kind": "removeClauses", "ruleId": "a902ef4a-2faf-4eaf-88e1-ecc356708a29", "clauseIds": ["10a58772-3121-400f-846b-b8a04e8944ed", "36a461dc-235e-4b08-97b9-73ce9365873e"] }] } “` #### removeRule Removes the targeting rule specified by `ruleId`. Does nothing if the rule does not exist. ##### Parameters - `ruleId`: ID of a rule. Here’s an example: “‘json { "environmentKey": "environment-key-123abc", "instructions": [ { "kind": "removeRule", "ruleId": "a902ef4a-2faf-4eaf-88e1-ecc356708a29" } ] } “` #### removeTargets Removes context keys from the individual context targets for the context kind that `contextKind` specifies and the variation that `variationId` specifies. Does nothing if the flag does not target the context keys. ##### Parameters - `values`: List of context keys. - `contextKind`: (Optional) Context kind to target, defaults to `user` - `variationId`: ID of a variation. Here’s an example: “‘json { "environmentKey": "environment-key-123abc", "instructions": [{ "kind": "removeTargets", "values": ["context-key-123abc", "context-key-456def"], "variationId": "2f43f67c-3e4e-4945-a18a-26559378ca00" }] } “` #### removeValuesFromClause Removes `values` from the values of the clause indicated by `ruleId` and `clauseId`. Does not update the context kind, attribute, or operator. ##### Parameters - `ruleId`: ID of a rule. - `clauseId`: ID of a clause in that rule. - `values`: Array of strings, case sensitive. Here’s an example: “‘json { "environmentKey": "environment-key-123abc", "instructions": [{ "kind": "removeValuesFromClause", "ruleId": "a902ef4a-2faf-4eaf-88e1-ecc356708a29", "clauseId": "10a58772-3121-400f-846b-b8a04e8944ed", "values": ["beta_testers"] }] } “` #### reorderRules Rearranges the rules to match the order given in `ruleIds`. Returns an error if `ruleIds` does not match the current set of rules on the AI Config. ##### Parameters - `ruleIds`: Array of IDs of all rules. Here’s an example: “‘json { "environmentKey": "environment-key-123abc", "instructions": [{ "kind": "reorderRules", "ruleIds": ["a902ef4a-2faf-4eaf-88e1-ecc356708a29", "63c238d1-835d-435e-8f21-c8d5e40b2a3d"] }] } “` #### replaceRules Removes all targeting rules for the AI Config and replaces them with the list you provide. ##### Parameters - `rules`: A list of rules. Here’s an example: “‘json { "environmentKey": "environment-key-123abc", "instructions": [ { "kind": "replaceRules", "rules": [ { "variationId": "2f43f67c-3e4e-4945-a18a-26559378ca00", "description": "My new rule", "clauses": [ { "contextKind": "user", "attribute": "segmentMatch", "op": "segmentMatch", "values": ["test"] } ] } ] } ] } “` #### replaceTargets Removes all existing targeting and replaces it with the list of targets you provide. ##### Parameters - `targets`: A list of context targeting. Each item in the list includes an optional `contextKind` that defaults to `user`, a required `variationId`, and a required list of `values`. Here’s an example: “‘json { "environmentKey": "environment-key-123abc", "instructions": [ { "kind": "replaceTargets", "targets": [ { "contextKind": "user", "variationId": "2f43f67c-3e4e-4945-a18a-26559378ca00", "values": ["user-key-123abc"] }, { "contextKind": "device", "variationId": "e5830889-1ec5-4b0c-9cc9-c48790090c43", "values": ["device-key-456def"] } ] } ] } “` #### updateClause Replaces the clause indicated by `ruleId` and `clauseId` with `clause`. ##### Parameters - `ruleId`: ID of a rule. - `clauseId`: ID of a clause in that rule. - `clause`: New `clause` object, with `contextKind` (string), `attribute` (string), `op` (string), `negate` (boolean), and `values` (array of strings, numbers, or dates) properties. The `contextKind`, `attribute`, and `values` are case sensitive. The `op` must be lower-case. Here’s an example: “‘json { "environmentKey": "environment-key-123abc", "instructions": [{ "kind": "updateClause", "ruleId": "a902ef4a-2faf-4eaf-88e1-ecc356708a29", "clauseId": "10c7462a-2062-45ba-a8bb-dfb3de0f8af5", "clause": { "contextKind": "user", "attribute": "country", "op": "in", "negate": false, "values": ["Mexico", "Canada"] } }] } “` #### updateDefaultVariation Updates the default on or off variation of the AI Config. ##### Parameters - `onVariationValue`: (Optional) The value of the variation of the new on variation. - `offVariationValue`: (Optional) The value of the variation of the new off variation Here’s an example: “‘json { "instructions": [ { "kind": "updateDefaultVariation", "OnVariationValue": true, "OffVariationValue": false } ] } “` #### updateFallthroughVariationOrRollout Updates the default or "fallthrough" rule for the AI Config, which the AI Config serves when a context matches none of the targeting rules. The rule can serve either the variation that `variationId` indicates, or a percentage rollout that `rolloutWeights` and `rolloutBucketBy` indicate. ##### Parameters - `variationId`: ID of a variation. or - `rolloutWeights`: Map of `variationId` to weight, in thousandths of a percent (0-100000). - `rolloutBucketBy`: (Optional) Context attribute available in the specified `rolloutContextKind`. - `rolloutContextKind`: (Optional) Context kind, defaults to `user` Here’s an example that uses a ‘variationId`: “`json { "environmentKey": "environment-key-123abc", "instructions": [{ "kind": "updateFallthroughVariationOrRollout", "variationId": "2f43f67c-3e4e-4945-a18a-26559378ca00" }] } “` Here’s an example that uses a percentage rollout: “‘json { "environmentKey": "environment-key-123abc", "instructions": [{ "kind": "updateFallthroughVariationOrRollout", "rolloutContextKind": "user", "rolloutWeights": { "2f43f67c-3e4e-4945-a18a-26559378ca00": 15000, // serve 15% this variation "e5830889-1ec5-4b0c-9cc9-c48790090c43": 85000 // serve 85% this variation } }] } “` #### updateOffVariation Updates the default off variation to `variationId`. The AI Config serves the default off variation when the AI Config’s targeting is Off. ##### Parameters - ‘variationId`: ID of a variation. Here’s an example: “‘json { "environmentKey": "environment-key-123abc", "instructions": [ { "kind": "updateOffVariation", "variationId": "2f43f67c-3e4e-4945-a18a-26559378ca00" } ] } “` #### updateRuleDescription Updates the description of the targeting rule. ##### Parameters - `description`: The new human-readable description for this rule. - `ruleId`: The ID of the rule. You can retrieve this by making a GET request for the AI Config. Here’s an example: “‘json { "environmentKey": "environment-key-123abc", "instructions": [{ "kind": "updateRuleDescription", "description": "New rule description", "ruleId": "a902ef4a-2faf-4eaf-88e1-ecc356708a29" }] } “` #### updateRuleTrackEvents Updates whether or not LaunchDarkly tracks events for the AI Config associated with this rule. ##### Parameters - `ruleId`: The ID of the rule. You can retrieve this by making a GET request for the AI Config. - `trackEvents`: Whether or not events are tracked. Here’s an example: “‘json { "environmentKey": "environment-key-123abc", "instructions": [{ "kind": "updateRuleTrackEvents", "ruleId": "a902ef4a-2faf-4eaf-88e1-ecc356708a29", "trackEvents": true }] } “` #### updateRuleVariationOrRollout Updates what `ruleId` serves when its clauses evaluate to true. The rule can serve either the variation that `variationId` indicates, or a percent rollout that `rolloutWeights` and `rolloutBucketBy` indicate. ##### Parameters - `ruleId`: ID of a rule. - `variationId`: ID of a variation. or - `rolloutWeights`: Map of `variationId` to weight, in thousandths of a percent (0-100000). - `rolloutBucketBy`: (Optional) Context attribute available in the specified `rolloutContextKind`. - `rolloutContextKind`: (Optional) Context kind, defaults to `user` Here’s an example: “‘json { "environmentKey": "environment-key-123abc", "instructions": [{ "kind": "updateRuleVariationOrRollout", "ruleId": "a902ef4a-2faf-4eaf-88e1-ecc356708a29", "variationId": "2f43f67c-3e4e-4945-a18a-26559378ca00" }] } “` #### updateTrackEvents Updates whether or not LaunchDarkly tracks events for the AI Config, for all rules. ##### Parameters - `trackEvents`: Whether or not events are tracked. Here’s an example: “‘json { "environmentKey": "environment-key-123abc", "instructions": [ { "kind": "updateTrackEvents", "trackEvents": true } ] } “` #### updateTrackEventsFallthrough Updates whether or not LaunchDarkly tracks events for the AI Config, for the default rule. ##### Parameters - `trackEvents`: Whether or not events are tracked. Here’s an example: “‘json { "environmentKey": "environment-key-123abc", "instructions": [ { "kind": "updateTrackEventsFallthrough", "trackEvents": true } ] } “` </details>

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • config_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



1491
1492
1493
1494
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 1491

def patch_ai_config_targeting(ld_api_version, project_key, config_key, opts = {})
  data, _status_code, _headers = patch_ai_config_targeting_with_http_info(ld_api_version, project_key, config_key, opts)
  data
end

#patch_ai_config_targeting_with_http_info(ld_api_version, project_key, config_key, opts = {}) ⇒ Array<(AIConfigTargeting, Integer, Hash)>

Update AI Config targeting Perform a partial update to an AI Config&#39;s targeting. The request body must be a valid semantic patch. ### Using semantic patches on an AI Config To make a semantic patch request, you must append &#x60;domain-model&#x3D;launchdarkly.semanticpatch&#x60; to your &#x60;Content-Type&#x60; header. To learn more, read [Updates using semantic patch](launchdarkly.com/docs/api#updates-using-semantic-patch). The body of a semantic patch request for updating an AI Config&#39;s targeting takes the following properties: * &#x60;comment&#x60; (string): (Optional) A description of the update. * &#x60;environmentKey&#x60; (string): The key of the LaunchDarkly environment. * &#x60;instructions&#x60; (array): (Required) A list of actions the update should perform. Each action in the list must be an object with a &#x60;kind&#x60; property that indicates the instruction. If the action requires parameters, you must include those parameters as additional fields in the object. The body of a single semantic patch can contain many different instructions. ### Instructions Semantic patch requests support the following &#x60;kind&#x60; instructions for updating AI Configs. &lt;details&gt; &lt;summary&gt;Click to expand instructions for &lt;strong&gt;working with targeting and variations&lt;/strong&gt; for AI Configs&lt;/summary&gt; #### addClauses Adds the given clauses to the rule indicated by &#x60;ruleId&#x60;. ##### Parameters - &#x60;ruleId&#x60;: ID of a rule in the AI Config. - &#x60;clauses&#x60;: Array of clause objects, with &#x60;contextKind&#x60; (string), &#x60;attribute&#x60; (string), &#x60;op&#x60; (string), &#x60;negate&#x60; (boolean), and &#x60;values&#x60; (array of strings, numbers, or dates) properties. The &#x60;contextKind&#x60;, &#x60;attribute&#x60;, and &#x60;values&#x60; are case sensitive. The &#x60;op&#x60; must be lower-case. Here&#39;s an example: &#x60;&#x60;&#x60;json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;addClauses&quot;, &quot;ruleId&quot;: &quot;a902ef4a-2faf-4eaf-88e1-ecc356708a29&quot;, &quot;clauses&quot;: [{ &quot;contextKind&quot;: &quot;user&quot;, &quot;attribute&quot;: &quot;country&quot;, &quot;op&quot;: &quot;in&quot;, &quot;negate&quot;: false, &quot;values&quot;: [&quot;USA&quot;, &quot;Canada&quot;] }] }] } &#x60;&#x60;&#x60; #### addRule Adds a new targeting rule to the AI Config. The rule may contain &#x60;clauses&#x60; and serve the variation that &#x60;variationId&#x60; indicates, or serve a percentage rollout that &#x60;rolloutWeights&#x60;, &#x60;rolloutBucketBy&#x60;, and &#x60;rolloutContextKind&#x60; indicate. If you set &#x60;beforeRuleId&#x60;, this adds the new rule before the indicated rule. Otherwise, adds the new rule to the end of the list. ##### Parameters - &#x60;clauses&#x60;: Array of clause objects, with &#x60;contextKind&#x60; (string), &#x60;attribute&#x60; (string), &#x60;op&#x60; (string), &#x60;negate&#x60; (boolean), and &#x60;values&#x60; (array of strings, numbers, or dates) properties. The &#x60;contextKind&#x60;, &#x60;attribute&#x60;, and &#x60;values&#x60; are case sensitive. The &#x60;op&#x60; must be lower-case. - &#x60;beforeRuleId&#x60;: (Optional) ID of a rule. - Either - &#x60;variationId&#x60;: ID of a variation. or - &#x60;rolloutWeights&#x60;: (Optional) Map of &#x60;variationId&#x60; to weight, in thousandths of a percent (0-100000). - &#x60;rolloutBucketBy&#x60;: (Optional) Context attribute available in the specified &#x60;rolloutContextKind&#x60;. - &#x60;rolloutContextKind&#x60;: (Optional) Context kind, defaults to &#x60;user&#x60; Here&#39;s an example that uses a &#x60;variationId&#x60;: &#x60;&#x60;&#x60;json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;addRule&quot;, &quot;variationId&quot;: &quot;2f43f67c-3e4e-4945-a18a-26559378ca00&quot;, &quot;clauses&quot;: [{ &quot;contextKind&quot;: &quot;organization&quot;, &quot;attribute&quot;: &quot;located_in&quot;, &quot;op&quot;: &quot;in&quot;, &quot;negate&quot;: false, &quot;values&quot;: [&quot;Sweden&quot;, &quot;Norway&quot;] }] }] } &#x60;&#x60;&#x60; Here&#39;s an example that uses a percentage rollout: &#x60;&#x60;&#x60;json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;addRule&quot;, &quot;clauses&quot;: [{ &quot;contextKind&quot;: &quot;organization&quot;, &quot;attribute&quot;: &quot;located_in&quot;, &quot;op&quot;: &quot;in&quot;, &quot;negate&quot;: false, &quot;values&quot;: [&quot;Sweden&quot;, &quot;Norway&quot;] }], &quot;rolloutContextKind&quot;: &quot;organization&quot;, &quot;rolloutWeights&quot;: { &quot;2f43f67c-3e4e-4945-a18a-26559378ca00&quot;: 15000, // serve 15% this variation &quot;e5830889-1ec5-4b0c-9cc9-c48790090c43&quot;: 85000 // serve 85% this variation } }] } &#x60;&#x60;&#x60; #### addTargets Adds context keys to the individual context targets for the context kind that &#x60;contextKind&#x60; specifies and the variation that &#x60;variationId&#x60; specifies. Returns an error if this causes the AI Config to target the same context key in multiple variations. ##### Parameters - &#x60;values&#x60;: List of context keys. - &#x60;contextKind&#x60;: (Optional) Context kind to target, defaults to &#x60;user&#x60; - &#x60;variationId&#x60;: ID of a variation. Here&#39;s an example: &#x60;&#x60;&#x60;json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;addTargets&quot;, &quot;values&quot;: [&quot;context-key-123abc&quot;, &quot;context-key-456def&quot;], &quot;variationId&quot;: &quot;2f43f67c-3e4e-4945-a18a-26559378ca00&quot; }] } &#x60;&#x60;&#x60; #### addValuesToClause Adds &#x60;values&#x60; to the values of the clause that &#x60;ruleId&#x60; and &#x60;clauseId&#x60; indicate. Does not update the context kind, attribute, or operator. ##### Parameters - &#x60;ruleId&#x60;: ID of a rule in the AI Config. - &#x60;clauseId&#x60;: ID of a clause in that rule. - &#x60;values&#x60;: Array of strings, case sensitive. Here&#39;s an example: &#x60;&#x60;&#x60;json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;addValuesToClause&quot;, &quot;ruleId&quot;: &quot;a902ef4a-2faf-4eaf-88e1-ecc356708a29&quot;, &quot;clauseId&quot;: &quot;10a58772-3121-400f-846b-b8a04e8944ed&quot;, &quot;values&quot;: [&quot;beta_testers&quot;] }] } &#x60;&#x60;&#x60; #### clearTargets Removes all individual targets from the variation that &#x60;variationId&#x60; specifies. This includes both user and non-user targets. ##### Parameters - &#x60;variationId&#x60;: ID of a variation. Here&#39;s an example: &#x60;&#x60;&#x60;json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [ { &quot;kind&quot;: &quot;clearTargets&quot;, &quot;variationId&quot;: &quot;2f43f67c-3e4e-4945-a18a-26559378ca00&quot; } ] } &#x60;&#x60;&#x60; #### removeClauses Removes the clauses specified by &#x60;clauseIds&#x60; from the rule indicated by &#x60;ruleId&#x60;. ##### Parameters - &#x60;ruleId&#x60;: ID of a rule. - &#x60;clauseIds&#x60;: Array of IDs of clauses in the rule. Here&#39;s an example: &#x60;&#x60;&#x60;json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;removeClauses&quot;, &quot;ruleId&quot;: &quot;a902ef4a-2faf-4eaf-88e1-ecc356708a29&quot;, &quot;clauseIds&quot;: [&quot;10a58772-3121-400f-846b-b8a04e8944ed&quot;, &quot;36a461dc-235e-4b08-97b9-73ce9365873e&quot;] }] } &#x60;&#x60;&#x60; #### removeRule Removes the targeting rule specified by &#x60;ruleId&#x60;. Does nothing if the rule does not exist. ##### Parameters - &#x60;ruleId&#x60;: ID of a rule. Here&#39;s an example: &#x60;&#x60;&#x60;json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [ { &quot;kind&quot;: &quot;removeRule&quot;, &quot;ruleId&quot;: &quot;a902ef4a-2faf-4eaf-88e1-ecc356708a29&quot; } ] } &#x60;&#x60;&#x60; #### removeTargets Removes context keys from the individual context targets for the context kind that &#x60;contextKind&#x60; specifies and the variation that &#x60;variationId&#x60; specifies. Does nothing if the flag does not target the context keys. ##### Parameters - &#x60;values&#x60;: List of context keys. - &#x60;contextKind&#x60;: (Optional) Context kind to target, defaults to &#x60;user&#x60; - &#x60;variationId&#x60;: ID of a variation. Here&#39;s an example: &#x60;&#x60;&#x60;json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;removeTargets&quot;, &quot;values&quot;: [&quot;context-key-123abc&quot;, &quot;context-key-456def&quot;], &quot;variationId&quot;: &quot;2f43f67c-3e4e-4945-a18a-26559378ca00&quot; }] } &#x60;&#x60;&#x60; #### removeValuesFromClause Removes &#x60;values&#x60; from the values of the clause indicated by &#x60;ruleId&#x60; and &#x60;clauseId&#x60;. Does not update the context kind, attribute, or operator. ##### Parameters - &#x60;ruleId&#x60;: ID of a rule. - &#x60;clauseId&#x60;: ID of a clause in that rule. - &#x60;values&#x60;: Array of strings, case sensitive. Here&#39;s an example: &#x60;&#x60;&#x60;json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;removeValuesFromClause&quot;, &quot;ruleId&quot;: &quot;a902ef4a-2faf-4eaf-88e1-ecc356708a29&quot;, &quot;clauseId&quot;: &quot;10a58772-3121-400f-846b-b8a04e8944ed&quot;, &quot;values&quot;: [&quot;beta_testers&quot;] }] } &#x60;&#x60;&#x60; #### reorderRules Rearranges the rules to match the order given in &#x60;ruleIds&#x60;. Returns an error if &#x60;ruleIds&#x60; does not match the current set of rules on the AI Config. ##### Parameters - &#x60;ruleIds&#x60;: Array of IDs of all rules. Here&#39;s an example: &#x60;&#x60;&#x60;json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;reorderRules&quot;, &quot;ruleIds&quot;: [&quot;a902ef4a-2faf-4eaf-88e1-ecc356708a29&quot;, &quot;63c238d1-835d-435e-8f21-c8d5e40b2a3d&quot;] }] } &#x60;&#x60;&#x60; #### replaceRules Removes all targeting rules for the AI Config and replaces them with the list you provide. ##### Parameters - &#x60;rules&#x60;: A list of rules. Here&#39;s an example: &#x60;&#x60;&#x60;json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [ { &quot;kind&quot;: &quot;replaceRules&quot;, &quot;rules&quot;: [ { &quot;variationId&quot;: &quot;2f43f67c-3e4e-4945-a18a-26559378ca00&quot;, &quot;description&quot;: &quot;My new rule&quot;, &quot;clauses&quot;: [ { &quot;contextKind&quot;: &quot;user&quot;, &quot;attribute&quot;: &quot;segmentMatch&quot;, &quot;op&quot;: &quot;segmentMatch&quot;, &quot;values&quot;: [&quot;test&quot;] } ] } ] } ] } &#x60;&#x60;&#x60; #### replaceTargets Removes all existing targeting and replaces it with the list of targets you provide. ##### Parameters - &#x60;targets&#x60;: A list of context targeting. Each item in the list includes an optional &#x60;contextKind&#x60; that defaults to &#x60;user&#x60;, a required &#x60;variationId&#x60;, and a required list of &#x60;values&#x60;. Here&#39;s an example: &#x60;&#x60;&#x60;json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [ { &quot;kind&quot;: &quot;replaceTargets&quot;, &quot;targets&quot;: [ { &quot;contextKind&quot;: &quot;user&quot;, &quot;variationId&quot;: &quot;2f43f67c-3e4e-4945-a18a-26559378ca00&quot;, &quot;values&quot;: [&quot;user-key-123abc&quot;] }, { &quot;contextKind&quot;: &quot;device&quot;, &quot;variationId&quot;: &quot;e5830889-1ec5-4b0c-9cc9-c48790090c43&quot;, &quot;values&quot;: [&quot;device-key-456def&quot;] } ] } ] } &#x60;&#x60;&#x60; #### updateClause Replaces the clause indicated by &#x60;ruleId&#x60; and &#x60;clauseId&#x60; with &#x60;clause&#x60;. ##### Parameters - &#x60;ruleId&#x60;: ID of a rule. - &#x60;clauseId&#x60;: ID of a clause in that rule. - &#x60;clause&#x60;: New &#x60;clause&#x60; object, with &#x60;contextKind&#x60; (string), &#x60;attribute&#x60; (string), &#x60;op&#x60; (string), &#x60;negate&#x60; (boolean), and &#x60;values&#x60; (array of strings, numbers, or dates) properties. The &#x60;contextKind&#x60;, &#x60;attribute&#x60;, and &#x60;values&#x60; are case sensitive. The &#x60;op&#x60; must be lower-case. Here&#39;s an example: &#x60;&#x60;&#x60;json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;updateClause&quot;, &quot;ruleId&quot;: &quot;a902ef4a-2faf-4eaf-88e1-ecc356708a29&quot;, &quot;clauseId&quot;: &quot;10c7462a-2062-45ba-a8bb-dfb3de0f8af5&quot;, &quot;clause&quot;: { &quot;contextKind&quot;: &quot;user&quot;, &quot;attribute&quot;: &quot;country&quot;, &quot;op&quot;: &quot;in&quot;, &quot;negate&quot;: false, &quot;values&quot;: [&quot;Mexico&quot;, &quot;Canada&quot;] } }] } &#x60;&#x60;&#x60; #### updateDefaultVariation Updates the default on or off variation of the AI Config. ##### Parameters - &#x60;onVariationValue&#x60;: (Optional) The value of the variation of the new on variation. - &#x60;offVariationValue&#x60;: (Optional) The value of the variation of the new off variation Here&#39;s an example: &#x60;&#x60;&#x60;json { &quot;instructions&quot;: [ { &quot;kind&quot;: &quot;updateDefaultVariation&quot;, &quot;OnVariationValue&quot;: true, &quot;OffVariationValue&quot;: false } ] } &#x60;&#x60;&#x60; #### updateFallthroughVariationOrRollout Updates the default or &quot;fallthrough&quot; rule for the AI Config, which the AI Config serves when a context matches none of the targeting rules. The rule can serve either the variation that &#x60;variationId&#x60; indicates, or a percentage rollout that &#x60;rolloutWeights&#x60; and &#x60;rolloutBucketBy&#x60; indicate. ##### Parameters - &#x60;variationId&#x60;: ID of a variation. or - &#x60;rolloutWeights&#x60;: Map of &#x60;variationId&#x60; to weight, in thousandths of a percent (0-100000). - &#x60;rolloutBucketBy&#x60;: (Optional) Context attribute available in the specified &#x60;rolloutContextKind&#x60;. - &#x60;rolloutContextKind&#x60;: (Optional) Context kind, defaults to &#x60;user&#x60; Here&#39;s an example that uses a &#x60;variationId&#x60;: &#x60;&#x60;&#x60;json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;updateFallthroughVariationOrRollout&quot;, &quot;variationId&quot;: &quot;2f43f67c-3e4e-4945-a18a-26559378ca00&quot; }] } &#x60;&#x60;&#x60; Here&#39;s an example that uses a percentage rollout: &#x60;&#x60;&#x60;json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;updateFallthroughVariationOrRollout&quot;, &quot;rolloutContextKind&quot;: &quot;user&quot;, &quot;rolloutWeights&quot;: { &quot;2f43f67c-3e4e-4945-a18a-26559378ca00&quot;: 15000, // serve 15% this variation &quot;e5830889-1ec5-4b0c-9cc9-c48790090c43&quot;: 85000 // serve 85% this variation } }] } &#x60;&#x60;&#x60; #### updateOffVariation Updates the default off variation to &#x60;variationId&#x60;. The AI Config serves the default off variation when the AI Config&#39;s targeting is Off. ##### Parameters - &#x60;variationId&#x60;: ID of a variation. Here&#39;s an example: &#x60;&#x60;&#x60;json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [ { &quot;kind&quot;: &quot;updateOffVariation&quot;, &quot;variationId&quot;: &quot;2f43f67c-3e4e-4945-a18a-26559378ca00&quot; } ] } &#x60;&#x60;&#x60; #### updateRuleDescription Updates the description of the targeting rule. ##### Parameters - &#x60;description&#x60;: The new human-readable description for this rule. - &#x60;ruleId&#x60;: The ID of the rule. You can retrieve this by making a GET request for the AI Config. Here&#39;s an example: &#x60;&#x60;&#x60;json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;updateRuleDescription&quot;, &quot;description&quot;: &quot;New rule description&quot;, &quot;ruleId&quot;: &quot;a902ef4a-2faf-4eaf-88e1-ecc356708a29&quot; }] } &#x60;&#x60;&#x60; #### updateRuleTrackEvents Updates whether or not LaunchDarkly tracks events for the AI Config associated with this rule. ##### Parameters - &#x60;ruleId&#x60;: The ID of the rule. You can retrieve this by making a GET request for the AI Config. - &#x60;trackEvents&#x60;: Whether or not events are tracked. Here&#39;s an example: &#x60;&#x60;&#x60;json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;updateRuleTrackEvents&quot;, &quot;ruleId&quot;: &quot;a902ef4a-2faf-4eaf-88e1-ecc356708a29&quot;, &quot;trackEvents&quot;: true }] } &#x60;&#x60;&#x60; #### updateRuleVariationOrRollout Updates what &#x60;ruleId&#x60; serves when its clauses evaluate to true. The rule can serve either the variation that &#x60;variationId&#x60; indicates, or a percent rollout that &#x60;rolloutWeights&#x60; and &#x60;rolloutBucketBy&#x60; indicate. ##### Parameters - &#x60;ruleId&#x60;: ID of a rule. - &#x60;variationId&#x60;: ID of a variation. or - &#x60;rolloutWeights&#x60;: Map of &#x60;variationId&#x60; to weight, in thousandths of a percent (0-100000). - &#x60;rolloutBucketBy&#x60;: (Optional) Context attribute available in the specified &#x60;rolloutContextKind&#x60;. - &#x60;rolloutContextKind&#x60;: (Optional) Context kind, defaults to &#x60;user&#x60; Here&#39;s an example: &#x60;&#x60;&#x60;json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;updateRuleVariationOrRollout&quot;, &quot;ruleId&quot;: &quot;a902ef4a-2faf-4eaf-88e1-ecc356708a29&quot;, &quot;variationId&quot;: &quot;2f43f67c-3e4e-4945-a18a-26559378ca00&quot; }] } &#x60;&#x60;&#x60; #### updateTrackEvents Updates whether or not LaunchDarkly tracks events for the AI Config, for all rules. ##### Parameters - &#x60;trackEvents&#x60;: Whether or not events are tracked. Here&#39;s an example: &#x60;&#x60;&#x60;json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [ { &quot;kind&quot;: &quot;updateTrackEvents&quot;, &quot;trackEvents&quot;: true } ] } &#x60;&#x60;&#x60; #### updateTrackEventsFallthrough Updates whether or not LaunchDarkly tracks events for the AI Config, for the default rule. ##### Parameters - &#x60;trackEvents&#x60;: Whether or not events are tracked. Here&#39;s an example: &#x60;&#x60;&#x60;json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [ { &quot;kind&quot;: &quot;updateTrackEventsFallthrough&quot;, &quot;trackEvents&quot;: true } ] } &#x60;&#x60;&#x60; &lt;/details&gt;

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • config_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(AIConfigTargeting, Integer, Hash)>)

    AIConfigTargeting data, response status code and response headers



1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 1504

def patch_ai_config_targeting_with_http_info(ld_api_version, project_key, config_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIConfigsBetaApi.patch_ai_config_targeting ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling AIConfigsBetaApi.patch_ai_config_targeting"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AIConfigsBetaApi.patch_ai_config_targeting"
  end
  # verify the required parameter 'config_key' is set
  if @api_client.config.client_side_validation && config_key.nil?
    fail ArgumentError, "Missing the required parameter 'config_key' when calling AIConfigsBetaApi.patch_ai_config_targeting"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/{configKey}/targeting'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'configKey' + '}', CGI.escape(config_key.to_s))

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

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

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

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

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

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

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

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

#patch_ai_config_variation(ld_api_version, project_key, config_key, variation_key, opts = {}) ⇒ AIConfigVariation

Update AI Config variation Edit an existing variation of an AI Config. This creates a new version of the variation. The request body must be a JSON object of the fields to update. The values you include replace the existing values for the fields. Here’s an example: “‘ { "messages": [ { "role": "system", "content": "The new message" } ] } “`

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • config_key (String)
  • variation_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



1580
1581
1582
1583
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 1580

def patch_ai_config_variation(ld_api_version, project_key, config_key, variation_key, opts = {})
  data, _status_code, _headers = patch_ai_config_variation_with_http_info(ld_api_version, project_key, config_key, variation_key, opts)
  data
end

#patch_ai_config_variation_with_http_info(ld_api_version, project_key, config_key, variation_key, opts = {}) ⇒ Array<(AIConfigVariation, Integer, Hash)>

Update AI Config variation Edit an existing variation of an AI Config. This creates a new version of the variation. The request body must be a JSON object of the fields to update. The values you include replace the existing values for the fields. Here&#39;s an example: &#x60;&#x60;&#x60; { &quot;messages&quot;: [ { &quot;role&quot;: &quot;system&quot;, &quot;content&quot;: &quot;The new message&quot; } ] } &#x60;&#x60;&#x60;

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • config_key (String)
  • variation_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(AIConfigVariation, Integer, Hash)>)

    AIConfigVariation data, response status code and response headers



1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 1594

def patch_ai_config_variation_with_http_info(ld_api_version, project_key, config_key, variation_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIConfigsBetaApi.patch_ai_config_variation ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling AIConfigsBetaApi.patch_ai_config_variation"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AIConfigsBetaApi.patch_ai_config_variation"
  end
  # verify the required parameter 'config_key' is set
  if @api_client.config.client_side_validation && config_key.nil?
    fail ArgumentError, "Missing the required parameter 'config_key' when calling AIConfigsBetaApi.patch_ai_config_variation"
  end
  # verify the required parameter 'variation_key' is set
  if @api_client.config.client_side_validation && variation_key.nil?
    fail ArgumentError, "Missing the required parameter 'variation_key' when calling AIConfigsBetaApi.patch_ai_config_variation"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/{configKey}/variations/{variationKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'configKey' + '}', CGI.escape(config_key.to_s)).sub('{' + 'variationKey' + '}', CGI.escape(variation_key.to_s))

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

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

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

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

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

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

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

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

#patch_ai_config_with_http_info(ld_api_version, project_key, config_key, opts = {}) ⇒ Array<(AIConfig, Integer, Hash)>

Update AI Config Edit an existing AI Config. The request body must be a JSON object of the fields to update. The values you include replace the existing values for the fields. Here&#39;s an example: &#x60;&#x60;&#x60; { &quot;description&quot;: &quot;Example updated description&quot;, &quot;tags&quot;: [&quot;new-tag&quot;] } &#x60;&#x60;&#x60;

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • config_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :ai_config_patch (AIConfigPatch)

    AI Config object to update

Returns:

  • (Array<(AIConfig, Integer, Hash)>)

    AIConfig data, response status code and response headers



1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 1416

def patch_ai_config_with_http_info(ld_api_version, project_key, config_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIConfigsBetaApi.patch_ai_config ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling AIConfigsBetaApi.patch_ai_config"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AIConfigsBetaApi.patch_ai_config"
  end
  # verify the required parameter 'config_key' is set
  if @api_client.config.client_side_validation && config_key.nil?
    fail ArgumentError, "Missing the required parameter 'config_key' when calling AIConfigsBetaApi.patch_ai_config"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/{configKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'configKey' + '}', CGI.escape(config_key.to_s))

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

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

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

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

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

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

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

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

#patch_ai_tool(ld_api_version, project_key, tool_key, opts = {}) ⇒ AITool

Update AI tool Edit an existing AI tool.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • tool_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :ai_tool_patch (AIToolPatch)

    AI tool object to update

Returns:



1673
1674
1675
1676
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 1673

def patch_ai_tool(ld_api_version, project_key, tool_key, opts = {})
  data, _status_code, _headers = patch_ai_tool_with_http_info(ld_api_version, project_key, tool_key, opts)
  data
end

#patch_ai_tool_with_http_info(ld_api_version, project_key, tool_key, opts = {}) ⇒ Array<(AITool, Integer, Hash)>

Update AI tool Edit an existing AI tool.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • tool_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :ai_tool_patch (AIToolPatch)

    AI tool object to update

Returns:

  • (Array<(AITool, Integer, Hash)>)

    AITool data, response status code and response headers



1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 1686

def patch_ai_tool_with_http_info(ld_api_version, project_key, tool_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIConfigsBetaApi.patch_ai_tool ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling AIConfigsBetaApi.patch_ai_tool"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AIConfigsBetaApi.patch_ai_tool"
  end
  # verify the required parameter 'tool_key' is set
  if @api_client.config.client_side_validation && tool_key.nil?
    fail ArgumentError, "Missing the required parameter 'tool_key' when calling AIConfigsBetaApi.patch_ai_tool"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-tools/{toolKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'toolKey' + '}', CGI.escape(tool_key.to_s))

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

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

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

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

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

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

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

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

#post_ai_config(ld_api_version, project_key, ai_config_post, opts = {}) ⇒ AIConfig

Create new AI Config Create a new AI Config within the given project.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • ai_config_post (AIConfigPost)

    AI Config object to create

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

    the optional parameters

Returns:



1760
1761
1762
1763
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 1760

def post_ai_config(ld_api_version, project_key, ai_config_post, opts = {})
  data, _status_code, _headers = post_ai_config_with_http_info(ld_api_version, project_key, ai_config_post, opts)
  data
end

#post_ai_config_variation(ld_api_version, project_key, config_key, ai_config_variation_post, opts = {}) ⇒ AIConfigVariation

Create AI Config variation Create a new variation for a given AI Config. The model in the request body requires a modelName and parameters, for example: “‘ "model": { "modelName": "claude-3-opus-20240229", "parameters": { "max_tokens": 1024 } } “`

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • config_key (String)
  • ai_config_variation_post (AIConfigVariationPost)

    AI Config variation object to create

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

    the optional parameters

Returns:



1847
1848
1849
1850
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 1847

def post_ai_config_variation(ld_api_version, project_key, config_key, ai_config_variation_post, opts = {})
  data, _status_code, _headers = post_ai_config_variation_with_http_info(ld_api_version, project_key, config_key, ai_config_variation_post, opts)
  data
end

#post_ai_config_variation_with_http_info(ld_api_version, project_key, config_key, ai_config_variation_post, opts = {}) ⇒ Array<(AIConfigVariation, Integer, Hash)>

Create AI Config variation Create a new variation for a given AI Config. The &lt;code&gt;model&lt;/code&gt; in the request body requires a &lt;code&gt;modelName&lt;/code&gt; and &lt;code&gt;parameters&lt;/code&gt;, for example: &#x60;&#x60;&#x60; &quot;model&quot;: { &quot;modelName&quot;: &quot;claude-3-opus-20240229&quot;, &quot;parameters&quot;: { &quot;max_tokens&quot;: 1024 } } &#x60;&#x60;&#x60;

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • config_key (String)
  • ai_config_variation_post (AIConfigVariationPost)

    AI Config variation object to create

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

    the optional parameters

Returns:

  • (Array<(AIConfigVariation, Integer, Hash)>)

    AIConfigVariation data, response status code and response headers



1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 1860

def post_ai_config_variation_with_http_info(ld_api_version, project_key, config_key, ai_config_variation_post, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIConfigsBetaApi.post_ai_config_variation ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling AIConfigsBetaApi.post_ai_config_variation"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AIConfigsBetaApi.post_ai_config_variation"
  end
  # verify the required parameter 'config_key' is set
  if @api_client.config.client_side_validation && config_key.nil?
    fail ArgumentError, "Missing the required parameter 'config_key' when calling AIConfigsBetaApi.post_ai_config_variation"
  end
  # verify the required parameter 'ai_config_variation_post' is set
  if @api_client.config.client_side_validation && ai_config_variation_post.nil?
    fail ArgumentError, "Missing the required parameter 'ai_config_variation_post' when calling AIConfigsBetaApi.post_ai_config_variation"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/{configKey}/variations'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'configKey' + '}', CGI.escape(config_key.to_s))

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

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

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

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

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

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

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

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

#post_ai_config_with_http_info(ld_api_version, project_key, ai_config_post, opts = {}) ⇒ Array<(AIConfig, Integer, Hash)>

Create new AI Config Create a new AI Config within the given project.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • ai_config_post (AIConfigPost)

    AI Config object to create

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

    the optional parameters

Returns:

  • (Array<(AIConfig, Integer, Hash)>)

    AIConfig data, response status code and response headers



1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 1772

def post_ai_config_with_http_info(ld_api_version, project_key, ai_config_post, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIConfigsBetaApi.post_ai_config ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling AIConfigsBetaApi.post_ai_config"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AIConfigsBetaApi.post_ai_config"
  end
  # verify the required parameter 'ai_config_post' is set
  if @api_client.config.client_side_validation && ai_config_post.nil?
    fail ArgumentError, "Missing the required parameter 'ai_config_post' when calling AIConfigsBetaApi.post_ai_config"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s))

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

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

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

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

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

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

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

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

#post_ai_tool(ld_api_version, project_key, ai_tool_post, opts = {}) ⇒ AITool

Create an AI tool Create an AI tool

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • ai_tool_post (AIToolPost)

    AI tool object to create

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

    the optional parameters

Returns:



1938
1939
1940
1941
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 1938

def post_ai_tool(ld_api_version, project_key, ai_tool_post, opts = {})
  data, _status_code, _headers = post_ai_tool_with_http_info(ld_api_version, project_key, ai_tool_post, opts)
  data
end

#post_ai_tool_with_http_info(ld_api_version, project_key, ai_tool_post, opts = {}) ⇒ Array<(AITool, Integer, Hash)>

Create an AI tool Create an AI tool

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • ai_tool_post (AIToolPost)

    AI tool object to create

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

    the optional parameters

Returns:

  • (Array<(AITool, Integer, Hash)>)

    AITool data, response status code and response headers



1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 1950

def post_ai_tool_with_http_info(ld_api_version, project_key, ai_tool_post, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIConfigsBetaApi.post_ai_tool ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling AIConfigsBetaApi.post_ai_tool"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AIConfigsBetaApi.post_ai_tool"
  end
  # verify the required parameter 'ai_tool_post' is set
  if @api_client.config.client_side_validation && ai_tool_post.nil?
    fail ArgumentError, "Missing the required parameter 'ai_tool_post' when calling AIConfigsBetaApi.post_ai_tool"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-tools'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s))

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

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

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

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

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

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

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

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

#post_model_config(ld_api_version, project_key, model_config_post, opts = {}) ⇒ ModelConfig

Create an AI model config Create an AI model config. You can use this in any variation for any AI Config in your project.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • model_config_post (ModelConfigPost)

    AI model config object to create

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

    the optional parameters

Returns:



2024
2025
2026
2027
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 2024

def post_model_config(ld_api_version, project_key, model_config_post, opts = {})
  data, _status_code, _headers = post_model_config_with_http_info(ld_api_version, project_key, model_config_post, opts)
  data
end

#post_model_config_with_http_info(ld_api_version, project_key, model_config_post, opts = {}) ⇒ Array<(ModelConfig, Integer, Hash)>

Create an AI model config Create an AI model config. You can use this in any variation for any AI Config in your project.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • model_config_post (ModelConfigPost)

    AI model config object to create

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

    the optional parameters

Returns:

  • (Array<(ModelConfig, Integer, Hash)>)

    ModelConfig data, response status code and response headers



2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 2036

def post_model_config_with_http_info(ld_api_version, project_key, model_config_post, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIConfigsBetaApi.post_model_config ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling AIConfigsBetaApi.post_model_config"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AIConfigsBetaApi.post_model_config"
  end
  # verify the required parameter 'model_config_post' is set
  if @api_client.config.client_side_validation && model_config_post.nil?
    fail ArgumentError, "Missing the required parameter 'model_config_post' when calling AIConfigsBetaApi.post_model_config"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/model-configs'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s))

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

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

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

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

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

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

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

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

#post_restricted_models(ld_api_version, project_key, restricted_models_request, opts = {}) ⇒ RestrictedModelsResponse

Add AI models to the restricted list Add AI models, by key, to the restricted list. Keys are included in the response from the [List AI model configs](launchdarkly.com/docs/api/ai-configs-beta/list-model-configs) endpoint.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • restricted_models_request (RestrictedModelsRequest)

    List of AI model keys to add to the restricted list.

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

    the optional parameters

Returns:



2110
2111
2112
2113
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 2110

def post_restricted_models(ld_api_version, project_key, restricted_models_request, opts = {})
  data, _status_code, _headers = post_restricted_models_with_http_info(ld_api_version, project_key, restricted_models_request, opts)
  data
end

#post_restricted_models_with_http_info(ld_api_version, project_key, restricted_models_request, opts = {}) ⇒ Array<(RestrictedModelsResponse, Integer, Hash)>

Add AI models to the restricted list Add AI models, by key, to the restricted list. Keys are included in the response from the [List AI model configs](launchdarkly.com/docs/api/ai-configs-beta/list-model-configs) endpoint.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • restricted_models_request (RestrictedModelsRequest)

    List of AI model keys to add to the restricted list.

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

    the optional parameters

Returns:

  • (Array<(RestrictedModelsResponse, Integer, Hash)>)

    RestrictedModelsResponse data, response status code and response headers



2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
# File 'lib/launchdarkly_api/api/ai_configs_beta_api.rb', line 2122

def post_restricted_models_with_http_info(ld_api_version, project_key, restricted_models_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIConfigsBetaApi.post_restricted_models ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling AIConfigsBetaApi.post_restricted_models"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AIConfigsBetaApi.post_restricted_models"
  end
  # verify the required parameter 'restricted_models_request' is set
  if @api_client.config.client_side_validation && restricted_models_request.nil?
    fail ArgumentError, "Missing the required parameter 'restricted_models_request' when calling AIConfigsBetaApi.post_restricted_models"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/model-configs/restricted'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s))

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

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

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

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

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

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

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

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