launchdarkly_api 9.0.0 → 9.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +12 -9
  3. data/docs/AccountMembersApi.md +6 -6
  4. data/docs/EnvironmentsApi.md +1 -1
  5. data/docs/Experiment.md +36 -0
  6. data/docs/ExperimentCollectionRep.md +1 -1
  7. data/docs/ExperimentExpandableProperties.md +20 -0
  8. data/docs/ExperimentInfoRep.md +1 -1
  9. data/docs/ExperimentsBetaApi.md +12 -12
  10. data/docs/FeatureFlagsApi.md +1 -1
  11. data/docs/FeatureFlagsBetaApi.md +2 -2
  12. data/docs/IterationExpandableProperties.md +1 -1
  13. data/docs/IterationRep.md +4 -2
  14. data/docs/{ExperimentRep.md → LegacyExperimentRep.md} +2 -2
  15. data/docs/MetricRep.md +43 -3
  16. data/docs/MetricV2Rep.md +22 -0
  17. data/docs/OtherApi.md +1 -1
  18. data/docs/StatisticsRep.md +20 -0
  19. data/docs/TeamsBetaApi.md +9 -9
  20. data/docs/TreatmentRep.md +1 -1
  21. data/docs/UserRecord.md +1 -1
  22. data/docs/Users.md +1 -1
  23. data/docs/UsersApi.md +4 -4
  24. data/docs/UsersRep.md +22 -0
  25. data/lib/launchdarkly_api/api/account_members_api.rb +6 -6
  26. data/lib/launchdarkly_api/api/environments_api.rb +2 -2
  27. data/lib/launchdarkly_api/api/experiments_beta_api.rb +9 -9
  28. data/lib/launchdarkly_api/api/feature_flags_api.rb +2 -2
  29. data/lib/launchdarkly_api/api/feature_flags_beta_api.rb +4 -4
  30. data/lib/launchdarkly_api/api/other_api.rb +2 -2
  31. data/lib/launchdarkly_api/api/teams_beta_api.rb +12 -12
  32. data/lib/launchdarkly_api/api/users_api.rb +3 -3
  33. data/lib/launchdarkly_api/models/experiment.rb +328 -0
  34. data/lib/launchdarkly_api/models/experiment_collection_rep.rb +1 -1
  35. data/lib/launchdarkly_api/models/{decimal.rb → experiment_expandable_properties.rb} +18 -17
  36. data/lib/launchdarkly_api/models/experiment_info_rep.rb +1 -1
  37. data/lib/launchdarkly_api/models/iteration_expandable_properties.rb +1 -1
  38. data/lib/launchdarkly_api/models/iteration_rep.rb +12 -3
  39. data/lib/launchdarkly_api/models/{experiment_rep.rb → legacy_experiment_rep.rb} +3 -3
  40. data/lib/launchdarkly_api/models/metric_rep.rb +256 -4
  41. data/lib/launchdarkly_api/models/metric_v2_rep.rb +253 -0
  42. data/lib/launchdarkly_api/models/{null_decimal.rb → statistics_rep.rb} +20 -16
  43. data/lib/launchdarkly_api/models/treatment_rep.rb +1 -1
  44. data/lib/launchdarkly_api/models/users_rep.rb +250 -0
  45. data/lib/launchdarkly_api/version.rb +1 -1
  46. data/lib/launchdarkly_api.rb +6 -3
  47. data/spec/api/account_members_api_spec.rb +3 -3
  48. data/spec/api/environments_api_spec.rb +1 -1
  49. data/spec/api/experiments_beta_api_spec.rb +3 -3
  50. data/spec/api/feature_flags_api_spec.rb +1 -1
  51. data/spec/api/feature_flags_beta_api_spec.rb +2 -2
  52. data/spec/api/other_api_spec.rb +1 -1
  53. data/spec/api/teams_beta_api_spec.rb +6 -6
  54. data/spec/api/users_api_spec.rb +1 -1
  55. data/spec/models/{decimal_spec.rb → experiment_expandable_properties_spec.rb} +8 -8
  56. data/spec/models/experiment_spec.rb +88 -0
  57. data/spec/models/iteration_rep_spec.rb +6 -0
  58. data/spec/models/{experiment_rep_spec.rb → legacy_experiment_rep_spec.rb} +6 -6
  59. data/spec/models/metric_rep_spec.rb +128 -0
  60. data/spec/models/metric_v2_rep_spec.rb +46 -0
  61. data/spec/models/{null_decimal_spec.rb → statistics_rep_spec.rb} +8 -8
  62. data/spec/models/users_rep_spec.rb +46 -0
  63. metadata +26 -14
  64. data/docs/Decimal.md +0 -20
  65. data/docs/NullDecimal.md +0 -20
