Class: LaunchDarklyApi::ExperimentsBetaApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ExperimentsBetaApi

Returns a new instance of ExperimentsBetaApi.



19
20
21
# File 'lib/launchdarkly_api/api/experiments_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/experiments_beta_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_experiment(project_key, environment_key, experiment_post, opts = {}) ⇒ ExperimentRep

Create experiment Create an experiment

Parameters:

  • project_key (String)

    The project key

  • environment_key (String)

    The environment key

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

    the optional parameters

Returns:



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

def create_experiment(project_key, environment_key, experiment_post, opts = {})
  data, _status_code, _headers = create_experiment_with_http_info(project_key, environment_key, experiment_post, opts)
  data
end

#create_experiment_with_http_info(project_key, environment_key, experiment_post, opts = {}) ⇒ Array<(ExperimentRep, Integer, Hash)>

Create experiment Create an experiment

Parameters:

  • project_key (String)

    The project key

  • environment_key (String)

    The environment key

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

    the optional parameters

Returns:

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

    ExperimentRep data, 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
# File 'lib/launchdarkly_api/api/experiments_beta_api.rb', line 41

def create_experiment_with_http_info(project_key, environment_key, experiment_post, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ExperimentsBetaApi.create_experiment ...'
  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 ExperimentsBetaApi.create_experiment"
  end
  # verify the required parameter 'environment_key' is set
  if @api_client.config.client_side_validation && environment_key.nil?
    fail ArgumentError, "Missing the required parameter 'environment_key' when calling ExperimentsBetaApi.create_experiment"
  end
  # verify the required parameter 'experiment_post' is set
  if @api_client.config.client_side_validation && experiment_post.nil?
    fail ArgumentError, "Missing the required parameter 'experiment_post' when calling ExperimentsBetaApi.create_experiment"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/environments/{environmentKey}/experiments'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_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

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

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

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

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

  new_options = opts.merge(
    :operation => :"ExperimentsBetaApi.create_experiment",
    :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: ExperimentsBetaApi#create_experiment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_iteration(project_key, environment_key, experiment_key, iteration_input, opts = {}) ⇒ IterationRep

Create iteration Create an experiment iteration

Parameters:

  • project_key (String)

    The project key

  • environment_key (String)

    The environment key

  • experiment_key (String)

    The experiment key

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

    the optional parameters

Returns:



110
111
112
113
# File 'lib/launchdarkly_api/api/experiments_beta_api.rb', line 110

def create_iteration(project_key, environment_key, experiment_key, iteration_input, opts = {})
  data, _status_code, _headers = create_iteration_with_http_info(project_key, environment_key, experiment_key, iteration_input, opts)
  data
end

#create_iteration_with_http_info(project_key, environment_key, experiment_key, iteration_input, opts = {}) ⇒ Array<(IterationRep, Integer, Hash)>

Create iteration Create an experiment iteration

Parameters:

  • project_key (String)

    The project key

  • environment_key (String)

    The environment key

  • experiment_key (String)

    The experiment key

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

    the optional parameters

Returns:

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

    IterationRep data, response status code and response headers



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

def create_iteration_with_http_info(project_key, environment_key, experiment_key, iteration_input, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ExperimentsBetaApi.create_iteration ...'
  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 ExperimentsBetaApi.create_iteration"
  end
  # verify the required parameter 'environment_key' is set
  if @api_client.config.client_side_validation && environment_key.nil?
    fail ArgumentError, "Missing the required parameter 'environment_key' when calling ExperimentsBetaApi.create_iteration"
  end
  # verify the required parameter 'experiment_key' is set
  if @api_client.config.client_side_validation && experiment_key.nil?
    fail ArgumentError, "Missing the required parameter 'experiment_key' when calling ExperimentsBetaApi.create_iteration"
  end
  # verify the required parameter 'iteration_input' is set
  if @api_client.config.client_side_validation && iteration_input.nil?
    fail ArgumentError, "Missing the required parameter 'iteration_input' when calling ExperimentsBetaApi.create_iteration"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/environments/{environmentKey}/experiments/{experimentKey}/iterations'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)).sub('{' + 'experimentKey' + '}', CGI.escape(experiment_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

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

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

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

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

  new_options = opts.merge(
    :operation => :"ExperimentsBetaApi.create_iteration",
    :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: ExperimentsBetaApi#create_iteration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_experiment(project_key, environment_key, experiment_key, opts = {}) ⇒ ExperimentRep

Get experiment Get details about an experiment

Parameters:

  • project_key (String)

    The project key

  • environment_key (String)

    The environment key

  • experiment_key (String)

    The experiment key

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

    the optional parameters

Returns:



195
196
197
198
# File 'lib/launchdarkly_api/api/experiments_beta_api.rb', line 195

def get_experiment(project_key, environment_key, experiment_key, opts = {})
  data, _status_code, _headers = get_experiment_with_http_info(project_key, environment_key, experiment_key, opts)
  data
end

#get_experiment_results(project_key, environment_key, experiment_key, metric_key, opts = {}) ⇒ ExperimentResults

Get experiment results Get results from an experiment for a particular metric

Parameters:

  • project_key (String)

    The project key

  • environment_key (String)

    The environment key

  • experiment_key (String)

    The experiment key

  • metric_key (String)

    The metric key

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

    the optional parameters

Returns:



271
272
273
274
# File 'lib/launchdarkly_api/api/experiments_beta_api.rb', line 271

def get_experiment_results(project_key, environment_key, experiment_key, metric_key, opts = {})
  data, _status_code, _headers = get_experiment_results_with_http_info(project_key, environment_key, experiment_key, metric_key, opts)
  data
end

#get_experiment_results_with_http_info(project_key, environment_key, experiment_key, metric_key, opts = {}) ⇒ Array<(ExperimentResults, Integer, Hash)>

Get experiment results Get results from an experiment for a particular metric

Parameters:

  • project_key (String)

    The project key

  • environment_key (String)

    The environment key

  • experiment_key (String)

    The experiment key

  • metric_key (String)

    The metric key

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

    the optional parameters

Returns:

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

    ExperimentResults data, response status code and response headers



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

def get_experiment_results_with_http_info(project_key, environment_key, experiment_key, metric_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ExperimentsBetaApi.get_experiment_results ...'
  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 ExperimentsBetaApi.get_experiment_results"
  end
  # verify the required parameter 'environment_key' is set
  if @api_client.config.client_side_validation && environment_key.nil?
    fail ArgumentError, "Missing the required parameter 'environment_key' when calling ExperimentsBetaApi.get_experiment_results"
  end
  # verify the required parameter 'experiment_key' is set
  if @api_client.config.client_side_validation && experiment_key.nil?
    fail ArgumentError, "Missing the required parameter 'experiment_key' when calling ExperimentsBetaApi.get_experiment_results"
  end
  # verify the required parameter 'metric_key' is set
  if @api_client.config.client_side_validation && metric_key.nil?
    fail ArgumentError, "Missing the required parameter 'metric_key' when calling ExperimentsBetaApi.get_experiment_results"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/environments/{environmentKey}/experiments/{experimentKey}/metrics/{metricKey}/results'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)).sub('{' + 'experimentKey' + '}', CGI.escape(experiment_key.to_s)).sub('{' + 'metricKey' + '}', CGI.escape(metric_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'])

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

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

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

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

  new_options = opts.merge(
    :operation => :"ExperimentsBetaApi.get_experiment_results",
    :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: ExperimentsBetaApi#get_experiment_results\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_experiment_with_http_info(project_key, environment_key, experiment_key, opts = {}) ⇒ Array<(ExperimentRep, Integer, Hash)>

Get experiment Get details about an experiment

Parameters:

  • project_key (String)

    The project key

  • environment_key (String)

    The environment key

  • experiment_key (String)

    The experiment key

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

    the optional parameters

Returns:

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

    ExperimentRep data, response status code and response headers



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

def get_experiment_with_http_info(project_key, environment_key, experiment_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ExperimentsBetaApi.get_experiment ...'
  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 ExperimentsBetaApi.get_experiment"
  end
  # verify the required parameter 'environment_key' is set
  if @api_client.config.client_side_validation && environment_key.nil?
    fail ArgumentError, "Missing the required parameter 'environment_key' when calling ExperimentsBetaApi.get_experiment"
  end
  # verify the required parameter 'experiment_key' is set
  if @api_client.config.client_side_validation && experiment_key.nil?
    fail ArgumentError, "Missing the required parameter 'experiment_key' when calling ExperimentsBetaApi.get_experiment"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/environments/{environmentKey}/experiments/{experimentKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)).sub('{' + 'experimentKey' + '}', CGI.escape(experiment_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'])

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

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

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

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

  new_options = opts.merge(
    :operation => :"ExperimentsBetaApi.get_experiment",
    :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: ExperimentsBetaApi#get_experiment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_experiments(project_key, environment_key, opts = {}) ⇒ ExperimentCollectionRep

Get experiments Get details about all experiments in an environment

Parameters:

  • project_key (String)

    The project key

  • environment_key (String)

    The environment key

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

    the optional parameters

Returns:



350
351
352
353
# File 'lib/launchdarkly_api/api/experiments_beta_api.rb', line 350

def get_experiments(project_key, environment_key, opts = {})
  data, _status_code, _headers = get_experiments_with_http_info(project_key, environment_key, opts)
  data
end

#get_experiments_with_http_info(project_key, environment_key, opts = {}) ⇒ Array<(ExperimentCollectionRep, Integer, Hash)>

Get experiments Get details about all experiments in an environment

Parameters:

  • project_key (String)

    The project key

  • environment_key (String)

    The environment key

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

    the optional parameters

Returns:

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

    ExperimentCollectionRep data, response status code and response headers



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

def get_experiments_with_http_info(project_key, environment_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ExperimentsBetaApi.get_experiments ...'
  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 ExperimentsBetaApi.get_experiments"
  end
  # verify the required parameter 'environment_key' is set
  if @api_client.config.client_side_validation && environment_key.nil?
    fail ArgumentError, "Missing the required parameter 'environment_key' when calling ExperimentsBetaApi.get_experiments"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/environments/{environmentKey}/experiments'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_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'])

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

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

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

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

  new_options = opts.merge(
    :operation => :"ExperimentsBetaApi.get_experiments",
    :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: ExperimentsBetaApi#get_experiments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_legacy_experiment_results(project_key, feature_flag_key, environment_key, metric_key, opts = {}) ⇒ ExperimentResults

Get legacy experiment results (deprecated) Get detailed experiment result data for legacy experiments

Parameters:

  • project_key (String)

    The project key

  • feature_flag_key (String)

    The feature flag key

  • environment_key (String)

    The environment key

  • metric_key (String)

    The metric key

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

    the optional parameters

Options Hash (opts):

  • :from (Integer)

    A timestamp denoting the start of the data collection period, expressed as a Unix epoch time in milliseconds.

  • :to (Integer)

    A timestamp denoting the end of the data collection period, expressed as a Unix epoch time in milliseconds.

Returns:



423
424
425
426
# File 'lib/launchdarkly_api/api/experiments_beta_api.rb', line 423

def get_legacy_experiment_results(project_key, feature_flag_key, environment_key, metric_key, opts = {})
  data, _status_code, _headers = get_legacy_experiment_results_with_http_info(project_key, feature_flag_key, environment_key, metric_key, opts)
  data
end

#get_legacy_experiment_results_with_http_info(project_key, feature_flag_key, environment_key, metric_key, opts = {}) ⇒ Array<(ExperimentResults, Integer, Hash)>

Get legacy experiment results (deprecated) Get detailed experiment result data for legacy experiments

Parameters:

  • project_key (String)

    The project key

  • feature_flag_key (String)

    The feature flag key

  • environment_key (String)

    The environment key

  • metric_key (String)

    The metric key

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

    the optional parameters

Options Hash (opts):

  • :from (Integer)

    A timestamp denoting the start of the data collection period, expressed as a Unix epoch time in milliseconds.

  • :to (Integer)

    A timestamp denoting the end of the data collection period, expressed as a Unix epoch time in milliseconds.

Returns:

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

    ExperimentResults data, response status code and response headers



438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
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
# File 'lib/launchdarkly_api/api/experiments_beta_api.rb', line 438

def get_legacy_experiment_results_with_http_info(project_key, feature_flag_key, environment_key, metric_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ExperimentsBetaApi.get_legacy_experiment_results ...'
  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 ExperimentsBetaApi.get_legacy_experiment_results"
  end
  # verify the required parameter 'feature_flag_key' is set
  if @api_client.config.client_side_validation && feature_flag_key.nil?
    fail ArgumentError, "Missing the required parameter 'feature_flag_key' when calling ExperimentsBetaApi.get_legacy_experiment_results"
  end
  # verify the required parameter 'environment_key' is set
  if @api_client.config.client_side_validation && environment_key.nil?
    fail ArgumentError, "Missing the required parameter 'environment_key' when calling ExperimentsBetaApi.get_legacy_experiment_results"
  end
  # verify the required parameter 'metric_key' is set
  if @api_client.config.client_side_validation && metric_key.nil?
    fail ArgumentError, "Missing the required parameter 'metric_key' when calling ExperimentsBetaApi.get_legacy_experiment_results"
  end
  # resource path
  local_var_path = '/api/v2/flags/{projectKey}/{featureFlagKey}/experiments/{environmentKey}/{metricKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'featureFlagKey' + '}', CGI.escape(feature_flag_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)).sub('{' + 'metricKey' + '}', CGI.escape(metric_key.to_s))

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

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

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

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

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

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

  new_options = opts.merge(
    :operation => :"ExperimentsBetaApi.get_legacy_experiment_results",
    :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: ExperimentsBetaApi#get_legacy_experiment_results\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#patch_experiment(project_key, environment_key, experiment_key, experiment_patch_input, opts = {}) ⇒ ExperimentRep

Patch experiment Patch an Experiment

Parameters:

  • project_key (String)

    The project key

  • environment_key (String)

    The environment key

  • experiment_key (String)

    The experiment key

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

    the optional parameters

Returns:



508
509
510
511
# File 'lib/launchdarkly_api/api/experiments_beta_api.rb', line 508

def patch_experiment(project_key, environment_key, experiment_key, experiment_patch_input, opts = {})
  data, _status_code, _headers = patch_experiment_with_http_info(project_key, environment_key, experiment_key, experiment_patch_input, opts)
  data
end

#patch_experiment_with_http_info(project_key, environment_key, experiment_key, experiment_patch_input, opts = {}) ⇒ Array<(ExperimentRep, Integer, Hash)>

Patch experiment Patch an Experiment

Parameters:

  • project_key (String)

    The project key

  • environment_key (String)

    The environment key

  • experiment_key (String)

    The experiment key

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

    the optional parameters

Returns:

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

    ExperimentRep data, response status code and response headers



521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
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
# File 'lib/launchdarkly_api/api/experiments_beta_api.rb', line 521

def patch_experiment_with_http_info(project_key, environment_key, experiment_key, experiment_patch_input, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ExperimentsBetaApi.patch_experiment ...'
  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 ExperimentsBetaApi.patch_experiment"
  end
  # verify the required parameter 'environment_key' is set
  if @api_client.config.client_side_validation && environment_key.nil?
    fail ArgumentError, "Missing the required parameter 'environment_key' when calling ExperimentsBetaApi.patch_experiment"
  end
  # verify the required parameter 'experiment_key' is set
  if @api_client.config.client_side_validation && experiment_key.nil?
    fail ArgumentError, "Missing the required parameter 'experiment_key' when calling ExperimentsBetaApi.patch_experiment"
  end
  # verify the required parameter 'experiment_patch_input' is set
  if @api_client.config.client_side_validation && experiment_patch_input.nil?
    fail ArgumentError, "Missing the required parameter 'experiment_patch_input' when calling ExperimentsBetaApi.patch_experiment"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/environments/{environmentKey}/experiments/{experimentKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)).sub('{' + 'experimentKey' + '}', CGI.escape(experiment_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

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

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

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

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

  new_options = opts.merge(
    :operation => :"ExperimentsBetaApi.patch_experiment",
    :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: ExperimentsBetaApi#patch_experiment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#reset_experiment(project_key, feature_flag_key, environment_key, metric_key, opts = {}) ⇒ nil

Reset experiment results Reset all experiment results by deleting all existing data for an experiment

Parameters:

  • project_key (String)

    The project key

  • feature_flag_key (String)

    The feature flag key

  • environment_key (String)

    The environment key

  • metric_key (String)

    The metric&#39;s key

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

    the optional parameters

Returns:

  • (nil)


594
595
596
597
# File 'lib/launchdarkly_api/api/experiments_beta_api.rb', line 594

def reset_experiment(project_key, feature_flag_key, environment_key, metric_key, opts = {})
  reset_experiment_with_http_info(project_key, feature_flag_key, environment_key, metric_key, opts)
  nil
end

#reset_experiment_with_http_info(project_key, feature_flag_key, environment_key, metric_key, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Reset experiment results Reset all experiment results by deleting all existing data for an experiment

Parameters:

  • project_key (String)

    The project key

  • feature_flag_key (String)

    The feature flag key

  • environment_key (String)

    The environment key

  • metric_key (String)

    The metric&#39;s key

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
# File 'lib/launchdarkly_api/api/experiments_beta_api.rb', line 607

def reset_experiment_with_http_info(project_key, feature_flag_key, environment_key, metric_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ExperimentsBetaApi.reset_experiment ...'
  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 ExperimentsBetaApi.reset_experiment"
  end
  # verify the required parameter 'feature_flag_key' is set
  if @api_client.config.client_side_validation && feature_flag_key.nil?
    fail ArgumentError, "Missing the required parameter 'feature_flag_key' when calling ExperimentsBetaApi.reset_experiment"
  end
  # verify the required parameter 'environment_key' is set
  if @api_client.config.client_side_validation && environment_key.nil?
    fail ArgumentError, "Missing the required parameter 'environment_key' when calling ExperimentsBetaApi.reset_experiment"
  end
  # verify the required parameter 'metric_key' is set
  if @api_client.config.client_side_validation && metric_key.nil?
    fail ArgumentError, "Missing the required parameter 'metric_key' when calling ExperimentsBetaApi.reset_experiment"
  end
  # resource path
  local_var_path = '/api/v2/flags/{projectKey}/{featureFlagKey}/experiments/{environmentKey}/{metricKey}/results'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'featureFlagKey' + '}', CGI.escape(feature_flag_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)).sub('{' + 'metricKey' + '}', CGI.escape(metric_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'])

  # 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 => :"ExperimentsBetaApi.reset_experiment",
    :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: ExperimentsBetaApi#reset_experiment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end