launchdarkly_api 25.1.1 → 25.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +18 -4
  3. data/docs/AIConfigTargetingEnvironmentRule.md +2 -0
  4. data/docs/AgentControlApi.md +3 -1
  5. data/docs/AssignmentDataSourceInput.md +24 -0
  6. data/docs/AuditLogApi.md +2 -0
  7. data/docs/Experiment.md +2 -0
  8. data/docs/ExperimentsApi.md +1 -1
  9. data/docs/IntegrationDeliveryConfiguration.md +3 -1
  10. data/docs/IntegrationDeliveryConfigurationStatus.md +26 -0
  11. data/docs/IntegrationsBetaApi.md +4 -4
  12. data/docs/IterationAssignmentDataSourceRep.md +26 -0
  13. data/docs/IterationInput.md +3 -1
  14. data/docs/IterationRep.md +4 -2
  15. data/docs/PatchSegmentScheduledChangeInput.md +20 -0
  16. data/docs/PostSegmentScheduledChangeInput.md +22 -0
  17. data/docs/SegmentScheduledChange.md +34 -0
  18. data/docs/SegmentScheduledChangeStatus.md +15 -0
  19. data/docs/SegmentScheduledChanges.md +20 -0
  20. data/docs/SegmentScheduledChangesLink.md +20 -0
  21. data/docs/SegmentsApi.md +389 -0
  22. data/docs/TreatmentInput.md +3 -1
  23. data/docs/TreatmentRep.md +3 -1
  24. data/docs/Webhook.md +2 -0
  25. data/docs/WebhookPost.md +2 -0
  26. data/lib/launchdarkly_api/api/agent_control_api.rb +3 -0
  27. data/lib/launchdarkly_api/api/audit_log_api.rb +3 -0
  28. data/lib/launchdarkly_api/api/experiments_api.rb +2 -2
  29. data/lib/launchdarkly_api/api/integrations_beta_api.rb +8 -8
  30. data/lib/launchdarkly_api/api/segments_api.rb +415 -0
  31. data/lib/launchdarkly_api/models/ai_config_targeting_environment_rule.rb +28 -1
  32. data/lib/launchdarkly_api/models/assignment_data_source_input.rb +193 -0
  33. data/lib/launchdarkly_api/models/experiment.rb +23 -1
  34. data/lib/launchdarkly_api/models/integration_delivery_configuration.rb +13 -4
  35. data/lib/launchdarkly_api/models/integration_delivery_configuration_status.rb +222 -0
  36. data/lib/launchdarkly_api/models/iteration_assignment_data_source_rep.rb +237 -0
  37. data/lib/launchdarkly_api/models/iteration_input.rb +11 -2
  38. data/lib/launchdarkly_api/models/iteration_rep.rb +14 -5
  39. data/lib/launchdarkly_api/models/patch_segment_scheduled_change_input.rb +157 -0
  40. data/lib/launchdarkly_api/models/post_segment_scheduled_change_input.rb +203 -0
  41. data/lib/launchdarkly_api/models/segment_scheduled_change.rb +353 -0
  42. data/lib/launchdarkly_api/models/segment_scheduled_change_status.rb +41 -0
  43. data/lib/launchdarkly_api/models/segment_scheduled_changes.rb +196 -0
  44. data/lib/launchdarkly_api/models/segment_scheduled_changes_link.rb +156 -0
  45. data/lib/launchdarkly_api/models/treatment_input.rb +14 -4
  46. data/lib/launchdarkly_api/models/treatment_rep.rb +14 -4
  47. data/lib/launchdarkly_api/models/webhook.rb +11 -1
  48. data/lib/launchdarkly_api/models/webhook_post.rb +11 -1
  49. data/lib/launchdarkly_api/version.rb +1 -1
  50. data/lib/launchdarkly_api.rb +9 -0
  51. data/spec/api/agent_control_api_spec.rb +1 -0
  52. data/spec/api/audit_log_api_spec.rb +1 -0
  53. data/spec/api/experiments_api_spec.rb +1 -1
  54. data/spec/api/integrations_beta_api_spec.rb +4 -4
  55. data/spec/api/segments_api_spec.rb +75 -0
  56. data/spec/models/ai_config_targeting_environment_rule_spec.rb +6 -0
  57. data/spec/models/assignment_data_source_input_spec.rb +54 -0
  58. data/spec/models/experiment_spec.rb +10 -0
  59. data/spec/models/integration_delivery_configuration_spec.rb +6 -0
  60. data/spec/models/integration_delivery_configuration_status_spec.rb +60 -0
  61. data/spec/models/iteration_assignment_data_source_rep_spec.rb +60 -0
  62. data/spec/models/iteration_input_spec.rb +6 -0
  63. data/spec/models/iteration_rep_spec.rb +6 -0
  64. data/spec/models/patch_segment_scheduled_change_input_spec.rb +42 -0
  65. data/spec/models/post_segment_scheduled_change_input_spec.rb +48 -0
  66. data/spec/models/segment_scheduled_change_spec.rb +84 -0
  67. data/spec/models/segment_scheduled_change_status_spec.rb +30 -0
  68. data/spec/models/segment_scheduled_changes_link_spec.rb +42 -0
  69. data/spec/models/segment_scheduled_changes_spec.rb +42 -0
  70. data/spec/models/treatment_input_spec.rb +6 -0
  71. data/spec/models/treatment_rep_spec.rb +6 -0
  72. data/spec/models/webhook_post_spec.rb +6 -0
  73. data/spec/models/webhook_spec.rb +6 -0
  74. metadata +758 -725
