launchdarkly_api 25.2.0 → 25.3.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 (184) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +64 -39
  3. data/docs/AIConfig.md +7 -5
  4. data/docs/AIConfigPatch.md +8 -4
  5. data/docs/AIConfigPost.md +8 -6
  6. data/docs/AIConfigTargeting.md +3 -3
  7. data/docs/AIConfigTargetingEnvironmentRule.md +8 -0
  8. data/docs/AIConfigTargetingEnvironmentRuleClause.md +2 -0
  9. data/docs/AIConfigVariation.md +1 -1
  10. data/docs/AIConfigVariationPatch.md +1 -1
  11. data/docs/AgentControlApi.md +110 -110
  12. data/docs/AgentOptimization.md +1 -1
  13. data/docs/AgentOptimizationJudge.md +1 -1
  14. data/docs/AgentOptimizationPost.md +1 -1
  15. data/docs/AgentSkill.md +3 -1
  16. data/docs/AgentSkillPatch.md +3 -1
  17. data/docs/AgentSkillPost.md +3 -1
  18. data/docs/AiConfigsMetricListingRep.md +2 -0
  19. data/docs/ApprovalsApi.md +1 -1
  20. data/docs/CreateFlagReleasePlanRequest.md +32 -0
  21. data/docs/EnvironmentReleasePlan.md +38 -0
  22. data/docs/EnvironmentReleasePlanClause.md +28 -0
  23. data/docs/EnvironmentReleasePlanMetric.md +20 -0
  24. data/docs/EnvironmentReleasePlanPhase.md +24 -0
  25. data/docs/EnvironmentReleasePlanProgressiveRelease.md +26 -0
  26. data/docs/EnvironmentReleasePlanProgressiveReleaseRep.md +26 -0
  27. data/docs/EnvironmentReleasePlanStep.md +22 -0
  28. data/docs/EnvironmentReleasePlans.md +22 -0
  29. data/docs/EnvironmentReleasePlansBetaApi.md +633 -0
  30. data/docs/EnvironmentReleasePlansLink.md +20 -0
  31. data/docs/EnvironmentReleasePlansPaginatedLinks.md +26 -0
  32. data/docs/EnvironmentReleasesMetricListingRep.md +2 -0
  33. data/docs/{ReleaseMethod.md → ExecutionMode.md} +2 -2
  34. data/docs/FeatureFlagsApi.md +1 -1
  35. data/docs/FlagReleasePlan.md +36 -0
  36. data/docs/FlagReleasePlanEnvironment.md +24 -0
  37. data/docs/FlagReleasePlanRequest.md +30 -0
  38. data/docs/FlagReleasePlansBetaApi.md +392 -0
  39. data/docs/FlagReleasePlansError.md +20 -0
  40. data/docs/FlagReleasePlansLink.md +20 -0
  41. data/docs/FlagReleasePlansPaginatedLinks.md +26 -0
  42. data/docs/ListFlagReleasePlansResponse.md +22 -0
  43. data/docs/MaintainerIdentifier.md +79 -0
  44. data/docs/MaintainerIdentifierMember.md +20 -0
  45. data/docs/MaintainerIdentifierTeam.md +20 -0
  46. data/docs/MaintainerResponse.md +79 -0
  47. data/docs/MaintainerResponseMember.md +26 -0
  48. data/docs/MaintainerResponseTeam.md +22 -0
  49. data/docs/PinnedSkillToolRef.md +20 -0
  50. data/docs/PostEnvironmentReleasePlanRequest.md +26 -0
  51. data/docs/PutDefaultEnvironmentReleasePlanRequest.md +18 -0
  52. data/docs/PutEnvironmentReleasePlanRequest.md +26 -0
  53. data/docs/PutFlagReleasePlanRequest.md +32 -0
  54. data/docs/QuickStats.md +2 -2
  55. data/docs/SkillToolRef.md +20 -0
  56. data/docs/ToolReferences.md +5 -1
  57. data/docs/ToolSkillReference.md +22 -0
  58. data/docs/TriggerType.md +15 -0
  59. data/lib/launchdarkly_api/api/agent_control_api.rb +98 -98
  60. data/lib/launchdarkly_api/api/approvals_api.rb +2 -2
  61. data/lib/launchdarkly_api/api/environment_release_plans_beta_api.rb +730 -0
  62. data/lib/launchdarkly_api/api/feature_flags_api.rb +2 -2
  63. data/lib/launchdarkly_api/api/{release_policies_beta_api.rb → flag_release_plans_beta_api.rb} +173 -212
  64. data/lib/launchdarkly_api/models/agent_optimization.rb +1 -1
  65. data/lib/launchdarkly_api/models/agent_optimization_judge.rb +1 -1
  66. data/lib/launchdarkly_api/models/agent_optimization_post.rb +1 -1
  67. data/lib/launchdarkly_api/models/agent_skill.rb +14 -2
  68. data/lib/launchdarkly_api/models/agent_skill_patch.rb +16 -4
  69. data/lib/launchdarkly_api/models/agent_skill_post.rb +16 -4
  70. data/lib/launchdarkly_api/models/ai_config.rb +16 -6
  71. data/lib/launchdarkly_api/models/ai_config_patch.rb +27 -7
  72. data/lib/launchdarkly_api/models/ai_config_post.rb +19 -9
  73. data/lib/launchdarkly_api/models/ai_config_targeting.rb +3 -3
  74. data/lib/launchdarkly_api/models/ai_config_targeting_environment_rule.rb +40 -1
  75. data/lib/launchdarkly_api/models/ai_config_targeting_environment_rule_clause.rb +11 -1
  76. data/lib/launchdarkly_api/models/ai_config_variation.rb +1 -1
  77. data/lib/launchdarkly_api/models/ai_config_variation_patch.rb +1 -1
  78. data/lib/launchdarkly_api/models/ai_configs_metric_listing_rep.rb +11 -1
  79. data/lib/launchdarkly_api/models/create_flag_release_plan_request.rb +335 -0
  80. data/lib/launchdarkly_api/models/environment_release_plan.rb +426 -0
  81. data/lib/launchdarkly_api/models/{release_policies_access_allowed_reason.rb → environment_release_plan_clause.rb} +98 -65
  82. data/lib/launchdarkly_api/models/{release_policies_access_allowed_rep.rb → environment_release_plan_metric.rb} +28 -41
  83. data/lib/launchdarkly_api/models/environment_release_plan_phase.rb +208 -0
  84. data/lib/launchdarkly_api/models/environment_release_plan_progressive_release.rb +285 -0
  85. data/lib/launchdarkly_api/models/{release_policies_access_denied_reason.rb → environment_release_plan_progressive_release_rep.rb} +85 -67
  86. data/lib/launchdarkly_api/models/{release_policy_stage.rb → environment_release_plan_step.rb} +43 -4
  87. data/lib/launchdarkly_api/models/{release_policies_response.rb → environment_release_plans.rb} +16 -7
  88. data/lib/launchdarkly_api/models/{release_policies_access_denied.rb → environment_release_plans_link.rb} +16 -50
  89. data/lib/launchdarkly_api/models/environment_release_plans_paginated_links.rb +200 -0
  90. data/lib/launchdarkly_api/models/environment_releases_metric_listing_rep.rb +11 -1
  91. data/lib/launchdarkly_api/models/{release_method.rb → execution_mode.rb} +6 -7
  92. data/lib/launchdarkly_api/models/expanded_ai_config.rb +1 -1
  93. data/lib/launchdarkly_api/models/flag_release_plan.rb +359 -0
  94. data/lib/launchdarkly_api/models/{put_release_policy_request.rb → flag_release_plan_environment.rb} +47 -65
  95. data/lib/launchdarkly_api/models/{post_release_policy_request.rb → flag_release_plan_request.rb} +64 -67
  96. data/lib/launchdarkly_api/models/flag_release_plans_error.rb +208 -0
  97. data/lib/launchdarkly_api/models/flag_release_plans_link.rb +156 -0
  98. data/lib/launchdarkly_api/models/flag_release_plans_paginated_links.rb +200 -0
  99. data/lib/launchdarkly_api/models/list_flag_release_plans_response.rb +202 -0
  100. data/lib/launchdarkly_api/models/maintainer_identifier.rb +56 -0
  101. data/lib/launchdarkly_api/models/maintainer_identifier_member.rb +214 -0
  102. data/lib/launchdarkly_api/models/{progressive_release_config.rb → maintainer_identifier_team.rb} +66 -32
  103. data/lib/launchdarkly_api/models/maintainer_response.rb +56 -0
  104. data/lib/launchdarkly_api/models/maintainer_response_member.rb +225 -0
  105. data/lib/launchdarkly_api/models/maintainer_response_team.rb +206 -0
  106. data/lib/launchdarkly_api/models/{release_policies_access_rep.rb → pinned_skill_tool_ref.rb} +46 -45
  107. data/lib/launchdarkly_api/models/{release_policy.rb → post_environment_release_plan_request.rb} +93 -120
  108. data/lib/launchdarkly_api/models/{release_policies_access.rb → put_default_environment_release_plan_request.rb} +33 -44
  109. data/lib/launchdarkly_api/models/put_environment_release_plan_request.rb +285 -0
  110. data/lib/launchdarkly_api/models/put_flag_release_plan_request.rb +309 -0
  111. data/lib/launchdarkly_api/models/quick_stats.rb +2 -2
  112. data/lib/launchdarkly_api/models/skill_tool_ref.rb +195 -0
  113. data/lib/launchdarkly_api/models/tool_references.rb +26 -4
  114. data/lib/launchdarkly_api/models/tool_skill_reference.rb +220 -0
  115. data/lib/launchdarkly_api/models/trigger_type.rb +42 -0
  116. data/lib/launchdarkly_api/version.rb +1 -1
  117. data/lib/launchdarkly_api.rb +35 -16
  118. data/spec/api/agent_control_api_spec.rb +49 -49
  119. data/spec/api/approvals_api_spec.rb +1 -1
  120. data/spec/api/environment_release_plans_beta_api_spec.rb +156 -0
  121. data/spec/api/feature_flags_api_spec.rb +1 -1
  122. data/spec/api/{release_policies_beta_api_spec.rb → flag_release_plans_beta_api_spec.rb} +43 -56
  123. data/spec/models/agent_skill_patch_spec.rb +6 -0
  124. data/spec/models/agent_skill_post_spec.rb +6 -0
  125. data/spec/models/agent_skill_spec.rb +6 -0
  126. data/spec/models/ai_config_patch_spec.rb +12 -0
  127. data/spec/models/ai_config_post_spec.rb +6 -0
  128. data/spec/models/ai_config_spec.rb +6 -0
  129. data/spec/models/ai_config_targeting_environment_rule_clause_spec.rb +6 -0
  130. data/spec/models/ai_config_targeting_environment_rule_spec.rb +24 -0
  131. data/spec/models/ai_configs_metric_listing_rep_spec.rb +6 -0
  132. data/spec/models/{release_policy_spec.rb → create_flag_release_plan_request_spec.rb} +13 -19
  133. data/spec/models/{release_policies_access_allowed_reason_spec.rb → environment_release_plan_clause_spec.rb} +16 -16
  134. data/spec/models/{release_policies_access_rep_spec.rb → environment_release_plan_metric_spec.rb} +8 -8
  135. data/spec/models/environment_release_plan_phase_spec.rb +54 -0
  136. data/spec/models/environment_release_plan_progressive_release_rep_spec.rb +68 -0
  137. data/spec/models/environment_release_plan_progressive_release_spec.rb +68 -0
  138. data/spec/models/environment_release_plan_spec.rb +100 -0
  139. data/spec/models/{release_policies_access_allowed_rep_spec.rb → environment_release_plan_step_spec.rb} +14 -8
  140. data/spec/models/{release_policies_access_denied_spec.rb → environment_release_plans_link_spec.rb} +8 -8
  141. data/spec/models/{guarded_release_config_spec.rb → environment_release_plans_paginated_links_spec.rb} +11 -17
  142. data/spec/models/environment_release_plans_spec.rb +48 -0
  143. data/spec/models/environment_releases_metric_listing_rep_spec.rb +6 -0
  144. data/spec/models/{release_method_spec.rb → execution_mode_spec.rb} +6 -6
  145. data/spec/models/flag_release_plan_environment_spec.rb +54 -0
  146. data/spec/models/{release_policies_access_denied_reason_spec.rb → flag_release_plan_request_spec.rb} +18 -16
  147. data/spec/models/flag_release_plan_spec.rb +90 -0
  148. data/spec/models/{release_policy_scope_spec.rb → flag_release_plans_error_spec.rb} +8 -8
  149. data/spec/models/{release_policy_stage_spec.rb → flag_release_plans_link_spec.rb} +8 -8
  150. data/spec/models/{put_release_policy_request_spec.rb → flag_release_plans_paginated_links_spec.rb} +11 -11
  151. data/spec/models/list_flag_release_plans_response_spec.rb +48 -0
  152. data/spec/models/maintainer_identifier_member_spec.rb +46 -0
  153. data/spec/models/maintainer_identifier_spec.rb +44 -0
  154. data/spec/models/{progressive_release_config_spec.rb → maintainer_identifier_team_spec.rb} +12 -8
  155. data/spec/models/maintainer_response_member_spec.rb +64 -0
  156. data/spec/models/maintainer_response_spec.rb +44 -0
  157. data/spec/models/maintainer_response_team_spec.rb +52 -0
  158. data/spec/models/{release_policies_access_spec.rb → pinned_skill_tool_ref_spec.rb} +8 -8
  159. data/spec/models/{post_release_policy_request_spec.rb → post_environment_release_plan_request_spec.rb} +15 -17
  160. data/spec/models/put_default_environment_release_plan_request_spec.rb +36 -0
  161. data/spec/models/put_environment_release_plan_request_spec.rb +64 -0
  162. data/spec/models/put_flag_release_plan_request_spec.rb +78 -0
  163. data/spec/models/{release_policies_response_spec.rb → skill_tool_ref_spec.rb} +8 -8
  164. data/spec/models/tool_references_spec.rb +12 -0
  165. data/spec/models/tool_skill_reference_spec.rb +48 -0
  166. data/spec/models/trigger_type_spec.rb +30 -0
  167. metadata +141 -65
  168. data/docs/GuardedReleaseConfig.md +0 -28
  169. data/docs/PostReleasePolicyRequest.md +0 -28
  170. data/docs/ProgressiveReleaseConfig.md +0 -20
  171. data/docs/PutReleasePolicyRequest.md +0 -26
  172. data/docs/ReleasePoliciesAccess.md +0 -20
  173. data/docs/ReleasePoliciesAccessAllowedReason.md +0 -28
  174. data/docs/ReleasePoliciesAccessAllowedRep.md +0 -20
  175. data/docs/ReleasePoliciesAccessDenied.md +0 -20
  176. data/docs/ReleasePoliciesAccessDeniedReason.md +0 -28
  177. data/docs/ReleasePoliciesAccessRep.md +0 -20
  178. data/docs/ReleasePoliciesBetaApi.md +0 -466
  179. data/docs/ReleasePoliciesResponse.md +0 -20
  180. data/docs/ReleasePolicy.md +0 -34
  181. data/docs/ReleasePolicyScope.md +0 -20
  182. data/docs/ReleasePolicyStage.md +0 -20
  183. data/lib/launchdarkly_api/models/guarded_release_config.rb +0 -224
  184. data/lib/launchdarkly_api/models/release_policy_scope.rb +0 -181
