launchdarkly_api 25.1.0 → 25.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +18 -4
  3. data/docs/AIConfigTargetingEnvironmentRule.md +2 -0
  4. data/docs/AgentControlApi.md +3 -1
  5. data/docs/AssignmentDataSourceInput.md +24 -0
  6. data/docs/AuditLogApi.md +2 -0
  7. data/docs/Experiment.md +2 -0
  8. data/docs/ExperimentsApi.md +1 -1
  9. data/docs/IntegrationDeliveryConfiguration.md +3 -1
  10. data/docs/IntegrationDeliveryConfigurationStatus.md +26 -0
  11. data/docs/IntegrationsBetaApi.md +4 -4
  12. data/docs/IterationAssignmentDataSourceRep.md +26 -0
  13. data/docs/IterationInput.md +3 -1
  14. data/docs/IterationRep.md +4 -2
  15. data/docs/PatchSegmentScheduledChangeInput.md +20 -0
  16. data/docs/PostSegmentScheduledChangeInput.md +22 -0
  17. data/docs/SegmentScheduledChange.md +34 -0
  18. data/docs/SegmentScheduledChangeStatus.md +15 -0
  19. data/docs/SegmentScheduledChanges.md +20 -0
  20. data/docs/SegmentScheduledChangesLink.md +20 -0
  21. data/docs/SegmentsApi.md +389 -0
  22. data/docs/TreatmentInput.md +3 -1
  23. data/docs/TreatmentRep.md +3 -1
  24. data/docs/Webhook.md +2 -0
  25. data/docs/WebhookPost.md +2 -0
  26. data/lib/launchdarkly_api/api/agent_control_api.rb +3 -0
  27. data/lib/launchdarkly_api/api/audit_log_api.rb +3 -0
  28. data/lib/launchdarkly_api/api/experiments_api.rb +2 -2
  29. data/lib/launchdarkly_api/api/integrations_beta_api.rb +8 -8
  30. data/lib/launchdarkly_api/api/segments_api.rb +415 -0
  31. data/lib/launchdarkly_api/models/ai_config_targeting_environment_rule.rb +28 -1
  32. data/lib/launchdarkly_api/models/assignment_data_source_input.rb +193 -0
  33. data/lib/launchdarkly_api/models/experiment.rb +23 -1
  34. data/lib/launchdarkly_api/models/integration_delivery_configuration.rb +13 -4
  35. data/lib/launchdarkly_api/models/integration_delivery_configuration_status.rb +222 -0
  36. data/lib/launchdarkly_api/models/iteration_assignment_data_source_rep.rb +237 -0
  37. data/lib/launchdarkly_api/models/iteration_input.rb +11 -2
  38. data/lib/launchdarkly_api/models/iteration_rep.rb +14 -5
  39. data/lib/launchdarkly_api/models/patch_segment_scheduled_change_input.rb +157 -0
  40. data/lib/launchdarkly_api/models/post_segment_scheduled_change_input.rb +203 -0
  41. data/lib/launchdarkly_api/models/segment_scheduled_change.rb +353 -0
  42. data/lib/launchdarkly_api/models/segment_scheduled_change_status.rb +41 -0
  43. data/lib/launchdarkly_api/models/segment_scheduled_changes.rb +196 -0
  44. data/lib/launchdarkly_api/models/segment_scheduled_changes_link.rb +156 -0
  45. data/lib/launchdarkly_api/models/treatment_input.rb +14 -4
  46. data/lib/launchdarkly_api/models/treatment_rep.rb +14 -4
  47. data/lib/launchdarkly_api/models/webhook.rb +11 -1
  48. data/lib/launchdarkly_api/models/webhook_post.rb +11 -1
  49. data/lib/launchdarkly_api/version.rb +1 -1
  50. data/lib/launchdarkly_api.rb +9 -0
  51. data/spec/api/agent_control_api_spec.rb +1 -0
  52. data/spec/api/audit_log_api_spec.rb +1 -0
  53. data/spec/api/experiments_api_spec.rb +1 -1
  54. data/spec/api/integrations_beta_api_spec.rb +4 -4
  55. data/spec/api/segments_api_spec.rb +75 -0
  56. data/spec/models/ai_config_targeting_environment_rule_spec.rb +6 -0
  57. data/spec/models/assignment_data_source_input_spec.rb +54 -0
  58. data/spec/models/experiment_spec.rb +10 -0
  59. data/spec/models/integration_delivery_configuration_spec.rb +6 -0
  60. data/spec/models/integration_delivery_configuration_status_spec.rb +60 -0
  61. data/spec/models/iteration_assignment_data_source_rep_spec.rb +60 -0
  62. data/spec/models/iteration_input_spec.rb +6 -0
  63. data/spec/models/iteration_rep_spec.rb +6 -0
  64. data/spec/models/patch_segment_scheduled_change_input_spec.rb +42 -0
  65. data/spec/models/post_segment_scheduled_change_input_spec.rb +48 -0
  66. data/spec/models/segment_scheduled_change_spec.rb +84 -0
  67. data/spec/models/segment_scheduled_change_status_spec.rb +30 -0
  68. data/spec/models/segment_scheduled_changes_link_spec.rb +42 -0
  69. data/spec/models/segment_scheduled_changes_spec.rb +42 -0
  70. data/spec/models/treatment_input_spec.rb +6 -0
  71. data/spec/models/treatment_rep_spec.rb +6 -0
  72. data/spec/models/webhook_post_spec.rb +6 -0
  73. data/spec/models/webhook_spec.rb +6 -0
  74. metadata +757 -724
@@ -30,6 +30,9 @@ module LaunchDarklyApi
30
30
  # The secret for this webhook
31
31
  attr_accessor :secret
32
32
 
33
+ # Whether this webhook sends a bearer token. The token itself is never returned.
34
+ attr_accessor :has_bearer_token
35
+
33
36
  # Represents a Custom role policy, defining a resource kinds filter the webhook responds to.
34
37
  attr_accessor :statements
35
38
 
@@ -49,6 +52,7 @@ module LaunchDarklyApi
49
52
  :'name' => :'name',
50
53
  :'url' => :'url',
51
54
  :'secret' => :'secret',
55
+ :'has_bearer_token' => :'hasBearerToken',
52
56
  :'statements' => :'statements',
53
57
  :'on' => :'on',
54
58
  :'tags' => :'tags',
@@ -74,6 +78,7 @@ module LaunchDarklyApi
74
78
  :'name' => :'String',
75
79
  :'url' => :'String',
76
80
  :'secret' => :'String',
81
+ :'has_bearer_token' => :'Boolean',
77
82
  :'statements' => :'Array<Statement>',
78
83
  :'on' => :'Boolean',
79
84
  :'tags' => :'Array<String>',
@@ -131,6 +136,10 @@ module LaunchDarklyApi
131
136
  self.secret = attributes[:'secret']
132
137
  end
133
138
 
139
+ if attributes.key?(:'has_bearer_token')
140
+ self.has_bearer_token = attributes[:'has_bearer_token']
141
+ end
142
+
134
143
  if attributes.key?(:'statements')
135
144
  if (value = attributes[:'statements']).is_a?(Array)
136
145
  self.statements = value
@@ -256,6 +265,7 @@ module LaunchDarklyApi
256
265
  name == o.name &&
257
266
  url == o.url &&
258
267
  secret == o.secret &&
268
+ has_bearer_token == o.has_bearer_token &&
259
269
  statements == o.statements &&
260
270
  on == o.on &&
261
271
  tags == o.tags &&
@@ -271,7 +281,7 @@ module LaunchDarklyApi
271
281
  # Calculates hash code according to all attributes.
272
282
  # @return [Integer] Hash code
273
283
  def hash
274
- [_links, _id, name, url, secret, statements, on, tags, _access].hash
284
+ [_links, _id, name, url, secret, has_bearer_token, statements, on, tags, _access].hash
275
285
  end
276
286
 
277
287
  # Builds the object from hash
@@ -24,6 +24,9 @@ module LaunchDarklyApi
24
24
  # If sign is true, and the secret attribute is omitted, LaunchDarkly automatically generates a secret for you.
25
25
  attr_accessor :secret
26
26
 
27
+ # An optional token. If set, LaunchDarkly sends it in an Authorization: Bearer header with each request. It is write-only and is never returned.
28
+ attr_accessor :bearer_token
29
+
27
30
  attr_accessor :statements
28
31
 
29
32
  # If sign is false, the webhook does not include a signature header, and the secret can be omitted.
@@ -41,6 +44,7 @@ module LaunchDarklyApi
41
44
  :'name' => :'name',
42
45
  :'url' => :'url',
43
46
  :'secret' => :'secret',
47
+ :'bearer_token' => :'bearerToken',
44
48
  :'statements' => :'statements',
45
49
  :'sign' => :'sign',
46
50
  :'on' => :'on',
@@ -64,6 +68,7 @@ module LaunchDarklyApi
64
68
  :'name' => :'String',