data/docs/TeamsBetaApi.md CHANGED
@@ -11,7 +11,7 @@ All URIs are relative to *https://app.launchdarkly.com*
11
11
  | [**get_teams**](TeamsBetaApi.md#get_teams) | **GET** /api/v2/teams | List teams |
12
12
  | [**patch_team**](TeamsBetaApi.md#patch_team) | **PATCH** /api/v2/teams/{teamKey} | Update team |
13
13
  | [**post_team**](TeamsBetaApi.md#post_team) | **POST** /api/v2/teams | Create team |
14
- | [**post_team_members**](TeamsBetaApi.md#post_team_members) | **POST** /api/v2/teams/{teamKey}/members | Add members to team |
14
+ | [**post_team_members**](TeamsBetaApi.md#post_team_members) | **POST** /api/v2/teams/{teamKey}/members | Add multiple members to team |
15
15
 
16
16
 
17
17
  ## delete_team
@@ -20,7 +20,7 @@ All URIs are relative to *https://app.launchdarkly.com*
20
20
 
21
21
  Delete team
22
22
 
23
- Delete a team by key
23
+ Delete a team by key. To learn more, read [Deleting a team](https://docs.launchdarkly.com/home/teams/managing#deleting-a-team).
24
24
 
25
25
  ### Examples
26
26
 
@@ -161,7 +161,7 @@ end
161
161
 
162
162
  Get team maintainers
163
163
 
164
- Fetch the maintainers that have been assigned to the team.
164
+ Fetch the maintainers that have been assigned to the team. To learn more, read [Managing team maintainers](https://docs.launchdarkly.com/home/teams/managing#managing-team-maintainers).
165
165
 
166
166
  ### Examples
167
167
 
@@ -238,7 +238,7 @@ end
238
238
 
239
239
  Get team custom roles
240
240
 
241
- Fetch the custom roles that have been assigned to the team.
241
+ Fetch the custom roles that have been assigned to the team. To learn more, read [Managing team permissions](https://docs.launchdarkly.com/home/teams/managing#managing-team-permissions).
242
242
 
243
243
  ### Examples
244
244
 
@@ -465,7 +465,7 @@ end
465
465
 
466
466
  Create team
467
467
 
468
- Create a team
468
+ Create a team. To learn more, read [Creating a team](https://docs.launchdarkly.com/home/teams/creating).
469
469
 
470
470
  ### Examples
471
471
 
@@ -534,9 +534,9 @@ end
534
534
 
535
535
  > <TeamImportsRep> post_team_members(team_key, opts)
536
536
 
537
- Add members to team
537
+ Add multiple members to team
538
538
 
539
- Add multiple members to an existing team by uploading a CSV file of member email addresses. Your CSV file must include email addresses in the first column. You can include data in additional columns, but LaunchDarkly ignores all data outside the first column. Headers are optional. **Members are only added on a `201` response.** A `207` indicates the CSV file contains a combination of valid and invalid entries and will _not_ result in any members being added to the team. On a `207` response, if an entry contains bad user input the `message` field will contain the row number as well as the reason for the error. The `message` field will be omitted if the entry is valid. Example `207` response: ```json { \"items\": [ { \"status\": \"success\", \"value\": \"a-valid-email@launchdarkly.com\" }, { \"message\": \"Line 2: empty row\", \"status\": \"error\", \"value\": \"\" }, { \"message\": \"Line 3: email already exists in the specified team\", \"status\": \"error\", \"value\": \"existing-team-member@launchdarkly.com\" }, { \"message\": \"Line 4: invalid email formatting\", \"status\": \"error\", \"value\": \"invalid email format\" } ] } ``` Message | Resolution --- | --- Empty row | This line is blank. Add an email address and try again. Duplicate entry | This email address appears in the file twice. Remove the email from the file and try again. Email already exists in the specified team | This member is already on your team. Remove the email from the file and try again. Invalid formatting | This email address is not formatted correctly. Fix the formatting and try again. Email does not belong to a LaunchDarkly member | The email address doesn't belong to a LaunchDarkly account member. Invite them to LaunchDarkly, then re-add them to the team. On a `400` response, the `message` field may contain errors specific to this endpoint. Example `400` response: ```json { \"code\": \"invalid_request\", \"message\": \"Unable to process file\" } ``` Message | Resolution --- | --- Unable to process file | LaunchDarkly could not process the file for an unspecified reason. Review your file for errors and try again. File exceeds 25mb | Break up your file into multiple files of less than 25mbs each. All emails have invalid formatting | None of the email addresses in the file are in the correct format. Fix the formatting and try again. All emails belong to existing team members | All listed members are already on this team. Populate the file with member emails that do not belong to the team and try again. File is empty | The CSV file does not contain any email addresses. Populate the file and try again. No emails belong to members of your LaunchDarkly organization | None of the email addresses belong to members of your LaunchDarkly account. Invite these members to LaunchDarkly, then re-add them to the team.
539
+ Add multiple members to an existing team by uploading a CSV file of member email addresses. Your CSV file must include email addresses in the first column. You can include data in additional columns, but LaunchDarkly ignores all data outside the first column. Headers are optional. To learn more, read [Managing team members](https://docs.launchdarkly.com/home/teams/managing#managing-team-members). **Members are only added on a `201` response.** A `207` indicates the CSV file contains a combination of valid and invalid entries and will _not_ result in any members being added to the team. On a `207` response, if an entry contains bad user input the `message` field will contain the row number as well as the reason for the error. The `message` field will be omitted if the entry is valid. Example `207` response: ```json { \"items\": [ { \"status\": \"success\", \"value\": \"a-valid-email@launchdarkly.com\" }, { \"message\": \"Line 2: empty row\", \"status\": \"error\", \"value\": \"\" }, { \"message\": \"Line 3: email already exists in the specified team\", \"status\": \"error\", \"value\": \"existing-team-member@launchdarkly.com\" }, { \"message\": \"Line 4: invalid email formatting\", \"status\": \"error\", \"value\": \"invalid email format\" } ] } ``` Message | Resolution --- | --- Empty row | This line is blank. Add an email address and try again. Duplicate entry | This email address appears in the file twice. Remove the email from the file and try again. Email already exists in the specified team | This member is already on your team. Remove the email from the file and try again. Invalid formatting | This email address is not formatted correctly. Fix the formatting and try again. Email does not belong to a LaunchDarkly member | The email address doesn't belong to a LaunchDarkly account member. Invite them to LaunchDarkly, then re-add them to the team. On a `400` response, the `message` field may contain errors specific to this endpoint. Example `400` response: ```json { \"code\": \"invalid_request\", \"message\": \"Unable to process file\" } ``` Message | Resolution --- | --- Unable to process file | LaunchDarkly could not process the file for an unspecified reason. Review your file for errors and try again. File exceeds 25mb | Break up your file into multiple files of less than 25mbs each. All emails have invalid formatting | None of the email addresses in the file are in the correct format. Fix the formatting and try again. All emails belong to existing team members | All listed members are already on this team. Populate the file with member emails that do not belong to the team and try again. File is empty | The CSV file does not contain any email addresses. Populate the file and try again. No emails belong to members of your LaunchDarkly organization | None of the email addresses belong to members of your LaunchDarkly account. Invite these members to LaunchDarkly, then re-add them to the team.
540
540
 
541
541
  ### Examples
542
542
 
@@ -558,7 +558,7 @@ opts = {
558
558
  }
559
559
 
560
560
  begin
561
- # Add members to team
561
+ # Add multiple members to team
562
562
  result = api_instance.post_team_members(team_key, opts)
563
563
  p result
564
564
  rescue LaunchDarklyApi::ApiError => e
@@ -574,7 +574,7 @@ This returns an Array which contains the response data, status code and headers.
574
574
 
575
575
  ```ruby
576
576
  begin
577
- # Add members to team
577
+ # Add multiple members to team
578
578
  data, status_code, headers = api_instance.post_team_members_with_http_info(team_key, opts)
579
579
  p status_code # => 2xx
580
580
  p headers # => { ... }
data/docs/TreatmentRep.md CHANGED
@@ -6,7 +6,7 @@
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **_id** | **String** | | [optional] |
8
8
  | **name** | **String** | | |
9
- | **allocation_percent** | [**NullDecimal**](NullDecimal.md) | | |
9
+ | **allocation_percent** | **String** | | |
10
10
  | **baseline** | **Boolean** | | [optional] |
11
11
  | **parameters** | [**Array&lt;ParameterRep&gt;**](ParameterRep.md) | | [optional] |
12
12
 
data/docs/UserRecord.md CHANGED
@@ -23,7 +23,7 @@ instance = LaunchDarklyApi::UserRecord.new(
23
23
  owner_id: null,
24
24
  user: null,
25
25
  sort_value: null,
26
- _links: null,
26
+ _links: {&quot;parent&quot;:{&quot;href&quot;:&quot;/api/v2/users/my-project/my-environment&quot;,&quot;type&quot;:&quot;application/json&quot;},&quot;self&quot;:{&quot;href&quot;:&quot;/api/v2/users/my-project/my-environment/my-user&quot;,&quot;type&quot;:&quot;application/json&quot;},&quot;settings&quot;:{&quot;href&quot;:&quot;/api/v2/users/my-project/my-environment/my-user/flags&quot;,&quot;type&quot;:&quot;text/html&quot;},&quot;site&quot;:{&quot;href&quot;:&quot;/my-project/my-environment/users/my-user&quot;,&quot;type&quot;:&quot;text/html&quot;}},
27
27
  _access: null
28
28
  )
29
29
  ```
data/docs/Users.md CHANGED
@@ -14,7 +14,7 @@
14
14
  require 'launchdarkly_api'
15
15
 
16
16
  instance = LaunchDarklyApi::Users.new(
17
- _links: null,
17
+ _links: {&quot;next&quot;:{&quot;href&quot;:&quot;/api/v2/user-search/my-project/my-environment?after&#x3D;1647993600000&amp;limit&#x3D;20&amp;searchAfter&#x3D;my-user&amp;sort&#x3D;userKey&quot;,&quot;type&quot;:&quot;application/json&quot;},&quot;self&quot;:{&quot;href&quot;:&quot;/api/v2/user-search/my-project/my-environment?after&#x3D;1647993600000&amp;limit&#x3D;20&amp;sort&#x3D;userKey&quot;,&quot;type&quot;:&quot;application/json&quot;}},
18
18
  total_count: null,
19
19
  items: null
20
20
  )
data/docs/UsersApi.md CHANGED
@@ -250,7 +250,7 @@ end
250
250
 
251
251
  ## get_users
252
252
 
253
- > <Users> get_users(project_key, environment_key, opts)
253
+ > <UsersRep> get_users(project_key, environment_key, opts)
254
254
 
255
255
  List users
256
256
 
@@ -290,7 +290,7 @@ end
290
290
 
291
291
  This returns an Array which contains the response data, status code and headers.
292
292
 
293
- > <Array(<Users>, Integer, Hash)> get_users_with_http_info(project_key, environment_key, opts)
293
+ > <Array(<UsersRep>, Integer, Hash)> get_users_with_http_info(project_key, environment_key, opts)
294
294
 
295
295
  ```ruby
296
296
  begin
@@ -298,7 +298,7 @@ begin
298
298
  data, status_code, headers = api_instance.get_users_with_http_info(project_key, environment_key, opts)
299
299
  p status_code # => 2xx
300
300
  p headers # => { ... }
301
- p data # => <Users>
301
+ p data # => <UsersRep>
302
302
  rescue LaunchDarklyApi::ApiError => e
303
303
  puts "Error when calling UsersApi->get_users_with_http_info: #{e}"
304
304
  end
@@ -315,7 +315,7 @@ end
315
315
 
316
316
  ### Return type
317
317
 
318
- [**Users**](Users.md)
318
+ [**UsersRep**](UsersRep.md)
319
319
 
320
320
  ### Authorization
321
321
 
data/docs/UsersRep.md ADDED
@@ -0,0 +1,22 @@
1
+ # LaunchDarklyApi::UsersRep
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **_links** | [**Hash&lt;String, Link&gt;**](Link.md) | | [optional] |
8
+ | **total_count** | **Integer** | | |
9
+ | **items** | [**Array&lt;UserRecord&gt;**](UserRecord.md) | | |
10
+
11
+ ## Example
12
+
13
+ ```ruby
14
+ require 'launchdarkly_api'
15
+
16
+ instance = LaunchDarklyApi::UsersRep.new(
17
+ _links: {&quot;next&quot;:{&quot;href&quot;:&quot;/api/v2/users/my-project/my-environment?after&#x3D;1647993600000&amp;limit&#x3D;20&amp;searchAfter&#x3D;my-user&quot;,&quot;type&quot;:&quot;application/json&quot;},&quot;self&quot;:{&quot;href&quot;:&quot;/api/v2/users/my-project/my-environment?after&#x3D;1647993600000&amp;limit&#x3D;20&quot;,&quot;type&quot;:&quot;application/json&quot;}},
18
+ total_count: null,
19
+ items: null
20
+ )
21
+ ```
22
+
@@ -83,7 +83,7 @@ module LaunchDarklyApi
83
83
  end
84
84
 
85
85
  # Get account member
86
- # Get a single account member by ID
86
+ # Get a single account member by ID. `me` is a reserved value for the `id` parameter and returns the caller's member information.
87
87
  # @param id [String] The member ID
88
88
  # @param [Hash] opts the optional parameters
89
89
  # @return [Member]
@@ -93,7 +93,7 @@ module LaunchDarklyApi
93
93
  end
94
94
 
95
95
  # Get account member
96
- # Get a single account member by ID
96
+ # Get a single account member by ID. &#x60;me&#x60; is a reserved value for the &#x60;id&#x60; parameter and returns the caller&#39;s member information.
97
97
  # @param id [String] The member ID
98
98
  # @param [Hash] opts the optional parameters
99
99
  # @return [Array<(Member, Integer, Hash)>] Member data, response status code and response headers
@@ -288,8 +288,8 @@ module LaunchDarklyApi
288
288
  return data, status_code, headers
289
289
  end
290
290
 
291
- # Add member to teams
292
- # Add member to team(s)
291
+ # Add a member to teams
292
+ # Add one member to one or more teams.
293
293
  # @param id [String] The member ID
294
294
  # @param member_teams_post_input [MemberTeamsPostInput]
295
295
  # @param [Hash] opts the optional parameters
@@ -299,8 +299,8 @@ module LaunchDarklyApi
299
299
  data
300
300
  end
301
301
 
302
- # Add member to teams
303
- # Add member to team(s)
302
+ # Add a member to teams
303
+ # Add one member to one or more teams.
304
304
  # @param id [String] The member ID
305
305
  # @param member_teams_post_input [MemberTeamsPostInput]
306
306
  # @param [Hash] opts the optional parameters
@@ -158,7 +158,7 @@ module LaunchDarklyApi
158
158
  end
159
159
 
160
160
  # Update environment
161
- # Update an environment. Requires a [JSON Patch](https://datatracker.ietf.org/doc/html/rfc6902) representation of the desired changes to the environment. To update fields in the environment object that are arrays, set the `path` to the name of the field and then append `/<array index>`. Using `/0` appends to the beginning of the array. ### Approval settings This request only returns the `approvalSettings` key if the [Flag Approvals](https://docs.launchdarkly.com/home/feature-workflows/approvals) feature is enabled. Only the `canReviewOwnRequest`, `canApplyDeclinedChanges`, `minNumApprovals`, `required` and `requiredApprovalTagsfields` are editable. If you try to patch the environment by setting both `required` and `requiredApprovalTags`, the request fails and an error appears. You can specify either required approvals for all flags in an environment or those with specific tags, but not both. Only customers on a Pro or Enterprise plan can require approval for flag updates by either mechanism.
161
+ # Update an environment. Requires a [JSON Patch](https://datatracker.ietf.org/doc/html/rfc6902) representation of the desired changes to the environment. To update fields in the environment object that are arrays, set the `path` to the name of the field and then append `/<array index>`. Using `/0` appends to the beginning of the array. ### Approval settings This request only returns the `approvalSettings` key if the [Flag Approvals](https://docs.launchdarkly.com/home/feature-workflows/approvals) feature is enabled. Only the `canReviewOwnRequest`, `canApplyDeclinedChanges`, `minNumApprovals`, `required` and `requiredApprovalTagsfields` are editable. If you try to patch the environment by setting both `required` and `requiredApprovalTags`, the request fails and an error appears. You can specify either required approvals for all flags in an environment or those with specific tags, but not both.
162
162
  # @param project_key [String] The project key
163
163
  # @param environment_key [String] The environment key
164
164
  # @param patch_operation [Array<PatchOperation>]
@@ -170,7 +170,7 @@ module LaunchDarklyApi
170
170
  end
171
171
 
172
172
  # Update environment
173
- # Update an environment. Requires a [JSON Patch](https://datatracker.ietf.org/doc/html/rfc6902) representation of the desired changes to the environment. To update fields in the environment object that are arrays, set the &#x60;path&#x60; to the name of the field and then append &#x60;/&lt;array index&gt;&#x60;. Using &#x60;/0&#x60; appends to the beginning of the array. ### Approval settings This request only returns the &#x60;approvalSettings&#x60; key if the [Flag Approvals](https://docs.launchdarkly.com/home/feature-workflows/approvals) feature is enabled. Only the &#x60;canReviewOwnRequest&#x60;, &#x60;canApplyDeclinedChanges&#x60;, &#x60;minNumApprovals&#x60;, &#x60;required&#x60; and &#x60;requiredApprovalTagsfields&#x60; are editable. If you try to patch the environment by setting both &#x60;required&#x60; and &#x60;requiredApprovalTags&#x60;, the request fails and an error appears. You can specify either required approvals for all flags in an environment or those with specific tags, but not both. Only customers on a Pro or Enterprise plan can require approval for flag updates by either mechanism.
173
+ # Update an environment. Requires a [JSON Patch](https://datatracker.ietf.org/doc/html/rfc6902) representation of the desired changes to the environment. To update fields in the environment object that are arrays, set the &#x60;path&#x60; to the name of the field and then append &#x60;/&lt;array index&gt;&#x60;. Using &#x60;/0&#x60; appends to the beginning of the array. ### Approval settings This request only returns the &#x60;approvalSettings&#x60; key if the [Flag Approvals](https://docs.launchdarkly.com/home/feature-workflows/approvals) feature is enabled. Only the &#x60;canReviewOwnRequest&#x60;, &#x60;canApplyDeclinedChanges&#x60;, &#x60;minNumApprovals&#x60;, &#x60;required&#x60; and &#x60;requiredApprovalTagsfields&#x60; are editable. If you try to patch the environment by setting both &#x60;required&#x60; and &#x60;requiredApprovalTags&#x60;, the request fails and an error appears. You can specify either required approvals for all flags in an environment or those with specific tags, but not both.
174
174
  # @param project_key [String] The project key
175
175
  # @param environment_key [String] The environment key
176
176
  # @param patch_operation [Array<PatchOperation>]
@@ -25,7 +25,7 @@ module LaunchDarklyApi
25
25
  # @param environment_key [String] The environment key
26
26
  # @param experiment_post [ExperimentPost]
27
27
  # @param [Hash] opts the optional parameters
28
- # @return [ExperimentRep]
28
+ # @return [Experiment]
29
29
  def create_experiment(project_key, environment_key, experiment_post, opts = {})
30
30
  data, _status_code, _headers = create_experiment_with_http_info(project_key, environment_key, experiment_post, opts)
31
31
  data
@@ -37,7 +37,7 @@ module LaunchDarklyApi
37
37
  # @param environment_key [String] The environment key
38
38
  # @param experiment_post [ExperimentPost]
39
39
  # @param [Hash] opts the optional parameters
40
- # @return [Array<(ExperimentRep, Integer, Hash)>] ExperimentRep data, response status code and response headers
40
+ # @return [Array<(Experiment, Integer, Hash)>] Experiment data, response status code and response headers
41
41
  def create_experiment_with_http_info(project_key, environment_key, experiment_post, opts = {})
42
42
  if @api_client.config.debugging
43
43
  @api_client.config.logger.debug 'Calling API: ExperimentsBetaApi.create_experiment ...'
@@ -77,7 +77,7 @@ module LaunchDarklyApi
77
77
  post_body = opts[:debug_body] || @api_client.object_to_http_body(experiment_post)
78
78
 
79
79
  # return_type
80
- return_type = opts[:debug_return_type] || 'ExperimentRep'
80
+ return_type = opts[:debug_return_type] || 'Experiment'
81
81
 
82
82
  # auth_names
83
83
  auth_names = opts[:debug_auth_names] || ['ApiKey']
@@ -191,7 +191,7 @@ module LaunchDarklyApi
191
191
  # @param environment_key [String] The environment key
192
192
  # @param experiment_key [String] The experiment key
193
193
  # @param [Hash] opts the optional parameters
194
- # @return [ExperimentRep]
194
+ # @return [Experiment]
195
195
  def get_experiment(project_key, environment_key, experiment_key, opts = {})
196
196
  data, _status_code, _headers = get_experiment_with_http_info(project_key, environment_key, experiment_key, opts)
197
197
  data
@@ -203,7 +203,7 @@ module LaunchDarklyApi
203
203
  # @param environment_key [String] The environment key
204
204
  # @param experiment_key [String] The experiment key
205
205
  # @param [Hash] opts the optional parameters
206
- # @return [Array<(ExperimentRep, Integer, Hash)>] ExperimentRep data, response status code and response headers
206
+ # @return [Array<(Experiment, Integer, Hash)>] Experiment data, response status code and response headers
207
207
  def get_experiment_with_http_info(project_key, environment_key, experiment_key, opts = {})
208
208
  if @api_client.config.debugging
209
209
  @api_client.config.logger.debug 'Calling API: ExperimentsBetaApi.get_experiment ...'
@@ -238,7 +238,7 @@ module LaunchDarklyApi
238
238
  post_body = opts[:debug_body]
239
239
 
240
240
  # return_type
241
- return_type = opts[:debug_return_type] || 'ExperimentRep'
241
+ return_type = opts[:debug_return_type] || 'Experiment'
242
242
 
243
243
  # auth_names
244
244
  auth_names = opts[:debug_auth_names] || ['ApiKey']
@@ -504,7 +504,7 @@ module LaunchDarklyApi
504
504
  # @param experiment_key [String] The experiment key
505
505
  # @param experiment_patch_input [ExperimentPatchInput]
506
506
  # @param [Hash] opts the optional parameters
507
- # @return [ExperimentRep]
507
+ # @return [Experiment]
508
508
  def patch_experiment(project_key, environment_key, experiment_key, experiment_patch_input, opts = {})
509
509
  data, _status_code, _headers = patch_experiment_with_http_info(project_key, environment_key, experiment_key, experiment_patch_input, opts)
510
510
  data
@@ -517,7 +517,7 @@ module LaunchDarklyApi
517
517
  # @param experiment_key [String] The experiment key
518
518
  # @param experiment_patch_input [ExperimentPatchInput]
519
519
  # @param [Hash] opts the optional parameters
520
- # @return [Array<(ExperimentRep, Integer, Hash)>] ExperimentRep data, response status code and response headers
520
+ # @return [Array<(Experiment, Integer, Hash)>] Experiment data, response status code and response headers
521
521
  def patch_experiment_with_http_info(project_key, environment_key, experiment_key, experiment_patch_input, opts = {})
522
522
  if @api_client.config.debugging
523
523
  @api_client.config.logger.debug 'Calling API: ExperimentsBetaApi.patch_experiment ...'
@@ -561,7 +561,7 @@ module LaunchDarklyApi
561
561
  post_body = opts[:debug_body] || @api_client.object_to_http_body(experiment_patch_input)
562
562
 
563
563
  # return_type
564
- return_type = opts[:debug_return_type] || 'ExperimentRep'
564
+ return_type = opts[:debug_return_type] || 'Experiment'
565
565
 
566
566
  # auth_names
567
567
  auth_names = opts[:debug_auth_names] || ['ApiKey']
@@ -708,7 +708,7 @@ module LaunchDarklyApi
708
708
  end
709
709
 
710
710
  # Update feature flag
711
- # Perform a partial update to a feature flag. ## 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 `400` response because your semantic patch will be interpreted as a JSON patch. Use this header: ``` Content-Type: application/json; domain-model=launchdarkly.semanticpatch ``` The body of a semantic patch request takes the following three properties: 1. `comment` (string): (Optional) A description of the update. 1. `environmentKey` (string): (Required) The key of the LaunchDarkly environment. 1. `instructions` (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 `kind` property that indicates the instruction. Depending on the `kind`, 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, `removeUserTargets` 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't correspond to a variation on the flag or a rule ID that doesn't belong to a rule on the flag. Other specific error conditions are noted in the instruction descriptions. ### Instructions #### `turnFlagOn` Sets the flag's targeting state to on. For example, to flip a flag on, use this request body: ```json { \"environmentKey\": \"example-environment-key\", \"instructions\": [ { \"kind\": \"turnFlagOn\" } ] } ``` #### `turnFlagOff` Sets the flag's targeting state to off. For example, to flip a flag off, use this request body: ```json { \"environmentKey\": \"example-environment-key\", \"instructions\": [ { \"kind\": \"turnFlagOff\" } ] } ``` #### `addUserTargets` Adds the user keys in `values` to the individual user targets for the variation specified by `variationId`. Returns an error if this causes the same user key to be targeted in multiple variations. ##### Parameters - `values`: list of user keys - `variationId`: ID of a variation on the flag #### `removeUserTargets` Removes the user keys in `values` to the individual user targets for the variation specified by `variationId`. Does nothing if the user keys are not targeted. ##### Parameters - `values`: list of user keys - `variationId`: ID of a variation on the flag #### `replaceUserTargets` Completely replaces the existing set of user targeting. All variations must be provided. Example: ```json { \"kind\": \"replaceUserTargets\", \"targets\": [ { \"variationId\": \"variation-1\", \"values\": [\"blah\", \"foo\", \"bar\"] }, { \"variationId\": \"variation-2\", \"values\": [\"abc\", \"def\"] } ] } ``` ##### Parameters - `targets`: a list of user targeting #### `clearUserTargets` Removes all individual user targets from the variation specified by `variationId` ##### Parameters - `variationId`: ID of a variation on the flag #### `addPrerequisite` Adds the flag indicated by `key` with variation `variationId` as a prerequisite to the flag. ##### Parameters - `key`: flag key of another flag - `variationId`: ID of a variation of the flag with key `key` #### `removePrerequisite` Removes the prerequisite indicated by `key`. Does nothing if this prerequisite does not exist. ##### Parameters - `key`: flag key of an existing prerequisite #### `updatePrerequisite` Changes the prerequisite with flag key `key` to the variation indicated by `variationId`. Returns an error if this prerequisite does not exist. ##### Parameters - `key`: flag key of an existing prerequisite - `variationId`: ID of a variation of the flag with key `key` #### `replacePrerequisites` Completely replaces the existing set of prerequisites for a given flag. Example: ```json { \"kind\": \"replacePrerequisites\", \"prerequisites\": [ { \"key\": \"flag-key\", \"variationId\": \"variation-1\" }, { \"key\": \"another-flag\", \"variationId\": \"variation-2\" } ] } ``` ##### Parameters - `prerequisites`: a list of prerequisites #### `addRule` Adds a new rule to the flag with the given `clauses` which serves the variation indicated by `variationId` or the percent rollout indicated by `rolloutWeights` and `rolloutBucketBy`. If `beforeRuleId` 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 - `clauses`: Array of clauses (see `addClauses`) - `beforeRuleId`: Optional ID of a rule in the flag - `variationId`: ID of a variation of the flag - `rolloutWeights`: Map of variationId to weight in thousandths of a percent (0-100000) - `rolloutBucketBy`: Optional user attribute #### `removeRule` Removes the targeting rule specified by `ruleId`. Does nothing if the rule does not exist. ##### Parameters - `ruleId`: ID of a rule in the flag #### `replaceRules` Completely replaces the existing rules for a given flag. Example: ```json { \"kind\": \"replaceRules\", \"rules\": [ { \"variationId\": \"variation-1\", \"description\": \"myRule\", \"clauses\": [ { \"attribute\": \"segmentMatch\", \"op\": \"segmentMatch\", \"values\": [\"test\"] } ], \"trackEvents\": true } ] } ``` ##### Parameters - `rules`: a list of rules #### `addClauses` Adds the given clauses to the rule indicated by `ruleId`. ##### Parameters - `ruleId`: ID of a rule in the flag - `clauses`: Array of clause objects, with `attribute` (string), `op` (string), and `values` (array of strings, numbers, or dates) properties. #### `removeClauses` Removes the clauses specified by `clauseIds` from the rule indicated by `ruleId`. #### Parameters - `ruleId`: ID of a rule in the flag - `clauseIds`: Array of IDs of clauses in the rule #### `updateClause` Replaces the clause indicated by `ruleId` and `clauseId` with `clause`. ##### Parameters - `ruleId`: ID of a rule in the flag - `clauseId`: ID of a clause in that rule - `clause`: Clause object #### `addValuesToClause` Adds `values` to the values of the clause indicated by `ruleId` and `clauseId`. ##### Parameters - `ruleId`: ID of a rule in the flag - `clauseId`: ID of a clause in that rule - `values`: Array of strings #### `removeValuesFromClause` Removes `values` from the values of the clause indicated by `ruleId` and `clauseId`. ##### Parameters `ruleId`: ID of a rule in the flag `clauseId`: ID of a clause in that rule `values`: Array of strings #### `reorderRules` Rearranges the rules to match the order given in `ruleIds`. Will return an error if `ruleIds` does not match the current set of rules on the flag. ##### Parameters - `ruleIds`: Array of IDs of all rules in the flag #### `updateRuleVariationOrRollout` Updates what the rule indicated by `ruleId` serves if its clauses evaluate to true. Can either be a fixed variation indicated by `variationId` or a percent rollout indicated by `rolloutWeights` and `rolloutBucketBy`. ##### Parameters - `ruleId`: ID of a rule in the flag - `variationId`: ID of a variation of the flag or - `rolloutWeights`: Map of variationId to weight in thousandths of a percent (0-100000) - `rolloutBucketBy`: Optional user attribute #### `updateFallthroughVariationOrRollout` Updates the flag's fallthrough, which is served if none of the targeting rules match. Can either be a fixed variation indicated by `variationId` or a percent rollout indicated by `rolloutWeights` and `rolloutBucketBy`. ##### Parameters `variationId`: ID of a variation of the flag or `rolloutWeights`: Map of variationId to weight in thousandths of a percent (0-100000) `rolloutBucketBy`: Optional user attribute #### `updateOffVariation` Updates the variation served when the flag's targeting is off to the variation indicated by `variationId`. ##### Parameters `variationId`: ID of a variation of the flag ### Example ```json { \"environmentKey\": \"production\", \"instructions\": [ { \"kind\": \"turnFlagOn\" }, { \"kind\": \"turnFlagOff\" }, { \"kind\": \"addUserTargets\", \"variationId\": \"8bfb304e-d516-47e5-8727-e7f798e8992d\", \"values\": [\"userId\", \"userId2\"] }, { \"kind\": \"removeUserTargets\", \"variationId\": \"8bfb304e-d516-47e5-8727-e7f798e8992d\", \"values\": [\"userId3\", \"userId4\"] }, { \"kind\": \"updateFallthroughVariationOrRollout\", \"rolloutWeights\": { \"variationId\": 50000, \"variationId2\": 50000 }, \"rolloutBucketBy\": null }, { \"kind\": \"addRule\", \"clauses\": [ { \"attribute\": \"segmentMatch\", \"negate\": false, \"values\": [\"test-segment\"] } ], \"variationId\": null, \"rolloutWeights\": { \"variationId\": 50000, \"variationId2\": 50000 }, \"rolloutBucketBy\": \"key\" }, { \"kind\": \"removeRule\", \"ruleId\": \"99f12464-a429-40fc-86cc-b27612188955\" }, { \"kind\": \"reorderRules\", \"ruleIds\": [\"2f72974e-de68-4243-8dd3-739582147a1f\", \"8bfb304e-d516-47e5-8727-e7f798e8992d\"] }, { \"kind\": \"addClauses\", \"ruleId\": \"1134\", \"clauses\": [ { \"attribute\": \"email\", \"op\": \"in\", \"negate\": false, \"values\": [\"test@test.com\"] } ] }, { \"kind\": \"removeClauses\", \"ruleId\": \"1242529\", \"clauseIds\": [\"8bfb304e-d516-47e5-8727-e7f798e8992d\"] }, { \"kind\": \"updateClause\", \"ruleId\": \"2f72974e-de68-4243-8dd3-739582147a1f\", \"clauseId\": \"309845\", \"clause\": { \"attribute\": \"segmentMatch\", \"negate\": false, \"values\": [\"test-segment\"] } }, { \"kind\": \"updateRuleVariationOrRollout\", \"ruleId\": \"2342\", \"rolloutWeights\": null, \"rolloutBucketBy\": null }, { \"kind\": \"updateOffVariation\", \"variationId\": \"3242453\" }, { \"kind\": \"addPrerequisite\", \"variationId\": \"234235\", \"key\": \"flagKey2\" }, { \"kind\": \"updatePrerequisite\", \"variationId\": \"234235\", \"key\": \"flagKey2\" }, { \"kind\": \"removePrerequisite\", \"key\": \"flagKey\" } ] } ``` ## 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). 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: ```json { \"op\": \"add\", \"path\": \"/environments/devint/targets/0/values/-\", \"value\": \"TestClient10\" } ``` If a flag variation does not already have users individually targeted, the path for the JSON Patch operation is: ```json [ { \"op\": \"add\", \"path\": \"/environments/devint/targets/-\", \"value\": { \"variation\": 0, \"values\": [\"TestClient10\"] } } ] ``` ## 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 required creating an [approval request](/tag/Approvals) or a [workflow](/tag/Workflows-(beta)). This behavior can be bypassed by users and access tokens that have a [custom role](https://docs.launchdarkly.com/home/members/custom-roles) with permission to perform the `bypassRequiredApproval` action on the flag. ## Conflicts If a flag configuration change made through this endpoint would cause a pending scheduled change or approval request to fail, this endpoint will return a 400. You can ignore this check by adding an `ignoreConflicts` query parameter set to `true`.
711
+ # Perform a partial update to a feature flag. ## 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 `400` response because your semantic patch will be interpreted as a JSON patch. Use this header: ``` Content-Type: application/json; domain-model=launchdarkly.semanticpatch ``` The body of a semantic patch request takes the following three properties: 1. `comment` (string): (Optional) A description of the update. 1. `environmentKey` (string): (Required) The key of the LaunchDarkly environment. 1. `instructions` (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 `kind` property that indicates the instruction. Depending on the `kind`, 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, `removeUserTargets` 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't correspond to a variation on the flag or a rule ID that doesn't belong to a rule on the flag. Other specific error conditions are noted in the instruction descriptions. ### Instructions #### `turnFlagOn` Sets the flag's targeting state to on. For example, to flip a flag on, use this request body: ```json { \"environmentKey\": \"example-environment-key\", \"instructions\": [ { \"kind\": \"turnFlagOn\" } ] } ``` #### `turnFlagOff` Sets the flag's targeting state to off. For example, to flip a flag off, use this request body: ```json { \"environmentKey\": \"example-environment-key\", \"instructions\": [ { \"kind\": \"turnFlagOff\" } ] } ``` #### `addUserTargets` Adds the user keys in `values` to the individual user targets for the variation specified by `variationId`. Returns an error if this causes the same user key to be targeted in multiple variations. ##### Parameters - `values`: list of user keys - `variationId`: ID of a variation on the flag #### `removeUserTargets` Removes the user keys in `values` to the individual user targets for the variation specified by `variationId`. Does nothing if the user keys are not targeted. ##### Parameters - `values`: list of user keys - `variationId`: ID of a variation on the flag #### `replaceUserTargets` Completely replaces the existing set of user targeting. All variations must be provided. Example: ```json { \"kind\": \"replaceUserTargets\", \"targets\": [ { \"variationId\": \"variation-1\", \"values\": [\"blah\", \"foo\", \"bar\"] }, { \"variationId\": \"variation-2\", \"values\": [\"abc\", \"def\"] } ] } ``` ##### Parameters - `targets`: a list of user targeting #### `clearUserTargets` Removes all individual user targets from the variation specified by `variationId` ##### Parameters - `variationId`: ID of a variation on the flag #### `addPrerequisite` Adds the flag indicated by `key` with variation `variationId` as a prerequisite to the flag. ##### Parameters - `key`: flag key of another flag - `variationId`: ID of a variation of the flag with key `key` #### `removePrerequisite` Removes the prerequisite indicated by `key`. Does nothing if this prerequisite does not exist. ##### Parameters - `key`: flag key of an existing prerequisite #### `updatePrerequisite` Changes the prerequisite with flag key `key` to the variation indicated by `variationId`. Returns an error if this prerequisite does not exist. ##### Parameters - `key`: flag key of an existing prerequisite - `variationId`: ID of a variation of the flag with key `key` #### `replacePrerequisites` Completely replaces the existing set of prerequisites for a given flag. Example: ```json { \"kind\": \"replacePrerequisites\", \"prerequisites\": [ { \"key\": \"flag-key\", \"variationId\": \"variation-1\" }, { \"key\": \"another-flag\", \"variationId\": \"variation-2\" } ] } ``` ##### Parameters - `prerequisites`: a list of prerequisites #### `addRule` Adds a new rule to the flag with the given `clauses` which serves the variation indicated by `variationId` or the percent rollout indicated by `rolloutWeights` and `rolloutBucketBy`. If `beforeRuleId` 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 - `clauses`: Array of clauses (see `addClauses`) - `beforeRuleId`: Optional ID of a rule in the flag - `variationId`: ID of a variation of the flag - `rolloutWeights`: Map of variationId to weight in thousandths of a percent (0-100000) - `rolloutBucketBy`: Optional user attribute #### `removeRule` Removes the targeting rule specified by `ruleId`. Does nothing if the rule does not exist. ##### Parameters - `ruleId`: ID of a rule in the flag #### `replaceRules` Completely replaces the existing rules for a given flag. Example: ```json { \"kind\": \"replaceRules\", \"rules\": [ { \"variationId\": \"variation-1\", \"description\": \"myRule\", \"clauses\": [ { \"attribute\": \"segmentMatch\", \"op\": \"segmentMatch\", \"values\": [\"test\"] } ], \"trackEvents\": true } ] } ``` ##### Parameters - `rules`: a list of rules #### `addClauses` Adds the given clauses to the rule indicated by `ruleId`. ##### Parameters - `ruleId`: ID of a rule in the flag - `clauses`: Array of clause objects, with `attribute` (string), `op` (string), and `values` (array of strings, numbers, or dates) properties. #### `removeClauses` Removes the clauses specified by `clauseIds` from the rule indicated by `ruleId`. #### Parameters - `ruleId`: ID of a rule in the flag - `clauseIds`: Array of IDs of clauses in the rule #### `updateClause` Replaces the clause indicated by `ruleId` and `clauseId` with `clause`. ##### Parameters - `ruleId`: ID of a rule in the flag - `clauseId`: ID of a clause in that rule - `clause`: Clause object #### `addValuesToClause` Adds `values` to the values of the clause indicated by `ruleId` and `clauseId`. ##### Parameters - `ruleId`: ID of a rule in the flag - `clauseId`: ID of a clause in that rule - `values`: Array of strings #### `removeValuesFromClause` Removes `values` from the values of the clause indicated by `ruleId` and `clauseId`. ##### Parameters `ruleId`: ID of a rule in the flag `clauseId`: ID of a clause in that rule `values`: Array of strings #### `reorderRules` Rearranges the rules to match the order given in `ruleIds`. Will return an error if `ruleIds` does not match the current set of rules on the flag. ##### Parameters - `ruleIds`: Array of IDs of all rules in the flag #### `updateRuleVariationOrRollout` Updates what the rule indicated by `ruleId` serves if its clauses evaluate to true. Can either be a fixed variation indicated by `variationId` or a percent rollout indicated by `rolloutWeights` and `rolloutBucketBy`. ##### Parameters - `ruleId`: ID of a rule in the flag - `variationId`: ID of a variation of the flag or - `rolloutWeights`: Map of variationId to weight in thousandths of a percent (0-100000) - `rolloutBucketBy`: Optional user attribute #### `updateFallthroughVariationOrRollout` Updates the flag's fallthrough, which is served if none of the targeting rules match. Can either be a fixed variation indicated by `variationId` or a percent rollout indicated by `rolloutWeights` and `rolloutBucketBy`. ##### Parameters `variationId`: ID of a variation of the flag or `rolloutWeights`: Map of variationId to weight in thousandths of a percent (0-100000) `rolloutBucketBy`: Optional user attribute #### `updateOffVariation` Updates the variation served when the flag's targeting is off to the variation indicated by `variationId`. ##### Parameters `variationId`: ID of a variation of the flag ### Example ```json { \"environmentKey\": \"production\", \"instructions\": [ { \"kind\": \"turnFlagOn\" }, { \"kind\": \"turnFlagOff\" }, { \"kind\": \"addUserTargets\", \"variationId\": \"8bfb304e-d516-47e5-8727-e7f798e8992d\", \"values\": [\"userId\", \"userId2\"] }, { \"kind\": \"removeUserTargets\", \"variationId\": \"8bfb304e-d516-47e5-8727-e7f798e8992d\", \"values\": [\"userId3\", \"userId4\"] }, { \"kind\": \"updateFallthroughVariationOrRollout\", \"rolloutWeights\": { \"variationId\": 50000, \"variationId2\": 50000 }, \"rolloutBucketBy\": null }, { \"kind\": \"addRule\", \"clauses\": [ { \"attribute\": \"segmentMatch\", \"negate\": false, \"values\": [\"test-segment\"] } ], \"variationId\": null, \"rolloutWeights\": { \"variationId\": 50000, \"variationId2\": 50000 }, \"rolloutBucketBy\": \"key\" }, { \"kind\": \"removeRule\", \"ruleId\": \"99f12464-a429-40fc-86cc-b27612188955\" }, { \"kind\": \"reorderRules\", \"ruleIds\": [\"2f72974e-de68-4243-8dd3-739582147a1f\", \"8bfb304e-d516-47e5-8727-e7f798e8992d\"] }, { \"kind\": \"addClauses\", \"ruleId\": \"1134\", \"clauses\": [ { \"attribute\": \"email\", \"op\": \"in\", \"negate\": false, \"values\": [\"test@test.com\"] } ] }, { \"kind\": \"removeClauses\", \"ruleId\": \"1242529\", \"clauseIds\": [\"8bfb304e-d516-47e5-8727-e7f798e8992d\"] }, { \"kind\": \"updateClause\", \"ruleId\": \"2f72974e-de68-4243-8dd3-739582147a1f\", \"clauseId\": \"309845\", \"clause\": { \"attribute\": \"segmentMatch\", \"negate\": false, \"values\": [\"test-segment\"] } }, { \"kind\": \"updateRuleVariationOrRollout\", \"ruleId\": \"2342\", \"rolloutWeights\": null, \"rolloutBucketBy\": null }, { \"kind\": \"updateOffVariation\", \"variationId\": \"3242453\" }, { \"kind\": \"addPrerequisite\", \"variationId\": \"234235\", \"key\": \"flagKey2\" }, { \"kind\": \"updatePrerequisite\", \"variationId\": \"234235\", \"key\": \"flagKey2\" }, { \"kind\": \"removePrerequisite\", \"key\": \"flagKey\" } ] } ``` ## 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). 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: ```json { \"op\": \"add\", \"path\": \"/environments/devint/targets/0/values/-\", \"value\": \"TestClient10\" } ``` If a flag variation does not already have users individually targeted, the path for the JSON Patch operation is: ```json [ { \"op\": \"add\", \"path\": \"/environments/devint/targets/-\", \"value\": { \"variation\": 0, \"values\": [\"TestClient10\"] } } ] ``` ## 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 required 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 `ignoreConflicts` query parameter set to `true`.
712
712
  # @param project_key [String] The project key
713
713
  # @param feature_flag_key [String] The feature flag key. The key identifies the flag in your code.
714
714
  # @param patch_with_comment [PatchWithComment]
@@ -720,7 +720,7 @@ module LaunchDarklyApi
720
720
  end
721
721
 
722
722
  # Update feature flag
723
- # Perform a partial update to a feature flag. ## 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). 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 required creating an [approval request](/tag/Approvals) or a [workflow](/tag/Workflows-(beta)). This behavior can be bypassed by users and access tokens that have a [custom role](https://docs.launchdarkly.com/home/members/custom-roles) with permission to perform the &#x60;bypassRequiredApproval&#x60; action on the flag. ## 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;.
723
+ # Perform a partial update to a feature flag. ## 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). 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 required 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;.
724
724
  # @param project_key [String] The project key
725
725
  # @param feature_flag_key [String] The feature flag key. The key identifies the flag in your code.
726
726
  # @param patch_with_comment [PatchWithComment]
@@ -20,7 +20,7 @@ module LaunchDarklyApi
20
20
  @api_client = api_client
21
21
  end
22
22
  # List dependent feature flags
23
- # List dependent flags across all environments for the flag specified in the path parameters. A dependent flag is a flag that uses another flag as a prerequisite.
23
+ # > ### Flag prerequisites is an Enterprise feature > > Flag prerequisites is available to customers on an Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/). > ### 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). List dependent flags across all environments for the flag specified in the path parameters. A dependent flag is a flag that uses another flag as a prerequisite. To learn more, read [Flag prerequisites](https://docs.launchdarkly.com/home/flags/prerequisites).
24
24
  # @param project_key [String] The project key
25
25
  # @param feature_flag_key [String] The feature flag key
26
26
  # @param [Hash] opts the optional parameters
@@ -31,7 +31,7 @@ module LaunchDarklyApi
31
31
  end
32
32
 
33
33
  # List dependent feature flags
34
- # List dependent flags across all environments for the flag specified in the path parameters. A dependent flag is a flag that uses another flag as a prerequisite.
34
+ # &gt; ### Flag prerequisites is an Enterprise feature &gt; &gt; Flag prerequisites is available to customers on an Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/). &gt; ### This feature is in beta &gt; &gt; To use this feature, pass in a header including the &#x60;LD-API-Version&#x60; key with value set to &#x60;beta&#x60;. Use this header with each call. To learn more, read [Beta resources](/#section/Overview/Beta-resources). List dependent flags across all environments for the flag specified in the path parameters. A dependent flag is a flag that uses another flag as a prerequisite. To learn more, read [Flag prerequisites](https://docs.launchdarkly.com/home/flags/prerequisites).
35
35
  # @param project_key [String] The project key
36
36
  # @param feature_flag_key [String] The feature flag key
37
37
  # @param [Hash] opts the optional parameters
@@ -89,7 +89,7 @@ module LaunchDarklyApi
89
89
  end
90
90
 
91
91
  # List dependent feature flags by environment
92
- # List dependent flags across all environments for the flag specified in the path parameters. A dependent flag is a flag that uses another flag as a prerequisite.
92
+ # > ### Flag prerequisites is an Enterprise feature > > Flag prerequisites is available to customers on an Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/). > ### 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). List dependent flags across all environments for the flag specified in the path parameters. A dependent flag is a flag that uses another flag as a prerequisite. To learn more, read [Flag prerequisites](https://docs.launchdarkly.com/home/flags/prerequisites).
93
93
  # @param project_key [String] The project key
94
94
  # @param environment_key [String] The environment key
95
95
  # @param feature_flag_key [String] The feature flag key
@@ -101,7 +101,7 @@ module LaunchDarklyApi
101
101
  end
102
102
 
103
103
  # List dependent feature flags by environment
104
- # List dependent flags across all environments for the flag specified in the path parameters. A dependent flag is a flag that uses another flag as a prerequisite.
104
+ # &gt; ### Flag prerequisites is an Enterprise feature &gt; &gt; Flag prerequisites is available to customers on an Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/). &gt; ### This feature is in beta &gt; &gt; To use this feature, pass in a header including the &#x60;LD-API-Version&#x60; key with value set to &#x60;beta&#x60;. Use this header with each call. To learn more, read [Beta resources](/#section/Overview/Beta-resources). List dependent flags across all environments for the flag specified in the path parameters. A dependent flag is a flag that uses another flag as a prerequisite. To learn more, read [Flag prerequisites](https://docs.launchdarkly.com/home/flags/prerequisites).
105
105
  # @param project_key [String] The project key
106
106
  # @param environment_key [String] The environment key
107
107
  # @param feature_flag_key [String] The feature flag key
@@ -20,7 +20,7 @@ module LaunchDarklyApi
20
20
  @api_client = api_client
21
21
  end
22
22
  # Gets the public IP list
23
- # Get a list of IP ranges the LaunchDarkly service uses. You can use this list to allow LaunchDarkly through your firewall.<br /><br />This endpoint returns a JSON object with two attributes: `addresses` and `outboundAddresses`. The `addresses` element contains the IP addresses LaunchDarkly's service uses. The `outboundAddresses` element contains the IP addresses outgoing webhook notifications use.<br /><br />We post upcoming changes to this list in advance on our [status page](https://status.launchdarkly.com/).
23
+ # Get a list of IP ranges the LaunchDarkly service uses. You can use this list to allow LaunchDarkly through your firewall.<br /><br />This endpoint returns a JSON object with two attributes: `addresses` and `outboundAddresses`. The `addresses` element contains the IP addresses LaunchDarkly's service uses. The `outboundAddresses` element contains the IP addresses outgoing webhook notifications use. To learn more, read [Public IP list](https://docs.launchdarkly.com/home/advanced/public-ip-list).<br /><br />We post upcoming changes to this list in advance on our [status page](https://status.launchdarkly.com/).
24
24
  # @param [Hash] opts the optional parameters
25
25
  # @return [IpList]
26
26
  def get_ips(opts = {})
@@ -29,7 +29,7 @@ module LaunchDarklyApi
29
29
  end
30
30
 
31
31
  # Gets the public IP list
32
- # Get a list of IP ranges the LaunchDarkly service uses. You can use this list to allow LaunchDarkly through your firewall.&lt;br /&gt;&lt;br /&gt;This endpoint returns a JSON object with two attributes: &#x60;addresses&#x60; and &#x60;outboundAddresses&#x60;. The &#x60;addresses&#x60; element contains the IP addresses LaunchDarkly&#39;s service uses. The &#x60;outboundAddresses&#x60; element contains the IP addresses outgoing webhook notifications use.&lt;br /&gt;&lt;br /&gt;We post upcoming changes to this list in advance on our [status page](https://status.launchdarkly.com/).
32
+ # Get a list of IP ranges the LaunchDarkly service uses. You can use this list to allow LaunchDarkly through your firewall.&lt;br /&gt;&lt;br /&gt;This endpoint returns a JSON object with two attributes: &#x60;addresses&#x60; and &#x60;outboundAddresses&#x60;. The &#x60;addresses&#x60; element contains the IP addresses LaunchDarkly&#39;s service uses. The &#x60;outboundAddresses&#x60; element contains the IP addresses outgoing webhook notifications use. To learn more, read [Public IP list](https://docs.launchdarkly.com/home/advanced/public-ip-list).&lt;br /&gt;&lt;br /&gt;We post upcoming changes to this list in advance on our [status page](https://status.launchdarkly.com/).
33
33
  # @param [Hash] opts the optional parameters
34
34
  # @return [Array<(IpList, Integer, Hash)>] IpList data, response status code and response headers
35
35
  def get_ips_with_http_info(opts = {})