@@ -197,7 +197,7 @@ describe 'FeatureFlagsApi' do
197
197
 
198
198
  # unit tests for patch_feature_flag
199
199
  # Update feature flag
200
- # Perform a partial update to a feature flag. The request body must be a valid semantic patch, JSON patch, or JSON merge patch. To learn more the different formats, read [Updates](https://launchdarkly.com/docs/api#updates). ### Using semantic patches on a feature flag To make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](https://launchdarkly.com/docs/api#updates-using-semantic-patch). The body of a semantic patch request for updating feature flags takes the following properties: * `comment` (string): (Optional) A description of the update. * `environmentKey` (string): (Required for some instructions only) The key of the LaunchDarkly environment. * `instructions` (array): (Required) A list of actions the update should perform. Each action in the list must be an object with a `kind` property that indicates the instruction. If the action requires parameters, you must include those parameters as additional fields in the object. The body of a single semantic patch can contain many different instructions. ### Instructions Semantic patch requests support the following `kind` instructions for updating feature flags. <details> <summary>Click to expand instructions for <strong>turning flags on and off</strong></summary> These instructions require the `environmentKey` parameter. #### turnFlagOff Sets the flag's targeting state to **Off**. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [ { \"kind\": \"turnFlagOff\" } ] } ``` #### turnFlagOn Sets the flag's targeting state to **On**. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [ { \"kind\": \"turnFlagOn\" } ] } ``` </details><br /> <details> <summary>Click to expand instructions for <strong>working with targeting and variations</strong></summary> These instructions require the `environmentKey` parameter. Several of the instructions for working with targeting and variations require flag rule IDs, variation IDs, or clause IDs as parameters. Each of these are returned as part of the [Get feature flag](https://launchdarkly.com/docs/api/feature-flags/get-feature-flag) response. The flag rule ID is the `_id` field of each element in the `rules` array within each environment listed in the `environments` object. The variation ID is the `_id` field in each element of the `variations` array. The clause ID is the `_id` field of each element of the `clauses` array within the `rules` array within each environment listed in the `environments` object. #### addClauses Adds the given clauses to the rule indicated by `ruleId`. ##### Parameters - `ruleId`: ID of a rule in the flag. - `clauses`: Array of clause objects, with `contextKind` (string), `attribute` (string), `op` (string), `negate` (boolean), and `values` (array of strings, numbers, or dates) properties. The `contextKind`, `attribute`, and `values` are case sensitive. The `op` must be lower-case. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"addClauses\", \"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\", \"clauses\": [{ \"contextKind\": \"user\", \"attribute\": \"country\", \"op\": \"in\", \"negate\": false, \"values\": [\"USA\", \"Canada\"] }] }] } ``` #### addPrerequisite Adds the flag indicated by `key` with variation `variationId` as a prerequisite to the flag in the path parameter. ##### Parameters - `key`: Flag key of the prerequisite flag. - `variationId`: ID of a variation of the prerequisite flag. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"addPrerequisite\", \"key\": \"example-prereq-flag-key\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" }] } ``` #### addRule Adds a new targeting rule to the flag. The rule may contain `clauses` and serve the variation that `variationId` indicates, or serve a percentage rollout that `rolloutWeights`, `rolloutBucketBy`, and `rolloutContextKind` indicate. If you set `beforeRuleId`, this adds the new rule before the indicated rule. Otherwise, adds the new rule to the end of the list. ##### Parameters - `clauses`: Array of clause objects, with `contextKind` (string), `attribute` (string), `op` (string), `negate` (boolean), and `values` (array of strings, numbers, or dates) properties. The `contextKind`, `attribute`, and `values` are case sensitive. The `op` must be lower-case. - `beforeRuleId`: (Optional) ID of a flag rule. - Either - `variationId`: ID of a variation of the flag. or - `rolloutWeights`: (Optional) Map of `variationId` to weight, in thousandths of a percent (0-100000). - `rolloutBucketBy`: (Optional) Context attribute available in the specified `rolloutContextKind`. - `rolloutContextKind`: (Optional) Context kind, defaults to `user` Here's an example that uses a `variationId`: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"addRule\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\", \"clauses\": [{ \"contextKind\": \"organization\", \"attribute\": \"located_in\", \"op\": \"in\", \"negate\": false, \"values\": [\"Sweden\", \"Norway\"] }] }] } ``` Here's an example that uses a percentage rollout: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"addRule\", \"clauses\": [{ \"contextKind\": \"organization\", \"attribute\": \"located_in\", \"op\": \"in\", \"negate\": false, \"values\": [\"Sweden\", \"Norway\"] }], \"rolloutContextKind\": \"organization\", \"rolloutWeights\": { \"2f43f67c-3e4e-4945-a18a-26559378ca00\": 15000, // serve 15% this variation \"e5830889-1ec5-4b0c-9cc9-c48790090c43\": 85000 // serve 85% this variation } }] } ``` #### addTargets Adds context keys to the individual context targets for the context kind that `contextKind` specifies and the variation that `variationId` specifies. Returns an error if this causes the flag to target the same context key in multiple variations. ##### Parameters - `values`: List of context keys. - `contextKind`: (Optional) Context kind to target, defaults to `user` - `variationId`: ID of a variation on the flag. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"addTargets\", \"values\": [\"context-key-123abc\", \"context-key-456def\"], \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" }] } ``` #### addUserTargets Adds user keys to the individual user targets for the variation that `variationId` specifies. Returns an error if this causes the flag to target the same user key in multiple variations. If you are working with contexts, use `addTargets` instead of this instruction. ##### Parameters - `values`: List of user keys. - `variationId`: ID of a variation on the flag. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"addUserTargets\", \"values\": [\"user-key-123abc\", \"user-key-456def\"], \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" }] } ``` #### addValuesToClause Adds `values` to the values of the clause that `ruleId` and `clauseId` indicate. Does not update the context kind, attribute, or operator. ##### Parameters - `ruleId`: ID of a rule in the flag. - `clauseId`: ID of a clause in that rule. - `values`: Array of strings, case sensitive. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"addValuesToClause\", \"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\", \"clauseId\": \"10a58772-3121-400f-846b-b8a04e8944ed\", \"values\": [\"beta_testers\"] }] } ``` #### addVariation Adds a variation to the flag. ##### Parameters - `value`: The variation value. - `name`: (Optional) The variation name. - `description`: (Optional) A description for the variation. Here's an example: ```json { \"instructions\": [ { \"kind\": \"addVariation\", \"value\": 20, \"name\": \"New variation\" } ] } ``` #### clearTargets Removes all individual targets from the variation that `variationId` specifies. This includes both user and non-user targets. ##### Parameters - `variationId`: ID of a variation on the flag. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [ { \"kind\": \"clearTargets\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" } ] } ``` #### clearUserTargets Removes all individual user targets from the variation that `variationId` specifies. If you are working with contexts, use `clearTargets` instead of this instruction. ##### Parameters - `variationId`: ID of a variation on the flag. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [ { \"kind\": \"clearUserTargets\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" } ] } ``` #### removeClauses Removes the clauses specified by `clauseIds` from the rule indicated by `ruleId`. ##### Parameters - `ruleId`: ID of a rule in the flag. - `clauseIds`: Array of IDs of clauses in the rule. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"removeClauses\", \"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\", \"clauseIds\": [\"10a58772-3121-400f-846b-b8a04e8944ed\", \"36a461dc-235e-4b08-97b9-73ce9365873e\"] }] } ``` #### removePrerequisite Removes the prerequisite flag indicated by `key`. Does nothing if this prerequisite does not exist. ##### Parameters - `key`: Flag key of an existing prerequisite flag. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [ { \"kind\": \"removePrerequisite\", \"key\": \"prereq-flag-key-123abc\" } ] } ``` #### removeRule Removes the targeting rule specified by `ruleId`. Does nothing if the rule does not exist. ##### Parameters - `ruleId`: ID of a rule in the flag. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [ { \"kind\": \"removeRule\", \"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\" } ] } ``` #### removeTargets Removes context keys from the individual context targets for the context kind that `contextKind` specifies and the variation that `variationId` specifies. Does nothing if the flag does not target the context keys. ##### Parameters - `values`: List of context keys. - `contextKind`: (Optional) Context kind to target, defaults to `user` - `variationId`: ID of a flag variation. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"removeTargets\", \"values\": [\"context-key-123abc\", \"context-key-456def\"], \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" }] } ``` #### removeUserTargets Removes user keys from the individual user targets for the variation that `variationId` specifies. Does nothing if the flag does not target the user keys. If you are working with contexts, use `removeTargets` instead of this instruction. ##### Parameters - `values`: List of user keys. - `variationId`: ID of a flag variation. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"removeUserTargets\", \"values\": [\"user-key-123abc\", \"user-key-456def\"], \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" }] } ``` #### removeValuesFromClause Removes `values` from the values of the clause indicated by `ruleId` and `clauseId`. Does not update the context kind, attribute, or operator. ##### Parameters - `ruleId`: ID of a rule in the flag. - `clauseId`: ID of a clause in that rule. - `values`: Array of strings, case sensitive. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"removeValuesFromClause\", \"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\", \"clauseId\": \"10a58772-3121-400f-846b-b8a04e8944ed\", \"values\": [\"beta_testers\"] }] } ``` #### removeVariation Removes a variation from the flag. ##### Parameters - `variationId`: ID of a variation of the flag to remove. Here's an example: ```json { \"instructions\": [ { \"kind\": \"removeVariation\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" } ] } ``` #### reorderRules Rearranges the rules to match the order given in `ruleIds`. Returns an error if `ruleIds` does not match the current set of rules on the flag. ##### Parameters - `ruleIds`: Array of IDs of all rules in the flag. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"reorderRules\", \"ruleIds\": [\"a902ef4a-2faf-4eaf-88e1-ecc356708a29\", \"63c238d1-835d-435e-8f21-c8d5e40b2a3d\"] }] } ``` #### replacePrerequisites Removes all existing prerequisites and replaces them with the list you provide. ##### Parameters - `prerequisites`: A list of prerequisites. Each item in the list must include a flag `key` and `variationId`. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [ { \"kind\": \"replacePrerequisites\", \"prerequisites\": [ { \"key\": \"prereq-flag-key-123abc\", \"variationId\": \"10a58772-3121-400f-846b-b8a04e8944ed\" }, { \"key\": \"another-prereq-flag-key-456def\", \"variationId\": \"e5830889-1ec5-4b0c-9cc9-c48790090c43\" } ] } ] } ``` #### replaceRules Removes all targeting rules for the flag and replaces them with the list you provide. ##### Parameters - `rules`: A list of rules. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [ { \"kind\": \"replaceRules\", \"rules\": [ { \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\", \"description\": \"My new rule\", \"clauses\": [ { \"contextKind\": \"user\", \"attribute\": \"segmentMatch\", \"op\": \"segmentMatch\", \"values\": [\"test\"] } ], \"trackEvents\": true } ] } ] } ``` #### replaceTargets Removes all existing targeting and replaces it with the list of targets you provide. ##### Parameters - `targets`: A list of context targeting. Each item in the list includes an optional `contextKind` that defaults to `user`, a required `variationId`, and a required list of `values`. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [ { \"kind\": \"replaceTargets\", \"targets\": [ { \"contextKind\": \"user\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\", \"values\": [\"user-key-123abc\"] }, { \"contextKind\": \"device\", \"variationId\": \"e5830889-1ec5-4b0c-9cc9-c48790090c43\", \"values\": [\"device-key-456def\"] } ] } ] } ``` #### replaceUserTargets Removes all existing user targeting and replaces it with the list of targets you provide. In the list of targets, you must include a target for each of the flag's variations. If you are working with contexts, use `replaceTargets` instead of this instruction. ##### Parameters - `targets`: A list of user targeting. Each item in the list must include a `variationId` and a list of `values`. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [ { \"kind\": \"replaceUserTargets\", \"targets\": [ { \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\", \"values\": [\"user-key-123abc\", \"user-key-456def\"] }, { \"variationId\": \"e5830889-1ec5-4b0c-9cc9-c48790090c43\", \"values\": [\"user-key-789ghi\"] } ] } ] } ``` #### updateClause Replaces the clause indicated by `ruleId` and `clauseId` with `clause`. ##### Parameters - `ruleId`: ID of a rule in the flag. - `clauseId`: ID of a clause in that rule. - `clause`: New `clause` object, with `contextKind` (string), `attribute` (string), `op` (string), `negate` (boolean), and `values` (array of strings, numbers, or dates) properties. The `contextKind`, `attribute`, and `values` are case sensitive. The `op` must be lower-case. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"updateClause\", \"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\", \"clauseId\": \"10c7462a-2062-45ba-a8bb-dfb3de0f8af5\", \"clause\": { \"contextKind\": \"user\", \"attribute\": \"country\", \"op\": \"in\", \"negate\": false, \"values\": [\"Mexico\", \"Canada\"] } }] } ``` #### updateDefaultVariation Updates the default on or off variation of the flag. ##### Parameters - `onVariationValue`: (Optional) The value of the variation of the new on variation. - `offVariationValue`: (Optional) The value of the variation of the new off variation Here's an example: ```json { \"instructions\": [ { \"kind\": \"updateDefaultVariation\", \"OnVariationValue\": true, \"OffVariationValue\": false } ] } ``` #### updateFallthroughVariationOrRollout Updates the default or \"fallthrough\" rule for the flag, which the flag serves when a context matches none of the targeting rules. The rule can serve either the variation that `variationId` indicates, or a percentage rollout that `rolloutWeights` and `rolloutBucketBy` indicate. ##### Parameters - `variationId`: ID of a variation of the flag. or - `rolloutWeights`: Map of `variationId` to weight, in thousandths of a percent (0-100000). - `rolloutBucketBy`: (Optional) Context attribute available in the specified `rolloutContextKind`. - `rolloutContextKind`: (Optional) Context kind, defaults to `user` Here's an example that uses a `variationId`: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"updateFallthroughVariationOrRollout\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" }] } ``` Here's an example that uses a percentage rollout: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"updateFallthroughVariationOrRollout\", \"rolloutContextKind\": \"user\", \"rolloutWeights\": { \"2f43f67c-3e4e-4945-a18a-26559378ca00\": 15000, // serve 15% this variation \"e5830889-1ec5-4b0c-9cc9-c48790090c43\": 85000 // serve 85% this variation } }] } ``` #### updateOffVariation Updates the default off variation to `variationId`. The flag serves the default off variation when the flag's targeting is **Off**. ##### Parameters - `variationId`: ID of a variation of the flag. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [ { \"kind\": \"updateOffVariation\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" } ] } ``` #### updatePrerequisite Changes the prerequisite flag that `key` indicates to use the variation that `variationId` indicates. Returns an error if this prerequisite does not exist. ##### Parameters - `key`: Flag key of an existing prerequisite flag. - `variationId`: ID of a variation of the prerequisite flag. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"updatePrerequisite\", \"key\": \"example-prereq-flag-key\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" }] } ``` #### updateRuleDescription Updates the description of the feature flag rule. ##### Parameters - `description`: The new human-readable description for this rule. - `ruleId`: The ID of the rule. You can retrieve this by making a GET request for the flag. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"updateRuleDescription\", \"description\": \"New rule description\", \"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\" }] } ``` #### updateRuleTrackEvents Updates whether the SDK sends a detailed event for every evaluation of this rule, instead of only summary counts. Required for Data Export, but doesn't enable Data Export on its own. ##### Parameters - `ruleId`: The ID of the rule. You can retrieve this by making a GET request for the flag. - `trackEvents`: Whether or not detailed events are sent for this rule. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"updateRuleTrackEvents\", \"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\", \"trackEvents\": true }] } ``` #### updateRuleVariationOrRollout Updates what `ruleId` serves when its clauses evaluate to true. The rule can serve either the variation that `variationId` indicates, or a percent rollout that `rolloutWeights` and `rolloutBucketBy` indicate. ##### Parameters - `ruleId`: ID of a rule in the flag. - `variationId`: ID of a variation of the flag. or - `rolloutWeights`: Map of `variationId` to weight, in thousandths of a percent (0-100000). - `rolloutBucketBy`: (Optional) Context attribute available in the specified `rolloutContextKind`. - `rolloutContextKind`: (Optional) Context kind, defaults to `user` Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"updateRuleVariationOrRollout\", \"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" }] } ``` #### updateTrackEvents Updates whether the SDK sends detailed evaluation events for this flag, for all rules. Required for Data Export, but doesn't enable Data Export on its own. ##### Parameters - `trackEvents`: Whether or not detailed events are sent for this flag. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [ { \"kind\": \"updateTrackEvents\", \"trackEvents\": true } ] } ``` #### updateTrackEventsFallthrough Updates whether the SDK sends detailed evaluation events for the flag's default rule. Required for Data Export, but doesn't enable Data Export on its own. ##### Parameters - `trackEvents`: Whether or not detailed events are sent for the default rule. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [ { \"kind\": \"updateTrackEventsFallthrough\", \"trackEvents\": true } ] } ``` #### updateVariation Updates a variation of the flag. ##### Parameters - `variationId`: The ID of the variation to update. - `name`: (Optional) The updated variation name. - `value`: (Optional) The updated variation value. - `description`: (Optional) The updated variation description. Here's an example: ```json { \"instructions\": [ { \"kind\": \"updateVariation\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\", \"value\": 20 } ] } ``` </details><br /> <details> <summary>Click to expand instructions for <strong>updating flag settings</strong></summary> These instructions do not require the `environmentKey` parameter. They make changes that apply to the flag across all environments. #### addCustomProperties Adds a new custom property to the feature flag. Custom properties are used to associate feature flags with LaunchDarkly integrations. For example, if you create an integration with an issue tracking service, you may want to associate a flag with a list of issues related to a feature's development. ##### Parameters - `key`: The custom property key. - `name`: The custom property name. - `values`: A list of the associated values for the custom property. Here's an example: ```json { \"instructions\": [{ \"kind\": \"addCustomProperties\", \"key\": \"example-custom-property\", \"name\": \"Example custom property\", \"values\": [\"value1\", \"value2\"] }] } ``` #### addTags Adds tags to the feature flag. ##### Parameters - `values`: A list of tags to add. Here's an example: ```json { \"instructions\": [ { \"kind\": \"addTags\", \"values\": [\"tag1\", \"tag2\"] } ] } ``` #### makeFlagPermanent Marks the feature flag as permanent. LaunchDarkly does not prompt you to remove permanent flags, even if one variation is rolled out to all your customers. Here's an example: ```json { \"instructions\": [ { \"kind\": \"makeFlagPermanent\" } ] } ``` #### makeFlagTemporary Marks the feature flag as temporary. Here's an example: ```json { \"instructions\": [ { \"kind\": \"makeFlagTemporary\" } ] } ``` #### removeCustomProperties Removes the associated values from a custom property. If all the associated values are removed, this instruction also removes the custom property. ##### Parameters - `key`: The custom property key. - `values`: A list of the associated values to remove from the custom property. ```json { \"instructions\": [{ \"kind\": \"replaceCustomProperties\", \"key\": \"example-custom-property\", \"values\": [\"value1\", \"value2\"] }] } ``` #### removeMaintainer Removes the flag's maintainer. To set a new maintainer, use the `updateMaintainerMember` or `updateMaintainerTeam` instructions. Here's an example: ```json { \"instructions\": [ { \"kind\": \"removeMaintainer\" } ] } ``` #### removeTags Removes tags from the feature flag. ##### Parameters - `values`: A list of tags to remove. Here's an example: ```json { \"instructions\": [ { \"kind\": \"removeTags\", \"values\": [\"tag1\", \"tag2\"] } ] } ``` #### replaceCustomProperties Replaces the existing associated values for a custom property with the new values. ##### Parameters - `key`: The custom property key. - `name`: The custom property name. - `values`: A list of the new associated values for the custom property. Here's an example: ```json { \"instructions\": [{ \"kind\": \"replaceCustomProperties\", \"key\": \"example-custom-property\", \"name\": \"Example custom property\", \"values\": [\"value1\", \"value2\"] }] } ``` #### turnOffClientSideAvailability Turns off client-side SDK availability for the flag. This is equivalent to unchecking the **SDKs using Mobile key** and/or **SDKs using Client-side ID** boxes for the flag. If you're using a client-side or mobile SDK, you must expose your feature flags in order for the client-side or mobile SDKs to evaluate them. ##### Parameters - `value`: Use \"usingMobileKey\" to turn off availability for mobile SDKs. Use \"usingEnvironmentId\" to turn on availability for client-side SDKs. Here's an example: ```json { \"instructions\": [ { \"kind\": \"turnOffClientSideAvailability\", \"value\": \"usingMobileKey\" } ] } ``` #### turnOnClientSideAvailability Turns on client-side SDK availability for the flag. This is equivalent to checking the **SDKs using Mobile key** and/or **SDKs using Client-side ID** boxes for the flag. If you're using a client-side or mobile SDK, you must expose your feature flags in order for the client-side or mobile SDKs to evaluate them. ##### Parameters - `value`: Use \"usingMobileKey\" to turn on availability for mobile SDKs. Use \"usingEnvironmentId\" to turn on availability for client-side SDKs. Here's an example: ```json { \"instructions\": [ { \"kind\": \"turnOnClientSideAvailability\", \"value\": \"usingMobileKey\" } ] } ``` #### updateDescription Updates the feature flag description. ##### Parameters - `value`: The new description. Here's an example: ```json { \"instructions\": [ { \"kind\": \"updateDescription\", \"value\": \"Updated flag description\" } ] } ``` #### updateMaintainerMember Updates the maintainer of the flag to an existing member and removes the existing maintainer. ##### Parameters - `value`: The ID of the member. Here's an example: ```json { \"instructions\": [ { \"kind\": \"updateMaintainerMember\", \"value\": \"61e9b714fd47591727db558a\" } ] } ``` #### updateMaintainerTeam Updates the maintainer of the flag to an existing team and removes the existing maintainer. ##### Parameters - `value`: The key of the team. Here's an example: ```json { \"instructions\": [ { \"kind\": \"updateMaintainerTeam\", \"value\": \"example-team-key\" } ] } ``` #### updateName Updates the feature flag name. ##### Parameters - `value`: The new name. Here's an example: ```json { \"instructions\": [ { \"kind\": \"updateName\", \"value\": \"Updated flag name\" } ] } ``` </details><br /> <details> <summary>Click to expand instructions for <strong>updating the flag lifecycle</strong></summary> These instructions do not require the `environmentKey` parameter. They make changes that apply to the flag across all environments. #### archiveFlag Archives the feature flag. This retires it from LaunchDarkly without deleting it. You cannot archive a flag that is a prerequisite of other flags. ```json { \"instructions\": [ { \"kind\": \"archiveFlag\" } ] } ``` #### deleteFlag Deletes the feature flag and its rules. You cannot restore a deleted flag. If this flag is requested again, the flag value defined in code will be returned for all contexts. Here's an example: ```json { \"instructions\": [ { \"kind\": \"deleteFlag\" } ] } ``` #### deprecateFlag Deprecates the feature flag. This hides it from the live flags list without archiving or deleting it. Here's an example: ```json { \"instructions\": [ { \"kind\": \"deprecateFlag\" } ] } ``` #### restoreDeprecatedFlag Restores the feature flag if it was previously deprecated. Here's an example: ```json { \"instructions\": [ { \"kind\": \"restoreDeprecatedFlag\" } ] } ``` #### restoreFlag Restores the feature flag if it was previously archived. Here's an example: ```json { \"instructions\": [ { \"kind\": \"restoreFlag\" } ] } ``` </details> ### Using JSON patches on a feature flag If you do not include the semantic patch header described above, you can use a [JSON patch](https://launchdarkly.com/docs/api#updates-using-json-patch) or [JSON merge patch](https://datatracker.ietf.org/doc/html/rfc7386) representation of the desired changes. In the JSON patch representation, use a JSON pointer in the `path` element to describe what field to change. Use the [Get feature flag](https://launchdarkly.com/docs/api/feature-flags/get-feature-flag) endpoint to find the field you want to update. There are a few special cases to keep in mind when determining the value of the `path` element: * To add an individual target to a specific variation if the flag variation already has individual targets, the path for the JSON patch operation is: ```json [ { \"op\": \"add\", \"path\": \"/environments/devint/targets/0/values/-\", \"value\": \"TestClient10\" } ] ``` * To add an individual target to a specific variation if the flag variation does not already have individual targets, the path for the JSON patch operation is: ```json [ { \"op\": \"add\", \"path\": \"/environments/devint/targets/-\", \"value\": { \"variation\": 0, \"values\": [\"TestClient10\"] } } ] ``` * To add a flag to a release pipeline, the path for the JSON patch operation is: ```json [ { \"op\": \"add\", \"path\": \"/releasePipelineKey\", \"value\": \"example-release-pipeline-key\" } ] ``` ### Required approvals If a request attempts to alter a flag configuration in an environment where approvals are required for the flag, the request will fail with a 405. Changes to the flag configuration in that environment will require creating an [approval request](https://launchdarkly.com/docs/api/approvals). ### Conflicts If a flag configuration change made through this endpoint would cause a pending scheduled change or approval request to fail, this endpoint will return a 400. You can ignore this check by adding an `ignoreConflicts` query parameter set to `true`. ### Migration flags For migration flags, the cohort information is included in the `rules` property of a flag's response. You can update cohorts by updating `rules`. Default cohort information is included in the `fallthrough` property of a flag's response. You can update the default cohort by updating `fallthrough`. When you update the rollout for a cohort or the default cohort through the API, provide a rollout instead of a single `variationId`. To learn more, read [Migration flags](https://launchdarkly.com/docs/home/flags/migration).
200
+ # Perform a partial update to a feature flag. The request body must be a valid semantic patch, JSON patch, or JSON merge patch. To learn more the different formats, read [Updates](https://launchdarkly.com/docs/api#updates). ### Using semantic patches on a feature flag To make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](https://launchdarkly.com/docs/api#updates-using-semantic-patch). The body of a semantic patch request for updating feature flags takes the following properties: * `comment` (string): (Optional) A description of the update. * `environmentKey` (string): (Required for some instructions only) The key of the LaunchDarkly environment. * `instructions` (array): (Required) A list of actions the update should perform. Each action in the list must be an object with a `kind` property that indicates the instruction. If the action requires parameters, you must include those parameters as additional fields in the object. The body of a single semantic patch can contain many different instructions. ### Instructions Semantic patch requests support the following `kind` instructions for updating feature flags. <details> <summary>Click to expand instructions for <strong>turning flags on and off</strong></summary> These instructions require the `environmentKey` parameter. #### turnFlagOff Sets the flag's targeting state to **Off**. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [ { \"kind\": \"turnFlagOff\" } ] } ``` #### turnFlagOn Sets the flag's targeting state to **On**. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [ { \"kind\": \"turnFlagOn\" } ] } ``` </details><br /> <details> <summary>Click to expand instructions for <strong>working with targeting and variations</strong></summary> These instructions require the `environmentKey` parameter. Several of the instructions for working with targeting and variations require flag rule IDs, variation IDs, or clause IDs as parameters. Each of these are returned as part of the [Get feature flag](https://launchdarkly.com/docs/api/feature-flags/get-feature-flag) response. The flag rule ID is the `_id` field of each element in the `rules` array within each environment listed in the `environments` object. The variation ID is the `_id` field in each element of the `variations` array. The clause ID is the `_id` field of each element of the `clauses` array within the `rules` array within each environment listed in the `environments` object. #### addClauses Adds the given clauses to the rule indicated by `ruleId`. ##### Parameters - `ruleId`: ID of a rule in the flag. - `clauses`: Array of clause objects, with `contextKind` (string), `attribute` (string), `op` (string), `negate` (boolean), and `values` (array of strings, numbers, or dates) properties. The `contextKind`, `attribute`, and `values` are case sensitive. The `op` must be lower-case. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"addClauses\", \"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\", \"clauses\": [{ \"contextKind\": \"user\", \"attribute\": \"country\", \"op\": \"in\", \"negate\": false, \"values\": [\"USA\", \"Canada\"] }] }] } ``` #### addPrerequisite Adds the flag indicated by `key` with variation `variationId` as a prerequisite to the flag in the path parameter. ##### Parameters - `key`: Flag key of the prerequisite flag. - `variationId`: ID of a variation of the prerequisite flag. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"addPrerequisite\", \"key\": \"example-prereq-flag-key\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" }] } ``` #### addRule Adds a new targeting rule to the flag. The rule may contain `clauses` and serve the variation that `variationId` indicates, or serve a percentage rollout that `rolloutWeights`, `rolloutBucketBy`, and `rolloutContextKind` indicate. If you set `beforeRuleId`, this adds the new rule before the indicated rule. Otherwise, adds the new rule to the end of the list. ##### Parameters - `clauses`: Array of clause objects, with `contextKind` (string), `attribute` (string), `op` (string), `negate` (boolean), and `values` (array of strings, numbers, or dates) properties. The `contextKind`, `attribute`, and `values` are case sensitive. The `op` must be lower-case. - `beforeRuleId`: (Optional) ID of a flag rule. - Either - `variationId`: ID of a variation of the flag. or - `rolloutWeights`: (Optional) Map of `variationId` to weight, in thousandths of a percent (0-100000). - `rolloutBucketBy`: (Optional) Context attribute available in the specified `rolloutContextKind`. - `rolloutContextKind`: (Optional) Context kind, defaults to `user` Here's an example that uses a `variationId`: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"addRule\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\", \"clauses\": [{ \"contextKind\": \"organization\", \"attribute\": \"located_in\", \"op\": \"in\", \"negate\": false, \"values\": [\"Sweden\", \"Norway\"] }] }] } ``` Here's an example that uses a percentage rollout: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"addRule\", \"clauses\": [{ \"contextKind\": \"organization\", \"attribute\": \"located_in\", \"op\": \"in\", \"negate\": false, \"values\": [\"Sweden\", \"Norway\"] }], \"rolloutContextKind\": \"organization\", \"rolloutWeights\": { \"2f43f67c-3e4e-4945-a18a-26559378ca00\": 15000, // serve 15% this variation \"e5830889-1ec5-4b0c-9cc9-c48790090c43\": 85000 // serve 85% this variation } }] } ``` #### addTargets Adds context keys to the individual context targets for the context kind that `contextKind` specifies and the variation that `variationId` specifies. Returns an error if this causes the flag to target the same context key in multiple variations. ##### Parameters - `values`: List of context keys. - `contextKind`: (Optional) Context kind to target, defaults to `user` - `variationId`: ID of a variation on the flag. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"addTargets\", \"values\": [\"context-key-123abc\", \"context-key-456def\"], \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" }] } ``` #### addUserTargets Adds user keys to the individual user targets for the variation that `variationId` specifies. Returns an error if this causes the flag to target the same user key in multiple variations. If you are working with contexts, use `addTargets` instead of this instruction. ##### Parameters - `values`: List of user keys. - `variationId`: ID of a variation on the flag. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"addUserTargets\", \"values\": [\"user-key-123abc\", \"user-key-456def\"], \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" }] } ``` #### addValuesToClause Adds `values` to the values of the clause that `ruleId` and `clauseId` indicate. Does not update the context kind, attribute, or operator. ##### Parameters - `ruleId`: ID of a rule in the flag. - `clauseId`: ID of a clause in that rule. - `values`: Array of strings, case sensitive. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"addValuesToClause\", \"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\", \"clauseId\": \"10a58772-3121-400f-846b-b8a04e8944ed\", \"values\": [\"beta_testers\"] }] } ``` #### addVariation Adds a variation to the flag. ##### Parameters - `value`: The variation value. - `name`: (Optional) The variation name. - `description`: (Optional) A description for the variation. Here's an example: ```json { \"instructions\": [ { \"kind\": \"addVariation\", \"value\": 20, \"name\": \"New variation\" } ] } ``` #### clearTargets Removes all individual targets from the variation that `variationId` specifies. This includes both user and non-user targets. ##### Parameters - `variationId`: ID of a variation on the flag. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [ { \"kind\": \"clearTargets\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" } ] } ``` #### clearUserTargets Removes all individual user targets from the variation that `variationId` specifies. If you are working with contexts, use `clearTargets` instead of this instruction. ##### Parameters - `variationId`: ID of a variation on the flag. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [ { \"kind\": \"clearUserTargets\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" } ] } ``` #### removeClauses Removes the clauses specified by `clauseIds` from the rule indicated by `ruleId`. ##### Parameters - `ruleId`: ID of a rule in the flag. - `clauseIds`: Array of IDs of clauses in the rule. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"removeClauses\", \"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\", \"clauseIds\": [\"10a58772-3121-400f-846b-b8a04e8944ed\", \"36a461dc-235e-4b08-97b9-73ce9365873e\"] }] } ``` #### removePrerequisite Removes the prerequisite flag indicated by `key`. Does nothing if this prerequisite does not exist. ##### Parameters - `key`: Flag key of an existing prerequisite flag. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [ { \"kind\": \"removePrerequisite\", \"key\": \"prereq-flag-key-123abc\" } ] } ``` #### removeRule Removes the targeting rule specified by `ruleId`. Does nothing if the rule does not exist. ##### Parameters - `ruleId`: ID of a rule in the flag. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [ { \"kind\": \"removeRule\", \"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\" } ] } ``` #### removeTargets Removes context keys from the individual context targets for the context kind that `contextKind` specifies and the variation that `variationId` specifies. Does nothing if the flag does not target the context keys. ##### Parameters - `values`: List of context keys. - `contextKind`: (Optional) Context kind to target, defaults to `user` - `variationId`: ID of a flag variation. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"removeTargets\", \"values\": [\"context-key-123abc\", \"context-key-456def\"], \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" }] } ``` #### removeUserTargets Removes user keys from the individual user targets for the variation that `variationId` specifies. Does nothing if the flag does not target the user keys. If you are working with contexts, use `removeTargets` instead of this instruction. ##### Parameters - `values`: List of user keys. - `variationId`: ID of a flag variation. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"removeUserTargets\", \"values\": [\"user-key-123abc\", \"user-key-456def\"], \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" }] } ``` #### removeValuesFromClause Removes `values` from the values of the clause indicated by `ruleId` and `clauseId`. Does not update the context kind, attribute, or operator. ##### Parameters - `ruleId`: ID of a rule in the flag. - `clauseId`: ID of a clause in that rule. - `values`: Array of strings, case sensitive. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"removeValuesFromClause\", \"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\", \"clauseId\": \"10a58772-3121-400f-846b-b8a04e8944ed\", \"values\": [\"beta_testers\"] }] } ``` #### removeVariation Removes a variation from the flag. ##### Parameters - `variationId`: ID of a variation of the flag to remove. Here's an example: ```json { \"instructions\": [ { \"kind\": \"removeVariation\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" } ] } ``` #### reorderRules Rearranges the rules to match the order given in `ruleIds`. Returns an error if `ruleIds` does not match the current set of rules on the flag. ##### Parameters - `ruleIds`: Array of IDs of all rules in the flag. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"reorderRules\", \"ruleIds\": [\"a902ef4a-2faf-4eaf-88e1-ecc356708a29\", \"63c238d1-835d-435e-8f21-c8d5e40b2a3d\"] }] } ``` #### replacePrerequisites Removes all existing prerequisites and replaces them with the list you provide. ##### Parameters - `prerequisites`: A list of prerequisites. Each item in the list must include a flag `key` and `variationId`. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [ { \"kind\": \"replacePrerequisites\", \"prerequisites\": [ { \"key\": \"prereq-flag-key-123abc\", \"variationId\": \"10a58772-3121-400f-846b-b8a04e8944ed\" }, { \"key\": \"another-prereq-flag-key-456def\", \"variationId\": \"e5830889-1ec5-4b0c-9cc9-c48790090c43\" } ] } ] } ``` #### replaceRules Removes all targeting rules for the flag and replaces them with the list you provide. ##### Parameters - `rules`: A list of rules. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [ { \"kind\": \"replaceRules\", \"rules\": [ { \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\", \"description\": \"My new rule\", \"clauses\": [ { \"contextKind\": \"user\", \"attribute\": \"segmentMatch\", \"op\": \"segmentMatch\", \"values\": [\"test\"] } ], \"trackEvents\": true } ] } ] } ``` #### replaceTargets Removes all existing targeting and replaces it with the list of targets you provide. ##### Parameters - `targets`: A list of context targeting. Each item in the list includes an optional `contextKind` that defaults to `user`, a required `variationId`, and a required list of `values`. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [ { \"kind\": \"replaceTargets\", \"targets\": [ { \"contextKind\": \"user\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\", \"values\": [\"user-key-123abc\"] }, { \"contextKind\": \"device\", \"variationId\": \"e5830889-1ec5-4b0c-9cc9-c48790090c43\", \"values\": [\"device-key-456def\"] } ] } ] } ``` #### replaceUserTargets Removes all existing user targeting and replaces it with the list of targets you provide. In the list of targets, you must include a target for each of the flag's variations. If you are working with contexts, use `replaceTargets` instead of this instruction. ##### Parameters - `targets`: A list of user targeting. Each item in the list must include a `variationId` and a list of `values`. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [ { \"kind\": \"replaceUserTargets\", \"targets\": [ { \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\", \"values\": [\"user-key-123abc\", \"user-key-456def\"] }, { \"variationId\": \"e5830889-1ec5-4b0c-9cc9-c48790090c43\", \"values\": [\"user-key-789ghi\"] } ] } ] } ``` #### updateClause Replaces the clause indicated by `ruleId` and `clauseId` with `clause`. ##### Parameters - `ruleId`: ID of a rule in the flag. - `clauseId`: ID of a clause in that rule. - `clause`: New `clause` object, with `contextKind` (string), `attribute` (string), `op` (string), `negate` (boolean), and `values` (array of strings, numbers, or dates) properties. The `contextKind`, `attribute`, and `values` are case sensitive. The `op` must be lower-case. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"updateClause\", \"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\", \"clauseId\": \"10c7462a-2062-45ba-a8bb-dfb3de0f8af5\", \"clause\": { \"contextKind\": \"user\", \"attribute\": \"country\", \"op\": \"in\", \"negate\": false, \"values\": [\"Mexico\", \"Canada\"] } }] } ``` #### updateDefaultVariation Updates the default on or off variation of the flag. ##### Parameters - `onVariationValue`: (Optional) The value of the variation of the new on variation. - `offVariationValue`: (Optional) The value of the variation of the new off variation Here's an example: ```json { \"instructions\": [ { \"kind\": \"updateDefaultVariation\", \"OnVariationValue\": true, \"OffVariationValue\": false } ] } ``` #### updateFallthroughVariationOrRollout Updates the default or \"fallthrough\" rule for the flag, which the flag serves when a context matches none of the targeting rules. The rule can serve either the variation that `variationId` indicates, or a percentage rollout that `rolloutWeights` and `rolloutBucketBy` indicate. ##### Parameters - `variationId`: ID of a variation of the flag. or - `rolloutWeights`: Map of `variationId` to weight, in thousandths of a percent (0-100000). - `rolloutBucketBy`: (Optional) Context attribute available in the specified `rolloutContextKind`. - `rolloutContextKind`: (Optional) Context kind, defaults to `user` Here's an example that uses a `variationId`: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"updateFallthroughVariationOrRollout\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" }] } ``` Here's an example that uses a percentage rollout: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"updateFallthroughVariationOrRollout\", \"rolloutContextKind\": \"user\", \"rolloutWeights\": { \"2f43f67c-3e4e-4945-a18a-26559378ca00\": 15000, // serve 15% this variation \"e5830889-1ec5-4b0c-9cc9-c48790090c43\": 85000 // serve 85% this variation } }] } ``` #### updateOffVariation Updates the default off variation to `variationId`. The flag serves the default off variation when the flag's targeting is **Off**. ##### Parameters - `variationId`: ID of a variation of the flag. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [ { \"kind\": \"updateOffVariation\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" } ] } ``` #### updatePrerequisite Changes the prerequisite flag that `key` indicates to use the variation that `variationId` indicates. Returns an error if this prerequisite does not exist. ##### Parameters - `key`: Flag key of an existing prerequisite flag. - `variationId`: ID of a variation of the prerequisite flag. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"updatePrerequisite\", \"key\": \"example-prereq-flag-key\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" }] } ``` #### updateRuleDescription Updates the description of the feature flag rule. ##### Parameters - `description`: The new human-readable description for this rule. - `ruleId`: The ID of the rule. You can retrieve this by making a GET request for the flag. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"updateRuleDescription\", \"description\": \"New rule description\", \"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\" }] } ``` #### updateRuleTrackEvents Updates whether the SDK sends a detailed event for every evaluation of this rule, instead of only summary counts. Required for Data Export, but doesn't enable Data Export on its own. ##### Parameters - `ruleId`: The ID of the rule. You can retrieve this by making a GET request for the flag. - `trackEvents`: Whether or not detailed events are sent for this rule. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"updateRuleTrackEvents\", \"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\", \"trackEvents\": true }] } ``` #### updateRuleVariationOrRollout Updates what `ruleId` serves when its clauses evaluate to true. The rule can serve either the variation that `variationId` indicates, or a percent rollout that `rolloutWeights` and `rolloutBucketBy` indicate. ##### Parameters - `ruleId`: ID of a rule in the flag. - `variationId`: ID of a variation of the flag. or - `rolloutWeights`: Map of `variationId` to weight, in thousandths of a percent (0-100000). - `rolloutBucketBy`: (Optional) Context attribute available in the specified `rolloutContextKind`. - `rolloutContextKind`: (Optional) Context kind, defaults to `user` Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"updateRuleVariationOrRollout\", \"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" }] } ``` #### updateTrackEvents Updates whether the SDK sends detailed evaluation events for this flag, for all rules. Required for Data Export, but doesn't enable Data Export on its own. ##### Parameters - `trackEvents`: Whether or not detailed events are sent for this flag. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [ { \"kind\": \"updateTrackEvents\", \"trackEvents\": true } ] } ``` #### updateTrackEventsFallthrough Updates whether the SDK sends detailed evaluation events for the flag's default rule. Required for Data Export, but doesn't enable Data Export on its own. ##### Parameters - `trackEvents`: Whether or not detailed events are sent for the default rule. Here's an example: ```json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [ { \"kind\": \"updateTrackEventsFallthrough\", \"trackEvents\": true } ] } ``` #### updateVariation Updates a variation of the flag. ##### Parameters - `variationId`: The ID of the variation to update. - `name`: (Optional) The updated variation name. - `value`: (Optional) The updated variation value. - `description`: (Optional) The updated variation description. Here's an example: ```json { \"instructions\": [ { \"kind\": \"updateVariation\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\", \"value\": 20 } ] } ``` </details><br /> <details> <summary>Click to expand instructions for <strong>updating flag settings</strong></summary> These instructions do not require the `environmentKey` parameter. They make changes that apply to the flag across all environments. #### addCustomProperties Adds a new custom property to the feature flag. Custom properties are used to associate feature flags with LaunchDarkly integrations. For example, if you create an integration with an issue tracking service, you may want to associate a flag with a list of issues related to a feature's development. ##### Parameters - `key`: The custom property key. - `name`: The custom property name. - `values`: A list of the associated values for the custom property. Here's an example: ```json { \"instructions\": [{ \"kind\": \"addCustomProperties\", \"key\": \"example-custom-property\", \"name\": \"Example custom property\", \"values\": [\"value1\", \"value2\"] }] } ``` #### addTags Adds tags to the feature flag. ##### Parameters - `values`: A list of tags to add. Here's an example: ```json { \"instructions\": [ { \"kind\": \"addTags\", \"values\": [\"tag1\", \"tag2\"] } ] } ``` #### makeFlagPermanent Marks the feature flag as permanent. LaunchDarkly does not prompt you to remove permanent flags, even if one variation is rolled out to all your customers. Here's an example: ```json { \"instructions\": [ { \"kind\": \"makeFlagPermanent\" } ] } ``` #### makeFlagTemporary Marks the feature flag as temporary. Here's an example: ```json { \"instructions\": [ { \"kind\": \"makeFlagTemporary\" } ] } ``` #### removeCustomProperties Removes the associated values from a custom property. If all the associated values are removed, this instruction also removes the custom property. ##### Parameters - `key`: The custom property key. - `values`: A list of the associated values to remove from the custom property. ```json { \"instructions\": [{ \"kind\": \"replaceCustomProperties\", \"key\": \"example-custom-property\", \"values\": [\"value1\", \"value2\"] }] } ``` #### removeMaintainer Removes the flag's maintainer. To set a new maintainer, use the `updateMaintainerMember` or `updateMaintainerTeam` instructions. Here's an example: ```json { \"instructions\": [ { \"kind\": \"removeMaintainer\" } ] } ``` #### removeTags Removes tags from the feature flag. ##### Parameters - `values`: A list of tags to remove. Here's an example: ```json { \"instructions\": [ { \"kind\": \"removeTags\", \"values\": [\"tag1\", \"tag2\"] } ] } ``` #### replaceCustomProperties Replaces the existing associated values for a custom property with the new values. ##### Parameters - `key`: The custom property key. - `name`: The custom property name. - `values`: A list of the new associated values for the custom property. Here's an example: ```json { \"instructions\": [{ \"kind\": \"replaceCustomProperties\", \"key\": \"example-custom-property\", \"name\": \"Example custom property\", \"values\": [\"value1\", \"value2\"] }] } ``` #### turnOffClientSideAvailability Turns off client-side SDK availability for the flag. This is equivalent to unchecking the **SDKs using Mobile key** and/or **SDKs using Client-side ID** boxes for the flag. If you're using a client-side or mobile SDK, you must expose your feature flags in order for the client-side or mobile SDKs to evaluate them. ##### Parameters - `value`: Use \"usingMobileKey\" to turn off availability for mobile SDKs. Use \"usingEnvironmentId\" to turn on availability for client-side SDKs. Here's an example: ```json { \"instructions\": [ { \"kind\": \"turnOffClientSideAvailability\", \"value\": \"usingMobileKey\" } ] } ``` #### turnOnClientSideAvailability Turns on client-side SDK availability for the flag. This is equivalent to checking the **SDKs using Mobile key** and/or **SDKs using Client-side ID** boxes for the flag. If you're using a client-side or mobile SDK, you must expose your feature flags in order for the client-side or mobile SDKs to evaluate them. ##### Parameters - `value`: Use \"usingMobileKey\" to turn on availability for mobile SDKs. Use \"usingEnvironmentId\" to turn on availability for client-side SDKs. Here's an example: ```json { \"instructions\": [ { \"kind\": \"turnOnClientSideAvailability\", \"value\": \"usingMobileKey\" } ] } ``` #### updateDescription Updates the feature flag description. ##### Parameters - `value`: The new description. Here's an example: ```json { \"instructions\": [ { \"kind\": \"updateDescription\", \"value\": \"Updated flag description\" } ] } ``` #### updateMaintainerMember Updates the maintainer of the flag to an existing member and removes the existing maintainer. ##### Parameters - `value`: The ID of the member. Here's an example: ```json { \"instructions\": [ { \"kind\": \"updateMaintainerMember\", \"value\": \"61e9b714fd47591727db558a\" } ] } ``` #### updateMaintainerTeam Updates the maintainer of the flag to an existing team and removes the existing maintainer. ##### Parameters - `value`: The key of the team. Here's an example: ```json { \"instructions\": [ { \"kind\": \"updateMaintainerTeam\", \"value\": \"example-team-key\" } ] } ``` #### updateName Updates the feature flag name. ##### Parameters - `value`: The new name. Here's an example: ```json { \"instructions\": [ { \"kind\": \"updateName\", \"value\": \"Updated flag name\" } ] } ``` </details><br /> <details> <summary>Click to expand instructions for <strong>updating the flag lifecycle</strong></summary> These instructions do not require the `environmentKey` parameter. They make changes that apply to the flag across all environments. #### archiveFlag Archives the feature flag. This retires it from LaunchDarkly without deleting it. You cannot archive a flag that is a prerequisite of other flags. ```json { \"instructions\": [ { \"kind\": \"archiveFlag\" } ] } ``` #### deleteFlag Deletes the feature flag and its rules. You cannot restore a deleted flag. If this flag is requested again, the flag value defined in code will be returned for all contexts. Here's an example: ```json { \"instructions\": [ { \"kind\": \"deleteFlag\" } ] } ``` #### deprecateFlag Deprecates the feature flag. This hides it from the live flags list without archiving or deleting it. You cannot deprecate an archived flag. If the flag is archived, this instruction fails with a `409` status code and makes no changes. To deprecate an archived flag, restore it with `restoreFlag` first. Here's an example: ```json { \"instructions\": [ { \"kind\": \"deprecateFlag\" } ] } ``` #### restoreDeprecatedFlag Restores the feature flag if it was previously deprecated. If the flag is archived, this instruction fails with a `409` status code and makes no changes. To restore an archived flag, use `restoreFlag`. Here's an example: ```json { \"instructions\": [ { \"kind\": \"restoreDeprecatedFlag\" } ] } ``` #### restoreFlag Restores the feature flag if it was previously archived. Here's an example: ```json { \"instructions\": [ { \"kind\": \"restoreFlag\" } ] } ``` </details> ### Using JSON patches on a feature flag If you do not include the semantic patch header described above, you can use a [JSON patch](https://launchdarkly.com/docs/api#updates-using-json-patch) or [JSON merge patch](https://datatracker.ietf.org/doc/html/rfc7386) representation of the desired changes. In the JSON patch representation, use a JSON pointer in the `path` element to describe what field to change. Use the [Get feature flag](https://launchdarkly.com/docs/api/feature-flags/get-feature-flag) endpoint to find the field you want to update. There are a few special cases to keep in mind when determining the value of the `path` element: * To add an individual target to a specific variation if the flag variation already has individual targets, the path for the JSON patch operation is: ```json [ { \"op\": \"add\", \"path\": \"/environments/devint/targets/0/values/-\", \"value\": \"TestClient10\" } ] ``` * To add an individual target to a specific variation if the flag variation does not already have individual targets, the path for the JSON patch operation is: ```json [ { \"op\": \"add\", \"path\": \"/environments/devint/targets/-\", \"value\": { \"variation\": 0, \"values\": [\"TestClient10\"] } } ] ``` * To add a flag to a release pipeline, the path for the JSON patch operation is: ```json [ { \"op\": \"add\", \"path\": \"/releasePipelineKey\", \"value\": \"example-release-pipeline-key\" } ] ``` ### Required approvals If a request attempts to alter a flag configuration in an environment where approvals are required for the flag, the request will fail with a 405. Changes to the flag configuration in that environment will require creating an [approval request](https://launchdarkly.com/docs/api/approvals). ### Conflicts If a flag configuration change made through this endpoint would cause a pending scheduled change or approval request to fail, this endpoint will return a 400. You can ignore this check by adding an `ignoreConflicts` query parameter set to `true`. ### Migration flags For migration flags, the cohort information is included in the `rules` property of a flag's response. You can update cohorts by updating `rules`. Default cohort information is included in the `fallthrough` property of a flag's response. You can update the default cohort by updating `fallthrough`. When you update the rollout for a cohort or the default cohort through the API, provide a rollout instead of a single `variationId`. To learn more, read [Migration flags](https://launchdarkly.com/docs/home/flags/migration).
201
201
  # @param project_key The project key