@@ -20,7 +20,7 @@ module LaunchDarklyApi
20
20
  @api_client = api_client
21
21
  end
22
22
  # Create integration configuration
23
- # Create a new integration configuration. (Excludes [persistent store](https://launchdarkly.com/docs/api/persistent-store-integrations-beta) and [flag import configurations](https://launchdarkly.com/docs/api/flag-import-configurations-beta).)
23
+ # Create a new integration configuration. This endpoint does not include persistent store integrations or flag import configurations. To manage those, use the [persistent store](https://launchdarkly.com/docs/api/persistent-store-integrations-beta) and [flag import configuration](https://launchdarkly.com/docs/api/flag-import-configurations-beta) endpoints.
24
24
  # @param integration_key [String] The integration key
25
25
  # @param integration_configuration_post [IntegrationConfigurationPost]
26
26
  # @param [Hash] opts the optional parameters
@@ -31,7 +31,7 @@ module LaunchDarklyApi
31
31
  end
32
32
 
33
33
  # Create integration configuration
34
- # Create a new integration configuration. (Excludes [persistent store](https://launchdarkly.com/docs/api/persistent-store-integrations-beta) and [flag import configurations](https://launchdarkly.com/docs/api/flag-import-configurations-beta).)
34
+ # Create a new integration configuration. This endpoint does not include persistent store integrations or flag import configurations. To manage those, use the [persistent store](https://launchdarkly.com/docs/api/persistent-store-integrations-beta) and [flag import configuration](https://launchdarkly.com/docs/api/flag-import-configurations-beta) endpoints.
35
35
  # @param integration_key [String] The integration key
36
36
  # @param integration_configuration_post [IntegrationConfigurationPost]
37
37
  # @param [Hash] opts the optional parameters
@@ -94,7 +94,7 @@ module LaunchDarklyApi
94
94
  end
95
95
 
96
96
  # Delete integration configuration
97
- # Delete an integration configuration by ID. (Excludes [persistent store](https://launchdarkly.com/docs/api/persistent-store-integrations-beta) and [flag import configurations](https://launchdarkly.com/docs/api/flag-import-configurations-beta).)
97
+ # Delete an integration configuration by ID. This endpoint does not include persistent store integrations or flag import configurations. To manage those, use the [persistent store](https://launchdarkly.com/docs/api/persistent-store-integrations-beta) and [flag import configuration](https://launchdarkly.com/docs/api/flag-import-configurations-beta) endpoints.
98
98
  # @param integration_configuration_id [String] The ID of the integration configuration to be deleted
99
99
  # @param [Hash] opts the optional parameters
100
100
  # @return [nil]
@@ -104,7 +104,7 @@ module LaunchDarklyApi
104
104
  end
105
105
 
106
106
  # Delete integration configuration
107
- # Delete an integration configuration by ID. (Excludes [persistent store](https://launchdarkly.com/docs/api/persistent-store-integrations-beta) and [flag import configurations](https://launchdarkly.com/docs/api/flag-import-configurations-beta).)
107
+ # Delete an integration configuration by ID. This endpoint does not include persistent store integrations or flag import configurations. To manage those, use the [persistent store](https://launchdarkly.com/docs/api/persistent-store-integrations-beta) and [flag import configuration](https://launchdarkly.com/docs/api/flag-import-configurations-beta) endpoints.
108
108
  # @param integration_configuration_id [String] The ID of the integration configuration to be deleted
109
109
  # @param [Hash] opts the optional parameters
110
110
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
@@ -157,7 +157,7 @@ module LaunchDarklyApi
157
157
  end
158
158
 
159
159
  # Get all configurations for the integration
160
- # Get all integration configurations with the specified integration key. (Excludes [persistent store](https://launchdarkly.com/docs/api/persistent-store-integrations-beta) and [flag import configurations](https://launchdarkly.com/docs/api/flag-import-configurations-beta).).
160
+ # Get all integration configurations with the specified integration key. This endpoint does not include persistent store integrations or flag import configurations. To manage those, use the [persistent store](https://launchdarkly.com/docs/api/persistent-store-integrations-beta) and [flag import configuration](https://launchdarkly.com/docs/api/flag-import-configurations-beta) endpoints.
161
161
  # @param integration_key [String] A key that corresponds to the third-party integration you are configuring. For example, &#x60;mezmo&#x60;.
162
162
  # @param [Hash] opts the optional parameters
163
163
  # @option opts [Boolean] :include_pending When &#x60;true&#x60;, includes pending two-step setup drafts that were created using &#x60;/setup&#x60; but are not yet finalized. Defaults to &#x60;false&#x60;, which returns only active configurations.
@@ -168,7 +168,7 @@ module LaunchDarklyApi
168
168
  end
169
169
 
170
170
  # Get all configurations for the integration
171
- # Get all integration configurations with the specified integration key. (Excludes [persistent store](https://launchdarkly.com/docs/api/persistent-store-integrations-beta) and [flag import configurations](https://launchdarkly.com/docs/api/flag-import-configurations-beta).).
171
+ # Get all integration configurations with the specified integration key. This endpoint does not include persistent store integrations or flag import configurations. To manage those, use the [persistent store](https://launchdarkly.com/docs/api/persistent-store-integrations-beta) and [flag import configuration](https://launchdarkly.com/docs/api/flag-import-configurations-beta) endpoints.
172
172
  # @param integration_key [String] A key that corresponds to the third-party integration you are configuring. For example, &#x60;mezmo&#x60;.
