launchdarkly_api 8.0.0 → 10.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (798) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +151 -150
  3. data/docs/AccountMembersApi.md +12 -12
  4. data/docs/ActionInputRep.md +2 -2
  5. data/docs/ApprovalConditionInputRep.md +3 -1
  6. data/docs/ApprovalsApi.md +10 -10
  7. data/docs/AuditLogApi.md +1 -1
  8. data/docs/Client.md +32 -0
  9. data/docs/ClientCollection.md +20 -0
  10. data/docs/ClientSideAvailabilityPost.md +4 -4
  11. data/docs/CodeReferencesApi.md +15 -15
  12. data/docs/ConditionInputRep.md +6 -4
  13. data/docs/CreateCopyFlagConfigApprovalRequestRequest.md +12 -10
  14. data/docs/CreateFlagConfigApprovalRequestRequest.md +10 -8
  15. data/docs/CredibleIntervalRep.md +20 -0
  16. data/docs/CustomProperty.md +4 -4
  17. data/docs/CustomRolePost.md +3 -3
  18. data/docs/CustomRolePostData.md +3 -3
  19. data/docs/CustomRolesApi.md +1 -1
  20. data/docs/CustomWorkflowInputRep.md +7 -5
  21. data/docs/DataExportDestinationsApi.md +7 -7
  22. data/docs/DefaultClientSideAvailabilityPost.md +4 -4
  23. data/docs/Defaults.md +4 -4
  24. data/docs/Destination.md +8 -8
  25. data/docs/DestinationPost.md +8 -8
  26. data/docs/Destinations.md +2 -2
  27. data/docs/Environments.md +22 -0
  28. data/docs/EnvironmentsApi.md +83 -1
  29. data/docs/EvaluationReason.md +28 -0
  30. data/docs/Experiment.md +36 -0
  31. data/docs/ExperimentBayesianResultsRep.md +22 -0
  32. data/docs/ExperimentCollectionRep.md +22 -0
  33. data/docs/ExperimentExpandableProperties.md +20 -0
  34. data/docs/ExperimentInfoRep.md +1 -1
  35. data/docs/ExperimentPatchInput.md +20 -0
  36. data/docs/ExperimentPost.md +26 -0
  37. data/docs/{ExperimentResultsRep.md → ExperimentResults.md} +2 -2
  38. data/docs/ExperimentsBetaApi.md +484 -14
  39. data/docs/FeatureFlag.md +5 -7
  40. data/docs/FeatureFlagBody.md +9 -11
  41. data/docs/FeatureFlagConfig.md +4 -4
  42. data/docs/FeatureFlagScheduledChange.md +6 -6
  43. data/docs/FeatureFlagScheduledChanges.md +2 -2
  44. data/docs/FeatureFlagsApi.md +14 -14
  45. data/docs/FeatureFlagsBetaApi.md +2 -2
  46. data/docs/FlagConfigApprovalRequestResponse.md +18 -18
  47. data/docs/FlagCopyConfigEnvironment.md +2 -2
  48. data/docs/FlagCopyConfigPost.md +5 -5
  49. data/docs/FlagFollowersByProjEnvGetRep.md +20 -0
  50. data/docs/FlagFollowersGetRep.md +20 -0
  51. data/docs/FlagGlobalAttributesRep.md +5 -7
  52. data/docs/FlagInput.md +20 -0
  53. data/docs/FlagLinkPost.md +10 -10
  54. data/docs/FlagLinksBetaApi.md +1 -1
  55. data/docs/FlagRep.md +22 -0
  56. data/docs/FlagScheduledChangesInput.md +2 -2
  57. data/docs/FlagSummary.md +2 -0
  58. data/docs/FlagTriggerInput.md +4 -4
  59. data/docs/FlagTriggersApi.md +3 -3
  60. data/docs/FollowFlagMember.md +28 -0
  61. data/docs/FollowFlagsApi.md +311 -0
  62. data/docs/FollowersPerFlag.md +20 -0
  63. data/docs/ForbiddenErrorRep.md +3 -3
  64. data/docs/InstructionUserRequest.md +26 -0
  65. data/docs/Integration.md +15 -15
  66. data/docs/IntegrationAuditLogSubscriptionsApi.md +2 -2
  67. data/docs/IntegrationDeliveryConfigurationPost.md +6 -6
  68. data/docs/IntegrationDeliveryConfigurationsBetaApi.md +1 -1
  69. data/docs/InvalidRequestErrorRep.md +3 -3
  70. data/docs/IterationExpandableProperties.md +20 -0
  71. data/docs/IterationInput.md +26 -0
  72. data/docs/IterationRep.md +42 -0
  73. data/docs/{ExperimentRep.md → LegacyExperimentRep.md} +2 -2
  74. data/docs/Member.md +4 -2
  75. data/docs/MemberTeamsPostInput.md +1 -1
  76. data/docs/MethodNotAllowedErrorRep.md +3 -3
  77. data/docs/MetricInput.md +20 -0
  78. data/docs/MetricPost.md +24 -24
  79. data/docs/MetricRep.md +1 -1
  80. data/docs/MetricV2Rep.md +24 -0
  81. data/docs/MetricsApi.md +2 -2
  82. data/docs/NewMemberForm.md +7 -7
  83. data/docs/NotFoundErrorRep.md +3 -3
  84. data/docs/OAuth2ClientsBetaApi.md +365 -0
  85. data/docs/OauthClientPost.md +22 -0
  86. data/docs/OtherApi.md +3 -3
  87. data/docs/ParameterDefault.md +22 -0
  88. data/docs/ParameterRep.md +20 -0
  89. data/docs/ParentResourceRep.md +1 -1
  90. data/docs/PatchFailedErrorRep.md +3 -3
  91. data/docs/PatchFlagsRequest.md +20 -0
  92. data/docs/PatchSegmentInstruction.md +7 -7
  93. data/docs/PatchSegmentRequest.md +1 -1
  94. data/docs/PatchUsersRequest.md +20 -0
  95. data/docs/PatchWithComment.md +1 -1
  96. data/docs/PermissionGrantInput.md +6 -6
  97. data/docs/PostApprovalRequestApplyRequest.md +2 -2
  98. data/docs/PostApprovalRequestReviewRequest.md +4 -4
  99. data/docs/PostFlagScheduledChangesInput.md +2 -2
  100. data/docs/Project.md +1 -1
  101. data/docs/ProjectPost.md +1 -1
  102. data/docs/ProjectRep.md +32 -0
  103. data/docs/ProjectSummary.md +3 -3
  104. data/docs/Projects.md +3 -1
  105. data/docs/ProjectsApi.md +37 -22
  106. data/docs/RateLimitedErrorRep.md +2 -2
  107. data/docs/RelativeDifferenceRep.md +22 -0
  108. data/docs/RelayAutoConfigPost.md +1 -1
  109. data/docs/RelayAutoConfigRep.md +1 -1
  110. data/docs/RelayProxyConfigurationsApi.md +5 -5
  111. data/docs/RepositoryPost.md +4 -4
  112. data/docs/ResourceAccess.md +1 -1
  113. data/docs/ReviewResponse.md +6 -6
  114. data/docs/RuleClause.md +22 -0
  115. data/docs/ScheduleConditionInputRep.md +4 -4
  116. data/docs/ScheduledChangesApi.md +8 -8
  117. data/docs/SegmentBody.md +6 -6
  118. data/docs/SegmentsApi.md +9 -9
  119. data/docs/SegmentsBetaApi.md +12 -6
  120. data/docs/SourceFlag.md +4 -4
  121. data/docs/StageInputRep.md +6 -4
  122. data/docs/StatementPost.md +4 -4
  123. data/docs/StatementPostData.md +4 -4
  124. data/docs/StatisticCollectionRep.md +2 -2
  125. data/docs/StatisticRep.md +14 -12
  126. data/docs/StatisticsRep.md +20 -0
  127. data/docs/StatusConflictErrorRep.md +3 -3
  128. data/docs/SubscriptionPost.md +7 -7
  129. data/docs/TargetResourceRep.md +1 -1
  130. data/docs/Team.md +13 -5
  131. data/docs/TeamCustomRole.md +2 -2
  132. data/docs/TeamCustomRoles.md +2 -2
  133. data/docs/TeamMaintainers.md +3 -3
  134. data/docs/TeamMembers.md +18 -0
  135. data/docs/TeamPatchInput.md +3 -3
  136. data/docs/TeamPostInput.md +7 -7
  137. data/docs/TeamProjects.md +1 -1
  138. data/docs/TeamRepExpandableProperties.md +24 -0
  139. data/docs/Teams.md +2 -2
  140. data/docs/TeamsApi.md +620 -0
  141. data/docs/Token.md +1 -1
  142. data/docs/TreatmentInput.md +24 -0
  143. data/docs/TreatmentParameterInput.md +20 -0
  144. data/docs/TreatmentRep.md +26 -0
  145. data/docs/TreatmentResultRep.md +30 -0
  146. data/docs/TriggerPost.md +6 -6
  147. data/docs/UnauthorizedErrorRep.md +3 -3
  148. data/docs/UserFlagSetting.md +6 -4
  149. data/docs/UserFlagSettings.md +1 -1
  150. data/docs/UserRecord.md +1 -1
  151. data/docs/UserSegment.md +24 -24
  152. data/docs/UserSegments.md +2 -2
  153. data/docs/UserSettingsApi.md +10 -10
  154. data/docs/Users.md +1 -1
  155. data/docs/UsersApi.md +6 -6
  156. data/docs/UsersRep.md +22 -0
  157. data/docs/ValuePut.md +4 -4
  158. data/docs/Variation.md +1 -1
  159. data/docs/Webhook.md +9 -9
  160. data/docs/Webhooks.md +2 -2
  161. data/docs/WebhooksApi.md +1 -1
  162. data/docs/WorkflowTemplateMetadata.md +18 -0
  163. data/docs/WorkflowTemplateParameter.md +24 -0
  164. data/docs/WorkflowsBetaApi.md +5 -5
  165. data/launchdarkly_api.gemspec +3 -3
  166. data/lib/launchdarkly_api/api/access_tokens_api.rb +2 -2
  167. data/lib/launchdarkly_api/api/account_members_api.rb +14 -14
  168. data/lib/launchdarkly_api/api/account_usage_beta_api.rb +2 -2
  169. data/lib/launchdarkly_api/api/approvals_api.rb +16 -16
  170. data/lib/launchdarkly_api/api/audit_log_api.rb +4 -4
  171. data/lib/launchdarkly_api/api/code_references_api.rb +22 -22
  172. data/lib/launchdarkly_api/api/custom_roles_api.rb +2 -2
  173. data/lib/launchdarkly_api/api/data_export_destinations_api.rb +10 -10
  174. data/lib/launchdarkly_api/api/environments_api.rb +79 -4
  175. data/lib/launchdarkly_api/api/experiments_beta_api.rb +509 -20
  176. data/lib/launchdarkly_api/api/feature_flags_api.rb +23 -23
  177. data/lib/launchdarkly_api/api/feature_flags_beta_api.rb +6 -6
  178. data/lib/launchdarkly_api/api/flag_links_beta_api.rb +4 -4
  179. data/lib/launchdarkly_api/api/flag_triggers_api.rb +6 -6
  180. data/lib/launchdarkly_api/api/follow_flags_api.rb +328 -0
  181. data/lib/launchdarkly_api/api/integration_audit_log_subscriptions_api.rb +4 -4
  182. data/lib/launchdarkly_api/api/integration_delivery_configurations_beta_api.rb +4 -4
  183. data/lib/launchdarkly_api/api/metrics_api.rb +4 -4
  184. data/lib/launchdarkly_api/api/o_auth2_clients_beta_api.rb +347 -0
  185. data/lib/launchdarkly_api/api/other_api.rb +8 -8
  186. data/lib/launchdarkly_api/api/projects_api.rb +31 -16
  187. data/lib/launchdarkly_api/api/relay_proxy_configurations_api.rb +10 -10
  188. data/lib/launchdarkly_api/api/scheduled_changes_api.rb +14 -14
  189. data/lib/launchdarkly_api/api/segments_api.rb +18 -18
  190. data/lib/launchdarkly_api/api/segments_beta_api.rb +15 -4
  191. data/lib/launchdarkly_api/api/tags_api.rb +2 -2
  192. data/lib/launchdarkly_api/api/teams_api.rb +577 -0
  193. data/lib/launchdarkly_api/api/user_settings_api.rb +19 -19
  194. data/lib/launchdarkly_api/api/users_api.rb +9 -9
  195. data/lib/launchdarkly_api/api/users_beta_api.rb +2 -2
  196. data/lib/launchdarkly_api/api/webhooks_api.rb +4 -4
  197. data/lib/launchdarkly_api/api/workflows_beta_api.rb +10 -10
  198. data/lib/launchdarkly_api/api_client.rb +5 -3
  199. data/lib/launchdarkly_api/api_error.rb +2 -2
  200. data/lib/launchdarkly_api/configuration.rb +9 -4
  201. data/lib/launchdarkly_api/models/access.rb +3 -2
  202. data/lib/launchdarkly_api/models/access_allowed_reason.rb +3 -2
  203. data/lib/launchdarkly_api/models/access_allowed_rep.rb +3 -2
  204. data/lib/launchdarkly_api/models/access_denied.rb +3 -2
  205. data/lib/launchdarkly_api/models/access_denied_reason.rb +3 -2
  206. data/lib/launchdarkly_api/models/access_token_post.rb +3 -2
  207. data/lib/launchdarkly_api/models/action_input_rep.rb +4 -2
  208. data/lib/launchdarkly_api/models/action_output_rep.rb +3 -2
  209. data/lib/launchdarkly_api/models/approval_condition_input_rep.rb +18 -6
  210. data/lib/launchdarkly_api/models/approval_condition_output_rep.rb +3 -2
  211. data/lib/launchdarkly_api/models/approval_settings.rb +3 -2
  212. data/lib/launchdarkly_api/models/audit_log_entry_listing_rep.rb +3 -2
  213. data/lib/launchdarkly_api/models/audit_log_entry_listing_rep_collection.rb +3 -2
  214. data/lib/launchdarkly_api/models/audit_log_entry_rep.rb +3 -2
  215. data/lib/launchdarkly_api/models/authorized_app_data_rep.rb +3 -2
  216. data/lib/launchdarkly_api/models/big_segment_target.rb +3 -2
  217. data/lib/launchdarkly_api/models/branch_collection_rep.rb +3 -2
  218. data/lib/launchdarkly_api/models/branch_rep.rb +3 -2
  219. data/lib/launchdarkly_api/models/clause.rb +3 -2
  220. data/lib/launchdarkly_api/models/client.rb +321 -0
  221. data/lib/launchdarkly_api/models/client_collection.rb +243 -0
  222. data/lib/launchdarkly_api/models/client_side_availability.rb +3 -2
  223. data/lib/launchdarkly_api/models/client_side_availability_post.rb +5 -2
  224. data/lib/launchdarkly_api/models/condition_base_output_rep.rb +3 -2
  225. data/lib/launchdarkly_api/models/condition_input_rep.rb +17 -3
  226. data/lib/launchdarkly_api/models/condition_output_rep.rb +3 -2
  227. data/lib/launchdarkly_api/models/confidence_interval_rep.rb +3 -2
  228. data/lib/launchdarkly_api/models/conflict.rb +3 -2
  229. data/lib/launchdarkly_api/models/conflict_output_rep.rb +3 -2
  230. data/lib/launchdarkly_api/models/copied_from_env.rb +3 -2
  231. data/lib/launchdarkly_api/models/create_copy_flag_config_approval_request_request.rb +42 -9
  232. data/lib/launchdarkly_api/models/create_flag_config_approval_request_request.rb +20 -12
  233. data/lib/launchdarkly_api/models/credible_interval_rep.rb +228 -0
  234. data/lib/launchdarkly_api/models/custom_property.rb +5 -2
  235. data/lib/launchdarkly_api/models/custom_role.rb +3 -2
  236. data/lib/launchdarkly_api/models/custom_role_post.rb +3 -2
  237. data/lib/launchdarkly_api/models/custom_role_post_data.rb +3 -2
  238. data/lib/launchdarkly_api/models/custom_roles.rb +3 -2
  239. data/lib/launchdarkly_api/models/custom_workflow_input_rep.rb +19 -6
  240. data/lib/launchdarkly_api/models/custom_workflow_meta.rb +3 -2
  241. data/lib/launchdarkly_api/models/custom_workflow_output_rep.rb +3 -2
  242. data/lib/launchdarkly_api/models/custom_workflow_stage_meta.rb +3 -2
  243. data/lib/launchdarkly_api/models/custom_workflows_listing_output_rep.rb +3 -2
  244. data/lib/launchdarkly_api/models/default_client_side_availability_post.rb +5 -2
  245. data/lib/launchdarkly_api/models/defaults.rb +5 -2
  246. data/lib/launchdarkly_api/models/dependent_flag.rb +3 -2
  247. data/lib/launchdarkly_api/models/dependent_flag_environment.rb +3 -2
  248. data/lib/launchdarkly_api/models/dependent_flags_by_environment.rb +3 -2
  249. data/lib/launchdarkly_api/models/destination.rb +9 -2
  250. data/lib/launchdarkly_api/models/destination_post.rb +7 -3
  251. data/lib/launchdarkly_api/models/destinations.rb +5 -2
  252. data/lib/launchdarkly_api/models/environment.rb +3 -2
  253. data/lib/launchdarkly_api/models/environment_post.rb +3 -2
  254. data/lib/launchdarkly_api/models/environments.rb +241 -0
  255. data/lib/launchdarkly_api/models/evaluation_reason.rb +275 -0
  256. data/lib/launchdarkly_api/models/execution_output_rep.rb +3 -2
  257. data/lib/launchdarkly_api/models/experiment.rb +329 -0
  258. data/lib/launchdarkly_api/models/experiment_allocation_rep.rb +3 -2
  259. data/lib/launchdarkly_api/models/experiment_bayesian_results_rep.rb +241 -0
  260. data/lib/launchdarkly_api/models/experiment_collection_rep.rb +241 -0
  261. data/lib/launchdarkly_api/models/experiment_enabled_period_rep.rb +3 -2
  262. data/lib/launchdarkly_api/models/experiment_environment_setting_rep.rb +3 -2
  263. data/lib/launchdarkly_api/models/experiment_expandable_properties.rb +230 -0
  264. data/lib/launchdarkly_api/models/experiment_info_rep.rb +4 -3
  265. data/lib/launchdarkly_api/models/experiment_metadata_rep.rb +3 -2
  266. data/lib/launchdarkly_api/models/experiment_patch_input.rb +236 -0
  267. data/lib/launchdarkly_api/models/experiment_post.rb +275 -0
  268. data/lib/launchdarkly_api/models/experiment_results.rb +281 -0
  269. data/lib/launchdarkly_api/models/experiment_stats_rep.rb +3 -2
  270. data/lib/launchdarkly_api/models/experiment_time_series_slice.rb +3 -2
  271. data/lib/launchdarkly_api/models/experiment_time_series_variation_slice.rb +3 -2
  272. data/lib/launchdarkly_api/models/experiment_totals_rep.rb +3 -2
  273. data/lib/launchdarkly_api/models/expiring_user_target_error.rb +3 -2
  274. data/lib/launchdarkly_api/models/expiring_user_target_get_response.rb +3 -2
  275. data/lib/launchdarkly_api/models/expiring_user_target_item.rb +3 -2
  276. data/lib/launchdarkly_api/models/expiring_user_target_patch_response.rb +3 -2
  277. data/lib/launchdarkly_api/models/export.rb +3 -2
  278. data/lib/launchdarkly_api/models/extinction.rb +3 -2
  279. data/lib/launchdarkly_api/models/extinction_collection_rep.rb +3 -2
  280. data/lib/launchdarkly_api/models/feature_flag.rb +6 -15
  281. data/lib/launchdarkly_api/models/feature_flag_body.rb +7 -16
  282. data/lib/launchdarkly_api/models/feature_flag_config.rb +3 -22
  283. data/lib/launchdarkly_api/models/feature_flag_scheduled_change.rb +7 -2
  284. data/lib/launchdarkly_api/models/feature_flag_scheduled_changes.rb +5 -2
  285. data/lib/launchdarkly_api/models/feature_flag_status.rb +3 -2
  286. data/lib/launchdarkly_api/models/feature_flag_status_across_environments.rb +3 -2
  287. data/lib/launchdarkly_api/models/feature_flag_statuses.rb +3 -2
  288. data/lib/launchdarkly_api/models/feature_flags.rb +3 -2
  289. data/lib/launchdarkly_api/models/file_rep.rb +3 -2
  290. data/lib/launchdarkly_api/models/flag_config_approval_request_response.rb +58 -2
  291. data/lib/launchdarkly_api/models/flag_config_approval_requests_response.rb +3 -2
  292. data/lib/launchdarkly_api/models/flag_copy_config_environment.rb +5 -2
  293. data/lib/launchdarkly_api/models/flag_copy_config_post.rb +6 -2
  294. data/lib/launchdarkly_api/models/flag_followers_by_proj_env_get_rep.rb +237 -0
  295. data/lib/launchdarkly_api/models/flag_followers_get_rep.rb +237 -0
  296. data/lib/launchdarkly_api/models/flag_global_attributes_rep.rb +6 -15
  297. data/lib/launchdarkly_api/models/flag_input.rb +238 -0
  298. data/lib/launchdarkly_api/models/flag_link_collection_rep.rb +3 -2
  299. data/lib/launchdarkly_api/models/flag_link_member.rb +3 -2
  300. data/lib/launchdarkly_api/models/flag_link_post.rb +9 -2
  301. data/lib/launchdarkly_api/models/flag_link_rep.rb +3 -2
  302. data/lib/launchdarkly_api/models/flag_listing_rep.rb +3 -2
  303. data/lib/launchdarkly_api/models/flag_rep.rb +244 -0
  304. data/lib/launchdarkly_api/models/flag_scheduled_changes_input.rb +4 -2
  305. data/lib/launchdarkly_api/models/flag_status_rep.rb +3 -2
  306. data/lib/launchdarkly_api/models/flag_summary.rb +20 -3
  307. data/lib/launchdarkly_api/models/flag_trigger_input.rb +5 -3
  308. data/lib/launchdarkly_api/models/follow_flag_member.rb +286 -0
  309. data/lib/launchdarkly_api/models/followers_per_flag.rb +230 -0
  310. data/lib/launchdarkly_api/models/forbidden_error_rep.rb +5 -2
  311. data/lib/launchdarkly_api/models/hunk_rep.rb +3 -2
  312. data/lib/launchdarkly_api/models/import.rb +3 -2
  313. data/lib/launchdarkly_api/models/initiator_rep.rb +3 -2
  314. data/lib/launchdarkly_api/models/instruction_user_request.rb +309 -0
  315. data/lib/launchdarkly_api/models/integration.rb +14 -3
  316. data/lib/launchdarkly_api/models/integration_delivery_configuration.rb +3 -2
  317. data/lib/launchdarkly_api/models/integration_delivery_configuration_collection.rb +3 -2
  318. data/lib/launchdarkly_api/models/integration_delivery_configuration_collection_links.rb +3 -2
  319. data/lib/launchdarkly_api/models/integration_delivery_configuration_links.rb +3 -2
  320. data/lib/launchdarkly_api/models/integration_delivery_configuration_post.rb +6 -5
  321. data/lib/launchdarkly_api/models/integration_delivery_configuration_response.rb +3 -2
  322. data/lib/launchdarkly_api/models/integration_metadata.rb +3 -2
  323. data/lib/launchdarkly_api/models/integration_status.rb +3 -2
  324. data/lib/launchdarkly_api/models/integration_status_rep.rb +3 -2
  325. data/lib/launchdarkly_api/models/integration_subscription_status_rep.rb +3 -2
  326. data/lib/launchdarkly_api/models/integrations.rb +3 -2
  327. data/lib/launchdarkly_api/models/invalid_request_error_rep.rb +5 -2
  328. data/lib/launchdarkly_api/models/ip_list.rb +3 -2
  329. data/lib/launchdarkly_api/models/iteration_expandable_properties.rb +232 -0
  330. data/lib/launchdarkly_api/models/iteration_input.rb +281 -0
  331. data/lib/launchdarkly_api/models/iteration_rep.rb +348 -0
  332. data/lib/launchdarkly_api/models/last_seen_metadata.rb +3 -2
  333. data/lib/launchdarkly_api/models/legacy_experiment_rep.rb +250 -0
  334. data/lib/launchdarkly_api/models/link.rb +3 -2
  335. data/lib/launchdarkly_api/models/member.rb +18 -11
  336. data/lib/launchdarkly_api/models/member_data_rep.rb +3 -2
  337. data/lib/launchdarkly_api/models/member_import_item.rb +3 -2
  338. data/lib/launchdarkly_api/models/member_permission_grant_summary_rep.rb +3 -2
  339. data/lib/launchdarkly_api/models/member_summary.rb +3 -2
  340. data/lib/launchdarkly_api/models/member_team_summary_rep.rb +3 -2
  341. data/lib/launchdarkly_api/models/member_teams_post_input.rb +3 -2
  342. data/lib/launchdarkly_api/models/members.rb +3 -2
  343. data/lib/launchdarkly_api/models/method_not_allowed_error_rep.rb +5 -2
  344. data/lib/launchdarkly_api/models/metric_collection_rep.rb +3 -2
  345. data/lib/launchdarkly_api/models/metric_input.rb +238 -0
  346. data/lib/launchdarkly_api/models/metric_listing_rep.rb +3 -2
  347. data/lib/launchdarkly_api/models/metric_post.rb +15 -5
  348. data/lib/launchdarkly_api/models/metric_rep.rb +4 -3
  349. data/lib/launchdarkly_api/models/metric_seen.rb +3 -2
  350. data/lib/launchdarkly_api/models/metric_v2_rep.rb +268 -0
  351. data/lib/launchdarkly_api/models/modification.rb +3 -2
  352. data/lib/launchdarkly_api/models/multi_environment_dependent_flag.rb +3 -2
  353. data/lib/launchdarkly_api/models/multi_environment_dependent_flags.rb +3 -2
  354. data/lib/launchdarkly_api/models/new_member_form.rb +38 -3
  355. data/lib/launchdarkly_api/models/not_found_error_rep.rb +5 -2
  356. data/lib/launchdarkly_api/models/oauth_client_post.rb +240 -0
  357. data/lib/launchdarkly_api/models/parameter_default.rb +240 -0
  358. data/lib/launchdarkly_api/models/parameter_rep.rb +228 -0
  359. data/lib/launchdarkly_api/models/parent_resource_rep.rb +7 -5
  360. data/lib/launchdarkly_api/models/patch_failed_error_rep.rb +5 -2
  361. data/lib/launchdarkly_api/models/patch_flags_request.rb +237 -0
  362. data/lib/launchdarkly_api/models/patch_operation.rb +3 -2
  363. data/lib/launchdarkly_api/models/patch_segment_instruction.rb +53 -5
  364. data/lib/launchdarkly_api/models/patch_segment_request.rb +3 -2
  365. data/lib/launchdarkly_api/models/patch_users_request.rb +237 -0
  366. data/lib/launchdarkly_api/models/patch_with_comment.rb +4 -2
  367. data/lib/launchdarkly_api/models/permission_grant_input.rb +40 -2
  368. data/lib/launchdarkly_api/models/post_approval_request_apply_request.rb +4 -2
  369. data/lib/launchdarkly_api/models/post_approval_request_review_request.rb +39 -2
  370. data/lib/launchdarkly_api/models/post_flag_scheduled_changes_input.rb +4 -2
  371. data/lib/launchdarkly_api/models/prerequisite.rb +3 -2
  372. data/lib/launchdarkly_api/models/project.rb +5 -11
  373. data/lib/launchdarkly_api/models/project_listing_rep.rb +3 -2
  374. data/lib/launchdarkly_api/models/project_post.rb +4 -2
  375. data/lib/launchdarkly_api/models/project_rep.rb +323 -0
  376. data/lib/launchdarkly_api/models/project_summary.rb +3 -2
  377. data/lib/launchdarkly_api/models/projects.rb +16 -6
  378. data/lib/launchdarkly_api/models/pub_nub_detail_rep.rb +3 -2
  379. data/lib/launchdarkly_api/models/put_branch.rb +3 -2
  380. data/lib/launchdarkly_api/models/rate_limited_error_rep.rb +5 -2
  381. data/lib/launchdarkly_api/models/recent_trigger_body.rb +3 -2
  382. data/lib/launchdarkly_api/models/reference_rep.rb +3 -2
  383. data/lib/launchdarkly_api/models/relative_difference_rep.rb +237 -0
  384. data/lib/launchdarkly_api/models/relay_auto_config_collection_rep.rb +3 -2
  385. data/lib/launchdarkly_api/models/relay_auto_config_post.rb +5 -3
  386. data/lib/launchdarkly_api/models/relay_auto_config_rep.rb +4 -3
  387. data/lib/launchdarkly_api/models/repository_collection_rep.rb +3 -2
  388. data/lib/launchdarkly_api/models/repository_post.rb +7 -4
  389. data/lib/launchdarkly_api/models/repository_rep.rb +3 -2
  390. data/lib/launchdarkly_api/models/resolved_context.rb +3 -2
  391. data/lib/launchdarkly_api/models/resolved_image.rb +3 -2
  392. data/lib/launchdarkly_api/models/resolved_title.rb +3 -2
  393. data/lib/launchdarkly_api/models/resolved_ui_block_element.rb +3 -2
  394. data/lib/launchdarkly_api/models/resolved_ui_blocks.rb +3 -2
  395. data/lib/launchdarkly_api/models/resource_access.rb +7 -5
  396. data/lib/launchdarkly_api/models/resource_id_response.rb +3 -2
  397. data/lib/launchdarkly_api/models/review_output_rep.rb +3 -2
  398. data/lib/launchdarkly_api/models/review_response.rb +5 -4
  399. data/lib/launchdarkly_api/models/rollout.rb +3 -2
  400. data/lib/launchdarkly_api/models/rule.rb +3 -2
  401. data/lib/launchdarkly_api/models/rule_clause.rb +274 -0
  402. data/lib/launchdarkly_api/models/schedule_condition_input_rep.rb +5 -2
  403. data/lib/launchdarkly_api/models/schedule_condition_output_rep.rb +3 -2
  404. data/lib/launchdarkly_api/models/sdk_list_rep.rb +3 -2
  405. data/lib/launchdarkly_api/models/sdk_version_list_rep.rb +3 -2
  406. data/lib/launchdarkly_api/models/sdk_version_rep.rb +3 -2
  407. data/lib/launchdarkly_api/models/segment_body.rb +4 -2
  408. data/lib/launchdarkly_api/models/segment_metadata.rb +3 -2
  409. data/lib/launchdarkly_api/models/segment_user_list.rb +3 -2
  410. data/lib/launchdarkly_api/models/segment_user_state.rb +3 -2
  411. data/lib/launchdarkly_api/models/series_list_rep.rb +3 -2
  412. data/lib/launchdarkly_api/models/source_env.rb +3 -2
  413. data/lib/launchdarkly_api/models/source_flag.rb +5 -3
  414. data/lib/launchdarkly_api/models/stage_input_rep.rb +16 -3
  415. data/lib/launchdarkly_api/models/stage_output_rep.rb +3 -2
  416. data/lib/launchdarkly_api/models/statement.rb +3 -2
  417. data/lib/launchdarkly_api/models/statement_post.rb +5 -4
  418. data/lib/launchdarkly_api/models/statement_post_data.rb +5 -4
  419. data/lib/launchdarkly_api/models/statistic_collection_rep.rb +5 -2
  420. data/lib/launchdarkly_api/models/statistic_rep.rb +26 -3
  421. data/lib/launchdarkly_api/models/statistics_rep.rb +234 -0
  422. data/lib/launchdarkly_api/models/statistics_root.rb +3 -2
  423. data/lib/launchdarkly_api/models/status_conflict_error_rep.rb +5 -2
  424. data/lib/launchdarkly_api/models/subject_data_rep.rb +3 -2
  425. data/lib/launchdarkly_api/models/subscription_post.rb +6 -4
  426. data/lib/launchdarkly_api/models/tag_collection.rb +3 -2
  427. data/lib/launchdarkly_api/models/target.rb +3 -2
  428. data/lib/launchdarkly_api/models/target_resource_rep.rb +4 -3
  429. data/lib/launchdarkly_api/models/team.rb +43 -6
  430. data/lib/launchdarkly_api/models/team_custom_role.rb +3 -2
  431. data/lib/launchdarkly_api/models/team_custom_roles.rb +3 -2
  432. data/lib/launchdarkly_api/models/team_imports_rep.rb +3 -2
  433. data/lib/launchdarkly_api/models/team_maintainers.rb +3 -2
  434. data/lib/launchdarkly_api/models/team_members.rb +219 -0
  435. data/lib/launchdarkly_api/models/team_patch_input.rb +11 -4
  436. data/lib/launchdarkly_api/models/team_post_input.rb +5 -4
  437. data/lib/launchdarkly_api/models/team_projects.rb +3 -2
  438. data/lib/launchdarkly_api/models/team_rep_expandable_properties.rb +246 -0
  439. data/lib/launchdarkly_api/models/teams.rb +3 -2
  440. data/lib/launchdarkly_api/models/timestamp_rep.rb +3 -2
  441. data/lib/launchdarkly_api/models/title_rep.rb +3 -2
  442. data/lib/launchdarkly_api/models/token.rb +4 -3
  443. data/lib/launchdarkly_api/models/token_data_rep.rb +3 -2
  444. data/lib/launchdarkly_api/models/tokens.rb +3 -2
  445. data/lib/launchdarkly_api/models/treatment_input.rb +268 -0
  446. data/lib/launchdarkly_api/models/treatment_parameter_input.rb +238 -0
  447. data/lib/launchdarkly_api/models/treatment_rep.rb +267 -0
  448. data/lib/launchdarkly_api/models/treatment_result_rep.rb +275 -0
  449. data/lib/launchdarkly_api/models/trigger_post.rb +6 -4
  450. data/lib/launchdarkly_api/models/trigger_workflow_collection_rep.rb +3 -2
  451. data/lib/launchdarkly_api/models/trigger_workflow_rep.rb +3 -2
  452. data/lib/launchdarkly_api/models/unauthorized_error_rep.rb +5 -2
  453. data/lib/launchdarkly_api/models/url_post.rb +3 -2
  454. data/lib/launchdarkly_api/models/user.rb +3 -2
  455. data/lib/launchdarkly_api/models/user_attribute_names_rep.rb +3 -2
  456. data/lib/launchdarkly_api/models/user_flag_setting.rb +20 -7
  457. data/lib/launchdarkly_api/models/user_flag_settings.rb +4 -2
  458. data/lib/launchdarkly_api/models/user_record.rb +3 -2
  459. data/lib/launchdarkly_api/models/user_record_rep.rb +3 -2
  460. data/lib/launchdarkly_api/models/user_segment.rb +14 -4
  461. data/lib/launchdarkly_api/models/user_segment_rule.rb +3 -2
  462. data/lib/launchdarkly_api/models/user_segments.rb +5 -2
  463. data/lib/launchdarkly_api/models/users.rb +3 -2
  464. data/lib/launchdarkly_api/models/users_rep.rb +251 -0
  465. data/lib/launchdarkly_api/models/value_put.rb +5 -3
  466. data/lib/launchdarkly_api/models/variation.rb +4 -2
  467. data/lib/launchdarkly_api/models/variation_or_rollout_rep.rb +3 -2
  468. data/lib/launchdarkly_api/models/variation_summary.rb +3 -2
  469. data/lib/launchdarkly_api/models/versions_rep.rb +3 -2
  470. data/lib/launchdarkly_api/models/webhook.rb +12 -3
  471. data/lib/launchdarkly_api/models/webhook_post.rb +3 -2
  472. data/lib/launchdarkly_api/models/webhooks.rb +5 -2
  473. data/lib/launchdarkly_api/models/weighted_variation.rb +3 -2
  474. data/lib/launchdarkly_api/models/workflow_template_metadata.rb +221 -0
  475. data/lib/launchdarkly_api/models/workflow_template_parameter.rb +248 -0
  476. data/lib/launchdarkly_api/version.rb +3 -3
  477. data/lib/launchdarkly_api.rb +48 -6
  478. data/spec/api/access_tokens_api_spec.rb +2 -2
  479. data/spec/api/account_members_api_spec.rb +8 -8
  480. data/spec/api/account_usage_beta_api_spec.rb +2 -2
  481. data/spec/api/approvals_api_spec.rb +9 -9
  482. data/spec/api/audit_log_api_spec.rb +3 -3
  483. data/spec/api/code_references_api_spec.rb +12 -12
  484. data/spec/api/custom_roles_api_spec.rb +2 -2
  485. data/spec/api/data_export_destinations_api_spec.rb +6 -6
  486. data/spec/api/environments_api_spec.rb +19 -3
  487. data/spec/api/experiments_beta_api_spec.rb +96 -6
  488. data/spec/api/feature_flags_api_spec.rb +9 -9
  489. data/spec/api/feature_flags_beta_api_spec.rb +4 -4
  490. data/spec/api/flag_links_beta_api_spec.rb +3 -3
  491. data/spec/api/flag_triggers_api_spec.rb +4 -4
  492. data/spec/api/follow_flags_api_spec.rb +92 -0
  493. data/spec/api/integration_audit_log_subscriptions_api_spec.rb +3 -3
  494. data/spec/api/integration_delivery_configurations_beta_api_spec.rb +3 -3
  495. data/spec/api/metrics_api_spec.rb +3 -3
  496. data/spec/api/o_auth2_clients_beta_api_spec.rb +95 -0
  497. data/spec/api/other_api_spec.rb +5 -5
  498. data/spec/api/projects_api_spec.rb +13 -8
  499. data/spec/api/relay_proxy_configurations_api_spec.rb +6 -6
  500. data/spec/api/scheduled_changes_api_spec.rb +8 -8
  501. data/spec/api/segments_api_spec.rb +10 -10
  502. data/spec/api/segments_beta_api_spec.rb +5 -3
  503. data/spec/api/tags_api_spec.rb +2 -2
  504. data/spec/api/teams_api_spec.rb +143 -0
  505. data/spec/api/user_settings_api_spec.rb +7 -7
  506. data/spec/api/users_api_spec.rb +5 -5
  507. data/spec/api/users_beta_api_spec.rb +2 -2
  508. data/spec/api/webhooks_api_spec.rb +3 -3
  509. data/spec/api/workflows_beta_api_spec.rb +6 -6
  510. data/spec/api_client_spec.rb +2 -2
  511. data/spec/configuration_spec.rb +2 -2
  512. data/spec/models/access_allowed_reason_spec.rb +2 -2
  513. data/spec/models/access_allowed_rep_spec.rb +2 -2
  514. data/spec/models/access_denied_reason_spec.rb +2 -2
  515. data/spec/models/access_denied_spec.rb +2 -2
  516. data/spec/models/access_spec.rb +2 -2
  517. data/spec/models/access_token_post_spec.rb +2 -2
  518. data/spec/models/action_input_rep_spec.rb +2 -2
  519. data/spec/models/action_output_rep_spec.rb +2 -2
  520. data/spec/models/approval_condition_input_rep_spec.rb +8 -2
  521. data/spec/models/approval_condition_output_rep_spec.rb +2 -2
  522. data/spec/models/approval_settings_spec.rb +2 -2
  523. data/spec/models/audit_log_entry_listing_rep_collection_spec.rb +2 -2
  524. data/spec/models/audit_log_entry_listing_rep_spec.rb +2 -2
  525. data/spec/models/audit_log_entry_rep_spec.rb +2 -2
  526. data/spec/models/authorized_app_data_rep_spec.rb +2 -2
  527. data/spec/models/big_segment_target_spec.rb +2 -2
  528. data/spec/models/branch_collection_rep_spec.rb +2 -2
  529. data/spec/models/branch_rep_spec.rb +2 -2
  530. data/spec/models/clause_spec.rb +2 -2
  531. data/spec/models/client_collection_spec.rb +40 -0
  532. data/spec/models/client_side_availability_post_spec.rb +2 -2
  533. data/spec/models/client_side_availability_spec.rb +2 -2
  534. data/spec/models/client_spec.rb +76 -0
  535. data/spec/models/condition_base_output_rep_spec.rb +2 -2
  536. data/spec/models/condition_input_rep_spec.rb +8 -2
  537. data/spec/models/condition_output_rep_spec.rb +2 -2
  538. data/spec/models/confidence_interval_rep_spec.rb +2 -2
  539. data/spec/models/conflict_output_rep_spec.rb +2 -2
  540. data/spec/models/conflict_spec.rb +2 -2
  541. data/spec/models/copied_from_env_spec.rb +2 -2
  542. data/spec/models/create_copy_flag_config_approval_request_request_spec.rb +16 -2
  543. data/spec/models/create_flag_config_approval_request_request_spec.rb +8 -2
  544. data/spec/models/credible_interval_rep_spec.rb +40 -0
  545. data/spec/models/custom_property_spec.rb +2 -2
  546. data/spec/models/custom_role_post_data_spec.rb +2 -2
  547. data/spec/models/custom_role_post_spec.rb +2 -2
  548. data/spec/models/custom_role_spec.rb +2 -2
  549. data/spec/models/custom_roles_spec.rb +2 -2
  550. data/spec/models/custom_workflow_input_rep_spec.rb +8 -2
  551. data/spec/models/custom_workflow_meta_spec.rb +2 -2
  552. data/spec/models/custom_workflow_output_rep_spec.rb +2 -2
  553. data/spec/models/custom_workflow_stage_meta_spec.rb +2 -2
  554. data/spec/models/custom_workflows_listing_output_rep_spec.rb +2 -2
  555. data/spec/models/default_client_side_availability_post_spec.rb +2 -2
  556. data/spec/models/defaults_spec.rb +2 -2
  557. data/spec/models/dependent_flag_environment_spec.rb +2 -2
  558. data/spec/models/dependent_flag_spec.rb +2 -2
  559. data/spec/models/dependent_flags_by_environment_spec.rb +2 -2
  560. data/spec/models/destination_post_spec.rb +2 -2
  561. data/spec/models/destination_spec.rb +2 -2
  562. data/spec/models/destinations_spec.rb +2 -2
  563. data/spec/models/environment_post_spec.rb +2 -2
  564. data/spec/models/environment_spec.rb +2 -2
  565. data/spec/models/environments_spec.rb +46 -0
  566. data/spec/models/evaluation_reason_spec.rb +64 -0
  567. data/spec/models/execution_output_rep_spec.rb +2 -2
  568. data/spec/models/experiment_allocation_rep_spec.rb +2 -2
  569. data/spec/models/experiment_bayesian_results_rep_spec.rb +46 -0
  570. data/spec/models/experiment_collection_rep_spec.rb +46 -0
  571. data/spec/models/experiment_enabled_period_rep_spec.rb +2 -2
  572. data/spec/models/experiment_environment_setting_rep_spec.rb +2 -2
  573. data/spec/models/experiment_expandable_properties_spec.rb +40 -0
  574. data/spec/models/experiment_info_rep_spec.rb +2 -2
  575. data/spec/models/experiment_metadata_rep_spec.rb +2 -2
  576. data/spec/models/experiment_patch_input_spec.rb +40 -0
  577. data/spec/models/experiment_post_spec.rb +58 -0
  578. data/spec/models/experiment_results_spec.rb +70 -0
  579. data/spec/models/experiment_spec.rb +88 -0
  580. data/spec/models/experiment_stats_rep_spec.rb +2 -2
  581. data/spec/models/experiment_time_series_slice_spec.rb +2 -2
  582. data/spec/models/experiment_time_series_variation_slice_spec.rb +2 -2
  583. data/spec/models/experiment_totals_rep_spec.rb +2 -2
  584. data/spec/models/expiring_user_target_error_spec.rb +2 -2
  585. data/spec/models/expiring_user_target_get_response_spec.rb +2 -2
  586. data/spec/models/expiring_user_target_item_spec.rb +2 -2
  587. data/spec/models/expiring_user_target_patch_response_spec.rb +2 -2
  588. data/spec/models/export_spec.rb +2 -2
  589. data/spec/models/extinction_collection_rep_spec.rb +2 -2
  590. data/spec/models/extinction_spec.rb +2 -2
  591. data/spec/models/feature_flag_body_spec.rb +2 -8
  592. data/spec/models/feature_flag_config_spec.rb +2 -2
  593. data/spec/models/feature_flag_scheduled_change_spec.rb +2 -2
  594. data/spec/models/feature_flag_scheduled_changes_spec.rb +2 -2
  595. data/spec/models/feature_flag_spec.rb +2 -8
  596. data/spec/models/feature_flag_status_across_environments_spec.rb +2 -2
  597. data/spec/models/feature_flag_status_spec.rb +2 -2
  598. data/spec/models/feature_flag_statuses_spec.rb +2 -2
  599. data/spec/models/feature_flags_spec.rb +2 -2
  600. data/spec/models/file_rep_spec.rb +2 -2
  601. data/spec/models/flag_config_approval_request_response_spec.rb +10 -2
  602. data/spec/models/flag_config_approval_requests_response_spec.rb +2 -2
  603. data/spec/models/flag_copy_config_environment_spec.rb +2 -2
  604. data/spec/models/flag_copy_config_post_spec.rb +2 -2
  605. data/spec/models/flag_followers_by_proj_env_get_rep_spec.rb +40 -0
  606. data/spec/models/flag_followers_get_rep_spec.rb +40 -0
  607. data/spec/models/flag_global_attributes_rep_spec.rb +2 -8
  608. data/spec/models/flag_input_spec.rb +40 -0
  609. data/spec/models/flag_link_collection_rep_spec.rb +2 -2
  610. data/spec/models/flag_link_member_spec.rb +2 -2
  611. data/spec/models/flag_link_post_spec.rb +2 -2
  612. data/spec/models/flag_link_rep_spec.rb +2 -2
  613. data/spec/models/flag_listing_rep_spec.rb +2 -2
  614. data/spec/models/flag_rep_spec.rb +46 -0
  615. data/spec/models/flag_scheduled_changes_input_spec.rb +2 -2
  616. data/spec/models/flag_status_rep_spec.rb +2 -2
  617. data/spec/models/flag_summary_spec.rb +8 -2
  618. data/spec/models/flag_trigger_input_spec.rb +2 -2
  619. data/spec/models/follow_flag_member_spec.rb +64 -0
  620. data/spec/models/followers_per_flag_spec.rb +40 -0
  621. data/spec/models/forbidden_error_rep_spec.rb +2 -2
  622. data/spec/models/hunk_rep_spec.rb +2 -2
  623. data/spec/models/import_spec.rb +2 -2
  624. data/spec/models/initiator_rep_spec.rb +2 -2
  625. data/spec/models/instruction_user_request_spec.rb +62 -0
  626. data/spec/models/integration_delivery_configuration_collection_links_spec.rb +2 -2
  627. data/spec/models/integration_delivery_configuration_collection_spec.rb +2 -2
  628. data/spec/models/integration_delivery_configuration_links_spec.rb +2 -2
  629. data/spec/models/integration_delivery_configuration_post_spec.rb +2 -2
  630. data/spec/models/integration_delivery_configuration_response_spec.rb +2 -2
  631. data/spec/models/integration_delivery_configuration_spec.rb +2 -2
  632. data/spec/models/integration_metadata_spec.rb +2 -2
  633. data/spec/models/integration_spec.rb +2 -2
  634. data/spec/models/integration_status_rep_spec.rb +2 -2
  635. data/spec/models/integration_status_spec.rb +2 -2
  636. data/spec/models/integration_subscription_status_rep_spec.rb +2 -2
  637. data/spec/models/integrations_spec.rb +2 -2
  638. data/spec/models/invalid_request_error_rep_spec.rb +2 -2
  639. data/spec/models/ip_list_spec.rb +2 -2
  640. data/spec/models/iteration_expandable_properties_spec.rb +40 -0
  641. data/spec/models/iteration_input_spec.rb +58 -0
  642. data/spec/models/iteration_rep_spec.rb +106 -0
  643. data/spec/models/last_seen_metadata_spec.rb +2 -2
  644. data/spec/models/legacy_experiment_rep_spec.rb +52 -0
  645. data/spec/models/link_spec.rb +2 -2
  646. data/spec/models/member_data_rep_spec.rb +2 -2
  647. data/spec/models/member_import_item_spec.rb +2 -2
  648. data/spec/models/member_permission_grant_summary_rep_spec.rb +2 -2
  649. data/spec/models/member_spec.rb +8 -2
  650. data/spec/models/member_summary_spec.rb +2 -2
  651. data/spec/models/member_team_summary_rep_spec.rb +2 -2
  652. data/spec/models/member_teams_post_input_spec.rb +2 -2
  653. data/spec/models/members_spec.rb +2 -2
  654. data/spec/models/method_not_allowed_error_rep_spec.rb +2 -2
  655. data/spec/models/metric_collection_rep_spec.rb +2 -2
  656. data/spec/models/metric_input_spec.rb +40 -0
  657. data/spec/models/metric_listing_rep_spec.rb +2 -2
  658. data/spec/models/metric_post_spec.rb +2 -2
  659. data/spec/models/metric_rep_spec.rb +2 -2
  660. data/spec/models/metric_seen_spec.rb +2 -2
  661. data/spec/models/metric_v2_rep_spec.rb +52 -0
  662. data/spec/models/modification_spec.rb +2 -2
  663. data/spec/models/multi_environment_dependent_flag_spec.rb +2 -2
  664. data/spec/models/multi_environment_dependent_flags_spec.rb +2 -2
  665. data/spec/models/new_member_form_spec.rb +6 -2
  666. data/spec/models/not_found_error_rep_spec.rb +2 -2
  667. data/spec/models/oauth_client_post_spec.rb +46 -0
  668. data/spec/models/parameter_default_spec.rb +46 -0
  669. data/spec/models/parameter_rep_spec.rb +40 -0
  670. data/spec/models/parent_resource_rep_spec.rb +2 -2
  671. data/spec/models/patch_failed_error_rep_spec.rb +2 -2
  672. data/spec/models/patch_flags_request_spec.rb +40 -0
  673. data/spec/models/patch_operation_spec.rb +2 -2
  674. data/spec/models/patch_segment_instruction_spec.rb +10 -2
  675. data/spec/models/patch_segment_request_spec.rb +2 -2
  676. data/spec/models/patch_users_request_spec.rb +40 -0
  677. data/spec/models/patch_with_comment_spec.rb +2 -2
  678. data/spec/models/permission_grant_input_spec.rb +6 -2
  679. data/spec/models/post_approval_request_apply_request_spec.rb +2 -2
  680. data/spec/models/post_approval_request_review_request_spec.rb +6 -2
  681. data/spec/models/post_flag_scheduled_changes_input_spec.rb +2 -2
  682. data/spec/models/prerequisite_spec.rb +2 -2
  683. data/spec/models/project_listing_rep_spec.rb +2 -2
  684. data/spec/models/project_post_spec.rb +2 -2
  685. data/spec/models/project_rep_spec.rb +76 -0
  686. data/spec/models/project_spec.rb +2 -2
  687. data/spec/models/project_summary_spec.rb +2 -2
  688. data/spec/models/projects_spec.rb +8 -2
  689. data/spec/models/pub_nub_detail_rep_spec.rb +2 -2
  690. data/spec/models/put_branch_spec.rb +2 -2
  691. data/spec/models/rate_limited_error_rep_spec.rb +2 -2
  692. data/spec/models/recent_trigger_body_spec.rb +2 -2
  693. data/spec/models/reference_rep_spec.rb +2 -2
  694. data/spec/models/relative_difference_rep_spec.rb +46 -0
  695. data/spec/models/relay_auto_config_collection_rep_spec.rb +2 -2
  696. data/spec/models/relay_auto_config_post_spec.rb +2 -2
  697. data/spec/models/relay_auto_config_rep_spec.rb +2 -2
  698. data/spec/models/repository_collection_rep_spec.rb +2 -2
  699. data/spec/models/repository_post_spec.rb +2 -2
  700. data/spec/models/repository_rep_spec.rb +2 -2
  701. data/spec/models/resolved_context_spec.rb +2 -2
  702. data/spec/models/resolved_image_spec.rb +2 -2
  703. data/spec/models/resolved_title_spec.rb +2 -2
  704. data/spec/models/resolved_ui_block_element_spec.rb +2 -2
  705. data/spec/models/resolved_ui_blocks_spec.rb +2 -2
  706. data/spec/models/resource_access_spec.rb +2 -2
  707. data/spec/models/resource_id_response_spec.rb +2 -2
  708. data/spec/models/review_output_rep_spec.rb +2 -2
  709. data/spec/models/review_response_spec.rb +2 -2
  710. data/spec/models/rollout_spec.rb +2 -2
  711. data/spec/models/rule_clause_spec.rb +50 -0
  712. data/spec/models/rule_spec.rb +2 -2
  713. data/spec/models/schedule_condition_input_rep_spec.rb +2 -2
  714. data/spec/models/schedule_condition_output_rep_spec.rb +2 -2
  715. data/spec/models/sdk_list_rep_spec.rb +2 -2
  716. data/spec/models/sdk_version_list_rep_spec.rb +2 -2
  717. data/spec/models/sdk_version_rep_spec.rb +2 -2
  718. data/spec/models/segment_body_spec.rb +2 -2
  719. data/spec/models/segment_metadata_spec.rb +2 -2
  720. data/spec/models/segment_user_list_spec.rb +2 -2
  721. data/spec/models/segment_user_state_spec.rb +2 -2
  722. data/spec/models/series_list_rep_spec.rb +2 -2
  723. data/spec/models/source_env_spec.rb +2 -2
  724. data/spec/models/source_flag_spec.rb +2 -2
  725. data/spec/models/stage_input_rep_spec.rb +8 -2
  726. data/spec/models/stage_output_rep_spec.rb +2 -2
  727. data/spec/models/statement_post_data_spec.rb +2 -2
  728. data/spec/models/statement_post_spec.rb +2 -2
  729. data/spec/models/statement_spec.rb +2 -2
  730. data/spec/models/statistic_collection_rep_spec.rb +2 -2
  731. data/spec/models/statistic_rep_spec.rb +8 -2
  732. data/spec/models/statistics_rep_spec.rb +40 -0
  733. data/spec/models/statistics_root_spec.rb +2 -2
  734. data/spec/models/status_conflict_error_rep_spec.rb +2 -2
  735. data/spec/models/subject_data_rep_spec.rb +2 -2
  736. data/spec/models/subscription_post_spec.rb +2 -2
  737. data/spec/models/tag_collection_spec.rb +2 -2
  738. data/spec/models/target_resource_rep_spec.rb +2 -2
  739. data/spec/models/target_spec.rb +2 -2
  740. data/spec/models/team_custom_role_spec.rb +2 -2
  741. data/spec/models/team_custom_roles_spec.rb +2 -2
  742. data/spec/models/team_imports_rep_spec.rb +2 -2
  743. data/spec/models/team_maintainers_spec.rb +2 -2
  744. data/spec/models/team_members_spec.rb +34 -0
  745. data/spec/models/team_patch_input_spec.rb +2 -2
  746. data/spec/models/team_post_input_spec.rb +2 -2
  747. data/spec/models/team_projects_spec.rb +2 -2
  748. data/spec/models/team_rep_expandable_properties_spec.rb +52 -0
  749. data/spec/models/team_spec.rb +26 -2
  750. data/spec/models/teams_spec.rb +2 -2
  751. data/spec/models/timestamp_rep_spec.rb +2 -2
  752. data/spec/models/title_rep_spec.rb +2 -2
  753. data/spec/models/token_data_rep_spec.rb +2 -2
  754. data/spec/models/token_spec.rb +2 -2
  755. data/spec/models/tokens_spec.rb +2 -2
  756. data/spec/models/treatment_input_spec.rb +52 -0
  757. data/spec/models/treatment_parameter_input_spec.rb +40 -0
  758. data/spec/models/treatment_rep_spec.rb +58 -0
  759. data/spec/models/treatment_result_rep_spec.rb +70 -0
  760. data/spec/models/trigger_post_spec.rb +2 -2
  761. data/spec/models/trigger_workflow_collection_rep_spec.rb +2 -2
  762. data/spec/models/trigger_workflow_rep_spec.rb +2 -2
  763. data/spec/models/unauthorized_error_rep_spec.rb +2 -2
  764. data/spec/models/url_post_spec.rb +2 -2
  765. data/spec/models/user_attribute_names_rep_spec.rb +2 -2
  766. data/spec/models/user_flag_setting_spec.rb +8 -2
  767. data/spec/models/user_flag_settings_spec.rb +2 -2
  768. data/spec/models/user_record_rep_spec.rb +2 -2
  769. data/spec/models/user_record_spec.rb +2 -2
  770. data/spec/models/user_segment_rule_spec.rb +2 -2
  771. data/spec/models/user_segment_spec.rb +2 -2
  772. data/spec/models/user_segments_spec.rb +2 -2
  773. data/spec/models/user_spec.rb +2 -2
  774. data/spec/models/users_rep_spec.rb +46 -0
  775. data/spec/models/users_spec.rb +2 -2
  776. data/spec/models/value_put_spec.rb +2 -2
  777. data/spec/models/variation_or_rollout_rep_spec.rb +2 -2
  778. data/spec/models/variation_spec.rb +2 -2
  779. data/spec/models/variation_summary_spec.rb +2 -2
  780. data/spec/models/versions_rep_spec.rb +2 -2
  781. data/spec/models/webhook_post_spec.rb +2 -2
  782. data/spec/models/webhook_spec.rb +2 -2
  783. data/spec/models/webhooks_spec.rb +2 -2
  784. data/spec/models/weighted_variation_spec.rb +2 -2
  785. data/spec/models/workflow_template_metadata_spec.rb +34 -0
  786. data/spec/models/workflow_template_parameter_spec.rb +52 -0
  787. data/spec/spec_helper.rb +2 -2
  788. metadata +320 -134
  789. data/docs/StatementRep.md +0 -26
  790. data/docs/TeamsBetaApi.md +0 -606
  791. data/lib/launchdarkly_api/api/teams_beta_api.rb +0 -565
  792. data/lib/launchdarkly_api/models/experiment_rep.rb +0 -249
  793. data/lib/launchdarkly_api/models/experiment_results_rep.rb +0 -280
  794. data/lib/launchdarkly_api/models/statement_rep.rb +0 -271
  795. data/spec/api/teams_beta_api_spec.rb +0 -139
  796. data/spec/models/experiment_rep_spec.rb +0 -52
  797. data/spec/models/experiment_results_rep_spec.rb +0 -70
  798. data/spec/models/statement_rep_spec.rb +0 -58