202
202
  # @param feature_flag_key The feature flag key. The key identifies the flag in your code.
203
203
  # @param patch_with_comment
@@ -13,105 +13,92 @@ Generator version: 7.18.0
13
13
  require 'spec_helper'
14
14
  require 'json'
15
15
 
16
- # Unit tests for LaunchDarklyApi::ReleasePoliciesBetaApi
16
+ # Unit tests for LaunchDarklyApi::FlagReleasePlansBetaApi
17
17
  # Automatically generated by openapi-generator (https://openapi-generator.tech)
18
18
  # Please update as you see appropriate
19
- describe 'ReleasePoliciesBetaApi' do
19
+ describe 'FlagReleasePlansBetaApi' do
20
20
  before do
21
21
  # run before each test
22
- @api_instance = LaunchDarklyApi::ReleasePoliciesBetaApi.new
22
+ @api_instance = LaunchDarklyApi::FlagReleasePlansBetaApi.new
23
23
  end
24
24
 
25
25
  after do
26
26
  # run after each test
27
27
  end
28
28
 
29
- describe 'test an instance of ReleasePoliciesBetaApi' do
30
- it 'should create an instance of ReleasePoliciesBetaApi' do
31
- expect(@api_instance).to be_instance_of(LaunchDarklyApi::ReleasePoliciesBetaApi)
29
+ describe 'test an instance of FlagReleasePlansBetaApi' do
30
+ it 'should create an instance of FlagReleasePlansBetaApi' do
31
+ expect(@api_instance).to be_instance_of(LaunchDarklyApi::FlagReleasePlansBetaApi)
32
32
  end