173
173
  # @param [Hash] opts the optional parameters
174
174
  # @option opts [Boolean] :include_pending When &#x60;true&#x60;, includes pending two-step setup drafts that were created using &#x60;/setup&#x60; but are not yet finalized. Defaults to &#x60;false&#x60;, which returns only active configurations.
@@ -223,7 +223,7 @@ module LaunchDarklyApi
223
223
  end
224
224
 
225
225
  # Get an integration configuration
226
- # Get integration configuration with the specified ID. (Excludes [persistent store](https://launchdarkly.com/docs/api/persistent-store-integrations-beta) and [flag import configurations](https://launchdarkly.com/docs/api/flag-import-configurations-beta).)
226
+ # Get integration configuration with the specified ID. This endpoint does not include persistent store integrations or flag import configurations. To manage those, use the [persistent store](https://launchdarkly.com/docs/api/persistent-store-integrations-beta) and [flag import configuration](https://launchdarkly.com/docs/api/flag-import-configurations-beta) endpoints.
227
227
  # @param integration_configuration_id [String] Integration configuration ID
228
228
  # @param [Hash] opts the optional parameters
229
229
  # @return [IntegrationConfigurationsRep]
@@ -233,7 +233,7 @@ module LaunchDarklyApi
233
233
  end
234
234
 
235
235
  # Get an integration configuration
236
- # Get integration configuration with the specified ID. (Excludes [persistent store](https://launchdarkly.com/docs/api/persistent-store-integrations-beta) and [flag import configurations](https://launchdarkly.com/docs/api/flag-import-configurations-beta).)
236
+ # Get integration configuration with the specified ID. This endpoint does not include persistent store integrations or flag import configurations. To manage those, use the [persistent store](https://launchdarkly.com/docs/api/persistent-store-integrations-beta) and [flag import configuration](https://launchdarkly.com/docs/api/flag-import-configurations-beta) endpoints.
237
237
  # @param integration_configuration_id [String] Integration configuration ID
238
238
  # @param [Hash] opts the optional parameters
239
239
  # @return [Array<(IntegrationConfigurationsRep, Integer, Hash)>] IntegrationConfigurationsRep data, response status code and response headers
@@ -258,6 +258,87 @@ module LaunchDarklyApi
258
258
  return data, status_code, headers
259
259
  end
260
260
 
261
+ # Delete a scheduled change for a segment
262
+ # Delete a scheduled change before its execution date, so that its instructions are never applied to the segment. Deleting a change with a `failed` status removes it from the segment's scheduled changes. Its instructions were not applied. The caller must be allowed to update scheduled changes on the segment. If an approval request scheduled the change, deleting the change also terminates that request, so it cannot be applied again. Declining the request is only an option while it is still awaiting review. Once it is applied, its instructions belong to a scheduled change, and this endpoint is how to stop them. Returns 409 if the scheduled change is already being applied or has already run.
263
+ # @param project_key [String]
264
+ # @param environment_key [String]
265
+ # @param segment_key [String]
266
+ # @param id [String] The ID of the scheduled change
267
+ # @param [Hash] opts the optional parameters
268
+ # @return [nil]
269
+ def delete_segment_scheduled_change(project_key, environment_key, segment_key, id, opts = {})
270
+ delete_segment_scheduled_change_with_http_info(project_key, environment_key, segment_key, id, opts)
271
+ nil
272
+ end
273
+
274
+ # Delete a scheduled change for a segment
275
+ # Delete a scheduled change before its execution date, so that its instructions are never applied to the segment. Deleting a change with a &#x60;failed&#x60; status removes it from the segment&#39;s scheduled changes. Its instructions were not applied. The caller must be allowed to update scheduled changes on the segment. If an approval request scheduled the change, deleting the change also terminates that request, so it cannot be applied again. Declining the request is only an option while it is still awaiting review. Once it is applied, its instructions belong to a scheduled change, and this endpoint is how to stop them. Returns 409 if the scheduled change is already being applied or has already run.
276
+ # @param project_key [String]
277
+ # @param environment_key [String]
278
+ # @param segment_key [String]
279
+ # @param id [String] The ID of the scheduled change
280
+ # @param [Hash] opts the optional parameters
281
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
282
+ def delete_segment_scheduled_change_with_http_info(project_key, environment_key, segment_key, id, opts = {})
283
+ if @api_client.config.debugging
284
+ @api_client.config.logger.debug 'Calling API: SegmentsApi.delete_segment_scheduled_change ...'
285
+ end
286
+ # verify the required parameter 'project_key' is set
287
+ if @api_client.config.client_side_validation && project_key.nil?
288
+ fail ArgumentError, "Missing the required parameter 'project_key' when calling SegmentsApi.delete_segment_scheduled_change"
289
+ end
290
+ # verify the required parameter 'environment_key' is set
291
+ if @api_client.config.client_side_validation && environment_key.nil?
292
+ fail ArgumentError, "Missing the required parameter 'environment_key' when calling SegmentsApi.delete_segment_scheduled_change"
293
+ end
294
+ # verify the required parameter 'segment_key' is set
295
+ if @api_client.config.client_side_validation && segment_key.nil?
296
+ fail ArgumentError, "Missing the required parameter 'segment_key' when calling SegmentsApi.delete_segment_scheduled_change"
297
+ end
298
+ # verify the required parameter 'id' is set
299
+ if @api_client.config.client_side_validation && id.nil?
300
+ fail ArgumentError, "Missing the required parameter 'id' when calling SegmentsApi.delete_segment_scheduled_change"
301
+ end
302
+ # resource path
303
+ local_var_path = '/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/scheduled-changes/{id}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)).sub('{' + 'segmentKey' + '}', CGI.escape(segment_key.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
304
+
305
+ # query parameters
306
+ query_params = opts[:query_params] || {}
307
+
308
+ # header parameters
309
+ header_params = opts[:header_params] || {}
310
+ # HTTP header 'Accept' (if needed)
311
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
312
+
313
+ # form parameters
314
+ form_params = opts[:form_params] || {}
315
+
316
+ # http body (model)
317
+ post_body = opts[:debug_body]
318
+
319
+ # return_type
320
+ return_type = opts[:debug_return_type]
321
+
322
+ # auth_names
323
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
324
+
325
+ new_options = opts.merge(
326
+ :operation => :"SegmentsApi.delete_segment_scheduled_change",
327
+ :header_params => header_params,
328
+ :query_params => query_params,
329
+ :form_params => form_params,
330
+ :body => post_body,
331
+ :auth_names => auth_names,
332
+ :return_type => return_type
333
+ )
334
+
335
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
336
+ if @api_client.config.debugging
337
+ @api_client.config.logger.debug "API called: SegmentsApi#delete_segment_scheduled_change\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
338
+ end
339
+ return data, status_code, headers
340
+ end
341
+
261
342
  # Get big segment export