@@ -1,12 +1,12 @@
1
1
  =begin
2
2
  #LaunchDarkly REST API
3
3
 
4
- ## Overview ## Authentication All REST API resources are authenticated with either [personal or service access tokens](https://docs.launchdarkly.com/home/account-security/api-access-tokens), or session cookies. Other authentication mechanisms are not supported. You can manage personal access tokens on your [Account settings](https://app.launchdarkly.com/settings/tokens) page. LaunchDarkly also has SDK keys, mobile keys, and client-side IDs that are used by our server-side SDKs, mobile SDKs, and client-side SDKs, respectively. **These keys cannot be used to access our REST API**. These keys are environment-specific, and can only perform read-only operations (fetching feature flag settings). | Auth mechanism | Allowed resources | Use cases | | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -------------------------------------------------- | | [Personal access tokens](https://docs.launchdarkly.com/home/account-security/api-access-tokens) | Can be customized on a per-token basis | Building scripts, custom integrations, data export | | SDK keys | Can only access read-only SDK-specific resources and the firehose, restricted to a single environment | Server-side SDKs, Firehose API | | Mobile keys | Can only access read-only mobile SDK-specific resources, restricted to a single environment | Mobile SDKs | | Client-side ID | Single environment, only flags marked available to client-side | Client-side JavaScript | > #### Keep your access tokens and SDK keys private > > Access tokens should _never_ be exposed in untrusted contexts. Never put an access token in client-side JavaScript, or embed it in a mobile application. LaunchDarkly has special mobile keys that you can embed in mobile apps. If you accidentally expose an access token or SDK key, you can reset it from your [Account Settings](https://app.launchdarkly.com/settings#/tokens) page. > > The client-side ID is safe to embed in untrusted contexts. It's designed for use in client-side JavaScript. ### Via request header The preferred way to authenticate with the API is by adding an `Authorization` header containing your access token to your requests. The value of the `Authorization` header must be your access token. Manage personal access tokens from the [Account Settings](https://app.launchdarkly.com/settings/tokens) page. ### Via session cookie For testing purposes, you can make API calls directly from your web browser. If you're logged in to the application, the API will use your existing session to authenticate calls. If you have a [role](https://docs.launchdarkly.com/home/team/built-in-roles) other than Admin, or have a [custom role](https://docs.launchdarkly.com/home/team/custom-roles) defined, you may not have permission to perform some API calls. You will receive a `401` response code in that case. > ### Modifying the Origin header causes an error > > LaunchDarkly validates that the Origin header for any API request authenticated by a session cookie matches the expected Origin header. The expected Origin header is `https://app.launchdarkly.com`. > > If the Origin header does not match what's expected, LaunchDarkly returns an error. This error can prevent the LaunchDarkly app from working correctly. > > Any browser extension that intentionally changes the Origin header can cause this problem. For example, the `Allow-Control-Allow-Origin: *` Chrome extension changes the Origin header to `http://evil.com` and causes the app to fail. > > To prevent this error, do not modify your Origin header. > > LaunchDarkly does not require origin matching when authenticating with an access token, so this issue does not affect normal API usage. ## Representations All resources expect and return JSON response bodies. Error responses will also send a JSON body. Read [Errors](#section/Errors) for a more detailed description of the error format used by the API. In practice this means that you always get a response with a `Content-Type` header set to `application/json`. In addition, request bodies for `PUT`, `POST`, `REPORT` and `PATCH` requests must be encoded as JSON with a `Content-Type` header set to `application/json`. ### Summary and detailed representations When you fetch a list of resources, the response includes only the most important attributes of each resource. This is a _summary representation_ of the resource. When you fetch an individual resource (for example, a single feature flag), you receive a _detailed representation_ containing all of the attributes of the resource. The best way to find a detailed representation is to follow links. Every summary representation includes a link to its detailed representation. ### Links and addressability The best way to navigate the API is by following links. These are attributes in representations that link to other resources. The API always uses the same format for links: - Links to other resources within the API are encapsulated in a `_links` object. - If the resource has a corresponding link to HTML content on the site, it is stored in a special `_site` link. Each link has two attributes: an href (the URL) and a type (the content type). For example, a feature resource might return the following: ```json { \"_links\": { \"parent\": { \"href\": \"/api/features\", \"type\": \"application/json\" }, \"self\": { \"href\": \"/api/features/sort.order\", \"type\": \"application/json\" } }, \"_site\": { \"href\": \"/features/sort.order\", \"type\": \"text/html\" } } ``` From this, you can navigate to the parent collection of features by following the `parent` link, or navigate to the site page for the feature by following the `_site` link. Collections are always represented as a JSON object with an `items` attribute containing an array of representations. Like all other representations, collections have `_links` defined at the top level. Paginated collections include `first`, `last`, `next`, and `prev` links containing a URL with the respective set of elements in the collection. ## Updates Resources that accept partial updates use the `PATCH` verb, and support the [JSON Patch](https://datatracker.ietf.org/doc/html/rfc6902) format. Some resources also support the [JSON Merge Patch](https://datatracker.ietf.org/doc/html/rfc7386) format. In addition, some resources support optional comments that can be submitted with updates. Comments appear in outgoing webhooks, the audit log, and other integrations. ### Updates via JSON Patch [JSON Patch](https://datatracker.ietf.org/doc/html/rfc6902) is a way to specify the modifications to perform on a resource. For example, in this feature flag representation: ```json { \"name\": \"New recommendations engine\", \"key\": \"engine.enable\", \"description\": \"This is the description\", ... } ``` You can change the feature flag's description with the following patch document: ```json [{ \"op\": \"replace\", \"path\": \"/description\", \"value\": \"This is the new description\" }] ``` JSON Patch documents are always arrays. You can specify multiple modifications to perform in a single request. You can also test that certain preconditions are met before applying the patch: ```json [ { \"op\": \"test\", \"path\": \"/version\", \"value\": 10 }, { \"op\": \"replace\", \"path\": \"/description\", \"value\": \"The new description\" } ] ``` The above patch request tests whether the feature flag's `version` is `10`, and if so, changes the feature flag's description. Attributes that aren't editable, like a resource's `_links`, have names that start with an underscore. ### Updates via JSON Merge Patch The API also supports the [JSON Merge Patch](https://datatracker.ietf.org/doc/html/rfc7386) format, as well as the [Update feature flag](/tag/Feature-flags#operation/patchFeatureFlag) resource. JSON Merge Patch is less expressive than JSON Patch but in many cases, it is simpler to construct a merge patch document. For example, you can change a feature flag's description with the following merge patch document: ```json { \"description\": \"New flag description\" } ``` ### Updates with comments You can submit optional comments with `PATCH` changes. The [Update feature flag](/tag/Feature-flags#operation/patchFeatureFlag) resource supports comments. To submit a comment along with a JSON Patch document, use the following format: ```json { \"comment\": \"This is a comment string\", \"patch\": [{ \"op\": \"replace\", \"path\": \"/description\", \"value\": \"The new description\" }] } ``` To submit a comment along with a JSON Merge Patch document, use the following format: ```json { \"comment\": \"This is a comment string\", \"merge\": { \"description\": \"New flag description\" } } ``` ### Updates via semantic patches The API also supports the Semantic patch format. A semantic `PATCH` is a way to specify the modifications to perform on a resource as a set of executable instructions. JSON Patch uses paths and a limited set of operations to describe how to transform the current state of the resource into a new state. Semantic patch allows you to be explicit about intent using precise, custom instructions. In many cases, semantic patch instructions can also be defined independently of the current state of the resource. This can be useful when defining a change that may be applied at a future date. For example, in this feature flag configuration in environment Production: ```json { \"name\": \"Alternate sort order\", \"kind\": \"boolean\", \"key\": \"sort.order\", ... \"environments\": { \"production\": { \"on\": true, \"archived\": false, \"salt\": \"c29ydC5vcmRlcg==\", \"sel\": \"8de1085cb7354b0ab41c0e778376dfd3\", \"lastModified\": 1469131558260, \"version\": 81, \"targets\": [ { \"values\": [ \"Gerhard.Little@yahoo.com\" ], \"variation\": 0 }, { \"values\": [ \"1461797806429-33-861961230\", \"438580d8-02ee-418d-9eec-0085cab2bdf0\" ], \"variation\": 1 } ], \"rules\": [], \"fallthrough\": { \"variation\": 0 }, \"offVariation\": 1, \"prerequisites\": [], \"_site\": { \"href\": \"/default/production/features/sort.order\", \"type\": \"text/html\" } } } } ``` You can add a date you want a user to be removed from the feature flag's user targets. For example, “remove user 1461797806429-33-861961230 from the user target for variation 0 on the Alternate sort order flag in the production environment on Wed Jul 08 2020 at 15:27:41 pm”. This is done using the following: ```json { \"comment\": \"update expiring user targets\", \"instructions\": [ { \"kind\": \"removeExpireUserTargetDate\", \"userKey\": \"userKey\", \"variationId\": \"978d53f9-7fe3-4a63-992d-97bcb4535dc8\" }, { \"kind\": \"updateExpireUserTargetDate\", \"userKey\": \"userKey2\", \"variationId\": \"978d53f9-7fe3-4a63-992d-97bcb4535dc8\", \"value\": 1587582000000 }, { \"kind\": \"addExpireUserTargetDate\", \"userKey\": \"userKey3\", \"variationId\": \"978d53f9-7fe3-4a63-992d-97bcb4535dc8\", \"value\": 1594247266386 } ] } ``` Here is another example. In this feature flag configuration: ```json { \"name\": \"New recommendations engine\", \"key\": \"engine.enable\", \"environments\": { \"test\": { \"on\": true } } } ``` You can change the feature flag's description with the following patch document as a set of executable instructions. For example, “add user X to targets for variation Y and remove user A from targets for variation B for test flag”: ```json { \"comment\": \"\", \"instructions\": [ { \"kind\": \"removeUserTargets\", \"values\": [\"438580d8-02ee-418d-9eec-0085cab2bdf0\"], \"variationId\": \"852cb784-54ff-46b9-8c35-5498d2e4f270\" }, { \"kind\": \"addUserTargets\", \"values\": [\"438580d8-02ee-418d-9eec-0085cab2bdf0\"], \"variationId\": \"1bb18465-33b6-49aa-a3bd-eeb6650b33ad\" } ] } ``` > ### Supported semantic patch API endpoints > > - [Update feature flag](/tag/Feature-flags#operation/patchFeatureFlag) > - [Update expiring user targets on feature flag](/tag/Feature-flags#operation/patchExpiringUserTargets) > - [Update expiring user target for flags](/tag/User-settings#operation/patchExpiringFlagsForUser) > - [Update expiring user targets on segment](/tag/Segments#operation/patchExpiringUserTargetsForSegment) ## Errors The API always returns errors in a common format. Here's an example: ```json { \"code\": \"invalid_request\", \"message\": \"A feature with that key already exists\", \"id\": \"30ce6058-87da-11e4-b116-123b93f75cba\" } ``` The general class of error is indicated by the `code`. The `message` is a human-readable explanation of what went wrong. The `id` is a unique identifier. Use it when you're working with LaunchDarkly support to debug a problem with a specific API call. ### HTTP Status - Error Response Codes | Code | Definition | Desc. | Possible Solution | | ---- | ----------------- | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | | 400 | Bad Request | A request that fails may return this HTTP response code. | Ensure JSON syntax in request body is correct. | | 401 | Unauthorized | User doesn't have permission to an API call. | Ensure your SDK key is good. | | 403 | Forbidden | User does not have permission for operation. | Ensure that the user or access token has proper permissions set. | | 409 | Conflict | The API request could not be completed because it conflicted with a concurrent API request. | Retry your request. | | 429 | Too many requests | See [Rate limiting](/#section/Rate-limiting). | Wait and try again later. | ## CORS The LaunchDarkly API supports Cross Origin Resource Sharing (CORS) for AJAX requests from any origin. If an `Origin` header is given in a request, it will be echoed as an explicitly allowed origin. Otherwise, a wildcard is returned: `Access-Control-Allow-Origin: *`. For more information on CORS, see the [CORS W3C Recommendation](http://www.w3.org/TR/cors). Example CORS headers might look like: ```http Access-Control-Allow-Headers: Accept, Content-Type, Content-Length, Accept-Encoding, Authorization Access-Control-Allow-Methods: OPTIONS, GET, DELETE, PATCH Access-Control-Allow-Origin: * Access-Control-Max-Age: 300 ``` You can make authenticated CORS calls just as you would make same-origin calls, using either [token or session-based authentication](#section/Authentication). If you’re using session auth, you should set the `withCredentials` property for your `xhr` request to `true`. You should never expose your access tokens to untrusted users. ## Rate limiting We use several rate limiting strategies to ensure the availability of our APIs. Rate-limited calls to our APIs will return a `429` status code. Calls to our APIs will include headers indicating the current rate limit status. The specific headers returned depend on the API route being called. The limits differ based on the route, authentication mechanism, and other factors. Routes that are not rate limited may not contain any of the headers described below. > ### Rate limiting and SDKs > > LaunchDarkly SDKs are never rate limited and do not use the API endpoints defined here. LaunchDarkly uses a different set of approaches, including streaming/server-sent events and a global CDN, to ensure availability to the routes used by LaunchDarkly SDKs. > > The client-side ID is safe to embed in untrusted contexts. It's designed for use in client-side JavaScript. ### Global rate limits Authenticated requests are subject to a global limit. This is the maximum number of calls that can be made to the API per ten seconds. All personal access tokens on the account share this limit, so exceeding the limit with one access token will impact other tokens. Calls that are subject to global rate limits will return the headers below: | Header name | Description | | ------------------------------ | -------------------------------------------------------------------------------- | | `X-Ratelimit-Global-Remaining` | The maximum number of requests the account is permitted to make per ten seconds. | | `X-Ratelimit-Reset` | The time at which the current rate limit window resets in epoch milliseconds. | We do not publicly document the specific number of calls that can be made globally. This limit may change, and we encourage clients to program against the specification, relying on the two headers defined above, rather than hardcoding to the current limit. ### Route-level rate limits Some authenticated routes have custom rate limits. These also reset every ten seconds. Any access tokens hitting the same route share this limit, so exceeding the limit with one access token may impact other tokens. Calls that are subject to route-level rate limits will return the headers below: | Header name | Description | | ----------------------------- | ----------------------------------------------------------------------------------------------------- | | `X-Ratelimit-Route-Remaining` | The maximum number of requests to the current route the account is permitted to make per ten seconds. | | `X-Ratelimit-Reset` | The time at which the current rate limit window resets in epoch milliseconds. | A _route_ represents a specific URL pattern and verb. For example, the [Delete environment](/tag/Environments#operation/deleteEnvironment) endpoint is considered a single route, and each call to delete an environment counts against your route-level rate limit for that route. We do not publicly document the specific number of calls that can be made to each endpoint per ten seconds. These limits may change, and we encourage clients to program against the specification, relying on the two headers defined above, rather than hardcoding to the current limits. ### IP-based rate limiting We also employ IP-based rate limiting on some API routes. If you hit an IP-based rate limit, your API response will include a `Retry-After` header indicating how long to wait before re-trying the call. Clients must wait at least `Retry-After` seconds before making additional calls to our API, and should employ jitter and backoff strategies to avoid triggering rate limits again. ## OpenAPI (Swagger) We have a [complete OpenAPI (Swagger) specification](https://app.launchdarkly.com/api/v2/openapi.json) for our API. You can use this specification to generate client libraries to interact with our REST API in your language of choice. This specification is supported by several API-based tools such as Postman and Insomnia. In many cases, you can directly import our specification to ease use in navigating the APIs in the tooling. ## Client libraries We auto-generate multiple client libraries based on our OpenAPI specification. To learn more, visit [GitHub](https://github.com/search?q=topic%3Alaunchdarkly-api+org%3Alaunchdarkly&type=Repositories). ## Method Overriding Some firewalls and HTTP clients restrict the use of verbs other than `GET` and `POST`. In those environments, our API endpoints that use `PUT`, `PATCH`, and `DELETE` verbs will be inaccessible. To avoid this issue, our API supports the `X-HTTP-Method-Override` header, allowing clients to \"tunnel\" `PUT`, `PATCH`, and `DELETE` requests via a `POST` request. For example, if you wish to call one of our `PATCH` resources via a `POST` request, you can include `X-HTTP-Method-Override:PATCH` as a header. ## Beta resources We sometimes release new API resources in **beta** status before we release them with general availability. Resources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible. We try to promote resources into general availability as quickly as possible. This happens after sufficient testing and when we're satisfied that we no longer need to make backwards-incompatible changes. We mark beta resources with a \"Beta\" callout in our documentation, pictured below: > ### This feature is in beta > > To use this feature, pass in a header including the `LD-API-Version` key with value set to `beta`. Use this header with each call. To learn more, read [Beta resources](/#section/Beta-resources). ### Using beta resources To use a beta resource, you must include a header in the request. If you call a beta resource without this header, you'll receive a `403` response. Use this header: ``` LD-API-Version: beta ``` ## Versioning We try hard to keep our REST API backwards compatible, but we occasionally have to make backwards-incompatible changes in the process of shipping new features. These breaking changes can cause unexpected behavior if you don't prepare for them accordingly. Updates to our REST API include support for the latest features in LaunchDarkly. We also release a new version of our REST API every time we make a breaking change. We provide simultaneous support for multiple API versions so you can migrate from your current API version to a new version at your own pace. ### Setting the API version per request You can set the API version on a specific request by sending an `LD-API-Version` header, as shown in the example below: ``` LD-API-Version: 20210729 ``` The header value is the version number of the API version you'd like to request. The number for each version corresponds to the date the version was released in yyyymmdd format. In the example above the version `20210729` corresponds to July 29, 2021. ### Setting the API version per access token When creating an access token, you must specify a specific version of the API to use. This ensures that integrations using this token cannot be broken by version changes. Tokens created before versioning was released have their version set to `20160426` (the version of the API that existed before versioning) so that they continue working the same way they did before versioning. If you would like to upgrade your integration to use a new API version, you can explicitly set the header described above. > ### Best practice: Set the header for every client or integration > > We recommend that you set the API version header explicitly in any client or integration you build. > > Only rely on the access token API version during manual testing. ### API version changelog | Version | Changes | |---|---| | `20210729` | <ul><li>Changed the [create approval request](/tag/Approvals#operation/postApprovalRequest) return value. It now returns HTTP Status Code `201` instead of `200`.</li><li> Changed the [get users](/tag/Users#operation/getUser) return value. It now returns a user record, not a user. </li><li> Added additional optional fields to environment, segments, flags, members, and segments, including the ability to create Big Segments. </li><li> Added default values for flag variations when new environments are created. </li><li> Added filtering and pagination for getting flags and members, including `limit`, `number`, `filter`, and `sort` query parameters. </li><li> Added endpoints for expiring user targets for flags and segments, scheduled changes, access tokens, Relay Proxy configuration, integrations and subscriptions, and approvals. </li></ul> | | `20191212` | <ul><li>[List feature flags](/tag/Feature-flags#operation/getFeatureFlags) now defaults to sending summaries of feature flag configurations, equivalent to setting the query parameter `summary=true`. Summaries omit flag targeting rules and individual user targets from the payload. </li><li> Added endpoints for flags, flag status, projects, environments, users, audit logs, members, users, custom roles, segments, usage, streams, events, and data export. </li></ul> | | `20160426` | <ul><li>Initial versioning of API. Tokens created before versioning have their version set to this.</li></ul> |
4
+ ## Overview ## Authentication All REST API resources are authenticated with either [personal or service access tokens](https://docs.launchdarkly.com/home/account-security/api-access-tokens), or session cookies. Other authentication mechanisms are not supported. You can manage personal access tokens on your [Account settings](https://app.launchdarkly.com/settings/tokens) page. LaunchDarkly also has SDK keys, mobile keys, and client-side IDs that are used by our server-side SDKs, mobile SDKs, and client-side SDKs, respectively. **These keys cannot be used to access our REST API**. These keys are environment-specific, and can only perform read-only operations (fetching feature flag settings). | Auth mechanism | Allowed resources | Use cases | | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -------------------------------------------------- | | [Personal access tokens](https://docs.launchdarkly.com/home/account-security/api-access-tokens) | Can be customized on a per-token basis | Building scripts, custom integrations, data export | | SDK keys | Can only access read-only SDK-specific resources and the firehose, restricted to a single environment | Server-side SDKs, Firehose API | | Mobile keys | Can only access read-only mobile SDK-specific resources, restricted to a single environment | Mobile SDKs | | Client-side ID | Single environment, only flags marked available to client-side | Client-side JavaScript | > #### Keep your access tokens and SDK keys private > > Access tokens should _never_ be exposed in untrusted contexts. Never put an access token in client-side JavaScript, or embed it in a mobile application. LaunchDarkly has special mobile keys that you can embed in mobile apps. If you accidentally expose an access token or SDK key, you can reset it from your [Account Settings](https://app.launchdarkly.com/settings#/tokens) page. > > The client-side ID is safe to embed in untrusted contexts. It's designed for use in client-side JavaScript. ### Via request header The preferred way to authenticate with the API is by adding an `Authorization` header containing your access token to your requests. The value of the `Authorization` header must be your access token. Manage personal access tokens from the [Account Settings](https://app.launchdarkly.com/settings/tokens) page. ### Via session cookie For testing purposes, you can make API calls directly from your web browser. If you're logged in to the application, the API will use your existing session to authenticate calls. If you have a [role](https://docs.launchdarkly.com/home/team/built-in-roles) other than Admin, or have a [custom role](https://docs.launchdarkly.com/home/team/custom-roles) defined, you may not have permission to perform some API calls. You will receive a `401` response code in that case. > ### Modifying the Origin header causes an error > > LaunchDarkly validates that the Origin header for any API request authenticated by a session cookie matches the expected Origin header. The expected Origin header is `https://app.launchdarkly.com`. > > If the Origin header does not match what's expected, LaunchDarkly returns an error. This error can prevent the LaunchDarkly app from working correctly. > > Any browser extension that intentionally changes the Origin header can cause this problem. For example, the `Allow-Control-Allow-Origin: *` Chrome extension changes the Origin header to `http://evil.com` and causes the app to fail. > > To prevent this error, do not modify your Origin header. > > LaunchDarkly does not require origin matching when authenticating with an access token, so this issue does not affect normal API usage. ## Representations All resources expect and return JSON response bodies. Error responses will also send a JSON body. Read [Errors](#section/Errors) for a more detailed description of the error format used by the API. In practice this means that you always get a response with a `Content-Type` header set to `application/json`. In addition, request bodies for `PUT`, `POST`, `REPORT` and `PATCH` requests must be encoded as JSON with a `Content-Type` header set to `application/json`. ### Summary and detailed representations When you fetch a list of resources, the response includes only the most important attributes of each resource. This is a _summary representation_ of the resource. When you fetch an individual resource, such as a single feature flag, you receive a _detailed representation_ of the resource. The best way to find a detailed representation is to follow links. Every summary representation includes a link to its detailed representation. In most cases, the detailed representation contains all of the attributes of the resource. In a few cases, the detailed representation contains many, but not all, of the attributes of the resource. Typically this happens when an attribute of the requested resource is itself paginated. You can request that the response include a particular attribute by using the `expand` request parameter. ### Links and addressability The best way to navigate the API is by following links. These are attributes in representations that link to other resources. The API always uses the same format for links: - Links to other resources within the API are encapsulated in a `_links` object. - If the resource has a corresponding link to HTML content on the site, it is stored in a special `_site` link. Each link has two attributes: an href (the URL) and a type (the content type). For example, a feature resource might return the following: ```json { \"_links\": { \"parent\": { \"href\": \"/api/features\", \"type\": \"application/json\" }, \"self\": { \"href\": \"/api/features/sort.order\", \"type\": \"application/json\" } }, \"_site\": { \"href\": \"/features/sort.order\", \"type\": \"text/html\" } } ``` From this, you can navigate to the parent collection of features by following the `parent` link, or navigate to the site page for the feature by following the `_site` link. Collections are always represented as a JSON object with an `items` attribute containing an array of representations. Like all other representations, collections have `_links` defined at the top level. Paginated collections include `first`, `last`, `next`, and `prev` links containing a URL with the respective set of elements in the collection. ### Expanding responses Sometimes the detailed representation of a resource does not include all of the attributes of the resource by default. If this is the case, the request method will clearly document this and describe which attributes you can include in an expanded response. To include the additional attributes, append the `expand` request parameter to your request and add a comma-separated list of the attributes to include. For example, when you append `?expand=members,roles` to the [Get team](/tag/Teams-(beta)#operation/getTeam) endpoint, the expanded response includes both of these attributes. ## Updates Resources that accept partial updates use the `PATCH` verb. Most resources support the [JSON Patch](https://datatracker.ietf.org/doc/html/rfc6902) format. Some resources also support the [JSON Merge Patch](https://datatracker.ietf.org/doc/html/rfc7386) format, and some resources support the [semantic patch](/reference#updates-using-semantic-patch) format, which is a way to specify the modifications to perform as a set of executable instructions. Each resource supports optional [comments](/reference#updates-with-comments) that you can submit with updates. Comments appear in outgoing webhooks, the audit log, and other integrations. ### Updates using JSON patch [JSON Patch](https://datatracker.ietf.org/doc/html/rfc6902) is a way to specify the modifications to perform on a resource. JSON patch uses paths and a limited set of operations to describe how to transform the current state of the resource into a new state. JSON patch documents are always arrays, where each element contains an operation, a path to the field to update, and the new value. For example, in this feature flag representation: ```json { \"name\": \"New recommendations engine\", \"key\": \"engine.enable\", \"description\": \"This is the description\", ... } ``` You can change the feature flag's description with the following patch document: ```json [{ \"op\": \"replace\", \"path\": \"/description\", \"value\": \"This is the new description\" }] ``` You can specify multiple modifications to perform in a single request. You can also test that certain preconditions are met before applying the patch: ```json [ { \"op\": \"test\", \"path\": \"/version\", \"value\": 10 }, { \"op\": \"replace\", \"path\": \"/description\", \"value\": \"The new description\" } ] ``` The above patch request tests whether the feature flag's `version` is `10`, and if so, changes the feature flag's description. Attributes that aren't editable, like a resource's `_links`, have names that start with an underscore. ### Updates using JSON merge patch [JSON merge patch](https://datatracker.ietf.org/doc/html/rfc7386) is another format for specifying the modifications to perform on a resource. JSON merge patch is less expressive than JSON patch but in many cases, it is simpler to construct a merge patch document. For example, you can change a feature flag's description with the following merge patch document: ```json { \"description\": \"New flag description\" } ``` ### Updates using semantic patch The API also supports the semantic patch format. A semantic `PATCH` is a way to specify the modifications to perform on a resource as a set of executable instructions. Semantic patch allows you to be explicit about intent using precise, custom instructions. In many cases, you can define semantic patch instructions independently of the current state of the resource. This can be useful when defining a change that may be applied at a future date. To make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. Here's how: ``` Content-Type: application/json; domain-model=launchdarkly.semanticpatch ``` If you call a semantic patch resource without this header, you will receive a `400` response because your semantic patch will be interpreted as a JSON patch. The body of a semantic patch request takes the following properties: * `comment` (string): (Optional) A description of the update. * `environmentKey` (string): (Required for some resources only) The environment key. * `instructions` (array): (Required) A list of actions the update should perform. Each action in the list must be an object with a `kind` property that indicates the instruction. If the action requires parameters, you must include those parameters as additional fields in the object. The documentation for each resource that supports semantic patch includes the available instructions and any additional parameters. For example: ```json { \"comment\": \"optional comment\", \"instructions\": [ {\"kind\": \"turnFlagOn\"} ] } ``` If any instruction in the patch encounters an error, the endpoint returns an error and will not change the resource. In general, each instruction silently does nothing if the resource is already in the state you request. > ### Supported semantic patch API endpoints > > - [Patch experiment](/tag/Experiments-(beta)#operation/patchExperiment) > - [Patch segment](/tag/Segments#operation/patchSegment) > - [Update feature flag](/tag/Feature-flags#operation/patchFeatureFlag) > - [Update flag trigger](/tag/Flag-triggers#operation/patchTriggerWorkflow) > - [Update expiring user targets on feature flag](/tag/Feature-flags#operation/patchExpiringUserTargets) > - [Update expiring user target for flags](/tag/User-settings#operation/patchExpiringFlagsForUser) > - [Update expiring user targets for segment](/tag/Segments#operation/patchExpiringUserTargetsForSegment) > - [Update scheduled changes workflow](/tag/Scheduled-changes#operation/patchFlagConfigScheduledChange) > - [Update team](/tag/Teams-(beta)#operation/patchTeam) ### Updates with comments You can submit optional comments with `PATCH` changes. To submit a comment along with a JSON Patch document, use the following format: ```json { \"comment\": \"This is a comment string\", \"patch\": [{ \"op\": \"replace\", \"path\": \"/description\", \"value\": \"The new description\" }] } ``` To submit a comment along with a JSON merge patch document, use the following format: ```json { \"comment\": \"This is a comment string\", \"merge\": { \"description\": \"New flag description\" } } ``` To submit a comment along with a semantic patch, use the following format: ```json { \"comment\": \"This is a comment string\", \"instructions\": [ {\"kind\": \"turnFlagOn\"} ] } ``` ## Errors The API always returns errors in a common format. Here's an example: ```json { \"code\": \"invalid_request\", \"message\": \"A feature with that key already exists\", \"id\": \"30ce6058-87da-11e4-b116-123b93f75cba\" } ``` The general class of error is indicated by the `code`. The `message` is a human-readable explanation of what went wrong. The `id` is a unique identifier. Use it when you're working with LaunchDarkly support to debug a problem with a specific API call. ### HTTP Status - Error Response Codes | Code | Definition | Description | Possible Solution | | ---- | ----------------- | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | | 400 | Invalid request | The request cannot be understood. | Ensure JSON syntax in request body is correct. | | 401 | Invalid access token | User is unauthorized or does not have permission for this API call. | Ensure your API access token is valid and has the appropriate permissions. | | 403 | Forbidden | User does not have access to this resource. | Ensure that the user or access token has proper permissions set. | | 404 | Invalid resource identifier | The requested resource is not valid. | Ensure that the resource is correctly identified by id or key. | | 405 | Method not allowed | The request method is not allowed on this resource. | Ensure that the HTTP verb is correct. | | 409 | Conflict | The API request can not be completed because it conflicted with a concurrent API request. | Retry your request. | | 422 | Unprocessable entity | The API request can not be completed because the update description can not be understood. | Ensure that the request body is correct for the type of patch you are using (JSON patch or semantic patch). | 429 | Too many requests | Read [Rate limiting](/#section/Rate-limiting). | Wait and try again later. | ## CORS The LaunchDarkly API supports Cross Origin Resource Sharing (CORS) for AJAX requests from any origin. If an `Origin` header is given in a request, it will be echoed as an explicitly allowed origin. Otherwise, a wildcard is returned: `Access-Control-Allow-Origin: *`. For more information on CORS, see the [CORS W3C Recommendation](http://www.w3.org/TR/cors). Example CORS headers might look like: ```http Access-Control-Allow-Headers: Accept, Content-Type, Content-Length, Accept-Encoding, Authorization Access-Control-Allow-Methods: OPTIONS, GET, DELETE, PATCH Access-Control-Allow-Origin: * Access-Control-Max-Age: 300 ``` You can make authenticated CORS calls just as you would make same-origin calls, using either [token or session-based authentication](#section/Authentication). If you’re using session auth, you should set the `withCredentials` property for your `xhr` request to `true`. You should never expose your access tokens to untrusted users. ## Rate limiting We use several rate limiting strategies to ensure the availability of our APIs. Rate-limited calls to our APIs will return a `429` status code. Calls to our APIs will include headers indicating the current rate limit status. The specific headers returned depend on the API route being called. The limits differ based on the route, authentication mechanism, and other factors. Routes that are not rate limited may not contain any of the headers described below. > ### Rate limiting and SDKs > > LaunchDarkly SDKs are never rate limited and do not use the API endpoints defined here. LaunchDarkly uses a different set of approaches, including streaming/server-sent events and a global CDN, to ensure availability to the routes used by LaunchDarkly SDKs. ### Global rate limits Authenticated requests are subject to a global limit. This is the maximum number of calls that can be made to the API per ten seconds. All personal access tokens on the account share this limit, so exceeding the limit with one access token will impact other tokens. Calls that are subject to global rate limits will return the headers below: | Header name | Description | | ------------------------------ | -------------------------------------------------------------------------------- | | `X-Ratelimit-Global-Remaining` | The maximum number of requests the account is permitted to make per ten seconds. | | `X-Ratelimit-Reset` | The time at which the current rate limit window resets in epoch milliseconds. | We do not publicly document the specific number of calls that can be made globally. This limit may change, and we encourage clients to program against the specification, relying on the two headers defined above, rather than hardcoding to the current limit. ### Route-level rate limits Some authenticated routes have custom rate limits. These also reset every ten seconds. Any access tokens hitting the same route share this limit, so exceeding the limit with one access token may impact other tokens. Calls that are subject to route-level rate limits will return the headers below: | Header name | Description | | ----------------------------- | ----------------------------------------------------------------------------------------------------- | | `X-Ratelimit-Route-Remaining` | The maximum number of requests to the current route the account is permitted to make per ten seconds. | | `X-Ratelimit-Reset` | The time at which the current rate limit window resets in epoch milliseconds. | A _route_ represents a specific URL pattern and verb. For example, the [Delete environment](/tag/Environments#operation/deleteEnvironment) endpoint is considered a single route, and each call to delete an environment counts against your route-level rate limit for that route. We do not publicly document the specific number of calls that can be made to each endpoint per ten seconds. These limits may change, and we encourage clients to program against the specification, relying on the two headers defined above, rather than hardcoding to the current limits. ### IP-based rate limiting We also employ IP-based rate limiting on some API routes. If you hit an IP-based rate limit, your API response will include a `Retry-After` header indicating how long to wait before re-trying the call. Clients must wait at least `Retry-After` seconds before making additional calls to our API, and should employ jitter and backoff strategies to avoid triggering rate limits again. ## OpenAPI (Swagger) We have a [complete OpenAPI (Swagger) specification](https://app.launchdarkly.com/api/v2/openapi.json) for our API. You can use this specification to generate client libraries to interact with our REST API in your language of choice. This specification is supported by several API-based tools such as Postman and Insomnia. In many cases, you can directly import our specification to ease use in navigating the APIs in the tooling. ## Client libraries We auto-generate multiple client libraries based on our OpenAPI specification. To learn more, visit [GitHub](https://github.com/search?q=topic%3Alaunchdarkly-api+org%3Alaunchdarkly&type=Repositories). ## Method Overriding Some firewalls and HTTP clients restrict the use of verbs other than `GET` and `POST`. In those environments, our API endpoints that use `PUT`, `PATCH`, and `DELETE` verbs will be inaccessible. To avoid this issue, our API supports the `X-HTTP-Method-Override` header, allowing clients to \"tunnel\" `PUT`, `PATCH`, and `DELETE` requests via a `POST` request. For example, if you wish to call one of our `PATCH` resources via a `POST` request, you can include `X-HTTP-Method-Override:PATCH` as a header. ## Beta resources We sometimes release new API resources in **beta** status before we release them with general availability. Resources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible. We try to promote resources into general availability as quickly as possible. This happens after sufficient testing and when we're satisfied that we no longer need to make backwards-incompatible changes. We mark beta resources with a \"Beta\" callout in our documentation, pictured below: > ### This feature is in beta > > To use this feature, pass in a header including the `LD-API-Version` key with value set to `beta`. Use this header with each call. To learn more, read [Beta resources](/#section/Overview/Beta-resources). ### Using beta resources To use a beta resource, you must include a header in the request. If you call a beta resource without this header, you'll receive a `403` response. Use this header: ``` LD-API-Version: beta ``` ## Versioning We try hard to keep our REST API backwards compatible, but we occasionally have to make backwards-incompatible changes in the process of shipping new features. These breaking changes can cause unexpected behavior if you don't prepare for them accordingly. Updates to our REST API include support for the latest features in LaunchDarkly. We also release a new version of our REST API every time we make a breaking change. We provide simultaneous support for multiple API versions so you can migrate from your current API version to a new version at your own pace. ### Setting the API version per request You can set the API version on a specific request by sending an `LD-API-Version` header, as shown in the example below: ``` LD-API-Version: 20220603 ``` The header value is the version number of the API version you'd like to request. The number for each version corresponds to the date the version was released in yyyymmdd format. In the example above the version `20220603` corresponds to June 03, 2022. ### Setting the API version per access token When creating an access token, you must specify a specific version of the API to use. This ensures that integrations using this token cannot be broken by version changes. Tokens created before versioning was released have their version set to `20160426` (the version of the API that existed before versioning) so that they continue working the same way they did before versioning. If you would like to upgrade your integration to use a new API version, you can explicitly set the header described above. > ### Best practice: Set the header for every client or integration > > We recommend that you set the API version header explicitly in any client or integration you build. > > Only rely on the access token API version during manual testing. ### API version changelog |<div style=\"width:75px\">Version</div> | Changes | |---|---| | `20220603` | <ul><li>Changed the [list projects](tag/Projects#operation/getProjects) return value:<ul><li>Response is now paginated with a default limit of `20`.</li><li>Added support for filter and sort.</li><li>The project `environments` field is now expandable. This field is omitted by default.</li></ul></li><li>Changed the [get project](tag/Projects#operation/getProject) return value:<ul><li>The `environments` field is now expandable. This field is omitted by default.</li></ul></li></ul> | | `20210729` | <ul><li>Changed the [create approval request](/tag/Approvals#operation/postApprovalRequest) return value. It now returns HTTP Status Code `201` instead of `200`.</li><li> Changed the [get users](/tag/Users#operation/getUser) return value. It now returns a user record, not a user. </li><li> Added additional optional fields to environment, segments, flags, members, and segments, including the ability to create Big Segments. </li><li> Added default values for flag variations when new environments are created. </li><li> Added filtering and pagination for getting flags and members, including `limit`, `number`, `filter`, and `sort` query parameters. </li><li> Added endpoints for expiring user targets for flags and segments, scheduled changes, access tokens, Relay Proxy configuration, integrations and subscriptions, and approvals. </li></ul> | | `20191212` | <ul><li>[List feature flags](/tag/Feature-flags#operation/getFeatureFlags) now defaults to sending summaries of feature flag configurations, equivalent to setting the query parameter `summary=true`. Summaries omit flag targeting rules and individual user targets from the payload. </li><li> Added endpoints for flags, flag status, projects, environments, users, audit logs, members, users, custom roles, segments, usage, streams, events, and data export. </li></ul> | | `20160426` | <ul><li>Initial versioning of API. Tokens created before versioning have their version set to this.</li></ul> |
5
5
 