65
69
  :'url' => :'String',
66
70
  :'secret' => :'String',
71
+ :'bearer_token' => :'String',
67
72
  :'statements' => :'Array<StatementPost>',
68
73
  :'sign' => :'Boolean',
69
74
  :'on' => :'Boolean',
@@ -107,6 +112,10 @@ module LaunchDarklyApi
107
112
  self.secret = attributes[:'secret']
108
113
  end
109
114
 
115
+ if attributes.key?(:'bearer_token')
116
+ self.bearer_token = attributes[:'bearer_token']
117
+ end
118
+
110
119
  if attributes.key?(:'statements')
111
120
  if (value = attributes[:'statements']).is_a?(Array)
112
121
  self.statements = value
@@ -200,6 +209,7 @@ module LaunchDarklyApi
200
209
  name == o.name &&
201
210
  url == o.url &&
202
211
  secret == o.secret &&
212
+ bearer_token == o.bearer_token &&
203
213
  statements == o.statements &&
204
214
  sign == o.sign &&
205
215
  on == o.on &&
@@ -215,7 +225,7 @@ module LaunchDarklyApi
215
225
  # Calculates hash code according to all attributes.
216
226
  # @return [Integer] Hash code
217
227
  def hash
218
- [name, url, secret, statements, sign, on, tags].hash
228
+ [name, url, secret, bearer_token, statements, sign, on, tags].hash
219
229
  end
220
230
 
221
231
  # Builds the object from hash
@@ -11,5 +11,5 @@ Generator version: 7.18.0
11
11
  =end
12
12
 
13
13
  module LaunchDarklyApi
14
- VERSION = '25.1.0'
14
+ VERSION = '25.2.0'
15
15
  end
@@ -133,6 +133,7 @@ require 'launchdarkly_api/models/approval_request_settings_patch'
133
133
  require 'launchdarkly_api/models/approval_settings'
134
134
  require 'launchdarkly_api/models/approvals_capability_config'
135
135
  require 'launchdarkly_api/models/assigned_to_rep'
136
+ require 'launchdarkly_api/models/assignment_data_source_input'
136
137
  require 'launchdarkly_api/models/audience'
137
138
  require 'launchdarkly_api/models/audience_configuration'
138
139
  require 'launchdarkly_api/models/audience_post'
@@ -417,6 +418,7 @@ require 'launchdarkly_api/models/integration_delivery_configuration_collection_l
417
418
  require 'launchdarkly_api/models/integration_delivery_configuration_links'
418
419
  require 'launchdarkly_api/models/integration_delivery_configuration_post'
419
420
  require 'launchdarkly_api/models/integration_delivery_configuration_response'
421
+ require 'launchdarkly_api/models/integration_delivery_configuration_status'
420
422
  require 'launchdarkly_api/models/integration_metadata'
421
423
  require 'launchdarkly_api/models/integration_status'
422
424
  require 'launchdarkly_api/models/integration_status_rep'
@@ -426,6 +428,7 @@ require 'launchdarkly_api/models/invalid_request_error_rep'
426
428
  require 'launchdarkly_api/models/ip_allowlist_entry_response'
427
429
  require 'launchdarkly_api/models/ip_allowlist_response'
428
430
  require 'launchdarkly_api/models/ip_list'
431
+ require 'launchdarkly_api/models/iteration_assignment_data_source_rep'
429
432
  require 'launchdarkly_api/models/iteration_input'
430
433
  require 'launchdarkly_api/models/iteration_rep'
431
434
  require 'launchdarkly_api/models/judge_attachment'
@@ -506,6 +509,7 @@ require 'launchdarkly_api/models/patch_segment_expiring_target_input_rep'
506
509
  require 'launchdarkly_api/models/patch_segment_expiring_target_instruction'
507
510
  require 'launchdarkly_api/models/patch_segment_instruction'
508
511
  require 'launchdarkly_api/models/patch_segment_request'
512
+ require 'launchdarkly_api/models/patch_segment_scheduled_change_input'
509
513
  require 'launchdarkly_api/models/patch_users_request'
510
514
  require 'launchdarkly_api/models/patch_with_comment'
511
515
  require 'launchdarkly_api/models/permission_grant_input'
@@ -525,6 +529,7 @@ require 'launchdarkly_api/models/post_deployment_event_input'
525
529
  require 'launchdarkly_api/models/post_flag_scheduled_changes_input'
526
530
  require 'launchdarkly_api/models/post_insight_group_params'
527
531
  require 'launchdarkly_api/models/post_release_policy_request'
532
+ require 'launchdarkly_api/models/post_segment_scheduled_change_input'
528
533
  require 'launchdarkly_api/models/prerequisite'
529
534
  require 'launchdarkly_api/models/progressive_release_config'
530
535
  require 'launchdarkly_api/models/project'
@@ -612,6 +617,10 @@ require 'launchdarkly_api/models/sdk_version_list_rep'
612
617
  require 'launchdarkly_api/models/sdk_version_rep'
613
618
  require 'launchdarkly_api/models/segment_body'
614
619
  require 'launchdarkly_api/models/segment_metadata'
620
+ require 'launchdarkly_api/models/segment_scheduled_change'
621
+ require 'launchdarkly_api/models/segment_scheduled_change_status'
622
+ require 'launchdarkly_api/models/segment_scheduled_changes'
623
+ require 'launchdarkly_api/models/segment_scheduled_changes_link'
615
624
  require 'launchdarkly_api/models/segment_target'
616
625
  require 'launchdarkly_api/models/segment_user_list'
617
626
  require 'launchdarkly_api/models/segment_user_state'
@@ -464,6 +464,7 @@ describe 'AgentControlApi' do
464
464
  # @option opts [Integer] :limit The number of resources to return.
465
465
  # @option opts [Integer] :offset 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;.
466
466
  # @option opts [String] :filter A filter to apply to the list.
467
+ # @option opts [String] :sort A sort to apply to the list of agent skills. Use &#x60;usedIn&#x60; to sort by the number of AgentControl configs that use each skill, fewest first, or &#x60;-usedIn&#x60; for most first. Without a sort, skills are ordered by creation date, newest first.
467
468
  # @return [AgentSkills]
468
469
  describe 'list_agent_skills test' do
469
470
  it 'should work' do
@@ -72,6 +72,7 @@ describe 'AuditLogApi' do
72
72
  # @option opts [Integer] :limit A limit on the number of audit log entries that return. Set between 1 and 20. The default is 10.
73
73
  # @option opts [String] :member A member ID that lets you filter audit log listings by the member who made the change. Repeat the parameter to filter by multiple members.
74
74
  # @option opts [String] :token An access token ID that lets you filter audit log listings by the token that made the change. Repeat the parameter to filter by multiple tokens.
75
+ # @option opts [Integer] :rollup Set to 1 to return rolled-up audit log entries, which group related changes into one entry. By default, entries aren&#39;t rolled up.
75
76
  # @option opts [Array<StatementPost>] :statement_post
76
77
  # @return [AuditLogEntryListingRepCollection]
77
78
  describe 'post_audit_log_entries test' do
@@ -125,7 +125,7 @@ describe 'ExperimentsApi' do
125
125
 
126
126
  # unit tests for patch_experiment
127
127
  # Patch experiment