262
343
  # Returns information about a big segment export process. This is an export for a synced segment or a list-based segment that can include more than 15,000 entries.
263
344
  # @param project_key [String] The project key
@@ -887,6 +968,162 @@ module LaunchDarklyApi
887
968
  return data, status_code, headers
888
969
  end
889
970
 
971
+ # Get a scheduled change for a segment
972
+ # Get one scheduled change that has not been applied yet, or that failed to apply. Returns 404 if the ID is not a scheduled change for the segment in the path. The caller must be allowed to view the segment's project.
973
+ # @param project_key [String]
974
+ # @param environment_key [String]
975
+ # @param segment_key [String]
976
+ # @param id [String] The ID of the scheduled change
977
+ # @param [Hash] opts the optional parameters
978
+ # @return [SegmentScheduledChange]
979
+ def get_segment_scheduled_change(project_key, environment_key, segment_key, id, opts = {})
980
+ data, _status_code, _headers = get_segment_scheduled_change_with_http_info(project_key, environment_key, segment_key, id, opts)
981
+ data
982
+ end
983
+
984
+ # Get a scheduled change for a segment
985
+ # Get one scheduled change that has not been applied yet, or that failed to apply. Returns 404 if the ID is not a scheduled change for the segment in the path. The caller must be allowed to view the segment&#39;s project.
986
+ # @param project_key [String]
987
+ # @param environment_key [String]
988
+ # @param segment_key [String]
989
+ # @param id [String] The ID of the scheduled change
990
+ # @param [Hash] opts the optional parameters
991
+ # @return [Array<(SegmentScheduledChange, Integer, Hash)>] SegmentScheduledChange data, response status code and response headers
992
+ def get_segment_scheduled_change_with_http_info(project_key, environment_key, segment_key, id, opts = {})
993
+ if @api_client.config.debugging
994
+ @api_client.config.logger.debug 'Calling API: SegmentsApi.get_segment_scheduled_change ...'
995
+ end
996
+ # verify the required parameter 'project_key' is set
997
+ if @api_client.config.client_side_validation && project_key.nil?
998
+ fail ArgumentError, "Missing the required parameter 'project_key' when calling SegmentsApi.get_segment_scheduled_change"
999
+ end
1000
+ # verify the required parameter 'environment_key' is set
1001
+ if @api_client.config.client_side_validation && environment_key.nil?
1002
+ fail ArgumentError, "Missing the required parameter 'environment_key' when calling SegmentsApi.get_segment_scheduled_change"
1003
+ end
1004
+ # verify the required parameter 'segment_key' is set
1005
+ if @api_client.config.client_side_validation && segment_key.nil?
1006
+ fail ArgumentError, "Missing the required parameter 'segment_key' when calling SegmentsApi.get_segment_scheduled_change"
1007
+ end
1008
+ # verify the required parameter 'id' is set
1009
+ if @api_client.config.client_side_validation && id.nil?
1010
+ fail ArgumentError, "Missing the required parameter 'id' when calling SegmentsApi.get_segment_scheduled_change"
1011
+ end
1012
+ # resource path
1013
+ local_var_path = '/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/scheduled-changes/{id}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)).sub('{' + 'segmentKey' + '}', CGI.escape(segment_key.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
1014
+
1015
+ # query parameters
1016
+ query_params = opts[:query_params] || {}
1017
+
1018
+ # header parameters
1019
+ header_params = opts[:header_params] || {}
1020
+ # HTTP header 'Accept' (if needed)
1021
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1022
+
1023
+ # form parameters
1024
+ form_params = opts[:form_params] || {}
1025
+
1026
+ # http body (model)
1027
+ post_body = opts[:debug_body]
1028
+
1029
+ # return_type
1030
+ return_type = opts[:debug_return_type] || 'SegmentScheduledChange'
1031
+
1032
+ # auth_names
1033
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
1034
+
1035
+ new_options = opts.merge(
1036
+ :operation => :"SegmentsApi.get_segment_scheduled_change",
1037
+ :header_params => header_params,
1038
+ :query_params => query_params,
1039
+ :form_params => form_params,
1040
+ :body => post_body,
1041
+ :auth_names => auth_names,
1042
+ :return_type => return_type
1043
+ )
1044
+
1045
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1046
+ if @api_client.config.debugging
1047
+ @api_client.config.logger.debug "API called: SegmentsApi#get_segment_scheduled_change\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1048
+ end
1049
+ return data, status_code, headers
1050
+ end
1051
+
1052
+ # List scheduled changes for a segment
1053
+ # Get every scheduled change for a segment that has not been applied yet, plus any that failed to apply, soonest first. Use the `status` of each change to tell them apart. The caller must be allowed to view the segment's project.
1054
+ # @param project_key [String]
1055
+ # @param environment_key [String]
1056
+ # @param segment_key [String]
1057
+ # @param [Hash] opts the optional parameters
1058
+ # @return [SegmentScheduledChanges]
1059
+ def get_segment_scheduled_changes(project_key, environment_key, segment_key, opts = {})
1060
+ data, _status_code, _headers = get_segment_scheduled_changes_with_http_info(project_key, environment_key, segment_key, opts)
1061
+ data
1062
+ end
1063
+
1064
+ # List scheduled changes for a segment
1065
+ # Get every scheduled change for a segment that has not been applied yet, plus any that failed to apply, soonest first. Use the &#x60;status&#x60; of each change to tell them apart. The caller must be allowed to view the segment&#39;s project.
1066
+ # @param project_key [String]
1067
+ # @param environment_key [String]
1068
+ # @param segment_key [String]
1069
+ # @param [Hash] opts the optional parameters
1070
+ # @return [Array<(SegmentScheduledChanges, Integer, Hash)>] SegmentScheduledChanges data, response status code and response headers
1071
+ def get_segment_scheduled_changes_with_http_info(project_key, environment_key, segment_key, opts = {})
1072
+ if @api_client.config.debugging
1073
+ @api_client.config.logger.debug 'Calling API: SegmentsApi.get_segment_scheduled_changes ...'
1074
+ end
1075
+ # verify the required parameter 'project_key' is set
1076
+ if @api_client.config.client_side_validation && project_key.nil?
1077
+ fail ArgumentError, "Missing the required parameter 'project_key' when calling SegmentsApi.get_segment_scheduled_changes"
1078
+ end
1079
+ # verify the required parameter 'environment_key' is set
1080
+ if @api_client.config.client_side_validation && environment_key.nil?
1081
+ fail ArgumentError, "Missing the required parameter 'environment_key' when calling SegmentsApi.get_segment_scheduled_changes"
1082
+ end
1083
+ # verify the required parameter 'segment_key' is set
1084
+ if @api_client.config.client_side_validation && segment_key.nil?
1085
+ fail ArgumentError, "Missing the required parameter 'segment_key' when calling SegmentsApi.get_segment_scheduled_changes"
1086
+ end
1087
+ # resource path
1088
+ local_var_path = '/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/scheduled-changes'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)).sub('{' + 'segmentKey' + '}', CGI.escape(segment_key.to_s))
1089
+
1090
+ # query parameters
1091
+ query_params = opts[:query_params] || {}
1092
+
1093
+ # header parameters
1094
+ header_params = opts[:header_params] || {}
1095
+ # HTTP header 'Accept' (if needed)
1096
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1097
+
1098
+ # form parameters
1099
+ form_params = opts[:form_params] || {}
1100
+
1101
+ # http body (model)
1102
+ post_body = opts[:debug_body]
1103
+
1104
+ # return_type
1105
+ return_type = opts[:debug_return_type] || 'SegmentScheduledChanges'
1106
+
1107
+ # auth_names
1108
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
1109
+
1110
+ new_options = opts.merge(
1111
+ :operation => :"SegmentsApi.get_segment_scheduled_changes",
1112
+ :header_params => header_params,
1113
+ :query_params => query_params,
1114
+ :form_params => form_params,
1115
+ :body => post_body,
1116
+ :auth_names => auth_names,
1117
+ :return_type => return_type
1118
+ )
1119
+
1120
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1121
+ if @api_client.config.debugging
1122
+ @api_client.config.logger.debug "API called: SegmentsApi#get_segment_scheduled_changes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1123
+ end
1124
+ return data, status_code, headers
1125
+ end
1126
+
890
1127
  # List segments