6
6
  The version of the OpenAPI document: 2.0
7
7
  Contact: support@launchdarkly.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.3.0
9
+ OpenAPI Generator version: 6.0.0
10
10
 
11
11
  =end
12
12
 
@@ -32,9 +32,84 @@ describe 'ExperimentsBetaApi' do
32
32
  end
33
33
  end
34
34
 
35
+ # unit tests for create_experiment
36
+ # Create experiment
37
+ # Create an experiment. To learn more, read [Creating experiments](https://docs.launchdarkly.com/home/creating-experiments).
38
+ # @param project_key The project key
39
+ # @param environment_key The environment key
40
+ # @param experiment_post
41
+ # @param [Hash] opts the optional parameters
42
+ # @return [Experiment]
43
+ describe 'create_experiment test' do
44
+ it 'should work' do
45
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
46
+ end
47
+ end
48
+
49
+ # unit tests for create_iteration
50
+ # Create iteration
51
+ # Create an experiment iteration. Experiment iterations let you record experiments in discrete blocks of time. To learn more, read [Starting experiment iterations](https://docs.launchdarkly.com/home/creating-experiments#starting-experiment-iterations).
52
+ # @param project_key The project key
53
+ # @param environment_key The environment key
54
+ # @param experiment_key The experiment key
55
+ # @param iteration_input
56
+ # @param [Hash] opts the optional parameters
57
+ # @return [IterationRep]
58
+ describe 'create_iteration test' do
59
+ it 'should work' do
60
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
61
+ end
62
+ end
63
+
35
64
  # unit tests for get_experiment