128
- # Update an experiment. Updating an experiment uses the semantic patch format. 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](https://launchdarkly.com/docs/api#updates-using-semantic-patch). ### Instructions Semantic patch requests support the following &#x60;kind&#x60; instructions for updating experiments. #### updateName &gt; **Deprecated**: &#x60;updateName&#x60; will be removed in a future version. Use &#x60;updateExperimentFields&#x60; instead. Updates the experiment name. ##### Parameters - &#x60;value&#x60;: The new name. Here&#39;s an example: &#x60;&#x60;&#x60;json { \&quot;instructions\&quot;: [{ \&quot;kind\&quot;: \&quot;updateName\&quot;, \&quot;value\&quot;: \&quot;Example updated experiment name\&quot; }] } &#x60;&#x60;&#x60; #### updateDescription &gt; **Deprecated**: &#x60;updateDescription&#x60; will be removed in a future version. Use &#x60;updateExperimentFields&#x60; instead. Updates the experiment description. ##### Parameters - &#x60;value&#x60;: The new description. Here&#39;s an example: &#x60;&#x60;&#x60;json { \&quot;instructions\&quot;: [{ \&quot;kind\&quot;: \&quot;updateDescription\&quot;, \&quot;value\&quot;: \&quot;Example updated description\&quot; }] } &#x60;&#x60;&#x60; #### updateExperimentFields Updates one or more fields on an experiment or its current iteration. Each field update specifies an operation (&#x60;add&#x60;, &#x60;update&#x60;, or &#x60;remove&#x60;) and an optional value. Which fields are mutable depends on the current iteration status. To discover which fields and operations are allowed, expand &#x60;mutableFieldsByStatus&#x60; on the [Get experiment](https://launchdarkly.com/docs/api/experiments/get-experiment) response. ##### Parameters - &#x60;value&#x60;: An object mapping field names to field updates. Each field update has the following properties: - &#x60;operation&#x60;: The operation to perform. One of &#x60;add&#x60;, &#x60;update&#x60;, or &#x60;remove&#x60;. - &#x60;value&#x60;: The new value for the field. Required for &#x60;add&#x60; and &#x60;update&#x60; operations. To find which fields are supported and which operations are allowed for each iteration status, expand &#x60;mutableFieldsByStatus&#x60; on the [Get experiment](https://launchdarkly.com/docs/api/experiments/get-experiment) response. Here&#39;s an example: &#x60;&#x60;&#x60;json { \&quot;instructions\&quot;: [{ \&quot;kind\&quot;: \&quot;updateExperimentFields\&quot;, \&quot;value\&quot;: { \&quot;name\&quot;: { \&quot;operation\&quot;: \&quot;update\&quot;, \&quot;value\&quot;: \&quot;Updated experiment name\&quot; }, \&quot;tags\&quot;: { \&quot;operation\&quot;: \&quot;add\&quot;, \&quot;value\&quot;: [\&quot;tag1\&quot;, \&quot;tag2\&quot;] } } }] } &#x60;&#x60;&#x60; #### saveAndStartNewIteration Stops the current running iteration, creates a new iteration from it, optionally applies field updates, and starts the new iteration. This is a convenience instruction that combines stopping, updating, and starting in a single operation. ##### Parameters - &#x60;changeJustification&#x60;: (Optional) The reason for stopping and starting a new iteration. - &#x60;value&#x60;: (Optional) An object mapping field names to field updates, using the same format as &#x60;updateExperimentFields&#x60;. These updates are applied to the new iteration before it is started. Here&#39;s an example: &#x60;&#x60;&#x60;json { \&quot;instructions\&quot;: [{ \&quot;kind\&quot;: \&quot;saveAndStartNewIteration\&quot;, \&quot;changeJustification\&quot;: \&quot;Adjusting hypothesis based on early results\&quot;, \&quot;value\&quot;: { \&quot;hypothesis\&quot;: { \&quot;operation\&quot;: \&quot;update\&quot;, \&quot;value\&quot;: \&quot;Updated hypothesis text\&quot; } } }] } &#x60;&#x60;&#x60; #### startIteration Starts a new iteration for this experiment. You must [create a new iteration](https://launchdarkly.com/docs/api/experiments/create-iteration) before calling this instruction. An iteration may not be started until it meets the following criteria: * Its associated flag is toggled on and is not archived * Its &#x60;randomizationUnit&#x60; is set * At least one of its &#x60;treatments&#x60; has a non-zero &#x60;allocationPercent&#x60; ##### Parameters - &#x60;changeJustification&#x60;: The reason for starting a new iteration. Required when you call &#x60;startIteration&#x60; on an already running experiment, otherwise optional. Here&#39;s an example: &#x60;&#x60;&#x60;json { \&quot;instructions\&quot;: [{ \&quot;kind\&quot;: \&quot;startIteration\&quot;, \&quot;changeJustification\&quot;: \&quot;It&#39;s time to start a new iteration\&quot; }] } &#x60;&#x60;&#x60; #### stopIteration Stops the current iteration for this experiment. ##### Parameters - &#x60;winningTreatmentId&#x60;: The ID of the winning treatment. Treatment IDs are returned as part of the [Get experiment](https://launchdarkly.com/docs/api/experiments/get-experiment) response. They are the &#x60;_id&#x60; of each element in the &#x60;treatments&#x60; array. - &#x60;winningReason&#x60;: The reason for the winner Here&#39;s an example: &#x60;&#x60;&#x60;json { \&quot;instructions\&quot;: [{ \&quot;kind\&quot;: \&quot;stopIteration\&quot;, \&quot;winningTreatmentId\&quot;: \&quot;3a548ec2-72ac-4e59-8518-5c24f5609ccf\&quot;, \&quot;winningReason\&quot;: \&quot;Example reason to stop the iteration\&quot; }] } &#x60;&#x60;&#x60; #### archiveExperiment Archives this experiment. Archived experiments are hidden by default in the LaunchDarkly user interface. You cannot start new iterations for archived experiments. Here&#39;s an example: &#x60;&#x60;&#x60;json { \&quot;instructions\&quot;: [{ \&quot;kind\&quot;: \&quot;archiveExperiment\&quot; }] } &#x60;&#x60;&#x60; #### restoreExperiment Restores an archived experiment. After restoring an experiment, you can start new iterations for it again. Here&#39;s an example: &#x60;&#x60;&#x60;json { \&quot;instructions\&quot;: [{ \&quot;kind\&quot;: \&quot;restoreExperiment\&quot; }] } &#x60;&#x60;&#x60;
128
+ # Update an experiment. Updating an experiment uses the semantic patch format. 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](https://launchdarkly.com/docs/api#updates-using-semantic-patch). ### Instructions Semantic patch requests support the following &#x60;kind&#x60; instructions for updating experiments. #### updateName &gt; **Deprecated**: &#x60;updateName&#x60; will be removed in a future version. Use &#x60;updateExperimentFields&#x60; instead. Updates the experiment name. ##### Parameters - &#x60;value&#x60;: The new name. Here&#39;s an example: &#x60;&#x60;&#x60;json { \&quot;instructions\&quot;: [{ \&quot;kind\&quot;: \&quot;updateName\&quot;, \&quot;value\&quot;: \&quot;Example updated experiment name\&quot; }] } &#x60;&#x60;&#x60; #### updateDescription &gt; **Deprecated**: &#x60;updateDescription&#x60; will be removed in a future version. Use &#x60;updateExperimentFields&#x60; instead. Updates the experiment description. ##### Parameters - &#x60;value&#x60;: The new description. Here&#39;s an example: &#x60;&#x60;&#x60;json { \&quot;instructions\&quot;: [{ \&quot;kind\&quot;: \&quot;updateDescription\&quot;, \&quot;value\&quot;: \&quot;Example updated description\&quot; }] } &#x60;&#x60;&#x60; #### updateExperimentFields Updates one or more fields on an experiment or its current iteration. Each field update specifies an operation (&#x60;add&#x60;, &#x60;update&#x60;, or &#x60;remove&#x60;) and an optional value. Which fields are mutable depends on the current iteration status. To discover which fields and operations are allowed, expand &#x60;mutableFieldsByStatus&#x60; on the [Get experiment](https://launchdarkly.com/docs/api/experiments/get-experiment) response. ##### Parameters - &#x60;value&#x60;: An object mapping field names to field updates. Each field update has the following properties: - &#x60;operation&#x60;: The operation to perform. One of &#x60;add&#x60;, &#x60;update&#x60;, or &#x60;remove&#x60;. - &#x60;value&#x60;: The new value for the field. Required for &#x60;add&#x60; and &#x60;update&#x60; operations. To find which fields are supported and which operations are allowed for each iteration status, expand &#x60;mutableFieldsByStatus&#x60; on the [Get experiment](https://launchdarkly.com/docs/api/experiments/get-experiment) response. Here&#39;s an example: &#x60;&#x60;&#x60;json { \&quot;instructions\&quot;: [{ \&quot;kind\&quot;: \&quot;updateExperimentFields\&quot;, \&quot;value\&quot;: { \&quot;name\&quot;: { \&quot;operation\&quot;: \&quot;update\&quot;, \&quot;value\&quot;: \&quot;Updated experiment name\&quot; }, \&quot;tags\&quot;: { \&quot;operation\&quot;: \&quot;add\&quot;, \&quot;value\&quot;: [\&quot;tag1\&quot;, \&quot;tag2\&quot;] } } }] } &#x60;&#x60;&#x60; ##### Custom assignment source fields If your experiment reads its assignment data from your data warehouse, two additional fields control the assignment source it uses. Use &#x60;assignmentDataSource&#x60; to attach an assignment source to an iteration, change which source it points at, or detach it. Its value is an object with the following properties: - &#x60;key&#x60;: (Required) The key of the assignment data source. - &#x60;experimentId&#x60;: The experiment identifier in the assignment data source. You can omit this while the experiment is a draft, but you must set it before you start the experiment. - &#x60;startTime&#x60;: (Optional) The start of the assignment data window, in Unix milliseconds. - &#x60;endTime&#x60;: (Optional) The end of the assignment data window, in Unix milliseconds. This must be later than &#x60;startTime&#x60;. To detach the assignment source, send &#x60;null&#x60; as the value. You can only change this field while the iteration is still a draft. Use &#x60;assignmentDataSourceWindow&#x60; to change only the dates on an assignment source that is already attached. Its value is an object with the same &#x60;startTime&#x60; and &#x60;endTime&#x60; properties. The iteration must already have an assignment source. This is how you adjust the dates after an iteration has run, because the source itself is fixed at that point. Multi-armed bandits use flags for assignment, so they support neither field. Here&#39;s an example: &#x60;&#x60;&#x60;json { \&quot;instructions\&quot;: [{ \&quot;kind\&quot;: \&quot;updateExperimentFields\&quot;, \&quot;value\&quot;: { \&quot;assignmentDataSource\&quot;: { \&quot;operation\&quot;: \&quot;update\&quot;, \&quot;value\&quot;: { \&quot;key\&quot;: \&quot;my-assignment-data-source\&quot;, \&quot;experimentId\&quot;: \&quot;experiment-123\&quot;, \&quot;startTime\&quot;: 1690000000000, \&quot;endTime\&quot;: 1690600000000 } } } }] } &#x60;&#x60;&#x60; #### saveAndStartNewIteration Stops the current running iteration, creates a new iteration from it, optionally applies field updates, and starts the new iteration. This is a convenience instruction that combines stopping, updating, and starting in a single operation. ##### Parameters - &#x60;changeJustification&#x60;: (Optional) The reason for stopping and starting a new iteration. - &#x60;value&#x60;: (Optional) An object mapping field names to field updates, using the same format as &#x60;updateExperimentFields&#x60;. These updates are applied to the new iteration before it is started. Here&#39;s an example: &#x60;&#x60;&#x60;json { \&quot;instructions\&quot;: [{ \&quot;kind\&quot;: \&quot;saveAndStartNewIteration\&quot;, \&quot;changeJustification\&quot;: \&quot;Adjusting hypothesis based on early results\&quot;, \&quot;value\&quot;: { \&quot;hypothesis\&quot;: { \&quot;operation\&quot;: \&quot;update\&quot;, \&quot;value\&quot;: \&quot;Updated hypothesis text\&quot; } } }] } &#x60;&#x60;&#x60; #### startIteration Starts a new iteration for this experiment. You must [create a new iteration](https://launchdarkly.com/docs/api/experiments/create-iteration) before calling this instruction. An iteration may not be started until it meets the following criteria: * Its associated flag is toggled on and is not archived * Its &#x60;randomizationUnit&#x60; is set * At least one of its &#x60;treatments&#x60; has a non-zero &#x60;allocationPercent&#x60; ##### Parameters - &#x60;changeJustification&#x60;: The reason for starting a new iteration. Required when you call &#x60;startIteration&#x60; on an already running experiment, otherwise optional. Here&#39;s an example: &#x60;&#x60;&#x60;json { \&quot;instructions\&quot;: [{ \&quot;kind\&quot;: \&quot;startIteration\&quot;, \&quot;changeJustification\&quot;: \&quot;It&#39;s time to start a new iteration\&quot; }] } &#x60;&#x60;&#x60; #### stopIteration Stops the current iteration for this experiment. ##### Parameters - &#x60;winningTreatmentId&#x60;: The ID of the winning treatment. Treatment IDs are returned as part of the [Get experiment](https://launchdarkly.com/docs/api/experiments/get-experiment) response. They are the &#x60;_id&#x60; of each element in the &#x60;treatments&#x60; array. - &#x60;winningReason&#x60;: The reason for the winner Here&#39;s an example: &#x60;&#x60;&#x60;json { \&quot;instructions\&quot;: [{ \&quot;kind\&quot;: \&quot;stopIteration\&quot;, \&quot;winningTreatmentId\&quot;: \&quot;3a548ec2-72ac-4e59-8518-5c24f5609ccf\&quot;, \&quot;winningReason\&quot;: \&quot;Example reason to stop the iteration\&quot; }] } &#x60;&#x60;&#x60; #### archiveExperiment Archives this experiment. Archived experiments are hidden by default in the LaunchDarkly user interface. You cannot start new iterations for archived experiments. Here&#39;s an example: &#x60;&#x60;&#x60;json { \&quot;instructions\&quot;: [{ \&quot;kind\&quot;: \&quot;archiveExperiment\&quot; }] } &#x60;&#x60;&#x60; #### restoreExperiment Restores an archived experiment. After restoring an experiment, you can start new iterations for it again. Here&#39;s an example: &#x60;&#x60;&#x60;json { \&quot;instructions\&quot;: [{ \&quot;kind\&quot;: \&quot;restoreExperiment\&quot; }] } &#x60;&#x60;&#x60;
129
129
  # @param project_key The project key