33
33
  end
34
34
 
35
- # unit tests for delete_release_policy
36
- # Delete a release policy
37
- # Delete an existing release policy for the specified project.
35
+ # unit tests for create_flag_release_plan
36
+ # Create a flag release plan for a project
37
+ # Creates a flag release plan. The key must not be in use by another active plan in the project, or the request is rejected with 409. The request is rejected with 400 when an environment isn't in the project, the maintainer isn't in the account, an environment release plan doesn't exist, is incomplete, or is in another environment, `default` is set while the project already has a default plan, or the project already has the maximum number of plans. To make a new plan the project's default, create it, then update it with `default` set, which demotes the current default.
38
38
  # @param ld_api_version Version of the endpoint.
39
- # @param project_key The project key
40
- # @param policy_key The human-readable key of the release policy
39
+ # @param project_key
40
+ # @param create_flag_release_plan_request
41
41
  # @param [Hash] opts the optional parameters
42
- # @return [nil]
43
- describe 'delete_release_policy test' do
42
+ # @return [FlagReleasePlan]
43
+ describe 'create_flag_release_plan test' do
44
44
  it 'should work' do
45
45
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
46
46
  end
47
47
  end
48
48
 
49
- # unit tests for get_release_policies
50
- # List release policies
51
- # Get a list of release policies for the specified project with optional filtering.
49
+ # unit tests for delete_flag_release_plan
50
+ # Delete a flag release plan in a project
51
+ # Delete a flag release plan in a project.
52
52
  # @param ld_api_version Version of the endpoint.