65
+ # Get experiment
66
+ # Get details about an experiment.
67
+ # @param project_key The project key
68
+ # @param environment_key The environment key
69
+ # @param experiment_key The experiment key
70
+ # @param [Hash] opts the optional parameters
71
+ # @return [Experiment]
72
+ describe 'get_experiment test' do
73
+ it 'should work' do
74
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
75
+ end
76
+ end
77
+
78
+ # unit tests for get_experiment_results
36
79
  # Get experiment results
37
- # Get detailed experiment result data
80
+ # Get results from an experiment for a particular metric.
81
+ # @param project_key The project key
82
+ # @param environment_key The environment key
83
+ # @param experiment_key The experiment key
84
+ # @param metric_key The metric key
85
+ # @param [Hash] opts the optional parameters
86
+ # @return [ExperimentBayesianResultsRep]
87
+ describe 'get_experiment_results test' do
88
+ it 'should work' do
89
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
90
+ end
91
+ end
92
+
93
+ # unit tests for get_experiments
94
+ # Get experiments
95
+ # Get details about all experiments in an environment. ### Filtering experiments LaunchDarkly supports the &#x60;filter&#x60; query param for filtering, with the following fields: - &#x60;flagKey&#x60; filters for only experiments that use the flag with the given key. - &#x60;metricKey&#x60; filters for only experiments that use the metric with the given key. - &#x60;status&#x60; filters for only experiments with an iteration with the given status. An iteration can have the status &#x60;not_started&#x60;, &#x60;running&#x60; or &#x60;stopped&#x60;. For example, &#x60;filter&#x3D;flagKey:my-flag,status:running,metricKey:page-load-ms&#x60; filters for experiments for the given flag key and the given metric key which have a currently running iteration. ### Expanding the experiments response LaunchDarkly supports four fields for expanding the \&quot;List experiments\&quot; response. By default, these fields are **not** included in the response. To expand the response, append the &#x60;expand&#x60; query parameter and add a comma-separated list with any of the following fields: - &#x60;previousIterations&#x60; includes all iterations prior to the current iteration. By default only the current iteration will be included in the response. - &#x60;draftIteration&#x60; includes a draft of an iteration which has not been started yet, if any. - &#x60;secondaryMetrics&#x60; includes secondary metrics. By default only the primary metric is included in the response. - &#x60;treatments&#x60; includes all treatment and parameter details. By default treatment data will not be included in the response. For example, &#x60;expand&#x3D;draftIteration,treatments&#x60; includes the &#x60;draftIteration&#x60; and &#x60;treatments&#x60; fields in the response.
96
+ # @param project_key The project key
97
+ # @param environment_key The environment key
98
+ # @param [Hash] opts the optional parameters
99
+ # @option opts [Integer] :limit The maximum number of experiments to return. Defaults to 20
100
+ # @option opts [Integer] :offset Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query &#x60;limit&#x60;.
101
+ # @option opts [String] :filter A comma-separated list of filters. Each filter is of the form &#x60;field:value&#x60;. Supported fields are explained above.
102
+ # @option opts [String] :expand A comma-separated list of properties that can reveal additional information in the response. Supported fields are explained above.
103
+ # @return [ExperimentCollectionRep]
104
+ describe 'get_experiments test' do
105
+ it 'should work' do
106
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
107
+ end
108
+ end
109
+
110
+ # unit tests for get_legacy_experiment_results
111
+ # Get legacy experiment results (deprecated)
112
+ # Get detailed experiment result data for legacy experiments.
38
113
  # @param project_key The project key