130
130
  # @param environment_key The environment key
131
131
  # @param experiment_key The experiment key
@@ -34,7 +34,7 @@ describe 'IntegrationsBetaApi' do
34
34
 
35
35
  # unit tests for create_integration_configuration
36
36
  # Create integration configuration
37
- # Create a new integration configuration. (Excludes [persistent store](https://launchdarkly.com/docs/api/persistent-store-integrations-beta) and [flag import configurations](https://launchdarkly.com/docs/api/flag-import-configurations-beta).)
37
+ # Create a new integration configuration. This endpoint does not include persistent store integrations or flag import configurations. To manage those, use the [persistent store](https://launchdarkly.com/docs/api/persistent-store-integrations-beta) and [flag import configuration](https://launchdarkly.com/docs/api/flag-import-configurations-beta) endpoints.
38
38
  # @param integration_key The integration key
39
39
  # @param integration_configuration_post
40
40
  # @param [Hash] opts the optional parameters
@@ -47,7 +47,7 @@ describe 'IntegrationsBetaApi' do
47
47
 
48
48
  # unit tests for delete_integration_configuration
49
49
  # Delete integration configuration
50
- # Delete an integration configuration by ID. (Excludes [persistent store](https://launchdarkly.com/docs/api/persistent-store-integrations-beta) and [flag import configurations](https://launchdarkly.com/docs/api/flag-import-configurations-beta).)
50
+ # Delete an integration configuration by ID. This endpoint does not include persistent store integrations or flag import configurations. To manage those, use the [persistent store](https://launchdarkly.com/docs/api/persistent-store-integrations-beta) and [flag import configuration](https://launchdarkly.com/docs/api/flag-import-configurations-beta) endpoints.
51
51
  # @param integration_configuration_id The ID of the integration configuration to be deleted
52
52
  # @param [Hash] opts the optional parameters
53
53
  # @return [nil]
@@ -59,7 +59,7 @@ describe 'IntegrationsBetaApi' do
59
59
 
60
60
  # unit tests for get_all_integration_configurations
61
61
  # Get all configurations for the integration
62
- # Get all integration configurations with the specified integration key. (Excludes [persistent store](https://launchdarkly.com/docs/api/persistent-store-integrations-beta) and [flag import configurations](https://launchdarkly.com/docs/api/flag-import-configurations-beta).).
62
+ # Get all integration configurations with the specified integration key. This endpoint does not include persistent store integrations or flag import configurations. To manage those, use the [persistent store](https://launchdarkly.com/docs/api/persistent-store-integrations-beta) and [flag import configuration](https://launchdarkly.com/docs/api/flag-import-configurations-beta) endpoints.
63
63
  # @param integration_key A key that corresponds to the third-party integration you are configuring. For example, &#x60;mezmo&#x60;.
64
64
  # @param [Hash] opts the optional parameters
65
65
  # @option opts [Boolean] :include_pending When &#x60;true&#x60;, includes pending two-step setup drafts that were created using &#x60;/setup&#x60; but are not yet finalized. Defaults to &#x60;false&#x60;, which returns only active configurations.
@@ -72,7 +72,7 @@ describe 'IntegrationsBetaApi' do
72
72
 
73
73
  # unit tests for get_integration_configuration
74
74
  # Get an integration configuration
75
- # Get integration configuration with the specified ID. (Excludes [persistent store](https://launchdarkly.com/docs/api/persistent-store-integrations-beta) and [flag import configurations](https://launchdarkly.com/docs/api/flag-import-configurations-beta).)
75
+ # Get integration configuration with the specified ID. This endpoint does not include persistent store integrations or flag import configurations. To manage those, use the [persistent store](https://launchdarkly.com/docs/api/persistent-store-integrations-beta) and [flag import configuration](https://launchdarkly.com/docs/api/flag-import-configurations-beta) endpoints.
76
76
  # @param integration_configuration_id Integration configuration ID
77
77
  # @param [Hash] opts the optional parameters
78
78
  # @return [IntegrationConfigurationsRep]
@@ -77,6 +77,21 @@ describe 'SegmentsApi' do
77
77
  end
78
78
  end
79
79
 