891
1128
  # Get a list of all segments in the given project. Segments can be rule-based, list-based, or synced. Big segments include larger list-based segments and synced segments. Some fields in the response only apply to big segments. ### Filtering segments The `filter` parameter supports the following operators: `equals`, `anyOf`, and `exists`. You can also combine filters in the following ways: - Use a comma (`,`) as an AND operator - Use a vertical bar (`|`) as an OR operator - Use parentheses (`()`) to group filters #### Supported fields and operators You can only filter certain fields in segments when using the `filter` parameter. Additionally, you can only filter some fields with certain operators. When you search for segments, the `filter` parameter supports the following fields and operators: |<div style=\"width:120px\">Field</div> |Description |Supported operators | |---|---|---| | `excludedKeys` | The segment keys of segments to exclude from the results. | `anyOf` | | `external` | Whether the segment is a synced segment. | `exists` | | `includedKeys` | The segment keys of segments to include in the results. | `anyOf` | | `query` | A \"fuzzy\" search across segment key, name, and description. Supply a string or list of strings to the operator. | `equals` | | `tags` | The segment tags. | `anyOf` | | `unbounded` | Whether the segment is a standard segment (`false`) or a big segment (`true`). Standard segments include rule-based segments and smaller list-based segments. Big segments include larger list-based segments and synced segments. | `equals` | Here are a few examples: * The filter `?filter=tags anyOf [\"enterprise\", \"beta\"],query equals \"toggle\"` matches segments with \"toggle\" in their key, name, or description that also have \"enterprise\" or \"beta\" as a tag. * The filter `?filter=excludedKeys anyOf [\"segmentKey1\", \"segmentKey2\"]` excludes the segments with those keys from the results. * The filter `?filter=unbounded equals true` matches larger list-based segments and synced segments. The documented values for `filter` query parameters are prior to URL encoding. For example, the `[` in `?filter=tags anyOf [\"enterprise\", \"beta\"]` must be encoded to `%5B`.