39
114
  # @param feature_flag_key The feature flag key
40
115
  # @param environment_key The environment key
@@ -42,8 +117,23 @@ describe 'ExperimentsBetaApi' do
42
117
  # @param [Hash] opts the optional parameters
43
118
  # @option opts [Integer] :from A timestamp denoting the start of the data collection period, expressed as a Unix epoch time in milliseconds.
44
119
  # @option opts [Integer] :to A timestamp denoting the end of the data collection period, expressed as a Unix epoch time in milliseconds.
45
- # @return [ExperimentResultsRep]
46
- describe 'get_experiment test' do
120
+ # @return [ExperimentResults]
121
+ describe 'get_legacy_experiment_results test' do
122
+ it 'should work' do
123
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
124
+ end
125
+ end
126
+
127
+ # unit tests for patch_experiment
128
+ # Patch experiment
129
+ # Update an experiment. Updating an experiment uses the semantic patch format. To make a semantic patch request, you must append &#x60;domain-model&#x3D;launchdarkly.semanticpatch&#x60; to your &#x60;Content-Type&#x60; header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch). ### Instructions Semantic patch requests support the following &#x60;kind&#x60; instructions for updating experiments. #### updateName Updates the experiment name. ##### Parameters - &#x60;value&#x60;: The new name. #### updateDescription Updates the experiment description. ##### Parameters - &#x60;value&#x60;: The new description. #### startIteration Starts a new iteration for this experiment. #### stopIteration Stops the current iteration for this experiment.
130
+ # @param project_key The project key
131
+ # @param environment_key The environment key
132
+ # @param experiment_key The experiment key
133
+ # @param experiment_patch_input
134
+ # @param [Hash] opts the optional parameters
135
+ # @return [Experiment]
136
+ describe 'patch_experiment test' do
47
137
  it 'should work' do
48
138
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
49
139
  end
@@ -51,7 +141,7 @@ describe 'ExperimentsBetaApi' do
51
141
 
52
142
  # unit tests for reset_experiment
53
143
  # Reset experiment results
54
- # Reset all experiment results by deleting all existing data for an experiment
144
+ # Reset all experiment results by deleting all existing data for an experiment.
55
145
  # @param project_key The project key
56
146
  # @param feature_flag_key The feature flag key
57
147
  # @param environment_key The environment key
@@ -1,12 +1,12 @@
1
1
  =begin
2
2
  #LaunchDarkly REST API
3
3
 