53
- # @param project_key The project key
53
+ # @param project_key
54
+ # @param plan_key
54
55
  # @param [Hash] opts the optional parameters
55
- # @option opts [Boolean] :exclude_default When true, exclude the default release policy from the response. When false or omitted, include the default policy if an environment filter is present.
56
- # @return [ReleasePoliciesResponse]
57
- describe 'get_release_policies test' do
58
- it 'should work' do
59
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
60
- end
61
- end
62
-
63
- # unit tests for get_release_policy
64
- # Get a release policy by key
65
- # Retrieve a single release policy by its key for the specified project.
66
- # @param ld_api_version Version of the endpoint.
67
- # @param project_key The project key
68
- # @param policy_key The release policy key
69
- # @param [Hash] opts the optional parameters
70
- # @return [ReleasePolicy]
71
- describe 'get_release_policy test' do
56
+ # @return [nil]
57
+ describe 'delete_flag_release_plan test' do
72
58
  it 'should work' do
73
59
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
74
60
  end
75
61
  end
76
62
 
77
- # unit tests for post_release_policies_order
78
- # Update the order of existing release policies
79
- # Update the order of existing release policies for the specified project.
63
+ # unit tests for get_flag_release_plan
64
+ # Get a flag release plan in a project by plan key
65
+ # Get a flag release plan in a project by plan key.
80
66
  # @param ld_api_version Version of the endpoint.