892
1129
  # @param project_key [String] The project key
@@ -1229,6 +1466,98 @@ module LaunchDarklyApi
1229
1466
  return data, status_code, headers
1230
1467
  end
1231
1468
 
1469
+ # Update a scheduled change for a segment
1470
+ # Edit the execution date and/or the comment of a scheduled change that has not been applied yet. A field you leave out is unchanged, and an empty comment clears the comment. The caller must be allowed to update scheduled changes on the segment, and must also be allowed to make the change's instructions directly. If the segment requires approvals, the caller must also be allowed to bypass them. Returns 409 if the scheduled change is already being applied or was changed by someone else in the meantime.
1471
+ # @param project_key [String]
1472
+ # @param environment_key [String]
1473
+ # @param segment_key [String]
1474
+ # @param id [String] The ID of the scheduled change
1475
+ # @param patch_segment_scheduled_change_input [PatchSegmentScheduledChangeInput]
1476
+ # @param [Hash] opts the optional parameters
1477
+ # @return [SegmentScheduledChange]
1478
+ def patch_segment_scheduled_change(project_key, environment_key, segment_key, id, patch_segment_scheduled_change_input, opts = {})
1479
+ data, _status_code, _headers = patch_segment_scheduled_change_with_http_info(project_key, environment_key, segment_key, id, patch_segment_scheduled_change_input, opts)
1480
+ data
1481
+ end
1482
+
1483
+ # Update a scheduled change for a segment
1484
+ # Edit the execution date and/or the comment of a scheduled change that has not been applied yet. A field you leave out is unchanged, and an empty comment clears the comment. The caller must be allowed to update scheduled changes on the segment, and must also be allowed to make the change&#39;s instructions directly. If the segment requires approvals, the caller must also be allowed to bypass them. Returns 409 if the scheduled change is already being applied or was changed by someone else in the meantime.
1485
+ # @param project_key [String]
1486
+ # @param environment_key [String]
1487
+ # @param segment_key [String]
1488
+ # @param id [String] The ID of the scheduled change
1489
+ # @param patch_segment_scheduled_change_input [PatchSegmentScheduledChangeInput]
1490
+ # @param [Hash] opts the optional parameters
1491
+ # @return [Array<(SegmentScheduledChange, Integer, Hash)>] SegmentScheduledChange data, response status code and response headers
1492
+ def patch_segment_scheduled_change_with_http_info(project_key, environment_key, segment_key, id, patch_segment_scheduled_change_input, opts = {})
1493
+ if @api_client.config.debugging
1494
+ @api_client.config.logger.debug 'Calling API: SegmentsApi.patch_segment_scheduled_change ...'
1495
+ end
1496
+ # verify the required parameter 'project_key' is set
1497
+ if @api_client.config.client_side_validation && project_key.nil?
1498
+ fail ArgumentError, "Missing the required parameter 'project_key' when calling SegmentsApi.patch_segment_scheduled_change"
1499
+ end
1500
+ # verify the required parameter 'environment_key' is set
1501
+ if @api_client.config.client_side_validation && environment_key.nil?
1502
+ fail ArgumentError, "Missing the required parameter 'environment_key' when calling SegmentsApi.patch_segment_scheduled_change"
1503
+ end
1504
+ # verify the required parameter 'segment_key' is set
1505
+ if @api_client.config.client_side_validation && segment_key.nil?
1506
+ fail ArgumentError, "Missing the required parameter 'segment_key' when calling SegmentsApi.patch_segment_scheduled_change"
1507
+ end
1508
+ # verify the required parameter 'id' is set
1509
+ if @api_client.config.client_side_validation && id.nil?
1510
+ fail ArgumentError, "Missing the required parameter 'id' when calling SegmentsApi.patch_segment_scheduled_change"
1511
+ end
1512
+ # verify the required parameter 'patch_segment_scheduled_change_input' is set
1513
+ if @api_client.config.client_side_validation && patch_segment_scheduled_change_input.nil?
1514
+ fail ArgumentError, "Missing the required parameter 'patch_segment_scheduled_change_input' when calling SegmentsApi.patch_segment_scheduled_change"
1515
+ end
1516
+ # resource path
1517
+ local_var_path = '/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/scheduled-changes/{id}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)).sub('{' + 'segmentKey' + '}', CGI.escape(segment_key.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
1518
+
1519
+ # query parameters
1520
+ query_params = opts[:query_params] || {}
1521
+
1522
+ # header parameters
1523
+ header_params = opts[:header_params] || {}
1524
+ # HTTP header 'Accept' (if needed)
1525
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1526
+ # HTTP header 'Content-Type'
1527
+ content_type = @api_client.select_header_content_type(['application/json'])
1528
+ if !content_type.nil?
1529
+ header_params['Content-Type'] = content_type
1530
+ end
1531
+
1532
+ # form parameters
1533
+ form_params = opts[:form_params] || {}
1534
+
1535
+ # http body (model)
1536
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(patch_segment_scheduled_change_input)
1537
+
1538
+ # return_type
1539
+ return_type = opts[:debug_return_type] || 'SegmentScheduledChange'
1540
+
1541
+ # auth_names
1542
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
1543
+
1544
+ new_options = opts.merge(
1545
+ :operation => :"SegmentsApi.patch_segment_scheduled_change",
1546
+ :header_params => header_params,
1547
+ :query_params => query_params,
1548
+ :form_params => form_params,
1549
+ :body => post_body,
1550
+ :auth_names => auth_names,
1551
+ :return_type => return_type
1552
+ )
1553
+
1554
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
1555
+ if @api_client.config.debugging
1556
+ @api_client.config.logger.debug "API called: SegmentsApi#patch_segment_scheduled_change\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1557
+ end
1558
+ return data, status_code, headers
1559
+ end
1560
+
1232
1561
  # Create segment