4
- ## Overview ## Authentication All REST API resources are authenticated with either [personal or service access tokens](https://docs.launchdarkly.com/home/account-security/api-access-tokens), or session cookies. Other authentication mechanisms are not supported. You can manage personal access tokens on your [Account settings](https://app.launchdarkly.com/settings/tokens) page. LaunchDarkly also has SDK keys, mobile keys, and client-side IDs that are used by our server-side SDKs, mobile SDKs, and client-side SDKs, respectively. **These keys cannot be used to access our REST API**. These keys are environment-specific, and can only perform read-only operations (fetching feature flag settings). | Auth mechanism | Allowed resources | Use cases | | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -------------------------------------------------- | | [Personal access tokens](https://docs.launchdarkly.com/home/account-security/api-access-tokens) | Can be customized on a per-token basis | Building scripts, custom integrations, data export | | SDK keys | Can only access read-only SDK-specific resources and the firehose, restricted to a single environment | Server-side SDKs, Firehose API | | Mobile keys | Can only access read-only mobile SDK-specific resources, restricted to a single environment | Mobile SDKs | | Client-side ID | Single environment, only flags marked available to client-side | Client-side JavaScript | > #### Keep your access tokens and SDK keys private > > Access tokens should _never_ be exposed in untrusted contexts. Never put an access token in client-side JavaScript, or embed it in a mobile application. LaunchDarkly has special mobile keys that you can embed in mobile apps. If you accidentally expose an access token or SDK key, you can reset it from your [Account Settings](https://app.launchdarkly.com/settings#/tokens) page. > > The client-side ID is safe to embed in untrusted contexts. It's designed for use in client-side JavaScript. ### Via request header The preferred way to authenticate with the API is by adding an `Authorization` header containing your access token to your requests. The value of the `Authorization` header must be your access token. Manage personal access tokens from the [Account Settings](https://app.launchdarkly.com/settings/tokens) page. ### Via session cookie For testing purposes, you can make API calls directly from your web browser. If you're logged in to the application, the API will use your existing session to authenticate calls. If you have a [role](https://docs.launchdarkly.com/home/team/built-in-roles) other than Admin, or have a [custom role](https://docs.launchdarkly.com/home/team/custom-roles) defined, you may not have permission to perform some API calls. You will receive a `401` response code in that case. > ### Modifying the Origin header causes an error > > LaunchDarkly validates that the Origin header for any API request authenticated by a session cookie matches the expected Origin header. The expected Origin header is `https://app.launchdarkly.com`. > > If the Origin header does not match what's expected, LaunchDarkly returns an error. This error can prevent the LaunchDarkly app from working correctly. > > Any browser extension that intentionally changes the Origin header can cause this problem. For example, the `Allow-Control-Allow-Origin: *` Chrome extension changes the Origin header to `http://evil.com` and causes the app to fail. > > To prevent this error, do not modify your Origin header. > > LaunchDarkly does not require origin matching when authenticating with an access token, so this issue does not affect normal API usage. ## Representations All resources expect and return JSON response bodies. Error responses will also send a JSON body. Read [Errors](#section/Errors) for a more detailed description of the error format used by the API. In practice this means that you always get a response with a `Content-Type` header set to `application/json`. In addition, request bodies for `PUT`, `POST`, `REPORT` and `PATCH` requests must be encoded as JSON with a `Content-Type` header set to `application/json`. ### Summary and detailed representations When you fetch a list of resources, the response includes only the most important attributes of each resource. This is a _summary representation_ of the resource. When you fetch an individual resource (for example, a single feature flag), you receive a _detailed representation_ containing all of the attributes of the resource. The best way to find a detailed representation is to follow links. Every summary representation includes a link to its detailed representation. ### Links and addressability The best way to navigate the API is by following links. These are attributes in representations that link to other resources. The API always uses the same format for links: - Links to other resources within the API are encapsulated in a `_links` object. - If the resource has a corresponding link to HTML content on the site, it is stored in a special `_site` link. Each link has two attributes: an href (the URL) and a type (the content type). For example, a feature resource might return the following: ```json { \"_links\": { \"parent\": { \"href\": \"/api/features\", \"type\": \"application/json\" }, \"self\": { \"href\": \"/api/features/sort.order\", \"type\": \"application/json\" } }, \"_site\": { \"href\": \"/features/sort.order\", \"type\": \"text/html\" } } ``` From this, you can navigate to the parent collection of features by following the `parent` link, or navigate to the site page for the feature by following the `_site` link. Collections are always represented as a JSON object with an `items` attribute containing an array of representations. Like all other representations, collections have `_links` defined at the top level. Paginated collections include `first`, `last`, `next`, and `prev` links containing a URL with the respective set of elements in the collection. ## Updates Resources that accept partial updates use the `PATCH` verb, and support the [JSON Patch](https://datatracker.ietf.org/doc/html/rfc6902) format. Some resources also support the [JSON Merge Patch](https://datatracker.ietf.org/doc/html/rfc7386) format. In addition, some resources support optional comments that can be submitted with updates. Comments appear in outgoing webhooks, the audit log, and other integrations. ### Updates via JSON Patch [JSON Patch](https://datatracker.ietf.org/doc/html/rfc6902) is a way to specify the modifications to perform on a resource. For example, in this feature flag representation: ```json { \"name\": \"New recommendations engine\", \"key\": \"engine.enable\", \"description\": \"This is the description\", ... } ``` You can change the feature flag's description with the following patch document: ```json [{ \"op\": \"replace\", \"path\": \"/description\", \"value\": \"This is the new description\" }] ``` JSON Patch documents are always arrays. You can specify multiple modifications to perform in a single request. You can also test that certain preconditions are met before applying the patch: ```json [ { \"op\": \"test\", \"path\": \"/version\", \"value\": 10 }, { \"op\": \"replace\", \"path\": \"/description\", \"value\": \"The new description\" } ] ``` The above patch request tests whether the feature flag's `version` is `10`, and if so, changes the feature flag's description. Attributes that aren't editable, like a resource's `_links`, have names that start with an underscore. ### Updates via JSON Merge Patch The API also supports the [JSON Merge Patch](https://datatracker.ietf.org/doc/html/rfc7386) format, as well as the [Update feature flag](/tag/Feature-flags#operation/patchFeatureFlag) resource. JSON Merge Patch is less expressive than JSON Patch but in many cases, it is simpler to construct a merge patch document. For example, you can change a feature flag's description with the following merge patch document: ```json { \"description\": \"New flag description\" } ``` ### Updates with comments You can submit optional comments with `PATCH` changes. The [Update feature flag](/tag/Feature-flags#operation/patchFeatureFlag) resource supports comments. To submit a comment along with a JSON Patch document, use the following format: ```json { \"comment\": \"This is a comment string\", \"patch\": [{ \"op\": \"replace\", \"path\": \"/description\", \"value\": \"The new description\" }] } ``` To submit a comment along with a JSON Merge Patch document, use the following format: ```json { \"comment\": \"This is a comment string\", \"merge\": { \"description\": \"New flag description\" } } ``` ### Updates via semantic patches The API also supports the Semantic patch format. A semantic `PATCH` is a way to specify the modifications to perform on a resource as a set of executable instructions. JSON Patch uses paths and a limited set of operations to describe how to transform the current state of the resource into a new state. Semantic patch allows you to be explicit about intent using precise, custom instructions. In many cases, semantic patch instructions can also be defined independently of the current state of the resource. This can be useful when defining a change that may be applied at a future date. For example, in this feature flag configuration in environment Production: ```json { \"name\": \"Alternate sort order\", \"kind\": \"boolean\", \"key\": \"sort.order\", ... \"environments\": { \"production\": { \"on\": true, \"archived\": false, \"salt\": \"c29ydC5vcmRlcg==\", \"sel\": \"8de1085cb7354b0ab41c0e778376dfd3\", \"lastModified\": 1469131558260, \"version\": 81, \"targets\": [ { \"values\": [ \"Gerhard.Little@yahoo.com\" ], \"variation\": 0 }, { \"values\": [ \"1461797806429-33-861961230\", \"438580d8-02ee-418d-9eec-0085cab2bdf0\" ], \"variation\": 1 } ], \"rules\": [], \"fallthrough\": { \"variation\": 0 }, \"offVariation\": 1, \"prerequisites\": [], \"_site\": { \"href\": \"/default/production/features/sort.order\", \"type\": \"text/html\" } } } } ``` You can add a date you want a user to be removed from the feature flag's user targets. For example, “remove user 1461797806429-33-861961230 from the user target for variation 0 on the Alternate sort order flag in the production environment on Wed Jul 08 2020 at 15:27:41 pm”. This is done using the following: ```json { \"comment\": \"update expiring user targets\", \"instructions\": [ { \"kind\": \"removeExpireUserTargetDate\", \"userKey\": \"userKey\", \"variationId\": \"978d53f9-7fe3-4a63-992d-97bcb4535dc8\" }, { \"kind\": \"updateExpireUserTargetDate\", \"userKey\": \"userKey2\", \"variationId\": \"978d53f9-7fe3-4a63-992d-97bcb4535dc8\", \"value\": 1587582000000 }, { \"kind\": \"addExpireUserTargetDate\", \"userKey\": \"userKey3\", \"variationId\": \"978d53f9-7fe3-4a63-992d-97bcb4535dc8\", \"value\": 1594247266386 } ] } ``` Here is another example. In this feature flag configuration: ```json { \"name\": \"New recommendations engine\", \"key\": \"engine.enable\", \"environments\": { \"test\": { \"on\": true } } } ``` You can change the feature flag's description with the following patch document as a set of executable instructions. For example, “add user X to targets for variation Y and remove user A from targets for variation B for test flag”: ```json { \"comment\": \"\", \"instructions\": [ { \"kind\": \"removeUserTargets\", \"values\": [\"438580d8-02ee-418d-9eec-0085cab2bdf0\"], \"variationId\": \"852cb784-54ff-46b9-8c35-5498d2e4f270\" }, { \"kind\": \"addUserTargets\", \"values\": [\"438580d8-02ee-418d-9eec-0085cab2bdf0\"], \"variationId\": \"1bb18465-33b6-49aa-a3bd-eeb6650b33ad\" } ] } ``` > ### Supported semantic patch API endpoints > > - [Update feature flag](/tag/Feature-flags#operation/patchFeatureFlag) > - [Update expiring user targets on feature flag](/tag/Feature-flags#operation/patchExpiringUserTargets) > - [Update expiring user target for flags](/tag/User-settings#operation/patchExpiringFlagsForUser) > - [Update expiring user targets on segment](/tag/Segments#operation/patchExpiringUserTargetsForSegment) ## Errors The API always returns errors in a common format. Here's an example: ```json { \"code\": \"invalid_request\", \"message\": \"A feature with that key already exists\", \"id\": \"30ce6058-87da-11e4-b116-123b93f75cba\" } ``` The general class of error is indicated by the `code`. The `message` is a human-readable explanation of what went wrong. The `id` is a unique identifier. Use it when you're working with LaunchDarkly support to debug a problem with a specific API call. ### HTTP Status - Error Response Codes | Code | Definition | Desc. | Possible Solution | | ---- | ----------------- | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | | 400 | Bad Request | A request that fails may return this HTTP response code. | Ensure JSON syntax in request body is correct. | | 401 | Unauthorized | User doesn't have permission to an API call. | Ensure your SDK key is good. | | 403 | Forbidden | User does not have permission for operation. | Ensure that the user or access token has proper permissions set. | | 409 | Conflict | The API request could not be completed because it conflicted with a concurrent API request. | Retry your request. | | 429 | Too many requests | See [Rate limiting](/#section/Rate-limiting). | Wait and try again later. | ## CORS The LaunchDarkly API supports Cross Origin Resource Sharing (CORS) for AJAX requests from any origin. If an `Origin` header is given in a request, it will be echoed as an explicitly allowed origin. Otherwise, a wildcard is returned: `Access-Control-Allow-Origin: *`. For more information on CORS, see the [CORS W3C Recommendation](http://www.w3.org/TR/cors). Example CORS headers might look like: ```http Access-Control-Allow-Headers: Accept, Content-Type, Content-Length, Accept-Encoding, Authorization Access-Control-Allow-Methods: OPTIONS, GET, DELETE, PATCH Access-Control-Allow-Origin: * Access-Control-Max-Age: 300 ``` You can make authenticated CORS calls just as you would make same-origin calls, using either [token or session-based authentication](#section/Authentication). If you’re using session auth, you should set the `withCredentials` property for your `xhr` request to `true`. You should never expose your access tokens to untrusted users. ## Rate limiting We use several rate limiting strategies to ensure the availability of our APIs. Rate-limited calls to our APIs will return a `429` status code. Calls to our APIs will include headers indicating the current rate limit status. The specific headers returned depend on the API route being called. The limits differ based on the route, authentication mechanism, and other factors. Routes that are not rate limited may not contain any of the headers described below. > ### Rate limiting and SDKs > > LaunchDarkly SDKs are never rate limited and do not use the API endpoints defined here. LaunchDarkly uses a different set of approaches, including streaming/server-sent events and a global CDN, to ensure availability to the routes used by LaunchDarkly SDKs. > > The client-side ID is safe to embed in untrusted contexts. It's designed for use in client-side JavaScript. ### Global rate limits Authenticated requests are subject to a global limit. This is the maximum number of calls that can be made to the API per ten seconds. All personal access tokens on the account share this limit, so exceeding the limit with one access token will impact other tokens. Calls that are subject to global rate limits will return the headers below: | Header name | Description | | ------------------------------ | -------------------------------------------------------------------------------- | | `X-Ratelimit-Global-Remaining` | The maximum number of requests the account is permitted to make per ten seconds. | | `X-Ratelimit-Reset` | The time at which the current rate limit window resets in epoch milliseconds. | We do not publicly document the specific number of calls that can be made globally. This limit may change, and we encourage clients to program against the specification, relying on the two headers defined above, rather than hardcoding to the current limit. ### Route-level rate limits Some authenticated routes have custom rate limits. These also reset every ten seconds. Any access tokens hitting the same route share this limit, so exceeding the limit with one access token may impact other tokens. Calls that are subject to route-level rate limits will return the headers below: | Header name | Description | | ----------------------------- | ----------------------------------------------------------------------------------------------------- | | `X-Ratelimit-Route-Remaining` | The maximum number of requests to the current route the account is permitted to make per ten seconds. | | `X-Ratelimit-Reset` | The time at which the current rate limit window resets in epoch milliseconds. | A _route_ represents a specific URL pattern and verb. For example, the [Delete environment](/tag/Environments#operation/deleteEnvironment) endpoint is considered a single route, and each call to delete an environment counts against your route-level rate limit for that route. We do not publicly document the specific number of calls that can be made to each endpoint per ten seconds. These limits may change, and we encourage clients to program against the specification, relying on the two headers defined above, rather than hardcoding to the current limits. ### IP-based rate limiting We also employ IP-based rate limiting on some API routes. If you hit an IP-based rate limit, your API response will include a `Retry-After` header indicating how long to wait before re-trying the call. Clients must wait at least `Retry-After` seconds before making additional calls to our API, and should employ jitter and backoff strategies to avoid triggering rate limits again. ## OpenAPI (Swagger) We have a [complete OpenAPI (Swagger) specification](https://app.launchdarkly.com/api/v2/openapi.json) for our API. You can use this specification to generate client libraries to interact with our REST API in your language of choice. This specification is supported by several API-based tools such as Postman and Insomnia. In many cases, you can directly import our specification to ease use in navigating the APIs in the tooling. ## Client libraries We auto-generate multiple client libraries based on our OpenAPI specification. To learn more, visit [GitHub](https://github.com/search?q=topic%3Alaunchdarkly-api+org%3Alaunchdarkly&type=Repositories). ## Method Overriding Some firewalls and HTTP clients restrict the use of verbs other than `GET` and `POST`. In those environments, our API endpoints that use `PUT`, `PATCH`, and `DELETE` verbs will be inaccessible. To avoid this issue, our API supports the `X-HTTP-Method-Override` header, allowing clients to \"tunnel\" `PUT`, `PATCH`, and `DELETE` requests via a `POST` request. For example, if you wish to call one of our `PATCH` resources via a `POST` request, you can include `X-HTTP-Method-Override:PATCH` as a header. ## Beta resources We sometimes release new API resources in **beta** status before we release them with general availability. Resources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible. We try to promote resources into general availability as quickly as possible. This happens after sufficient testing and when we're satisfied that we no longer need to make backwards-incompatible changes. We mark beta resources with a \"Beta\" callout in our documentation, pictured below: > ### This feature is in beta > > To use this feature, pass in a header including the `LD-API-Version` key with value set to `beta`. Use this header with each call. To learn more, read [Beta resources](/#section/Beta-resources). ### Using beta resources To use a beta resource, you must include a header in the request. If you call a beta resource without this header, you'll receive a `403` response. Use this header: ``` LD-API-Version: beta ``` ## Versioning We try hard to keep our REST API backwards compatible, but we occasionally have to make backwards-incompatible changes in the process of shipping new features. These breaking changes can cause unexpected behavior if you don't prepare for them accordingly. Updates to our REST API include support for the latest features in LaunchDarkly. We also release a new version of our REST API every time we make a breaking change. We provide simultaneous support for multiple API versions so you can migrate from your current API version to a new version at your own pace. ### Setting the API version per request You can set the API version on a specific request by sending an `LD-API-Version` header, as shown in the example below: ``` LD-API-Version: 20210729 ``` The header value is the version number of the API version you'd like to request. The number for each version corresponds to the date the version was released in yyyymmdd format. In the example above the version `20210729` corresponds to July 29, 2021. ### Setting the API version per access token When creating an access token, you must specify a specific version of the API to use. This ensures that integrations using this token cannot be broken by version changes. Tokens created before versioning was released have their version set to `20160426` (the version of the API that existed before versioning) so that they continue working the same way they did before versioning. If you would like to upgrade your integration to use a new API version, you can explicitly set the header described above. > ### Best practice: Set the header for every client or integration > > We recommend that you set the API version header explicitly in any client or integration you build. > > Only rely on the access token API version during manual testing. ### API version changelog | Version | Changes | |---|---| | `20210729` | <ul><li>Changed the [create approval request](/tag/Approvals#operation/postApprovalRequest) return value. It now returns HTTP Status Code `201` instead of `200`.</li><li> Changed the [get users](/tag/Users#operation/getUser) return value. It now returns a user record, not a user. </li><li> Added additional optional fields to environment, segments, flags, members, and segments, including the ability to create Big Segments. </li><li> Added default values for flag variations when new environments are created. </li><li> Added filtering and pagination for getting flags and members, including `limit`, `number`, `filter`, and `sort` query parameters. </li><li> Added endpoints for expiring user targets for flags and segments, scheduled changes, access tokens, Relay Proxy configuration, integrations and subscriptions, and approvals. </li></ul> | | `20191212` | <ul><li>[List feature flags](/tag/Feature-flags#operation/getFeatureFlags) now defaults to sending summaries of feature flag configurations, equivalent to setting the query parameter `summary=true`. Summaries omit flag targeting rules and individual user targets from the payload. </li><li> Added endpoints for flags, flag status, projects, environments, users, audit logs, members, users, custom roles, segments, usage, streams, events, and data export. </li></ul> | | `20160426` | <ul><li>Initial versioning of API. Tokens created before versioning have their version set to this.</li></ul> |
4
+ ## Overview ## Authentication All REST API resources are authenticated with either [personal or service access tokens](https://docs.launchdarkly.com/home/account-security/api-access-tokens), or session cookies. Other authentication mechanisms are not supported. You can manage personal access tokens on your [Account settings](https://app.launchdarkly.com/settings/tokens) page. LaunchDarkly also has SDK keys, mobile keys, and client-side IDs that are used by our server-side SDKs, mobile SDKs, and client-side SDKs, respectively. **These keys cannot be used to access our REST API**. These keys are environment-specific, and can only perform read-only operations (fetching feature flag settings). | Auth mechanism | Allowed resources | Use cases | | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -------------------------------------------------- | | [Personal access tokens](https://docs.launchdarkly.com/home/account-security/api-access-tokens) | Can be customized on a per-token basis | Building scripts, custom integrations, data export | | SDK keys | Can only access read-only SDK-specific resources and the firehose, restricted to a single environment | Server-side SDKs, Firehose API | | Mobile keys | Can only access read-only mobile SDK-specific resources, restricted to a single environment | Mobile SDKs | | Client-side ID | Single environment, only flags marked available to client-side | Client-side JavaScript | > #### Keep your access tokens and SDK keys private > > Access tokens should _never_ be exposed in untrusted contexts. Never put an access token in client-side JavaScript, or embed it in a mobile application. LaunchDarkly has special mobile keys that you can embed in mobile apps. If you accidentally expose an access token or SDK key, you can reset it from your [Account Settings](https://app.launchdarkly.com/settings#/tokens) page. > > The client-side ID is safe to embed in untrusted contexts. It's designed for use in client-side JavaScript. ### Via request header The preferred way to authenticate with the API is by adding an `Authorization` header containing your access token to your requests. The value of the `Authorization` header must be your access token. Manage personal access tokens from the [Account Settings](https://app.launchdarkly.com/settings/tokens) page. ### Via session cookie For testing purposes, you can make API calls directly from your web browser. If you're logged in to the application, the API will use your existing session to authenticate calls. If you have a [role](https://docs.launchdarkly.com/home/team/built-in-roles) other than Admin, or have a [custom role](https://docs.launchdarkly.com/home/team/custom-roles) defined, you may not have permission to perform some API calls. You will receive a `401` response code in that case. > ### Modifying the Origin header causes an error > > LaunchDarkly validates that the Origin header for any API request authenticated by a session cookie matches the expected Origin header. The expected Origin header is `https://app.launchdarkly.com`. > > If the Origin header does not match what's expected, LaunchDarkly returns an error. This error can prevent the LaunchDarkly app from working correctly. > > Any browser extension that intentionally changes the Origin header can cause this problem. For example, the `Allow-Control-Allow-Origin: *` Chrome extension changes the Origin header to `http://evil.com` and causes the app to fail. > > To prevent this error, do not modify your Origin header. > > LaunchDarkly does not require origin matching when authenticating with an access token, so this issue does not affect normal API usage. ## Representations All resources expect and return JSON response bodies. Error responses will also send a JSON body. Read [Errors](#section/Errors) for a more detailed description of the error format used by the API. In practice this means that you always get a response with a `Content-Type` header set to `application/json`. In addition, request bodies for `PUT`, `POST`, `REPORT` and `PATCH` requests must be encoded as JSON with a `Content-Type` header set to `application/json`. ### Summary and detailed representations When you fetch a list of resources, the response includes only the most important attributes of each resource. This is a _summary representation_ of the resource. When you fetch an individual resource, such as a single feature flag, you receive a _detailed representation_ of the resource. The best way to find a detailed representation is to follow links. Every summary representation includes a link to its detailed representation. In most cases, the detailed representation contains all of the attributes of the resource. In a few cases, the detailed representation contains many, but not all, of the attributes of the resource. Typically this happens when an attribute of the requested resource is itself paginated. You can request that the response include a particular attribute by using the `expand` request parameter. ### Links and addressability The best way to navigate the API is by following links. These are attributes in representations that link to other resources. The API always uses the same format for links: - Links to other resources within the API are encapsulated in a `_links` object. - If the resource has a corresponding link to HTML content on the site, it is stored in a special `_site` link. Each link has two attributes: an href (the URL) and a type (the content type). For example, a feature resource might return the following: ```json { \"_links\": { \"parent\": { \"href\": \"/api/features\", \"type\": \"application/json\" }, \"self\": { \"href\": \"/api/features/sort.order\", \"type\": \"application/json\" } }, \"_site\": { \"href\": \"/features/sort.order\", \"type\": \"text/html\" } } ``` From this, you can navigate to the parent collection of features by following the `parent` link, or navigate to the site page for the feature by following the `_site` link. Collections are always represented as a JSON object with an `items` attribute containing an array of representations. Like all other representations, collections have `_links` defined at the top level. Paginated collections include `first`, `last`, `next`, and `prev` links containing a URL with the respective set of elements in the collection. ### Expanding responses Sometimes the detailed representation of a resource does not include all of the attributes of the resource by default. If this is the case, the request method will clearly document this and describe which attributes you can include in an expanded response. To include the additional attributes, append the `expand` request parameter to your request and add a comma-separated list of the attributes to include. For example, when you append `?expand=members,roles` to the [Get team](/tag/Teams-(beta)#operation/getTeam) endpoint, the expanded response includes both of these attributes. ## Updates Resources that accept partial updates use the `PATCH` verb. Most resources support the [JSON Patch](https://datatracker.ietf.org/doc/html/rfc6902) format. Some resources also support the [JSON Merge Patch](https://datatracker.ietf.org/doc/html/rfc7386) format, and some resources support the [semantic patch](/reference#updates-using-semantic-patch) format, which is a way to specify the modifications to perform as a set of executable instructions. Each resource supports optional [comments](/reference#updates-with-comments) that you can submit with updates. Comments appear in outgoing webhooks, the audit log, and other integrations. ### Updates using JSON patch [JSON Patch](https://datatracker.ietf.org/doc/html/rfc6902) is a way to specify the modifications to perform on a resource. JSON patch uses paths and a limited set of operations to describe how to transform the current state of the resource into a new state. JSON patch documents are always arrays, where each element contains an operation, a path to the field to update, and the new value. For example, in this feature flag representation: ```json { \"name\": \"New recommendations engine\", \"key\": \"engine.enable\", \"description\": \"This is the description\", ... } ``` You can change the feature flag's description with the following patch document: ```json [{ \"op\": \"replace\", \"path\": \"/description\", \"value\": \"This is the new description\" }] ``` You can specify multiple modifications to perform in a single request. You can also test that certain preconditions are met before applying the patch: ```json [ { \"op\": \"test\", \"path\": \"/version\", \"value\": 10 }, { \"op\": \"replace\", \"path\": \"/description\", \"value\": \"The new description\" } ] ``` The above patch request tests whether the feature flag's `version` is `10`, and if so, changes the feature flag's description. Attributes that aren't editable, like a resource's `_links`, have names that start with an underscore. ### Updates using JSON merge patch [JSON merge patch](https://datatracker.ietf.org/doc/html/rfc7386) is another format for specifying the modifications to perform on a resource. JSON merge patch is less expressive than JSON patch but in many cases, it is simpler to construct a merge patch document. For example, you can change a feature flag's description with the following merge patch document: ```json { \"description\": \"New flag description\" } ``` ### Updates using semantic patch The API also supports the semantic patch format. A semantic `PATCH` is a way to specify the modifications to perform on a resource as a set of executable instructions. Semantic patch allows you to be explicit about intent using precise, custom instructions. In many cases, you can define semantic patch instructions independently of the current state of the resource. This can be useful when defining a change that may be applied at a future date. To make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. Here's how: ``` Content-Type: application/json; domain-model=launchdarkly.semanticpatch ``` If you call a semantic patch resource without this header, you will receive a `400` response because your semantic patch will be interpreted as a JSON patch. The body of a semantic patch request takes the following properties: * `comment` (string): (Optional) A description of the update. * `environmentKey` (string): (Required for some resources only) The environment key. * `instructions` (array): (Required) A list of actions the update should perform. Each action in the list must be an object with a `kind` property that indicates the instruction. If the action requires parameters, you must include those parameters as additional fields in the object. The documentation for each resource that supports semantic patch includes the available instructions and any additional parameters. For example: ```json { \"comment\": \"optional comment\", \"instructions\": [ {\"kind\": \"turnFlagOn\"} ] } ``` If any instruction in the patch encounters an error, the endpoint returns an error and will not change the resource. In general, each instruction silently does nothing if the resource is already in the state you request. > ### Supported semantic patch API endpoints > > - [Patch experiment](/tag/Experiments-(beta)#operation/patchExperiment) > - [Patch segment](/tag/Segments#operation/patchSegment) > - [Update feature flag](/tag/Feature-flags#operation/patchFeatureFlag) > - [Update flag trigger](/tag/Flag-triggers#operation/patchTriggerWorkflow) > - [Update expiring user targets on feature flag](/tag/Feature-flags#operation/patchExpiringUserTargets) > - [Update expiring user target for flags](/tag/User-settings#operation/patchExpiringFlagsForUser) > - [Update expiring user targets for segment](/tag/Segments#operation/patchExpiringUserTargetsForSegment) > - [Update scheduled changes workflow](/tag/Scheduled-changes#operation/patchFlagConfigScheduledChange) > - [Update team](/tag/Teams-(beta)#operation/patchTeam) ### Updates with comments You can submit optional comments with `PATCH` changes. To submit a comment along with a JSON Patch document, use the following format: ```json { \"comment\": \"This is a comment string\", \"patch\": [{ \"op\": \"replace\", \"path\": \"/description\", \"value\": \"The new description\" }] } ``` To submit a comment along with a JSON merge patch document, use the following format: ```json { \"comment\": \"This is a comment string\", \"merge\": { \"description\": \"New flag description\" } } ``` To submit a comment along with a semantic patch, use the following format: ```json { \"comment\": \"This is a comment string\", \"instructions\": [ {\"kind\": \"turnFlagOn\"} ] } ``` ## Errors The API always returns errors in a common format. Here's an example: ```json { \"code\": \"invalid_request\", \"message\": \"A feature with that key already exists\", \"id\": \"30ce6058-87da-11e4-b116-123b93f75cba\" } ``` The general class of error is indicated by the `code`. The `message` is a human-readable explanation of what went wrong. The `id` is a unique identifier. Use it when you're working with LaunchDarkly support to debug a problem with a specific API call. ### HTTP Status - Error Response Codes | Code | Definition | Description | Possible Solution | | ---- | ----------------- | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | | 400 | Invalid request | The request cannot be understood. | Ensure JSON syntax in request body is correct. | | 401 | Invalid access token | User is unauthorized or does not have permission for this API call. | Ensure your API access token is valid and has the appropriate permissions. | | 403 | Forbidden | User does not have access to this resource. | Ensure that the user or access token has proper permissions set. | | 404 | Invalid resource identifier | The requested resource is not valid. | Ensure that the resource is correctly identified by id or key. | | 405 | Method not allowed | The request method is not allowed on this resource. | Ensure that the HTTP verb is correct. | | 409 | Conflict | The API request can not be completed because it conflicted with a concurrent API request. | Retry your request. | | 422 | Unprocessable entity | The API request can not be completed because the update description can not be understood. | Ensure that the request body is correct for the type of patch you are using (JSON patch or semantic patch). | 429 | Too many requests | Read [Rate limiting](/#section/Rate-limiting). | Wait and try again later. | ## CORS The LaunchDarkly API supports Cross Origin Resource Sharing (CORS) for AJAX requests from any origin. If an `Origin` header is given in a request, it will be echoed as an explicitly allowed origin. Otherwise, a wildcard is returned: `Access-Control-Allow-Origin: *`. For more information on CORS, see the [CORS W3C Recommendation](http://www.w3.org/TR/cors). Example CORS headers might look like: ```http Access-Control-Allow-Headers: Accept, Content-Type, Content-Length, Accept-Encoding, Authorization Access-Control-Allow-Methods: OPTIONS, GET, DELETE, PATCH Access-Control-Allow-Origin: * Access-Control-Max-Age: 300 ``` You can make authenticated CORS calls just as you would make same-origin calls, using either [token or session-based authentication](#section/Authentication). If you’re using session auth, you should set the `withCredentials` property for your `xhr` request to `true`. You should never expose your access tokens to untrusted users. ## Rate limiting We use several rate limiting strategies to ensure the availability of our APIs. Rate-limited calls to our APIs will return a `429` status code. Calls to our APIs will include headers indicating the current rate limit status. The specific headers returned depend on the API route being called. The limits differ based on the route, authentication mechanism, and other factors. Routes that are not rate limited may not contain any of the headers described below. > ### Rate limiting and SDKs > > LaunchDarkly SDKs are never rate limited and do not use the API endpoints defined here. LaunchDarkly uses a different set of approaches, including streaming/server-sent events and a global CDN, to ensure availability to the routes used by LaunchDarkly SDKs. ### Global rate limits Authenticated requests are subject to a global limit. This is the maximum number of calls that can be made to the API per ten seconds. All personal access tokens on the account share this limit, so exceeding the limit with one access token will impact other tokens. Calls that are subject to global rate limits will return the headers below: | Header name | Description | | ------------------------------ | -------------------------------------------------------------------------------- | | `X-Ratelimit-Global-Remaining` | The maximum number of requests the account is permitted to make per ten seconds. | | `X-Ratelimit-Reset` | The time at which the current rate limit window resets in epoch milliseconds. | We do not publicly document the specific number of calls that can be made globally. This limit may change, and we encourage clients to program against the specification, relying on the two headers defined above, rather than hardcoding to the current limit. ### Route-level rate limits Some authenticated routes have custom rate limits. These also reset every ten seconds. Any access tokens hitting the same route share this limit, so exceeding the limit with one access token may impact other tokens. Calls that are subject to route-level rate limits will return the headers below: | Header name | Description | | ----------------------------- | ----------------------------------------------------------------------------------------------------- | | `X-Ratelimit-Route-Remaining` | The maximum number of requests to the current route the account is permitted to make per ten seconds. | | `X-Ratelimit-Reset` | The time at which the current rate limit window resets in epoch milliseconds. | A _route_ represents a specific URL pattern and verb. For example, the [Delete environment](/tag/Environments#operation/deleteEnvironment) endpoint is considered a single route, and each call to delete an environment counts against your route-level rate limit for that route. We do not publicly document the specific number of calls that can be made to each endpoint per ten seconds. These limits may change, and we encourage clients to program against the specification, relying on the two headers defined above, rather than hardcoding to the current limits. ### IP-based rate limiting We also employ IP-based rate limiting on some API routes. If you hit an IP-based rate limit, your API response will include a `Retry-After` header indicating how long to wait before re-trying the call. Clients must wait at least `Retry-After` seconds before making additional calls to our API, and should employ jitter and backoff strategies to avoid triggering rate limits again. ## OpenAPI (Swagger) We have a [complete OpenAPI (Swagger) specification](https://app.launchdarkly.com/api/v2/openapi.json) for our API. You can use this specification to generate client libraries to interact with our REST API in your language of choice. This specification is supported by several API-based tools such as Postman and Insomnia. In many cases, you can directly import our specification to ease use in navigating the APIs in the tooling. ## Client libraries We auto-generate multiple client libraries based on our OpenAPI specification. To learn more, visit [GitHub](https://github.com/search?q=topic%3Alaunchdarkly-api+org%3Alaunchdarkly&type=Repositories). ## Method Overriding Some firewalls and HTTP clients restrict the use of verbs other than `GET` and `POST`. In those environments, our API endpoints that use `PUT`, `PATCH`, and `DELETE` verbs will be inaccessible. To avoid this issue, our API supports the `X-HTTP-Method-Override` header, allowing clients to \"tunnel\" `PUT`, `PATCH`, and `DELETE` requests via a `POST` request. For example, if you wish to call one of our `PATCH` resources via a `POST` request, you can include `X-HTTP-Method-Override:PATCH` as a header. ## Beta resources We sometimes release new API resources in **beta** status before we release them with general availability. Resources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible. We try to promote resources into general availability as quickly as possible. This happens after sufficient testing and when we're satisfied that we no longer need to make backwards-incompatible changes. We mark beta resources with a \"Beta\" callout in our documentation, pictured below: > ### This feature is in beta > > To use this feature, pass in a header including the `LD-API-Version` key with value set to `beta`. Use this header with each call. To learn more, read [Beta resources](/#section/Overview/Beta-resources). ### Using beta resources To use a beta resource, you must include a header in the request. If you call a beta resource without this header, you'll receive a `403` response. Use this header: ``` LD-API-Version: beta ``` ## Versioning We try hard to keep our REST API backwards compatible, but we occasionally have to make backwards-incompatible changes in the process of shipping new features. These breaking changes can cause unexpected behavior if you don't prepare for them accordingly. Updates to our REST API include support for the latest features in LaunchDarkly. We also release a new version of our REST API every time we make a breaking change. We provide simultaneous support for multiple API versions so you can migrate from your current API version to a new version at your own pace. ### Setting the API version per request You can set the API version on a specific request by sending an `LD-API-Version` header, as shown in the example below: ``` LD-API-Version: 20220603 ``` The header value is the version number of the API version you'd like to request. The number for each version corresponds to the date the version was released in yyyymmdd format. In the example above the version `20220603` corresponds to June 03, 2022. ### Setting the API version per access token When creating an access token, you must specify a specific version of the API to use. This ensures that integrations using this token cannot be broken by version changes. Tokens created before versioning was released have their version set to `20160426` (the version of the API that existed before versioning) so that they continue working the same way they did before versioning. If you would like to upgrade your integration to use a new API version, you can explicitly set the header described above. > ### Best practice: Set the header for every client or integration > > We recommend that you set the API version header explicitly in any client or integration you build. > > Only rely on the access token API version during manual testing. ### API version changelog |<div style=\"width:75px\">Version</div> | Changes | |---|---| | `20220603` | <ul><li>Changed the [list projects](tag/Projects#operation/getProjects) return value:<ul><li>Response is now paginated with a default limit of `20`.</li><li>Added support for filter and sort.</li><li>The project `environments` field is now expandable. This field is omitted by default.</li></ul></li><li>Changed the [get project](tag/Projects#operation/getProject) return value:<ul><li>The `environments` field is now expandable. This field is omitted by default.</li></ul></li></ul> | | `20210729` | <ul><li>Changed the [create approval request](/tag/Approvals#operation/postApprovalRequest) return value. It now returns HTTP Status Code `201` instead of `200`.</li><li> Changed the [get users](/tag/Users#operation/getUser) return value. It now returns a user record, not a user. </li><li> Added additional optional fields to environment, segments, flags, members, and segments, including the ability to create Big Segments. </li><li> Added default values for flag variations when new environments are created. </li><li> Added filtering and pagination for getting flags and members, including `limit`, `number`, `filter`, and `sort` query parameters. </li><li> Added endpoints for expiring user targets for flags and segments, scheduled changes, access tokens, Relay Proxy configuration, integrations and subscriptions, and approvals. </li></ul> | | `20191212` | <ul><li>[List feature flags](/tag/Feature-flags#operation/getFeatureFlags) now defaults to sending summaries of feature flag configurations, equivalent to setting the query parameter `summary=true`. Summaries omit flag targeting rules and individual user targets from the payload. </li><li> Added endpoints for flags, flag status, projects, environments, users, audit logs, members, users, custom roles, segments, usage, streams, events, and data export. </li></ul> | | `20160426` | <ul><li>Initial versioning of API. Tokens created before versioning have their version set to this.</li></ul> |
5
5
 
6
6
  The version of the OpenAPI document: 2.0
7
7
  Contact: support@launchdarkly.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.3.0
9
+ OpenAPI Generator version: 6.0.0
10
10
 
11
11
  =end
12
12
 