81
- # @param project_key The project key
82
- # @param request_body Array of release policy keys in the desired rank order (scoped policies only). These keys must include _all_ of the scoped release policies for the project.
67
+ # @param project_key
68
+ # @param plan_key
83
69
  # @param [Hash] opts the optional parameters
84
- # @return [Array<ReleasePolicy>]
85
- describe 'post_release_policies_order test' do
70
+ # @return [FlagReleasePlan]
71
+ describe 'get_flag_release_plan test' do
86
72
  it 'should work' do
87
73
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
88
74
  end
89
75
  end
90
76
 
91
- # unit tests for post_release_policy
92
- # Create a release policy
93
- # Create a new release policy for the specified project.
77
+ # unit tests for list_flag_release_plans
78
+ # List a project&#39;s flag release plans
79
+ # List a project&#39;s flag release plans, in creation order.
94
80
  # @param ld_api_version Version of the endpoint.
95
- # @param project_key The project key
96
- # @param post_release_policy_request Release policy to create
81
+ # @param project_key
97
82
  # @param [Hash] opts the optional parameters
98
- # @return [ReleasePolicy]
99
- describe 'post_release_policy test' do
83
+ # @option opts [Integer] :limit The number of flag release plans to return.
84
+ # @option opts [Integer] :offset The number of flag release plans to skip. Used for pagination.
85
+ # @return [ListFlagReleasePlansResponse]
86
+ describe 'list_flag_release_plans test' do
100
87
  it 'should work' do