1233
1562
  # Create a new segment. The new segment has no individual targets or rules. The request body only accepts the fields documented below. If you include targeting fields such as `included`, `excluded`, `includedContexts`, `excludedContexts`, or `rules`, LaunchDarkly ignores them and does not return an error. These fields are empty in the response. To add individual targets or rules after you create the segment, use [Update segment](https://launchdarkly.com/docs/api/segments/patch-segment) with a semantic patch. For example, use the `addIncludedTargets` or `addExcludedTargets` instruction to add individual targets, and the `addRule` instruction to add a rule. For big segments, use the `addBigSegmentIncludedTargets` or `addBigSegmentExcludedTargets` instruction.
1234
1563
  # @param project_key [String] The project key
@@ -1309,6 +1638,92 @@ module LaunchDarklyApi
1309
1638
  return data, status_code, headers
1310
1639
  end
1311
1640
 
1641
+ # Create a scheduled change for a segment
1642
+ # Schedule semantic patch instructions to be applied to a segment at a future time. Each instruction uses the same format as an instruction in a semantic patch request to update a segment. Send between 1 and 100 instructions. LaunchDarkly rejects the request with a 400 if an instruction has an unknown `kind` or is malformed. The caller must be allowed to update scheduled changes on the segment, and must also be allowed to make each instruction's change directly. If the segment requires approvals for an instruction, the caller must also be allowed to bypass them. Otherwise, request the change through an approval request instead. To learn more about semantic patches, read [Updates](/reference#updates-using-semantic-patch).
1643
+ # @param project_key [String]
1644
+ # @param environment_key [String]
1645
+ # @param segment_key [String]
1646
+ # @param post_segment_scheduled_change_input [PostSegmentScheduledChangeInput]
1647
+ # @param [Hash] opts the optional parameters
1648
+ # @return [SegmentScheduledChange]
1649
+ def post_segment_scheduled_change(project_key, environment_key, segment_key, post_segment_scheduled_change_input, opts = {})
1650
+ data, _status_code, _headers = post_segment_scheduled_change_with_http_info(project_key, environment_key, segment_key, post_segment_scheduled_change_input, opts)
1651
+ data
1652
+ end
1653
+
1654
+ # Create a scheduled change for a segment
1655
+ # Schedule semantic patch instructions to be applied to a segment at a future time. Each instruction uses the same format as an instruction in a semantic patch request to update a segment. Send between 1 and 100 instructions. LaunchDarkly rejects the request with a 400 if an instruction has an unknown &#x60;kind&#x60; or is malformed. The caller must be allowed to update scheduled changes on the segment, and must also be allowed to make each instruction&#39;s change directly. If the segment requires approvals for an instruction, the caller must also be allowed to bypass them. Otherwise, request the change through an approval request instead. To learn more about semantic patches, read [Updates](/reference#updates-using-semantic-patch).
1656
+ # @param project_key [String]
1657
+ # @param environment_key [String]
1658
+ # @param segment_key [String]
1659
+ # @param post_segment_scheduled_change_input [PostSegmentScheduledChangeInput]
1660
+ # @param [Hash] opts the optional parameters
1661
+ # @return [Array<(SegmentScheduledChange, Integer, Hash)>] SegmentScheduledChange data, response status code and response headers
1662
+ def post_segment_scheduled_change_with_http_info(project_key, environment_key, segment_key, post_segment_scheduled_change_input, opts = {})
1663
+ if @api_client.config.debugging
1664
+ @api_client.config.logger.debug 'Calling API: SegmentsApi.post_segment_scheduled_change ...'
1665
+ end
1666
+ # verify the required parameter 'project_key' is set
1667
+ if @api_client.config.client_side_validation && project_key.nil?
1668
+ fail ArgumentError, "Missing the required parameter 'project_key' when calling SegmentsApi.post_segment_scheduled_change"
1669
+ end
1670
+ # verify the required parameter 'environment_key' is set
1671
+ if @api_client.config.client_side_validation && environment_key.nil?
1672
+ fail ArgumentError, "Missing the required parameter 'environment_key' when calling SegmentsApi.post_segment_scheduled_change"
1673
+ end
1674
+ # verify the required parameter 'segment_key' is set
1675
+ if @api_client.config.client_side_validation && segment_key.nil?
1676
+ fail ArgumentError, "Missing the required parameter 'segment_key' when calling SegmentsApi.post_segment_scheduled_change"
1677
+ end
1678
+ # verify the required parameter 'post_segment_scheduled_change_input' is set
1679
+ if @api_client.config.client_side_validation && post_segment_scheduled_change_input.nil?
1680
+ fail ArgumentError, "Missing the required parameter 'post_segment_scheduled_change_input' when calling SegmentsApi.post_segment_scheduled_change"
1681
+ end
1682
+ # resource path
1683
+ local_var_path = '/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/scheduled-changes'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)).sub('{' + 'segmentKey' + '}', CGI.escape(segment_key.to_s))
1684
+
1685
+ # query parameters
1686
+ query_params = opts[:query_params] || {}
1687
+
1688
+ # header parameters
1689
+ header_params = opts[:header_params] || {}
1690
+ # HTTP header 'Accept' (if needed)
1691
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1692
+ # HTTP header 'Content-Type'
1693
+ content_type = @api_client.select_header_content_type(['application/json'])
1694
+ if !content_type.nil?
1695
+ header_params['Content-Type'] = content_type
1696
+ end
1697
+
1698
+ # form parameters
1699
+ form_params = opts[:form_params] || {}
1700
+
1701
+ # http body (model)
1702
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(post_segment_scheduled_change_input)
1703
+
1704
+ # return_type
1705
+ return_type = opts[:debug_return_type] || 'SegmentScheduledChange'
1706
+
1707
+ # auth_names
1708
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
1709
+
1710
+ new_options = opts.merge(
1711
+ :operation => :"SegmentsApi.post_segment_scheduled_change",
1712
+ :header_params => header_params,
1713
+ :query_params => query_params,
1714
+ :form_params => form_params,
1715
+ :body => post_body,
1716
+ :auth_names => auth_names,
1717
+ :return_type => return_type
1718
+ )
1719
+
1720
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1721
+ if @api_client.config.debugging
1722
+ @api_client.config.logger.debug "API called: SegmentsApi#post_segment_scheduled_change\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1723
+ end
1724
+ return data, status_code, headers
1725
+ end
1726
+
1312
1727
  # Update context targets on a big segment