@@ -34,7 +34,7 @@ describe 'FeatureFlagsApi' do
34
34
 
35
35
  # unit tests for copy_feature_flag
36
36
  # Copy feature flag
37
- # The includedActions and excludedActions define the parts of the flag configuration that are copied or not copied. By default, the entire flag configuration is copied. You can have either &#x60;includedActions&#x60; or &#x60;excludedActions&#x60; but not both. Valid &#x60;includedActions&#x60; and &#x60;excludedActions&#x60; include: - &#x60;updateOn&#x60; - &#x60;updatePrerequisites&#x60; - &#x60;updateTargets&#x60; - &#x60;updateRules&#x60; - &#x60;updateFallthrough&#x60; - &#x60;updateOffVariation&#x60; The &#x60;source&#x60; and &#x60;target&#x60; must be JSON objects if using curl, specifying the environment key and (optional) current flag configuration version in that environment. For example: &#x60;&#x60;&#x60;json { \&quot;key\&quot;: \&quot;production\&quot;, \&quot;currentVersion\&quot;: 3 } &#x60;&#x60;&#x60; If target is specified as above, the API will test to ensure that the current flag version in the &#x60;production&#x60; environment is &#x60;3&#x60;, and reject attempts to copy settings to &#x60;production&#x60; otherwise. You can use this to enforce optimistic locking on copy attempts.
37
+ # Copy flag settings from a source environment to a target environment. By default, this operation copies the entire flag configuration. You can use the &#x60;includedActions&#x60; or &#x60;excludedActions&#x60; to specify that only part of the flag configuration is copied. If you provide the optional &#x60;currentVersion&#x60; of a flag, this operation tests to ensure that the current flag version in the environment matches the version you&#39;ve specified. The operation rejects attempts to copy flag settings if the environment&#39;s current version of the flag does not match the version you&#39;ve specified. You can use this to enforce optimistic locking on copy attempts.
38
38
  # @param project_key The project key
39
39
  # @param feature_flag_key The feature flag key. The key identifies the flag in your code.
40
40
  # @param flag_copy_config_post
@@ -130,13 +130,13 @@ describe 'FeatureFlagsApi' do
130
130
 
131
131
  # unit tests for get_feature_flags
132
132
  # List feature flags
133
- # Get a list of all features in the given project. By default, each feature includes configurations for each environment. You can filter environments with the env query parameter. For example, setting &#x60;env&#x3D;production&#x60; restricts the returned configurations to just your production environment. You can also filter feature flags by tag with the tag query parameter. We support the following fields for filters: - &#x60;query&#x60; is a string that matches against the flags&#39; keys and names. It is not case sensitive. - &#x60;archived&#x60; is a boolean to filter the list to archived flags. When this is absent, only unarchived flags are returned. - &#x60;type&#x60; is a string allowing filtering to &#x60;temporary&#x60; or &#x60;permanent&#x60; flags. - &#x60;status&#x60; is a string allowing filtering to &#x60;new&#x60;, &#x60;inactive&#x60;, &#x60;active&#x60;, or &#x60;launched&#x60; flags in the specified environment. This filter also requires a &#x60;filterEnv&#x60; field to be set to a valid environment. For example: &#x60;filter&#x3D;status:active,filterEnv:production&#x60;. - &#x60;tags&#x60; is a + separated list of tags. It filters the list to members who have all of the tags in the list. - &#x60;hasExperiment&#x60; is a boolean with values of true or false and returns any flags that have an attached metric. - &#x60;hasDataExport&#x60; is a boolean with values of true or false and returns any flags that are currently exporting data in the specified environment. This includes flags that are exporting data via Experimentation. This filter also requires a &#x60;filterEnv&#x60; field to be set to a valid environment key. e.g. &#x60;filter&#x3D;hasExperiment:true,filterEnv:production&#x60; - &#x60;evaluated&#x60; is an object that contains a key of &#x60;after&#x60; and a value in Unix time in milliseconds. This returns all flags that have been evaluated since the time you specify in the environment provided. This filter also requires a &#x60;filterEnv&#x60; field to be set to a valid environment. For example: &#x60;filter&#x3D;evaluated:{\&quot;after\&quot;: 1590768455282},filterEnv:production&#x60;. - &#x60;filterEnv&#x60; is a string with the key of a valid environment. The filterEnv field is used for filters that are environment specific. If there are multiple environment specific filters you should only declare this parameter once. For example: &#x60;filter&#x3D;evaluated:{\&quot;after\&quot;: 1590768455282},filterEnv:production,status:active&#x60;. An example filter is &#x60;query:abc,tags:foo+bar&#x60;. This matches flags with the string &#x60;abc&#x60; in their key or name, ignoring case, which also have the tags &#x60;foo&#x60; and &#x60;bar&#x60;. By default, this returns all flags. You can page through the list with the &#x60;limit&#x60; parameter and by following the &#x60;first&#x60;, &#x60;prev&#x60;, &#x60;next&#x60;, and &#x60;last&#x60; links in the returned &#x60;_links&#x60; field. These links will not be present if the pages they refer to don&#39;t exist. For example, the &#x60;first&#x60; and &#x60;prev&#x60; links will be missing from the response on the first page.
133
+ # Get a list of all features in the given project. By default, each feature includes configurations for each environment. You can filter environments with the env query parameter. For example, setting &#x60;env&#x3D;production&#x60; restricts the returned configurations to just your production environment. You can also filter feature flags by tag with the tag query parameter. We support the following fields for filters: - &#x60;query&#x60; is a string that matches against the flags&#39; keys and names. It is not case sensitive. - &#x60;archived&#x60; is a boolean to filter the list to archived flags. When this is absent, only unarchived flags are returned. - &#x60;type&#x60; is a string allowing filtering to &#x60;temporary&#x60; or &#x60;permanent&#x60; flags. - &#x60;status&#x60; is a string allowing filtering to &#x60;new&#x60;, &#x60;inactive&#x60;, &#x60;active&#x60;, or &#x60;launched&#x60; flags in the specified environment. This filter also requires a &#x60;filterEnv&#x60; field to be set to a valid environment. For example: &#x60;filter&#x3D;status:active,filterEnv:production&#x60;. - &#x60;tags&#x60; is a + separated list of tags. It filters the list to members who have all of the tags in the list. - &#x60;hasExperiment&#x60; is a boolean with values of true or false and returns any flags that have an attached metric. - &#x60;hasDataExport&#x60; is a boolean with values of true or false and returns any flags that are exporting data in the specified environment. This includes flags that are exporting data from Experimentation. This filter also requires that you set a &#x60;filterEnv&#x60; field to a valid environment key. For example: &#x60;filter&#x3D;hasDataExport:true,filterEnv:production&#x60; - &#x60;evaluated&#x60; is an object that contains a key of &#x60;after&#x60; and a value in Unix time in milliseconds. This returns all flags that have been evaluated since the time you specify in the environment provided. This filter also requires you to set a &#x60;filterEnv&#x60; field to a valid environment. For example: &#x60;filter&#x3D;evaluated:{\&quot;after\&quot;: 1590768455282},filterEnv:production&#x60;. - &#x60;filterEnv&#x60; is a string with the key of a valid environment. You can use the filterEnv field for filters that are environment-specific. If there are multiple environment-specific filters, you should only declare this parameter once. For example: &#x60;filter&#x3D;evaluated:{\&quot;after\&quot;: 1590768455282},filterEnv:production,status:active&#x60;. An example filter is &#x60;query:abc,tags:foo+bar&#x60;. This matches flags with the string &#x60;abc&#x60; in their key or name, ignoring case, which also have the tags &#x60;foo&#x60; and &#x60;bar&#x60;. By default, this returns all flags. You can page through the list with the &#x60;limit&#x60; parameter and by following the &#x60;first&#x60;, &#x60;prev&#x60;, &#x60;next&#x60;, and &#x60;last&#x60; links in the returned &#x60;_links&#x60; field. These links will not be present if the pages they refer to don&#39;t exist. For example, the &#x60;first&#x60; and &#x60;prev&#x60; links will be missing from the response on the first page.
134
134
  # @param project_key The project key
135
135
  # @param [Hash] opts the optional parameters
136
136
  # @option opts [String] :env Filter configurations by environment
137
137
  # @option opts [String] :tag Filter feature flags by tag
138
138
  # @option opts [Integer] :limit The number of feature flags to return. Defaults to -1, which returns all flags
139
- # @option opts [Integer] :offset Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next limit items
139
+ # @option opts [Integer] :offset Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query &#x60;limit&#x60;.
140
140
  # @option opts [Boolean] :archived A boolean to filter the list to archived flags. When this is absent, only unarchived flags will be returned
141
141
  # @option opts [Boolean] :summary By default in API version &gt;&#x3D; 1, flags will _not_ include their list of prerequisites, targets or rules. Set summary&#x3D;0 to include these fields for each flag returned
142
142
  # @option opts [String] :filter A comma-separated list of filters. Each filter is of the form field:value
@@ -151,11 +151,11 @@ describe 'FeatureFlagsApi' do
151
151
 
152
152
  # unit tests for patch_expiring_user_targets
153
153
  # Update expiring user targets on feature flag
154
- # Update the list of user targets on a feature flag that are scheduled for removal.
154
+ # Schedule a user for removal from individual targeting on a feature flag. The flag must already individually target the user. You can add, update, or remove a scheduled removal date. You can only schedule a user for removal on a single variation per flag. This request only supports semantic patches. To make a semantic patch request, you must append &#x60;domain-model&#x3D;launchdarkly.semanticpatch&#x60; to your &#x60;Content-Type&#x60; header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch). ### Instructions #### addExpireUserTargetDate Adds a date and time that LaunchDarkly will remove the user from the flag&#39;s individual targeting. ##### Parameters * &#x60;value&#x60;: The time, in Unix milliseconds, when LaunchDarkly should remove the user from individual targeting for this flag * &#x60;variationId&#x60;: The version of the flag variation to update. You can retrieve this by making a GET request for the flag. * &#x60;userKey&#x60;: The user key for the user to remove from individual targeting #### updateExpireUserTargetDate Updates the date and time that LaunchDarkly will remove the user from the flag&#39;s individual targeting. ##### Parameters * &#x60;value&#x60;: The time, in Unix milliseconds, when LaunchDarkly should remove the user from individual targeting for this flag * &#x60;variationId&#x60;: The version of the flag variation to update. You can retrieve this by making a GET request for the flag. * &#x60;userKey&#x60;: The user key for the user to remove from individual targeting #### removeExpireUserTargetDate Removes the scheduled removal of the user from the flag&#39;s individual targeting. The user will remain part of the flag&#39;s individual targeting until you explicitly remove them, or until you schedule another removal. ##### Parameters * &#x60;variationId&#x60;: The version of the flag variation to update. You can retrieve this by making a GET request for the flag. * &#x60;userKey&#x60;: The user key for the user to remove from individual targeting
155
155
  # @param project_key The project key
156
156
  # @param environment_key The environment key
157
157
  # @param feature_flag_key The feature flag key
158
- # @param patch_with_comment
158
+ # @param patch_flags_request
159
159
  # @param [Hash] opts the optional parameters
160
160
  # @return [ExpiringUserTargetPatchResponse]
161
161
  describe 'patch_expiring_user_targets test' do
@@ -166,7 +166,7 @@ describe 'FeatureFlagsApi' do
166
166
 
167
167
  # unit tests for patch_feature_flag
168
168
  # Update feature flag