101
88
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
102
89
  end
103
90
  end
104
91
 
105
- # unit tests for put_release_policy
106
- # Update a release policy
107
- # Update an existing release policy for the specified project.
92
+ # unit tests for update_flag_release_plan
93
+ # Replace a flag release plan configuration in a project
94
+ # Replace a flag release plan configuration in a project. This is a full replace, not a merge, and anything omitted is overwritten. Omitting &#x60;default&#x60; clears it, so a request without it demotes the project&#39;s default plan. The flag release plan&#39;s key is immutable, and its version increments by 1 on every successful update. The request&#39;s version is an optional optimistic lock: when present it must match the plan&#39;s current version, and on mismatch the request is rejected with 409 and no changes are applied, meaning the plan was edited since it was read; get the plan again and retry with its current version. When omitted the update applies unconditionally to the plan currently holding the key. A flag release already started from the plan is not affected.
108
95
  # @param ld_api_version Version of the endpoint.
109
- # @param project_key The project key
110
- # @param policy_key The human-readable key of the release policy
111
- # @param put_release_policy_request Release policy data to update
96
+ # @param project_key
97
+ # @param plan_key
98
+ # @param put_flag_release_plan_request
112
99
  # @param [Hash] opts the optional parameters
113
- # @return [ReleasePolicy]
114
- describe 'put_release_policy test' do
100
+ # @return [FlagReleasePlan]
101
+ describe 'update_flag_release_plan test' do
115
102
  it 'should work' do