1313
1728
  # Update context targets included or excluded in a big segment. Big segments include larger list-based segments and synced segments. This operation does not support standard segments.
1314
1729
  # @param project_key [String] The project key
@@ -15,6 +15,9 @@ require 'time'
15
15
 
16
16
  module LaunchDarklyApi
17
17
  class AIConfigTargetingEnvironmentRule < ApiModelBase
18
+ # The rule ID. Pass it as ruleId in targeting instructions that change this rule.
19
+ attr_accessor :_id
20
+
18
21
  # The clauses a context must match
19
22
  attr_accessor :clauses
20
23
 
@@ -24,6 +27,7 @@ module LaunchDarklyApi
24
27
  # Attribute mapping from ruby-style variable name to JSON key.
25
28
  def self.attribute_map
26
29
  {
30
+ :'_id' => :'_id',
27
31
  :'clauses' => :'clauses',
28
32
  :'track_events' => :'trackEvents'
29
33
  }
@@ -42,6 +46,7 @@ module LaunchDarklyApi
42
46
  # Attribute type mapping.
43
47
  def self.openapi_types
44
48
  {
49
+ :'_id' => :'String',
45
50
  :'clauses' => :'Array<AIConfigTargetingEnvironmentRuleClause>',
46
51
  :'track_events' => :'Boolean'
47
52
  }
@@ -69,6 +74,12 @@ module LaunchDarklyApi
69
74
  h[k.to_sym] = v
70
75
  }
71
76
 
77
+ if attributes.key?(:'_id')
78
+ self._id = attributes[:'_id']
79
+ else
80
+ self._id = nil
81
+ end
82
+
72
83
  if attributes.key?(:'clauses')
73
84
  if (value = attributes[:'clauses']).is_a?(Array)
74
85
  self.clauses = value
@@ -89,6 +100,10 @@ module LaunchDarklyApi
89
100
  def list_invalid_properties
90
101
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
91
102
  invalid_properties = Array.new
103
+ if @_id.nil?
104
+ invalid_properties.push('invalid value for "_id", _id cannot be nil.')
105
+ end
106
+
92
107
  if @clauses.nil?
93
108
  invalid_properties.push('invalid value for "clauses", clauses cannot be nil.')
94
109
  end
@@ -104,11 +119,22 @@ module LaunchDarklyApi
104
119
  # @return true if the model is valid
105
120
  def valid?
106
121
  warn '[DEPRECATED] the `valid?` method is obsolete'
122
+ return false if @_id.nil?
107
123
  return false if @clauses.nil?
108
124
  return false if @track_events.nil?
109
125
  true
110
126
  end
111
127
 
128
+ # Custom attribute writer method with validation
129
+ # @param [Object] _id Value to be assigned
130
+ def _id=(_id)
131
+ if _id.nil?
132
+ fail ArgumentError, '_id cannot be nil'
133
+ end
134
+
135
+ @_id = _id
136
+ end
137
+
112
138
  # Custom attribute writer method with validation
113
139
  # @param [Object] clauses Value to be assigned
114
140
  def clauses=(clauses)
@@ -134,6 +160,7 @@ module LaunchDarklyApi
134
160
  def ==(o)
135
161
  return true if self.equal?(o)
136
162
  self.class == o.class &&
163
+ _id == o._id &&
137
164
  clauses == o.clauses &&
138
165
  track_events == o.track_events
139
166
  end
@@ -147,7 +174,7 @@ module LaunchDarklyApi
147
174
  # Calculates hash code according to all attributes.
148
175
  # @return [Integer] Hash code
149
176
  def hash
150
- [clauses, track_events].hash
177
+ [_id, clauses, track_events].hash
151
178
  end
152
179
 
153
180
  # Builds the object from hash