80
+ # unit tests for delete_segment_scheduled_change
81
+ # Delete a scheduled change for a segment
82
+ # Delete a scheduled change before its execution date, so that its instructions are never applied to the segment. Deleting a change with a &#x60;failed&#x60; status removes it from the segment&#39;s scheduled changes. Its instructions were not applied. The caller must be allowed to update scheduled changes on the segment. If an approval request scheduled the change, deleting the change also terminates that request, so it cannot be applied again. Declining the request is only an option while it is still awaiting review. Once it is applied, its instructions belong to a scheduled change, and this endpoint is how to stop them. Returns 409 if the scheduled change is already being applied or has already run.
83
+ # @param project_key
84
+ # @param environment_key
85
+ # @param segment_key
86
+ # @param id The ID of the scheduled change
87
+ # @param [Hash] opts the optional parameters
88
+ # @return [nil]
89
+ describe 'delete_segment_scheduled_change test' do
90
+ it 'should work' do
91
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
92
+ end
93
+ end
94
+
80
95
  # unit tests for get_big_segment_export
81
96
  # Get big segment export
82
97
  # Returns information about a big segment export process. This is an export for a synced segment or a list-based segment that can include more than 15,000 entries.
@@ -193,6 +208,35 @@ describe 'SegmentsApi' do
193
208
  end
194
209
  end
195
210
 
211
+ # unit tests for get_segment_scheduled_change
212
+ # Get a scheduled change for a segment
213
+ # Get one scheduled change that has not been applied yet, or that failed to apply. Returns 404 if the ID is not a scheduled change for the segment in the path. The caller must be allowed to view the segment&#39;s project.
214
+ # @param project_key
215
+ # @param environment_key
216
+ # @param segment_key
217
+ # @param id The ID of the scheduled change
218
+ # @param [Hash] opts the optional parameters
219
+ # @return [SegmentScheduledChange]
220
+ describe 'get_segment_scheduled_change test' do
221
+ it 'should work' do
222
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
223
+ end
224
+ end
225
+
226
+ # unit tests for get_segment_scheduled_changes
227
+ # List scheduled changes for a segment
228
+ # Get every scheduled change for a segment that has not been applied yet, plus any that failed to apply, soonest first. Use the &#x60;status&#x60; of each change to tell them apart. The caller must be allowed to view the segment&#39;s project.
229
+ # @param project_key
230
+ # @param environment_key
231
+ # @param segment_key
232
+ # @param [Hash] opts the optional parameters
233
+ # @return [SegmentScheduledChanges]
234
+ describe 'get_segment_scheduled_changes test' do
235
+ it 'should work' do
236
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
237
+ end
238
+ end
239
+
196
240
  # unit tests for get_segments
197
241
  # List segments
198
242
  # Get a list of all segments in the given project. Segments can be rule-based, list-based, or synced. Big segments include larger list-based segments and synced segments. Some fields in the response only apply to big segments. ### Filtering segments The &#x60;filter&#x60; parameter supports the following operators: &#x60;equals&#x60;, &#x60;anyOf&#x60;, and &#x60;exists&#x60;. You can also combine filters in the following ways: - Use a comma (&#x60;,&#x60;) as an AND operator - Use a vertical bar (&#x60;|&#x60;) as an OR operator - Use parentheses (&#x60;()&#x60;) to group filters #### Supported fields and operators You can only filter certain fields in segments when using the &#x60;filter&#x60; parameter. Additionally, you can only filter some fields with certain operators. When you search for segments, the &#x60;filter&#x60; parameter supports the following fields and operators: |&lt;div style&#x3D;\&quot;width:120px\&quot;&gt;Field&lt;/div&gt; |Description |Supported operators | |---|---|---| | &#x60;excludedKeys&#x60; | The segment keys of segments to exclude from the results. | &#x60;anyOf&#x60; | | &#x60;external&#x60; | Whether the segment is a synced segment. | &#x60;exists&#x60; | | &#x60;includedKeys&#x60; | The segment keys of segments to include in the results. | &#x60;anyOf&#x60; | | &#x60;query&#x60; | A \&quot;fuzzy\&quot; search across segment key, name, and description. Supply a string or list of strings to the operator. | &#x60;equals&#x60; | | &#x60;tags&#x60; | The segment tags. | &#x60;anyOf&#x60; | | &#x60;unbounded&#x60; | Whether the segment is a standard segment (&#x60;false&#x60;) or a big segment (&#x60;true&#x60;). Standard segments include rule-based segments and smaller list-based segments. Big segments include larger list-based segments and synced segments. | &#x60;equals&#x60; | Here are a few examples: * The filter &#x60;?filter&#x3D;tags anyOf [\&quot;enterprise\&quot;, \&quot;beta\&quot;],query equals \&quot;toggle\&quot;&#x60; matches segments with \&quot;toggle\&quot; in their key, name, or description that also have \&quot;enterprise\&quot; or \&quot;beta\&quot; as a tag. * The filter &#x60;?filter&#x3D;excludedKeys anyOf [\&quot;segmentKey1\&quot;, \&quot;segmentKey2\&quot;]&#x60; excludes the segments with those keys from the results. * The filter &#x60;?filter&#x3D;unbounded equals true&#x60; matches larger list-based segments and synced segments. The documented values for &#x60;filter&#x60; query parameters are prior to URL encoding. For example, the &#x60;[&#x60; in &#x60;?filter&#x3D;tags anyOf [\&quot;enterprise\&quot;, \&quot;beta\&quot;]&#x60; must be encoded to &#x60;%5B&#x60;.
@@ -256,6 +300,22 @@ describe 'SegmentsApi' do
256
300
  end
257
301
  end
258
302
 
303
+ # unit tests for patch_segment_scheduled_change
304
+ # Update a scheduled change for a segment
305
+ # Edit the execution date and/or the comment of a scheduled change that has not been applied yet. A field you leave out is unchanged, and an empty comment clears the comment. The caller must be allowed to update scheduled changes on the segment, and must also be allowed to make the change&#39;s instructions directly. If the segment requires approvals, the caller must also be allowed to bypass them. Returns 409 if the scheduled change is already being applied or was changed by someone else in the meantime.
306
+ # @param project_key
307
+ # @param environment_key
308
+ # @param segment_key
309
+ # @param id The ID of the scheduled change
310
+ # @param patch_segment_scheduled_change_input
311
+ # @param [Hash] opts the optional parameters
312
+ # @return [SegmentScheduledChange]
313
+ describe 'patch_segment_scheduled_change test' do
314
+ it 'should work' do
315
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
316
+ end
317
+ end
318
+
259
319
  # unit tests for post_segment
260
320
  # Create segment
261
321
  # Create a new segment. The new segment has no individual targets or rules. The request body only accepts the fields documented below. If you include targeting fields such as &#x60;included&#x60;, &#x60;excluded&#x60;, &#x60;includedContexts&#x60;, &#x60;excludedContexts&#x60;, or &#x60;rules&#x60;, LaunchDarkly ignores them and does not return an error. These fields are empty in the response. To add individual targets or rules after you create the segment, use [Update segment](https://launchdarkly.com/docs/api/segments/patch-segment) with a semantic patch. For example, use the &#x60;addIncludedTargets&#x60; or &#x60;addExcludedTargets&#x60; instruction to add individual targets, and the &#x60;addRule&#x60; instruction to add a rule. For big segments, use the &#x60;addBigSegmentIncludedTargets&#x60; or &#x60;addBigSegmentExcludedTargets&#x60; instruction.
@@ -270,6 +330,21 @@ describe 'SegmentsApi' do
270
330
  end
271
331
  end
272
332
 
333
+ # unit tests for post_segment_scheduled_change
334
+ # Create a scheduled change for a segment
335
+ # Schedule semantic patch instructions to be applied to a segment at a future time. Each instruction uses the same format as an instruction in a semantic patch request to update a segment. Send between 1 and 100 instructions. LaunchDarkly rejects the request with a 400 if an instruction has an unknown &#x60;kind&#x60; or is malformed. The caller must be allowed to update scheduled changes on the segment, and must also be allowed to make each instruction&#39;s change directly. If the segment requires approvals for an instruction, the caller must also be allowed to bypass them. Otherwise, request the change through an approval request instead. To learn more about semantic patches, read [Updates](/reference#updates-using-semantic-patch).
336
+ # @param project_key
337
+ # @param environment_key
338
+ # @param segment_key
339
+ # @param post_segment_scheduled_change_input
340
+ # @param [Hash] opts the optional parameters
341
+ # @return [SegmentScheduledChange]
342
+ describe 'post_segment_scheduled_change test' do
343
+ it 'should work' do
344
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
345
+ end
346
+ end
347
+
273
348
  # unit tests for update_big_segment_context_targets
274
349
  # Update context targets on a big segment
275
350
  # Update context targets included or excluded in a big segment. Big segments include larger list-based segments and synced segments. This operation does not support standard segments.
@@ -27,6 +27,12 @@ describe LaunchDarklyApi::AIConfigTargetingEnvironmentRule do
27
27
  end
28
28
  end
29
29
 
30
+ describe 'test attribute "_id"' do
31
+ it 'should work' do
32
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
33
+ end
34
+ end
35
+
30
36
  describe 'test attribute "clauses"' do
31
37
  it 'should work' do