116
103
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
117
104
  end
@@ -63,4 +63,10 @@ describe LaunchDarklyApi::AgentSkillPatch do
63
63
  end
64
64
  end
65
65
 
66
+ describe 'test attribute "tools"' do
67
+ it 'should work' do
68
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
69
+ end
70
+ end
71
+
66
72
  end
@@ -69,4 +69,10 @@ describe LaunchDarklyApi::AgentSkillPost do
69
69
  end
70
70
  end
71
71
 
72
+ describe 'test attribute "tools"' do
73
+ it 'should work' do
74
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
75
+ end
76
+ end
77
+
72
78
  end
@@ -81,6 +81,12 @@ describe LaunchDarklyApi::AgentSkill do
81
81
  end
82
82
  end
83
83
 
84
+ describe 'test attribute "tools"' do
85
+ it 'should work' do
86
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
87
+ end
88
+ end
89
+
84
90
  describe 'test attribute "created_at"' do
85
91
  it 'should work' do
86
92
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
@@ -75,4 +75,16 @@ describe LaunchDarklyApi::AIConfigPatch do
75
75
  end
76
76
  end
77
77
 
78
+ describe 'test attribute "default_threshold"' do
79
+ it 'should work' do
80
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
81
+ end
82
+ end
83
+
84
+ describe 'test attribute "clear_default_threshold"' do
85
+ it 'should work' do
86
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
87
+ end
88
+ end
89
+
78
90
  end
@@ -97,4 +97,10 @@ describe LaunchDarklyApi::AIConfigPost do
97
97
  end
98
98
  end
99
99
 
100
+ describe 'test attribute "default_threshold"' do
101
+ it 'should work' do
102
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
103
+ end
104
+ end
105
+
100
106
  end
@@ -127,6 +127,12 @@ describe LaunchDarklyApi::AIConfig do
127
127
  end
128
128
  end
129
129
 
130
+ describe 'test attribute "default_threshold"' do
131
+ it 'should work' do
132
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
133
+ end
134
+ end
135
+
130
136
  describe 'test attribute "dependencies"' do
131
137
  it 'should work' do
132
138
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
@@ -33,6 +33,12 @@ describe LaunchDarklyApi::AIConfigTargetingEnvironmentRuleClause do
33
33
  end
34
34
  end
35
35
 
36
+ describe 'test attribute "context_kind"' 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
+
36
42
  describe 'test attribute "id"' do
37
43
  it 'should work' do
38
44
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
@@ -33,12 +33,36 @@ describe LaunchDarklyApi::AIConfigTargetingEnvironmentRule do
33
33
  end
34
34
  end
35
35
 
36
+ describe 'test attribute "disabled"' 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 "description"' 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
+
36
48
  describe 'test attribute "clauses"' do
37
49
  it 'should work' do
38
50
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
39
51
  end
40
52
  end
41
53
 
54
+ describe 'test attribute "variation"' do
55
+ it 'should work' do
56
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
57
+ end
58
+ end
59
+
60
+ describe 'test attribute "rollout"' do
61
+ it 'should work' do
62
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
63
+ end
64
+ end
65
+
42
66
  describe 'test attribute "track_events"' do
43
67
  it 'should work' do
44
68
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
@@ -51,6 +51,12 @@ describe LaunchDarklyApi::AiConfigsMetricListingRep do
51
51
  end
52
52
  end
53
53
 
54
+ describe 'test attribute "environment_release_plan_count"' do
55
+ it 'should work' do
56
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
57
+ end
58
+ end
59
+
54
60
  describe 'test attribute "active_experiment_count"' do
55
61
  it 'should work' do
56
62
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
@@ -14,62 +14,56 @@ require 'spec_helper'
14
14
  require 'json'
15
15
  require 'date'
16
16
 
17
- # Unit tests for LaunchDarklyApi::ReleasePolicy
17
+ # Unit tests for LaunchDarklyApi::CreateFlagReleasePlanRequest
18
18
  # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
19
  # Please update as you see appropriate
20
- describe LaunchDarklyApi::ReleasePolicy do
21
- #let(:instance) { LaunchDarklyApi::ReleasePolicy.new }
20
+ describe LaunchDarklyApi::CreateFlagReleasePlanRequest do
21
+ #let(:instance) { LaunchDarklyApi::CreateFlagReleasePlanRequest.new }
22
22
 
23
- describe 'test an instance of ReleasePolicy' do
24
- it 'should create an instance of ReleasePolicy' do
23
+ describe 'test an instance of CreateFlagReleasePlanRequest' do
24
+ it 'should create an instance of CreateFlagReleasePlanRequest' do
25
25
  # uncomment below to test the instance creation
26
- #expect(instance).to be_instance_of(LaunchDarklyApi::ReleasePolicy)
26
+ #expect(instance).to be_instance_of(LaunchDarklyApi::CreateFlagReleasePlanRequest)
27
27
  end
28
28
  end
29
29
 
30
- describe 'test attribute "_access"' 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 "_id"' do
30
+ describe 'test attribute "name"' do
37
31
  it 'should work' do
38
32
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
39
33
  end
40
34
  end
41
35
 
42
- describe 'test attribute "scope"' do
36
+ describe 'test attribute "description"' do
43
37
  it 'should work' do
44
38
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
45
39
  end
46
40
  end
47
41
 
48
- describe 'test attribute "rank"' do
42
+ describe 'test attribute "maintainer"' do
49
43
  it 'should work' do
50
44
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
51
45
  end
52
46
  end
53
47
 
54
- describe 'test attribute "release_method"' do
48
+ describe 'test attribute "execution_mode"' do
55
49
  it 'should work' do
56
50
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
57
51
  end
58
52
  end
59
53
 
60
- describe 'test attribute "guarded_release_config"' do
54
+ describe 'test attribute "application_keys"' do
61
55
  it 'should work' do
62
56
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
63
57
  end
64
58
  end
65
59
 
66
- describe 'test attribute "progressive_release_config"' do
60
+ describe 'test attribute "default"' do
67
61
  it 'should work' do
68
62
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
69
63
  end
70
64
  end
71
65
 
72
- describe 'test attribute "name"' do
66
+ describe 'test attribute "environments"' do
73
67
  it 'should work' do
74
68
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
75
69
  end