169
- # Perform a partial update to a feature flag. ## Using JSON Patches on a feature flag When using the update feature flag endpoint to add individual users to a specific variation, there are two different patch documents, depending on whether users are already being individually targeted for the variation. If a flag variation already has users individually targeted, the path for the JSON Patch operation is: &#x60;&#x60;&#x60;json { \&quot;op\&quot;: \&quot;add\&quot;, \&quot;path\&quot;: \&quot;/environments/devint/targets/0/values/-\&quot;, \&quot;value\&quot;: \&quot;TestClient10\&quot; } &#x60;&#x60;&#x60; If a flag variation does not already have users individually targeted, the path for the JSON Patch operation is: &#x60;&#x60;&#x60;json [ { \&quot;op\&quot;: \&quot;add\&quot;, \&quot;path\&quot;: \&quot;/environments/devint/targets/-\&quot;, \&quot;value\&quot;: { \&quot;variation\&quot;: 0, \&quot;values\&quot;: [\&quot;TestClient10\&quot;] } } ] &#x60;&#x60;&#x60; ## Using semantic patches on a feature flag To use a [semantic patch](/reference#updates-via-semantic-patches) on a feature flag resource, you must include a header in the request. If you call a semantic patch resource without this header, you will receive a &#x60;400&#x60; response because your semantic patch will be interpreted as a JSON patch. Use this header: &#x60;&#x60;&#x60; Content-Type: application/json; domain-model&#x3D;launchdarkly.semanticpatch &#x60;&#x60;&#x60; The body of a semantic patch request takes the following three properties: 1. &#x60;comment&#x60; (string): (Optional) A description of the update. 1. &#x60;environmentKey&#x60; (string): (Required) The key of the LaunchDarkly environment. 1. &#x60;instructions&#x60; (array): (Required) The list of actions to be performed by the update. Each action in the list must be an object/hash table with a &#x60;kind&#x60; property that indicates the instruction. Depending on the &#x60;kind&#x60;, the API may require other parameters. When this is the case, add the parameters as additional fields to the instruction object. Read below for more information on the specific supported semantic patch instructions. If any instruction in the patch encounters an error, the error will be returned and the flag will not be changed. In general, instructions will silently do nothing if the flag is already in the state requested by the patch instruction. For example, &#x60;removeUserTargets&#x60; does nothing when the targets have already been removed. They will generally error if a parameter refers to something that does not exist, like a variation ID that doesn&#39;t correspond to a variation on the flag or a rule ID that doesn&#39;t belong to a rule on the flag. Other specific error conditions are noted in the instruction descriptions. ### Instructions #### &#x60;turnFlagOn&#x60; Sets the flag&#39;s targeting state to on. For example, to flip a flag on, use this request body: &#x60;&#x60;&#x60;json { \&quot;environmentKey\&quot;: \&quot;example-environment-key\&quot;, \&quot;instructions\&quot;: [ { \&quot;kind\&quot;: \&quot;turnFlagOn\&quot; } ] } &#x60;&#x60;&#x60; #### &#x60;turnFlagOff&#x60; Sets the flag&#39;s targeting state to off. For example, to flip a flag off, use this request body: &#x60;&#x60;&#x60;json { \&quot;environmentKey\&quot;: \&quot;example-environment-key\&quot;, \&quot;instructions\&quot;: [ { \&quot;kind\&quot;: \&quot;turnFlagOff\&quot; } ] } &#x60;&#x60;&#x60; #### &#x60;addUserTargets&#x60; Adds the user keys in &#x60;values&#x60; to the individual user targets for the variation specified by &#x60;variationId&#x60;. Returns an error if this causes the same user key to be targeted in multiple variations. ##### Parameters - &#x60;values&#x60;: list of user keys - &#x60;variationId&#x60;: ID of a variation on the flag #### &#x60;removeUserTargets&#x60; Removes the user keys in &#x60;values&#x60; to the individual user targets for the variation specified by &#x60;variationId&#x60;. Does nothing if the user keys are not targeted. ##### Parameters - &#x60;values&#x60;: list of user keys - &#x60;variationId&#x60;: ID of a variation on the flag #### &#x60;replaceUserTargets&#x60; Completely replaces the existing set of user targeting. All variations must be provided. Example: &#x60;&#x60;&#x60;json { \&quot;kind\&quot;: \&quot;replaceUserTargets\&quot;, \&quot;targets\&quot;: [ { \&quot;variationId\&quot;: \&quot;variation-1\&quot;, \&quot;values\&quot;: [\&quot;blah\&quot;, \&quot;foo\&quot;, \&quot;bar\&quot;] }, { \&quot;variationId\&quot;: \&quot;variation-2\&quot;, \&quot;values\&quot;: [\&quot;abc\&quot;, \&quot;def\&quot;] } ] } &#x60;&#x60;&#x60; ##### Parameters - &#x60;targets&#x60;: a list of user targeting #### &#x60;clearUserTargets&#x60; Removes all individual user targets from the variation specified by &#x60;variationId&#x60; ##### Parameters - &#x60;variationId&#x60;: ID of a variation on the flag #### &#x60;addPrerequisite&#x60; Adds the flag indicated by &#x60;key&#x60; with variation &#x60;variationId&#x60; as a prerequisite to the flag. ##### Parameters - &#x60;key&#x60;: flag key of another flag - &#x60;variationId&#x60;: ID of a variation of the flag with key &#x60;key&#x60; #### &#x60;removePrerequisite&#x60; Removes the prerequisite indicated by &#x60;key&#x60;. Does nothing if this prerequisite does not exist. ##### Parameters - &#x60;key&#x60;: flag key of an existing prerequisite #### &#x60;updatePrerequisite&#x60; Changes the prerequisite with flag key &#x60;key&#x60; to the variation indicated by &#x60;variationId&#x60;. Returns an error if this prerequisite does not exist. ##### Parameters - &#x60;key&#x60;: flag key of an existing prerequisite - &#x60;variationId&#x60;: ID of a variation of the flag with key &#x60;key&#x60; #### &#x60;replacePrerequisites&#x60; Completely replaces the existing set of prerequisites for a given flag. Example: &#x60;&#x60;&#x60;json { \&quot;kind\&quot;: \&quot;replacePrerequisites\&quot;, \&quot;prerequisites\&quot;: [ { \&quot;key\&quot;: \&quot;flag-key\&quot;, \&quot;variationId\&quot;: \&quot;variation-1\&quot; }, { \&quot;key\&quot;: \&quot;another-flag\&quot;, \&quot;variationId\&quot;: \&quot;variation-2\&quot; } ] } &#x60;&#x60;&#x60; ##### Parameters - &#x60;prerequisites&#x60;: a list of prerequisites #### &#x60;addRule&#x60; Adds a new rule to the flag with the given &#x60;clauses&#x60; which serves the variation indicated by &#x60;variationId&#x60; or the percent rollout indicated by &#x60;rolloutWeights&#x60; and &#x60;rolloutBucketBy&#x60;. If &#x60;beforeRuleId&#x60; is set, the rule will be added in the list of rules before the indicated rule. Otherwise, the rule will be added to the end of the list. ##### Parameters - &#x60;clauses&#x60;: Array of clauses (see &#x60;addClauses&#x60;) - &#x60;beforeRuleId&#x60;: Optional ID of a rule in the flag - &#x60;variationId&#x60;: ID of a variation of the flag - &#x60;rolloutWeights&#x60;: Map of variationId to weight in thousandths of a percent (0-100000) - &#x60;rolloutBucketBy&#x60;: Optional user attribute #### &#x60;removeRule&#x60; Removes the targeting rule specified by &#x60;ruleId&#x60;. Does nothing if the rule does not exist. ##### Parameters - &#x60;ruleId&#x60;: ID of a rule in the flag #### &#x60;replaceRules&#x60; Completely replaces the existing rules for a given flag. Example: &#x60;&#x60;&#x60;json { \&quot;kind\&quot;: \&quot;replaceRules\&quot;, \&quot;rules\&quot;: [ { \&quot;variationId\&quot;: \&quot;variation-1\&quot;, \&quot;description\&quot;: \&quot;myRule\&quot;, \&quot;clauses\&quot;: [ { \&quot;attribute\&quot;: \&quot;segmentMatch\&quot;, \&quot;op\&quot;: \&quot;segmentMatch\&quot;, \&quot;values\&quot;: [\&quot;test\&quot;] } ], \&quot;trackEvents\&quot;: true } ] } &#x60;&#x60;&#x60; ##### Parameters - &#x60;rules&#x60;: a list of rules #### &#x60;addClauses&#x60; Adds the given clauses to the rule indicated by &#x60;ruleId&#x60;. ##### Parameters - &#x60;ruleId&#x60;: ID of a rule in the flag - &#x60;clauses&#x60;: Array of clause objects, with &#x60;attribute&#x60; (string), &#x60;op&#x60; (string), and &#x60;values&#x60; (array of strings, numbers, or dates) properties. #### &#x60;removeClauses&#x60; Removes the clauses specified by &#x60;clauseIds&#x60; from the rule indicated by &#x60;ruleId&#x60;. #### Parameters - &#x60;ruleId&#x60;: ID of a rule in the flag - &#x60;clauseIds&#x60;: Array of IDs of clauses in the rule #### &#x60;updateClause&#x60; Replaces the clause indicated by &#x60;ruleId&#x60; and &#x60;clauseId&#x60; with &#x60;clause&#x60;. ##### Parameters - &#x60;ruleId&#x60;: ID of a rule in the flag - &#x60;clauseId&#x60;: ID of a clause in that rule - &#x60;clause&#x60;: Clause object #### &#x60;addValuesToClause&#x60; Adds &#x60;values&#x60; to the values of the clause indicated by &#x60;ruleId&#x60; and &#x60;clauseId&#x60;. ##### Parameters - &#x60;ruleId&#x60;: ID of a rule in the flag - &#x60;clauseId&#x60;: ID of a clause in that rule - &#x60;values&#x60;: Array of strings #### &#x60;removeValuesFromClause&#x60; Removes &#x60;values&#x60; from the values of the clause indicated by &#x60;ruleId&#x60; and &#x60;clauseId&#x60;. ##### Parameters &#x60;ruleId&#x60;: ID of a rule in the flag &#x60;clauseId&#x60;: ID of a clause in that rule &#x60;values&#x60;: Array of strings #### &#x60;reorderRules&#x60; Rearranges the rules to match the order given in &#x60;ruleIds&#x60;. Will return an error if &#x60;ruleIds&#x60; does not match the current set of rules on the flag. ##### Parameters - &#x60;ruleIds&#x60;: Array of IDs of all rules in the flag #### &#x60;updateRuleVariationOrRollout&#x60; Updates what the rule indicated by &#x60;ruleId&#x60; serves if its clauses evaluate to true. Can either be a fixed variation indicated by &#x60;variationId&#x60; or a percent rollout indicated by &#x60;rolloutWeights&#x60; and &#x60;rolloutBucketBy&#x60;. ##### Parameters - &#x60;ruleId&#x60;: ID of a rule in the flag - &#x60;variationId&#x60;: ID of a variation of the flag or - &#x60;rolloutWeights&#x60;: Map of variationId to weight in thousandths of a percent (0-100000) - &#x60;rolloutBucketBy&#x60;: Optional user attribute #### &#x60;updateFallthroughVariationOrRollout&#x60; Updates the flag&#39;s fallthrough, which is served if none of the targeting rules match. Can either be a fixed variation indicated by &#x60;variationId&#x60; or a percent rollout indicated by &#x60;rolloutWeights&#x60; and &#x60;rolloutBucketBy&#x60;. ##### Parameters &#x60;variationId&#x60;: ID of a variation of the flag or &#x60;rolloutWeights&#x60;: Map of variationId to weight in thousandths of a percent (0-100000) &#x60;rolloutBucketBy&#x60;: Optional user attribute #### &#x60;updateOffVariation&#x60; Updates the variation served when the flag&#39;s targeting is off to the variation indicated by &#x60;variationId&#x60;. ##### Parameters &#x60;variationId&#x60;: ID of a variation of the flag ### Example &#x60;&#x60;&#x60;json { \&quot;environmentKey\&quot;: \&quot;production\&quot;, \&quot;instructions\&quot;: [ { \&quot;kind\&quot;: \&quot;turnFlagOn\&quot; }, { \&quot;kind\&quot;: \&quot;turnFlagOff\&quot; }, { \&quot;kind\&quot;: \&quot;addUserTargets\&quot;, \&quot;variationId\&quot;: \&quot;8bfb304e-d516-47e5-8727-e7f798e8992d\&quot;, \&quot;values\&quot;: [\&quot;userId\&quot;, \&quot;userId2\&quot;] }, { \&quot;kind\&quot;: \&quot;removeUserTargets\&quot;, \&quot;variationId\&quot;: \&quot;8bfb304e-d516-47e5-8727-e7f798e8992d\&quot;, \&quot;values\&quot;: [\&quot;userId3\&quot;, \&quot;userId4\&quot;] }, { \&quot;kind\&quot;: \&quot;updateFallthroughVariationOrRollout\&quot;, \&quot;rolloutWeights\&quot;: { \&quot;variationId\&quot;: 50000, \&quot;variationId2\&quot;: 50000 }, \&quot;rolloutBucketBy\&quot;: null }, { \&quot;kind\&quot;: \&quot;addRule\&quot;, \&quot;clauses\&quot;: [ { \&quot;attribute\&quot;: \&quot;segmentMatch\&quot;, \&quot;negate\&quot;: false, \&quot;values\&quot;: [\&quot;test-segment\&quot;] } ], \&quot;variationId\&quot;: null, \&quot;rolloutWeights\&quot;: { \&quot;variationId\&quot;: 50000, \&quot;variationId2\&quot;: 50000 }, \&quot;rolloutBucketBy\&quot;: \&quot;key\&quot; }, { \&quot;kind\&quot;: \&quot;removeRule\&quot;, \&quot;ruleId\&quot;: \&quot;99f12464-a429-40fc-86cc-b27612188955\&quot; }, { \&quot;kind\&quot;: \&quot;reorderRules\&quot;, \&quot;ruleIds\&quot;: [\&quot;2f72974e-de68-4243-8dd3-739582147a1f\&quot;, \&quot;8bfb304e-d516-47e5-8727-e7f798e8992d\&quot;] }, { \&quot;kind\&quot;: \&quot;addClauses\&quot;, \&quot;ruleId\&quot;: \&quot;1134\&quot;, \&quot;clauses\&quot;: [ { \&quot;attribute\&quot;: \&quot;email\&quot;, \&quot;op\&quot;: \&quot;in\&quot;, \&quot;negate\&quot;: false, \&quot;values\&quot;: [\&quot;test@test.com\&quot;] } ] }, { \&quot;kind\&quot;: \&quot;removeClauses\&quot;, \&quot;ruleId\&quot;: \&quot;1242529\&quot;, \&quot;clauseIds\&quot;: [\&quot;8bfb304e-d516-47e5-8727-e7f798e8992d\&quot;] }, { \&quot;kind\&quot;: \&quot;updateClause\&quot;, \&quot;ruleId\&quot;: \&quot;2f72974e-de68-4243-8dd3-739582147a1f\&quot;, \&quot;clauseId\&quot;: \&quot;309845\&quot;, \&quot;clause\&quot;: { \&quot;attribute\&quot;: \&quot;segmentMatch\&quot;, \&quot;negate\&quot;: false, \&quot;values\&quot;: [\&quot;test-segment\&quot;] } }, { \&quot;kind\&quot;: \&quot;updateRuleVariationOrRollout\&quot;, \&quot;ruleId\&quot;: \&quot;2342\&quot;, \&quot;rolloutWeights\&quot;: null, \&quot;rolloutBucketBy\&quot;: null }, { \&quot;kind\&quot;: \&quot;updateOffVariation\&quot;, \&quot;variationId\&quot;: \&quot;3242453\&quot; }, { \&quot;kind\&quot;: \&quot;addPrerequisite\&quot;, \&quot;variationId\&quot;: \&quot;234235\&quot;, \&quot;key\&quot;: \&quot;flagKey2\&quot; }, { \&quot;kind\&quot;: \&quot;updatePrerequisite\&quot;, \&quot;variationId\&quot;: \&quot;234235\&quot;, \&quot;key\&quot;: \&quot;flagKey2\&quot; }, { \&quot;kind\&quot;: \&quot;removePrerequisite\&quot;, \&quot;key\&quot;: \&quot;flagKey\&quot; } ] } &#x60;&#x60;&#x60; ## Using JSON patches on a feature flag If you do not include the header described above, you can use [JSON patch](/reference#updates-via-json-patch).
169
+ # Perform a partial update to a feature flag. The request body must be a valid semantic patch or JSON patch. ## Using semantic patches on a feature flag To make a semantic patch request, you must append &#x60;domain-model&#x3D;launchdarkly.semanticpatch&#x60; to your &#x60;Content-Type&#x60; header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch). The body of a semantic patch request for updating feature flags requires an &#x60;environmentKey&#x60; in addition to &#x60;instructions&#x60; and an optional &#x60;comment&#x60;. The body of the request takes the following properties: * &#x60;comment&#x60; (string): (Optional) A description of the update. * &#x60;environmentKey&#x60; (string): (Required) The key of the LaunchDarkly environment. * &#x60;instructions&#x60; (array): (Required) A list of actions the update should perform. Each action in the list must be an object with a &#x60;kind&#x60; property that indicates the instruction. If the action requires parameters, you must include those parameters as additional fields in the object. ### Instructions Semantic patch requests support the following &#x60;kind&#x60; instructions for updating feature flags. &lt;details&gt; &lt;summary&gt;Click to expand instructions for turning flags on and off&lt;/summary&gt; #### turnFlagOff Sets the flag&#39;s targeting state to **Off**. For example, to turn a flag off, use this request body: &#x60;&#x60;&#x60;json { \&quot;environmentKey\&quot;: \&quot;example-environment-key\&quot;, \&quot;instructions\&quot;: [ { \&quot;kind\&quot;: \&quot;turnFlagOff\&quot; } ] } &#x60;&#x60;&#x60; #### turnFlagOn Sets the flag&#39;s targeting state to **On**. For example, to turn a flag on, use this request body: &#x60;&#x60;&#x60;json { \&quot;environmentKey\&quot;: \&quot;example-environment-key\&quot;, \&quot;instructions\&quot;: [ { \&quot;kind\&quot;: \&quot;turnFlagOn\&quot; } ] } &#x60;&#x60;&#x60; &lt;/details&gt;&lt;br /&gt; &lt;details&gt; &lt;summary&gt;Click to expand instructions for working with targeting and variations&lt;/summary&gt; #### addClauses Adds the given clauses to the rule indicated by &#x60;ruleId&#x60;. ##### Parameters - &#x60;ruleId&#x60;: ID of a rule in the flag. - &#x60;clauses&#x60;: Array of clause objects, with &#x60;attribute&#x60; (string), &#x60;op&#x60; (string), and &#x60;values&#x60; (array of strings, numbers, or dates) properties. #### addPrerequisite Adds the flag indicated by &#x60;key&#x60; with variation &#x60;variationId&#x60; as a prerequisite to the flag in the path parameter. ##### Parameters - &#x60;key&#x60;: Flag key of the prerequisite flag. - &#x60;variationId&#x60;: ID of a variation of the prerequisite flag. #### addRule Adds a new targeting rule to the flag. The rule may contain &#x60;clauses&#x60; and serve the variation that &#x60;variationId&#x60; indicates, or serve a percentage rollout that &#x60;rolloutWeights&#x60; and &#x60;rolloutBucketBy&#x60; indicate. If you set &#x60;beforeRuleId&#x60;, this adds the new rule before the indicated rule. Otherwise, adds the new rule to the end of the list. ##### Parameters - &#x60;clauses&#x60;: Array of clause objects, with &#x60;attribute&#x60; (string), &#x60;op&#x60; (string), and &#x60;values&#x60; (array of strings, numbers, or dates) properties. - &#x60;beforeRuleId&#x60;: (Optional) ID of a flag rule. - &#x60;variationId&#x60;: ID of a variation of the flag. - &#x60;rolloutWeights&#x60;: Map of &#x60;variationId&#x60; to weight, in thousandths of a percent (0-100000). - &#x60;rolloutBucketBy&#x60;: (Optional) User attribute. #### addUserTargets Adds user keys to the individual user targets for the variation that &#x60;variationId&#x60; specifies. Returns an error if this causes the flag to target the same user key in multiple variations. ##### Parameters - &#x60;values&#x60;: List of user keys. - &#x60;variationId&#x60;: ID of a variation on the flag. #### addValuesToClause Adds &#x60;values&#x60; to the values of the clause that &#x60;ruleId&#x60; and &#x60;clauseId&#x60; indicate. ##### Parameters - &#x60;ruleId&#x60;: ID of a rule in the flag. - &#x60;clauseId&#x60;: ID of a clause in that rule. - &#x60;values&#x60;: Array of strings. #### clearUserTargets Removes all individual user targets from the variation that &#x60;variationId&#x60; specifies. ##### Parameters - &#x60;variationId&#x60;: ID of a variation on the flag. #### removeClauses Removes the clauses specified by &#x60;clauseIds&#x60; from the rule indicated by &#x60;ruleId&#x60;. ##### Parameters - &#x60;ruleId&#x60;: ID of a rule in the flag. - &#x60;clauseIds&#x60;: Array of IDs of clauses in the rule. #### removePrerequisite Removes the prerequisite flag indicated by &#x60;key&#x60;. Does nothing if this prerequisite does not exist. ##### Parameters - &#x60;key&#x60;: Flag key of an existing prerequisite flag. #### removeRule Removes the targeting rule specified by &#x60;ruleId&#x60;. Does nothing if the rule does not exist. ##### Parameters - &#x60;ruleId&#x60;: ID of a rule in the flag. #### removeUserTargets Removes user keys from the individual user targets for the variation that &#x60;variationId&#x60; specifies. Does nothing if the flag does not target the user keys. ##### Parameters - &#x60;values&#x60;: List of user keys. - &#x60;variationId&#x60;: ID of a flag variation. #### removeValuesFromClause Removes &#x60;values&#x60; from the values of the clause indicated by &#x60;ruleId&#x60; and &#x60;clauseId&#x60;. ##### Parameters - &#x60;ruleId&#x60;: ID of a rule in the flag. - &#x60;clauseId&#x60;: ID of a clause in that rule. - &#x60;values&#x60;: Array of strings. #### reorderRules Rearranges the rules to match the order given in &#x60;ruleIds&#x60;. Returns an error if &#x60;ruleIds&#x60; does not match the current set of rules on the flag. ##### Parameters - &#x60;ruleIds&#x60;: Array of IDs of all rules in the flag. #### replacePrerequisites Removes all existing prerequisites and replaces them with the list you provide. ##### Parameters - &#x60;prerequisites&#x60;: A list of prerequisites. Each item in the list must include a flag &#x60;key&#x60; and &#x60;variationId&#x60;. For example, to replace prerequisites, use this request body: &#x60;&#x60;&#x60;json { \&quot;environmentKey\&quot;: \&quot;example-environment-key\&quot;, \&quot;instructions\&quot;: [ { \&quot;kind\&quot;: \&quot;replacePrerequisites\&quot;, \&quot;prerequisites\&quot;: [ { \&quot;key\&quot;: \&quot;prereq-flag-key\&quot;, \&quot;variationId\&quot;: \&quot;variation-1\&quot; }, { \&quot;key\&quot;: \&quot;another-prereq-flag-key\&quot;, \&quot;variationId\&quot;: \&quot;variation-2\&quot; } ] } ] } &#x60;&#x60;&#x60; #### replaceRules Removes all targeting rules for the flag and replaces them with the list you provide. ##### Parameters - &#x60;rules&#x60;: A list of rules. For example, to replace rules, use this request body: &#x60;&#x60;&#x60;json { \&quot;environmentKey\&quot;: \&quot;example-environment-key\&quot;, \&quot;instructions\&quot;: [ { \&quot;kind\&quot;: \&quot;replaceRules\&quot;, \&quot;rules\&quot;: [ { \&quot;variationId\&quot;: \&quot;variation-1\&quot;, \&quot;description\&quot;: \&quot;myRule\&quot;, \&quot;clauses\&quot;: [ { \&quot;attribute\&quot;: \&quot;segmentMatch\&quot;, \&quot;op\&quot;: \&quot;segmentMatch\&quot;, \&quot;values\&quot;: [\&quot;test\&quot;] } ], \&quot;trackEvents\&quot;: true } ] } ] } &#x60;&#x60;&#x60; #### replaceUserTargets Removes all existing user targeting and replaces it with the list of targets you provide. ##### Parameters - &#x60;targets&#x60;: A list of user targeting. Each item in the list must include a &#x60;variationId&#x60; and a list of &#x60;values&#x60;. For example, to replace user targets, use this request body: &#x60;&#x60;&#x60;json { \&quot;environmentKey\&quot;: \&quot;example-environment-key\&quot;, \&quot;instructions\&quot;: [ { \&quot;kind\&quot;: \&quot;replaceUserTargets\&quot;, \&quot;targets\&quot;: [ { \&quot;variationId\&quot;: \&quot;variation-1\&quot;, \&quot;values\&quot;: [\&quot;blah\&quot;, \&quot;foo\&quot;, \&quot;bar\&quot;] }, { \&quot;variationId\&quot;: \&quot;variation-2\&quot;, \&quot;values\&quot;: [\&quot;abc\&quot;, \&quot;def\&quot;] } ] } ] } &#x60;&#x60;&#x60; #### updateClause Replaces the clause indicated by &#x60;ruleId&#x60; and &#x60;clauseId&#x60; with &#x60;clause&#x60;. ##### Parameters - &#x60;ruleId&#x60;: ID of a rule in the flag. - &#x60;clauseId&#x60;: ID of a clause in that rule. - &#x60;clause&#x60;: New &#x60;clause&#x60; object, with &#x60;attribute&#x60; (string), &#x60;op&#x60; (string), and &#x60;values&#x60; (array of strings, numbers, or dates) properties. #### updateFallthroughVariationOrRollout Updates the default or \&quot;fallthrough\&quot; rule for the flag, which the flag serves when a user matches none of the targeting rules. The rule can serve either the variation that &#x60;variationId&#x60; indicates, or a percent rollout that &#x60;rolloutWeights&#x60; and &#x60;rolloutBucketBy&#x60; indicate. ##### Parameters - &#x60;variationId&#x60;: ID of a variation of the flag. or - &#x60;rolloutWeights&#x60;: Map of &#x60;variationId&#x60; to weight, in thousandths of a percent (0-100000). - &#x60;rolloutBucketBy&#x60;: Optional user attribute. #### updateOffVariation Updates the default off variation to &#x60;variationId&#x60;. The flag serves the default off variation when the flag&#39;s targeting is **Off**. ##### Parameters - &#x60;variationId&#x60;: ID of a variation of the flag. #### updatePrerequisite Changes the prerequisite flag that &#x60;key&#x60; indicates to use the variation that &#x60;variationId&#x60; indicates. Returns an error if this prerequisite does not exist. ##### Parameters - &#x60;key&#x60;: Flag key of an existing prerequisite flag. - &#x60;variationId&#x60;: ID of a variation of the prerequisite flag. #### updateRuleDescription Updates the description of the feature flag rule. ##### Parameters - &#x60;description&#x60;: The new human-readable description for this rule. - &#x60;ruleId&#x60;: The ID of the rule. You can retrieve this by making a GET request for the flag. #### updateRuleTrackEvents Updates whether or not LaunchDarkly tracks events for the feature flag associated with this rule. ##### Parameters - &#x60;ruleId&#x60;: The ID of the rule. You can retrieve this by making a GET request for the flag. - &#x60;trackEvents&#x60;: Whether or not events are tracked. #### updateRuleVariationOrRollout Updates what &#x60;ruleId&#x60; serves when its clauses evaluate to true. The rule can serve either the variation that &#x60;variationId&#x60; indicates, or a percent rollout that &#x60;rolloutWeights&#x60; and &#x60;rolloutBucketBy&#x60; indicate. ##### Parameters - &#x60;ruleId&#x60;: ID of a rule in the flag. - &#x60;variationId&#x60;: ID of a variation of the flag. or - &#x60;rolloutWeights&#x60;: Map of &#x60;variationId&#x60; to weight, in thousandths of a percent (0-100000). - &#x60;rolloutBucketBy&#x60;: Optional user attribute. #### updateTrackEvents Updates whether or not LaunchDarkly tracks events for the feature flag, for all rules. ##### Parameters - &#x60;trackEvents&#x60;: Whether or not events are tracked. #### updateTrackEventsFallthrough Updates whether or not LaunchDarkly tracks events for the feature flag, for the default rule. ##### Parameters - &#x60;trackEvents&#x60;: Whether or not events are tracked. &lt;/details&gt;&lt;br /&gt; &lt;details&gt; &lt;summary&gt;Click to expand instructions for updating flag settings&lt;/summary&gt; #### addTags Adds tags to the feature flag. ##### Parameters - &#x60;values&#x60;: A list of tags to add. #### 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 users. #### makeFlagTemporary Marks the feature flag as temporary. #### removeMaintainer Removes the flag&#39;s maintainer. To set a new maintainer, use the flag&#39;s **Settings** tab in the LaunchDarkly user interface. #### removeTags Removes tags from the feature flag. ##### Parameters - &#x60;values&#x60;: A list of tags to remove. #### 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&#39;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 - &#x60;value&#x60;: Use \&quot;usingMobileKey\&quot; to turn on availability for mobile SDKs. Use \&quot;usingEnvironmentId\&quot; to turn on availability for client-side SDKs. #### turnOnClientSideAvailability Turns on 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&#39;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 - &#x60;value&#x60;: Use \&quot;usingMobileKey\&quot; to turn on availability for mobile SDKs. Use \&quot;usingEnvironmentId\&quot; to turn on availability for client-side SDKs. #### updateDescription Updates the feature flag description. ##### Parameters - &#x60;value&#x60;: The new description. #### updateName Updates the feature flag name. ##### Parameters - &#x60;value&#x60;: The new name. &lt;/details&gt;&lt;br /&gt; &lt;details&gt; &lt;summary&gt;Click to expand instructions for updating the flag lifecycle&lt;/summary&gt; #### 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. #### 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 users. #### restoreFlag Restores the feature flag if it was previously archived. &lt;/details&gt; ### Example The body of a single semantic patch can contain many different instructions. &lt;details&gt; &lt;summary&gt;Click to expand example semantic patch request body&lt;/summary&gt; &#x60;&#x60;&#x60;json { \&quot;environmentKey\&quot;: \&quot;production\&quot;, \&quot;instructions\&quot;: [ { \&quot;kind\&quot;: \&quot;turnFlagOn\&quot; }, { \&quot;kind\&quot;: \&quot;turnFlagOff\&quot; }, { \&quot;kind\&quot;: \&quot;addUserTargets\&quot;, \&quot;variationId\&quot;: \&quot;8bfb304e-d516-47e5-8727-e7f798e8992d\&quot;, \&quot;values\&quot;: [\&quot;userId\&quot;, \&quot;userId2\&quot;] }, { \&quot;kind\&quot;: \&quot;removeUserTargets\&quot;, \&quot;variationId\&quot;: \&quot;8bfb304e-d516-47e5-8727-e7f798e8992d\&quot;, \&quot;values\&quot;: [\&quot;userId3\&quot;, \&quot;userId4\&quot;] }, { \&quot;kind\&quot;: \&quot;updateFallthroughVariationOrRollout\&quot;, \&quot;rolloutWeights\&quot;: { \&quot;variationId\&quot;: 50000, \&quot;variationId2\&quot;: 50000 }, \&quot;rolloutBucketBy\&quot;: null }, { \&quot;kind\&quot;: \&quot;addRule\&quot;, \&quot;clauses\&quot;: [ { \&quot;attribute\&quot;: \&quot;segmentMatch\&quot;, \&quot;negate\&quot;: false, \&quot;values\&quot;: [\&quot;test-segment\&quot;] } ], \&quot;variationId\&quot;: null, \&quot;rolloutWeights\&quot;: { \&quot;variationId\&quot;: 50000, \&quot;variationId2\&quot;: 50000 }, \&quot;rolloutBucketBy\&quot;: \&quot;key\&quot; }, { \&quot;kind\&quot;: \&quot;removeRule\&quot;, \&quot;ruleId\&quot;: \&quot;99f12464-a429-40fc-86cc-b27612188955\&quot; }, { \&quot;kind\&quot;: \&quot;reorderRules\&quot;, \&quot;ruleIds\&quot;: [\&quot;2f72974e-de68-4243-8dd3-739582147a1f\&quot;, \&quot;8bfb304e-d516-47e5-8727-e7f798e8992d\&quot;] }, { \&quot;kind\&quot;: \&quot;addClauses\&quot;, \&quot;ruleId\&quot;: \&quot;1134\&quot;, \&quot;clauses\&quot;: [ { \&quot;attribute\&quot;: \&quot;email\&quot;, \&quot;op\&quot;: \&quot;in\&quot;, \&quot;negate\&quot;: false, \&quot;values\&quot;: [\&quot;test@test.com\&quot;] } ] }, { \&quot;kind\&quot;: \&quot;removeClauses\&quot;, \&quot;ruleId\&quot;: \&quot;1242529\&quot;, \&quot;clauseIds\&quot;: [\&quot;8bfb304e-d516-47e5-8727-e7f798e8992d\&quot;] }, { \&quot;kind\&quot;: \&quot;updateClause\&quot;, \&quot;ruleId\&quot;: \&quot;2f72974e-de68-4243-8dd3-739582147a1f\&quot;, \&quot;clauseId\&quot;: \&quot;309845\&quot;, \&quot;clause\&quot;: { \&quot;attribute\&quot;: \&quot;segmentMatch\&quot;, \&quot;negate\&quot;: false, \&quot;values\&quot;: [\&quot;test-segment\&quot;] } }, { \&quot;kind\&quot;: \&quot;updateRuleVariationOrRollout\&quot;, \&quot;ruleId\&quot;: \&quot;2342\&quot;, \&quot;rolloutWeights\&quot;: null, \&quot;rolloutBucketBy\&quot;: null }, { \&quot;kind\&quot;: \&quot;updateOffVariation\&quot;, \&quot;variationId\&quot;: \&quot;3242453\&quot; }, { \&quot;kind\&quot;: \&quot;addPrerequisite\&quot;, \&quot;variationId\&quot;: \&quot;234235\&quot;, \&quot;key\&quot;: \&quot;flagKey2\&quot; }, { \&quot;kind\&quot;: \&quot;updatePrerequisite\&quot;, \&quot;variationId\&quot;: \&quot;234235\&quot;, \&quot;key\&quot;: \&quot;flagKey2\&quot; }, { \&quot;kind\&quot;: \&quot;removePrerequisite\&quot;, \&quot;key\&quot;: \&quot;flagKey\&quot; } ] } &#x60;&#x60;&#x60; &lt;/details&gt; ## Using JSON Patches on a feature flag If you do not include the header described above, you can use [JSON patch](/reference#updates-using-json-patch). When using the update feature flag endpoint to add individual users to a specific variation, there are two different patch documents, depending on whether users are already being individually targeted for the variation. If a flag variation already has users individually targeted, the path for the JSON Patch operation is: &#x60;&#x60;&#x60;json { \&quot;op\&quot;: \&quot;add\&quot;, \&quot;path\&quot;: \&quot;/environments/devint/targets/0/values/-\&quot;, \&quot;value\&quot;: \&quot;TestClient10\&quot; } &#x60;&#x60;&#x60; If a flag variation does not already have users individually targeted, the path for the JSON Patch operation is: &#x60;&#x60;&#x60;json [ { \&quot;op\&quot;: \&quot;add\&quot;, \&quot;path\&quot;: \&quot;/environments/devint/targets/-\&quot;, \&quot;value\&quot;: { \&quot;variation\&quot;: 0, \&quot;values\&quot;: [\&quot;TestClient10\&quot;] } } ] &#x60;&#x60;&#x60; ## 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](/tag/Approvals) or a [workflow](/tag/Workflows-(beta)). ## 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 &#x60;ignoreConflicts&#x60; query parameter set to &#x60;true&#x60;.
170
170
  # @param project_key The project key
171
171
  # @param feature_flag_key The feature flag key. The key identifies the flag in your code.
172
172
  # @param patch_with_comment
@@ -180,7 +180,7 @@ describe 'FeatureFlagsApi' do
180
180
 
181
181
  # unit tests for post_feature_flag
182
182
  # Create a feature flag
183
- # Create a feature flag with the given name, key, and variations
183
+ # Create a feature flag with the given name, key, and variations.
184
184
  # @param project_key The project key
185
185
  # @param feature_flag_body
186
186
  # @param [Hash] opts the optional parameters