32
38
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
@@ -0,0 +1,54 @@
1
+ =begin
2
+ #LaunchDarkly REST API
3
+
4
+ #This documentation describes LaunchDarkly's REST API. To access the complete OpenAPI spec directly, use [Get OpenAPI spec](https://launchdarkly.com/docs/api/other/get-openapi-spec). To learn how to use LaunchDarkly using the user interface (UI) instead, read our [product documentation](https://launchdarkly.com/docs/home). ## Authentication LaunchDarkly's REST API uses the HTTPS protocol with a minimum TLS version of 1.2. All REST API resources are authenticated with either [personal or service access tokens](https://launchdarkly.com/docs/home/account/api), or session cookies. Other authentication mechanisms are not supported. You can manage personal access tokens on your [**Authorization**](https://app.launchdarkly.com/settings/authorization) page in the LaunchDarkly UI. LaunchDarkly also has SDK keys, mobile keys, and client-side IDs that are used by our server-side SDKs, mobile SDKs, and JavaScript-based SDKs, respectively. **These keys cannot be used to access our REST API**. These keys are environment-specific, and can only perform read-only operations such as fetching feature flag settings. | Auth mechanism | Allowed resources | Use cases | | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -------------------------------------------------- | | [Personal or service access tokens](https://launchdarkly.com/docs/home/account/api) | Can be customized on a per-token basis | Building scripts, custom integrations, data export. | | SDK keys | Can only access read-only resources specific to server-side SDKs. Restricted to a single environment. | Server-side SDKs | | Mobile keys | Can only access read-only resources specific to mobile SDKs, and only for flags marked available to mobile keys. Restricted to a single environment. | Mobile SDKs | | Client-side ID | Can only access read-only resources specific to JavaScript-based client-side SDKs, and only for flags marked available to client-side. Restricted to a single environment. | Client-side JavaScript | > #### Keep your access tokens and SDK keys private > > Access tokens should _never_ be exposed in untrusted contexts. Never put an access token in client-side JavaScript, or embed it in a mobile application. LaunchDarkly has special mobile keys that you can embed in mobile apps. If you accidentally expose an access token or SDK key, you can reset it from your [**Authorization**](https://app.launchdarkly.com/settings/authorization) page. > > The client-side ID is safe to embed in untrusted contexts. It's designed for use in client-side JavaScript. ### Authentication using request header The preferred way to authenticate with the API is by adding an `Authorization` header containing your access token to your requests. The value of the `Authorization` header must be your access token. Manage personal access tokens from the [**Authorization**](https://app.launchdarkly.com/settings/authorization) page. ### Authentication using session cookie For testing purposes, you can make API calls directly from your web browser. If you are logged in to the LaunchDarkly application, the API will use your existing session to authenticate calls. Depending on the permissions granted as part of your [role](https://launchdarkly.com/docs/home/account/roles), you may not have permission to perform some API calls. You will receive a `401` response code in that case. > ### Modifying the Origin header causes an error > > LaunchDarkly validates that the Origin header for any API request authenticated by a session cookie matches the expected Origin header. The expected Origin header is `https://app.launchdarkly.com`. > > If the Origin header does not match what's expected, LaunchDarkly returns an error. This error can prevent the LaunchDarkly app from working correctly. > > Any browser extension that intentionally changes the Origin header can cause this problem. For example, Cross-Origin Resource Sharing (CORS) extensions used during development can modify the Origin header and cause the app to fail. > > To prevent this error, do not modify your Origin header. > > LaunchDarkly does not require origin matching when authenticating with an access token, so this issue does not affect normal API usage. ## Representations All resources expect and return JSON response bodies. Error responses also send a JSON body. To learn more about the error format of the API, read [Errors](https://launchdarkly.com/docs/api#errors). In practice this means that you always get a response with a `Content-Type` header set to `application/json`. In addition, request bodies for `PATCH`, `POST`, and `PUT` requests must be encoded as JSON with a `Content-Type` header set to `application/json`. Unless an endpoint's documentation says otherwise, the API ignores request body fields that are not part of that endpoint's request schema, and does not return an error for them. A successful response does not mean that every field you sent was applied. To confirm the result, check the response body. ### Summary and detailed representations When you fetch a list of resources, the response includes only the most important attributes of each resource. This is a _summary representation_ of the resource. When you fetch an individual resource, such as a single feature flag, you receive a _detailed representation_ of the resource. The best way to find a detailed representation is to follow links. Every summary representation includes a link to its detailed representation. ### Expanding responses Sometimes the detailed representation of a resource does not include all of the attributes of the resource by default. If this is the case, the request method will clearly document this and describe which attributes you can include in an expanded response. To include the additional attributes, append the `expand` request parameter to your request and add a comma-separated list of the attributes to include. For example, when you append `?expand=members,maintainers` to the [Get team](https://launchdarkly.com/docs/api/teams/get-team) endpoint, the expanded response includes both of these attributes. ### Links and addressability The best way to navigate the API is by following links. These are attributes in representations that link to other resources. The API always uses the same format for links: - Links to other resources within the API are encapsulated in a `_links` object - If the resource has a corresponding link to HTML content on the site, it is stored in a special `_site` link Each link has two attributes: - An `href`, which contains the URL - A `type`, which describes the content type For example, a feature resource might return the following: ```json { \"_links\": { \"parent\": { \"href\": \"/api/features\", \"type\": \"application/json\" }, \"self\": { \"href\": \"/api/features/sort.order\", \"type\": \"application/json\" } }, \"_site\": { \"href\": \"/features/sort.order\", \"type\": \"text/html\" } } ``` From this, you can navigate to the parent collection of features by following the `parent` link, or navigate to the site page for the feature by following the `_site` link. Collections are always represented as a JSON object with an `items` attribute containing an array of representations. Like all other representations, collections have `_links` defined at the top level. Paginated collections include `first`, `last`, `next`, and `prev` links containing a URL with the respective set of elements in the collection. ## Updates Resources that accept partial updates use the `PATCH` verb. Most resources support the [JSON patch](https://launchdarkly.com/docs/api#updates-using-json-patch) format. Some resources also support the [JSON merge patch](https://launchdarkly.com/docs/api#updates-using-json-merge-patch) format, and some resources support the [semantic patch](https://launchdarkly.com/docs/api#updates-using-semantic-patch) format, which is a way to specify the modifications to perform as a set of executable instructions. Each resource supports optional [comments](https://launchdarkly.com/docs/api#updates-with-comments) that you can submit with updates. Comments appear in outgoing webhooks, the audit log, and other integrations. When a resource supports both JSON patch and semantic patch, we document both in the request method. However, the specific request body fields and descriptions included in our documentation only match one type of patch or the other. ### Updates using JSON patch [JSON patch](https://datatracker.ietf.org/doc/html/rfc6902) is a way to specify the modifications to perform on a resource. JSON patch uses paths and a limited set of operations to describe how to transform the current state of the resource into a new state. JSON patch documents are always arrays, where each element contains an operation, a path to the field to update, and the new value. For example, in this feature flag representation: ```json { \"name\": \"New recommendations engine\", \"key\": \"engine.enable\", \"description\": \"This is the description\", ... } ``` You can change the feature flag's description with the following patch document: ```json [{ \"op\": \"replace\", \"path\": \"/description\", \"value\": \"This is the new description\" }] ``` You can specify multiple modifications to perform in a single request. You can also test that certain preconditions are met before applying the patch: ```json [ { \"op\": \"test\", \"path\": \"/version\", \"value\": 10 }, { \"op\": \"replace\", \"path\": \"/description\", \"value\": \"The new description\" } ] ``` The above patch request tests whether the feature flag's `version` is `10`, and if so, changes the feature flag's description. Attributes that are not editable, such as a resource's `_links`, have names that start with an underscore. ### Updates using JSON merge patch [JSON merge patch](https://datatracker.ietf.org/doc/html/rfc7386) is another format for specifying the modifications to perform on a resource. JSON merge patch is less expressive than JSON patch. However, in many cases it is simpler to construct a merge patch document. For example, you can change a feature flag's description with the following merge patch document: ```json { \"description\": \"New flag description\" } ``` ### Updates using semantic patch Some resources support the semantic patch format. A semantic patch is a way to specify the modifications to perform on a resource as a set of executable instructions. Semantic patch allows you to be explicit about intent using precise, custom instructions. In many cases, you can define semantic patch instructions independently of the current state of the resource. This can be useful when defining a change that may be applied at a future date. To make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. Here's how: ``` Content-Type: application/json; domain-model=launchdarkly.semanticpatch ``` If you call a semantic patch resource without this header, you will receive a `400` response because your semantic patch will be interpreted as a JSON patch. The body of a semantic patch request takes the following properties: * `comment` (string): (Optional) A description of the update. * `environmentKey` (string): (Required for some resources only) The environment key. * `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 instruction requires parameters, you must include those parameters as additional fields in the object. The documentation for each resource that supports semantic patch includes the available instructions and any additional parameters. For example: ```json { \"comment\": \"optional comment\", \"instructions\": [ {\"kind\": \"turnFlagOn\"} ] } ``` Semantic patches are not applied partially; either all of the instructions are applied or none of them are. If **any** instruction is invalid, the endpoint returns an error and will not change the resource. If all instructions are valid, the request succeeds and the resources are updated if necessary, or left unchanged if they are already in the state you request. ### Updates with comments You can submit optional comments with `PATCH` changes. To submit a comment along with a JSON patch document, use the following format: ```json { \"comment\": \"This is a comment string\", \"patch\": [{ \"op\": \"replace\", \"path\": \"/description\", \"value\": \"The new description\" }] } ``` To submit a comment along with a JSON merge patch document, use the following format: ```json { \"comment\": \"This is a comment string\", \"merge\": { \"description\": \"New flag description\" } } ``` To submit a comment along with a semantic patch, use the following format: ```json { \"comment\": \"This is a comment string\", \"instructions\": [ {\"kind\": \"turnFlagOn\"} ] } ``` ## Errors The API always returns errors in a common format. Here's an example: ```json { \"code\": \"invalid_request\", \"message\": \"A feature with that key already exists\", \"id\": \"30ce6058-87da-11e4-b116-123b93f75cba\" } ``` The `code` indicates the general class of error. The `message` is a human-readable explanation of what went wrong. The `id` is a unique identifier. Use it when you're working with LaunchDarkly Support to debug a problem with a specific API call. ### HTTP status error response codes | Code | Definition | Description | Possible Solution | | ---- | ----------------- | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | | 400 | Invalid request | The request cannot be understood. | Ensure JSON syntax in request body is correct. | | 401 | Invalid access token | Requestor is unauthorized or does not have permission for this API call. | Ensure your API access token is valid and has the appropriate permissions. | | 403 | Forbidden | Requestor does not have access to this resource. | Ensure that the account member or access token has proper permissions set. | | 404 | Invalid resource identifier | The requested resource is not valid. | Ensure that the resource is correctly identified by ID or key. | | 405 | Method not allowed | The request method is not allowed on this resource. | Ensure that the HTTP verb is correct. | | 409 | Conflict | The API request can not be completed because it conflicts with a concurrent API request. | Retry your request. | | 422 | Unprocessable entity | The API request can not be completed because the update description can not be understood. | Ensure that the request body is correct for the type of patch you are using, either JSON patch or semantic patch. | 429 | Too many requests | Read [Rate limiting](https://launchdarkly.com/docs/api#rate-limiting). | Wait and try again later. | ## CORS The LaunchDarkly API supports Cross Origin Resource Sharing (CORS) for AJAX requests from any origin. If an `Origin` header is given in a request, it will be echoed as an explicitly allowed origin. Otherwise the request returns a wildcard, `Access-Control-Allow-Origin: *`. For more information on CORS, read the [CORS W3C Recommendation](http://www.w3.org/TR/cors). Example CORS headers might look like: ```http Access-Control-Allow-Headers: Accept, Content-Type, Content-Length, Accept-Encoding, Authorization Access-Control-Allow-Methods: OPTIONS, GET, DELETE, PATCH Access-Control-Allow-Origin: * Access-Control-Max-Age: 300 ``` You can make authenticated CORS calls just as you would make same-origin calls, using either [token or session-based authentication](https://launchdarkly.com/docs/api#authentication). If you are using session authentication, you should set the `withCredentials` property for your `xhr` request to `true`. You should never expose your access tokens to untrusted entities. ## Rate limiting We use several rate-limiting strategies to ensure the availability of our APIs. Rate-limited calls to our APIs return a `429` status code and include headers to indicate the current rate limit status. The specific headers returned depend on the API route that was called. Limits differ based on the route, authentication mechanism, and other factors. Each set of headers below appears only when the corresponding limit is being enforced for your call. A given route may be subject to any combination of these limits, so a response can include one, several, or none of these headers. A missing header indicates that the limit was not applied to this specific call; it does not necessarily indicate that the limit does not exist. To reduce usage before hitting a `429` status, program against whichever rate limit headers are present rather than expecting a specific header. We do not publicly document the specific number of calls permitted by any of these limits, and these limits may change. We encourage clients to program against the specification and rely on the headers described below, rather than hardcoding the current limits. > ### Rate limiting and SDKs > > LaunchDarkly SDKs are never rate limited and do not use the API endpoints defined here. LaunchDarkly uses a different set of approaches, including streaming/server-sent events and a global CDN, to ensure availability to the routes used by LaunchDarkly SDKs. ### Global rate limits Authenticated requests are subject to a global limit. This is the maximum number of calls that your account can make to the API per ten seconds. All service and personal access tokens on the account share this limit, so exceeding the limit with one access token will impact other tokens. Calls that are subject to global rate limits may return the headers below: | Header name | Description | | ------------------------------ | -------------------------------------------------------------------------------- | | `X-Ratelimit-Global-Limit` | The maximum number of requests the account is permitted to make per ten seconds. | | `X-Ratelimit-Global-Remaining` | The number of requests remaining in the current global rate limit window. | | `X-Ratelimit-Reset` | The time at which the current rate limit window resets in epoch milliseconds. | ### Route-level rate limits Some authenticated routes have custom rate limits. These also reset every ten seconds. Any service or personal access tokens hitting the same route share this limit, so exceeding the limit with one access token may impact other tokens. Calls that are subject to route-level rate limits return the headers below: | Header name | Description | | ----------------------------- | ----------------------------------------------------------------------------------------------------- | | `X-Ratelimit-Route-Limit` | The maximum number of requests to the current route permitted per ten seconds. | | `X-Ratelimit-Route-Remaining` | The number of requests remaining for the current route in the current rate limit window. | | `X-Ratelimit-Reset` | The time at which the current rate limit window resets in epoch milliseconds. | A _route_ represents a specific URL pattern and verb. For example, the [Delete environment](https://launchdarkly.com/docs/api/environments/delete-environment) endpoint is considered a single route, and each call to delete an environment counts against your route-level rate limit for that route. ### Access token rate limits Some calls are rate limited per access token. Unlike the global and route-level limits, this limit applies to a single service or personal access token on its own. Exceeding a limit with one access token does not affect other tokens on the account. Calls that are subject to access token rate limits return these headers: | Header name | Description | | ---------------------------------- | --------------------------------------------------------------------------------------- | | `X-Ratelimit-Auth-Token-Limit` | The maximum number of requests the access token can make per ten seconds. | | `X-Ratelimit-Auth-Token-Remaining` | The number of requests remaining for the access token in the current rate limit window. | | `X-Ratelimit-Auth-Token-Reset` | The time at which the current rate limit window resets in epoch milliseconds. | Unlike the other rate limits, access token rate limits report their own reset time in the `X-Ratelimit-Auth-Token-Reset` header instead of in `X-Ratelimit-Reset`. ### IP-based rate limiting We also employ IP-based rate limiting on some API routes. If you hit an IP-based rate limit, your API response will include a `Retry-After` header indicating how long to wait before re-trying the call. Clients must wait at least `Retry-After` seconds before making additional calls to our API, and should employ jitter and backoff strategies to avoid triggering rate limits again. ## OpenAPI (Swagger) and client libraries We have a [complete OpenAPI (Swagger) specification](https://app.launchdarkly.com/api/v2/openapi.json) for our API. We auto-generate multiple client libraries based on our OpenAPI specification. To learn more, visit the [collection of client libraries on GitHub](https://github.com/search?q=topic%3Alaunchdarkly-api+org%3Alaunchdarkly&type=Repositories). Alternatively, you can use the specification to generate client libraries to interact with our REST API in your language of choice. Or, you can refer to our API endpoints' documentation for guidance on how to make requests with a common HTTP library in your language of choice. Our OpenAPI specification is supported by several API-based tools such as Postman and Insomnia. In many cases, you can directly import our specification to explore our APIs. ## Method overriding Some firewalls and HTTP clients restrict the use of verbs other than `GET` and `POST`. In those environments, our API endpoints that use `DELETE`, `PATCH`, and `PUT` verbs are inaccessible. To avoid this issue, our API supports the `X-HTTP-Method-Override` header, allowing clients to \"tunnel\" `DELETE`, `PATCH`, and `PUT` requests using a `POST` request. For example, to call a `PATCH` endpoint using a `POST` request, you can include `X-HTTP-Method-Override:PATCH` as a header. ## Beta resources We sometimes release new API resources in **beta** status before we release them with general availability. Resources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible. We try to promote resources into general availability as quickly as possible. This happens after sufficient testing and when we're satisfied that we no longer need to make backwards-incompatible changes. We mark beta resources with a \"Beta\" callout in our documentation, pictured below: > ### This feature is in beta > > To use this feature, pass in a header including the `LD-API-Version` key with value set to `beta`. Use this header with each call. To learn more, read [Beta resources](https://launchdarkly.com/docs/api#beta-resources). > > Resources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible. ### Using beta resources To use a beta resource, you must include a header in the request. If you call a beta resource without this header, you receive a `403` response. Use this header: ``` LD-API-Version: beta ``` ## Federal and EU environments In addition to the commercial versions, LaunchDarkly offers instances for federal agencies and those based in the European Union (EU). ### Federal environments The version of LaunchDarkly that is available on domains controlled by the United States government is different from the version of LaunchDarkly available to the general public. If you are an employee or contractor for a United States federal agency and use LaunchDarkly in your work, you likely use the federal instance of LaunchDarkly. If you are working in the federal instance of LaunchDarkly, the base URI for each request is `https://app.launchdarkly.us`. To learn more, read [LaunchDarkly in federal environments](https://launchdarkly.com/docs/home/infrastructure/federal). ### EU environments The version of LaunchDarkly that is available in the EU is different from the version of LaunchDarkly available to other regions. If you are based in the EU, you likely use the EU instance of LaunchDarkly. The LaunchDarkly EU instance complies with EU data residency principles, including the protection and confidentiality of EU customer information. If you are working in the EU instance of LaunchDarkly, the base URI for each request is `https://app.eu.launchdarkly.com`. To learn more, read [LaunchDarkly in the European Union (EU)](https://launchdarkly.com/docs/home/infrastructure/eu). ## Versioning We try hard to keep our REST API backwards compatible, but we occasionally have to make backwards-incompatible changes in the process of shipping new features. These breaking changes can cause unexpected behavior if you don't prepare for them accordingly. Updates to our REST API include support for the latest features in LaunchDarkly. We also release a new version of our REST API every time we make a breaking change. We provide simultaneous support for multiple API versions so you can migrate from your current API version to a new version at your own pace. ### Setting the API version per request You can set the API version on a specific request by sending an `LD-API-Version` header, as shown in the example below: ``` LD-API-Version: 20240415 ``` The header value is the version number of the API version you would like to request. The number for each version corresponds to the date the version was released in `yyyymmdd` format. In the example above the version `20240415` corresponds to April 15, 2024. ### Setting the API version per access token When you create an access token, you must specify a specific version of the API to use. This ensures that integrations using this token cannot be broken by version changes. Tokens created before versioning was released have their version set to `20160426`, which is the version of the API that existed before the current versioning scheme, so that they continue working the same way they did before versioning. If you would like to upgrade your integration to use a new API version, you can explicitly set the header described above. > ### Best practice: Set the header for every client or integration > > We recommend that you set the API version header explicitly in any client or integration you build. > > Only rely on the access token API version during manual testing. ### API version changelog <table> <tr> <th>Version</th> <th>Changes</th> <th>End of life (EOL)</th> </tr> <tr> <td>`20240415`</td> <td> <ul><li>Changed several endpoints from unpaginated to paginated. Use the `limit` and `offset` query parameters to page through the results.</li> <li>Changed the [list access tokens](https://launchdarkly.com/docs/api/access-tokens/get-tokens) endpoint: <ul><li>Response is now paginated with a default limit of `25`</li></ul></li> <li>Changed the [list account members](https://launchdarkly.com/docs/api/account-members/get-members) endpoint: <ul><li>The `accessCheck` filter is no longer available</li></ul></li> <li>Changed the [list custom roles](https://launchdarkly.com/docs/api/custom-roles/get-custom-roles) endpoint: <ul><li>Response is now paginated with a default limit of `20`</li></ul></li> <li>Changed the [list feature flags](https://launchdarkly.com/docs/api/feature-flags/get-feature-flags) endpoint: <ul><li>Response is now paginated with a default limit of `20`</li><li>The `environments` field is now only returned if the request is filtered by environment, using the `filterEnv` query parameter</li><li>The `followerId`, `hasDataExport`, `status`, `contextKindTargeted`, and `segmentTargeted` filters are no longer available</li><li>The `compare` query parameter is no longer available</li></ul></li> <li>Changed the [list segments](https://launchdarkly.com/docs/api/segments/get-segments) endpoint: <ul><li>Response is now paginated with a default limit of `20`</li></ul></li> <li>Changed the [list teams](https://launchdarkly.com/docs/api/teams/get-teams) endpoint: <ul><li>The `expand` parameter no longer supports including `projects` or `roles`</li><li>In paginated results, the maximum page size is now 100</li></ul></li> <li>Changed the [get workflows](https://launchdarkly.com/docs/api/workflows/get-workflows) endpoint: <ul><li>Response is now paginated with a default limit of `20`</li><li>The `_conflicts` field in the response is no longer available</li></ul></li> </ul> </td> <td>Current</td> </tr> <tr> <td>`20220603`</td> <td> <ul><li>Changed the [list projects](https://launchdarkly.com/docs/api/projects/get-projects) return value:<ul><li>Response is now paginated with a default limit of `20`.</li><li>Added support for filter and sort.</li><li>The project `environments` field is now expandable. This field is omitted by default.</li></ul></li><li>Changed the [get project](https://launchdarkly.com/docs/api/projects/get-project) return value:<ul><li>The `environments` field is now expandable. This field is omitted by default.</li></ul></li></ul> </td> <td>2025-04-15</td> </tr> <tr> <td>`20210729`</td> <td> <ul><li>Changed the [create approval request](https://launchdarkly.com/docs/api/approvals/post-approval-request) return value. It now returns HTTP Status Code `201` instead of `200`.</li><li> Changed the [get user](https://launchdarkly.com/docs/api/users/get-user) return value. It now returns a user record, not a user. </li><li>Added additional optional fields to environment, segments, flags, members, and segments, including the ability to create big segments. </li><li> Added default values for flag variations when new environments are created. </li><li>Added filtering and pagination for getting flags and members, including `limit`, `number`, `filter`, and `sort` query parameters. </li><li>Added endpoints for expiring user targets for flags and segments, scheduled changes, access tokens, Relay Proxy configuration, integrations and subscriptions, and approvals. </li></ul> </td> <td>2023-06-03</td> </tr> <tr> <td>`20191212`</td> <td> <ul><li>[List feature flags](https://launchdarkly.com/docs/api/feature-flags/get-feature-flags) now defaults to sending summaries of feature flag configurations, equivalent to setting the query parameter `summary=true`. Summaries omit flag targeting rules and individual user targets from the payload. </li><li> Added endpoints for flags, flag status, projects, environments, audit logs, members, users, custom roles, segments, usage, streams, events, and data export. </li></ul> </td> <td>2022-07-29</td> </tr> <tr> <td>`20160426`</td> <td> <ul><li>Initial versioning of API. Tokens created before versioning have their version set to this.</li></ul> </td> <td>2020-12-12</td> </tr> </table> To learn more about how EOL is determined, read LaunchDarkly's [End of Life (EOL) Policy](https://launchdarkly.com/policies/end-of-life-policy/).
5
+
6
+ The version of the OpenAPI document: 2.0
7
+ Contact: support@launchdarkly.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.18.0
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for LaunchDarklyApi::AssignmentDataSourceInput
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe LaunchDarklyApi::AssignmentDataSourceInput do
21
+ #let(:instance) { LaunchDarklyApi::AssignmentDataSourceInput.new }
22
+
23
+ describe 'test an instance of AssignmentDataSourceInput' do
24
+ it 'should create an instance of AssignmentDataSourceInput' do
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(LaunchDarklyApi::AssignmentDataSourceInput)
27
+ end
28
+ end
29
+
30
+ describe 'test attribute "key"' do
31
+ it 'should work' do
32
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
33
+ end
34
+ end
35
+
36
+ describe 'test attribute "experiment_id"' do
37
+ it 'should work' do
38
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
39
+ end
40
+ end
41
+
42
+ describe 'test attribute "start_time"' do
43
+ it 'should work' do
44
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
45
+ end
46
+ end
47
+
48
+ describe 'test attribute "end_time"' do
49
+ it 'should work' do
50
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
51
+ end
52
+ end
53
+
54
+ end
@@ -89,6 +89,16 @@ describe LaunchDarklyApi::Experiment do
89
89
  end
90
90
  end
91
91
 
92
+ describe 'test attribute "assignment_source_type"' do
93
+ it 'should work' do
94
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
95
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["launchdarkly", "snowflake", "databricks", "redshift", "bigquery", "clickhouse"])
96
+ # validator.allowable_values.each do |value|
97
+ # expect { instance.assignment_source_type = value }.not_to raise_error
98
+ # end
99
+ end
100
+ end
101
+
92
102
  describe 'test attribute "archived_date"' do
93
103
  it 'should work' do
94
104
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
@@ -93,4 +93,10 @@ describe LaunchDarklyApi::IntegrationDeliveryConfiguration do
93
93
  end
94
94
  end
95
95
 
96
+ describe 'test attribute "_status"' do
97
+ it 'should work' do
98
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
99
+ end
100
+ end
101
+
96
102
  end