Class: LaunchDarklyApi::FlagTriggersApi
- Inherits:
-
Object
- Object
- LaunchDarklyApi::FlagTriggersApi
- Defined in:
- lib/launchdarkly_api/api/flag_triggers_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_trigger_workflow(project_key, environment_key, feature_flag_key, trigger_post, opts = {}) ⇒ TriggerWorkflowRep
Create flag trigger Create a new flag trigger.
-
#create_trigger_workflow_with_http_info(project_key, environment_key, feature_flag_key, trigger_post, opts = {}) ⇒ Array<(TriggerWorkflowRep, Integer, Hash)>
Create flag trigger Create a new flag trigger.
-
#delete_trigger_workflow(project_key, environment_key, feature_flag_key, id, opts = {}) ⇒ nil
Delete flag trigger Delete a flag trigger by ID.
-
#delete_trigger_workflow_with_http_info(project_key, environment_key, feature_flag_key, id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete flag trigger Delete a flag trigger by ID.
-
#get_trigger_workflow_by_id(project_key, feature_flag_key, environment_key, id, opts = {}) ⇒ TriggerWorkflowRep
Get flag trigger by ID Get a flag trigger by ID.
-
#get_trigger_workflow_by_id_with_http_info(project_key, feature_flag_key, environment_key, id, opts = {}) ⇒ Array<(TriggerWorkflowRep, Integer, Hash)>
Get flag trigger by ID Get a flag trigger by ID.
-
#get_trigger_workflows(project_key, environment_key, feature_flag_key, opts = {}) ⇒ TriggerWorkflowCollectionRep
List flag triggers Get a list of all flag triggers.
-
#get_trigger_workflows_with_http_info(project_key, environment_key, feature_flag_key, opts = {}) ⇒ Array<(TriggerWorkflowCollectionRep, Integer, Hash)>
List flag triggers Get a list of all flag triggers.
-
#initialize(api_client = ApiClient.default) ⇒ FlagTriggersApi
constructor
A new instance of FlagTriggersApi.
-
#patch_trigger_workflow(project_key, environment_key, feature_flag_key, id, flag_trigger_input, opts = {}) ⇒ TriggerWorkflowRep
Update flag trigger Update a flag trigger.
-
#patch_trigger_workflow_with_http_info(project_key, environment_key, feature_flag_key, id, flag_trigger_input, opts = {}) ⇒ Array<(TriggerWorkflowRep, Integer, Hash)>
Update flag trigger Update a flag trigger.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ FlagTriggersApi
Returns a new instance of FlagTriggersApi.
19 20 21 |
# File 'lib/launchdarkly_api/api/flag_triggers_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/launchdarkly_api/api/flag_triggers_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#create_trigger_workflow(project_key, environment_key, feature_flag_key, trigger_post, opts = {}) ⇒ TriggerWorkflowRep
Create flag trigger Create a new flag trigger.
30 31 32 33 |
# File 'lib/launchdarkly_api/api/flag_triggers_api.rb', line 30 def create_trigger_workflow(project_key, environment_key, feature_flag_key, trigger_post, opts = {}) data, _status_code, _headers = create_trigger_workflow_with_http_info(project_key, environment_key, feature_flag_key, trigger_post, opts) data end |
#create_trigger_workflow_with_http_info(project_key, environment_key, feature_flag_key, trigger_post, opts = {}) ⇒ Array<(TriggerWorkflowRep, Integer, Hash)>
Create flag trigger Create a new flag trigger.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/launchdarkly_api/api/flag_triggers_api.rb', line 43 def create_trigger_workflow_with_http_info(project_key, environment_key, feature_flag_key, trigger_post, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FlagTriggersApi.create_trigger_workflow ...' end # verify the required parameter 'project_key' is set if @api_client.config.client_side_validation && project_key.nil? fail ArgumentError, "Missing the required parameter 'project_key' when calling FlagTriggersApi.create_trigger_workflow" end # verify the required parameter 'environment_key' is set if @api_client.config.client_side_validation && environment_key.nil? fail ArgumentError, "Missing the required parameter 'environment_key' when calling FlagTriggersApi.create_trigger_workflow" end # verify the required parameter 'feature_flag_key' is set if @api_client.config.client_side_validation && feature_flag_key.nil? fail ArgumentError, "Missing the required parameter 'feature_flag_key' when calling FlagTriggersApi.create_trigger_workflow" end # verify the required parameter 'trigger_post' is set if @api_client.config.client_side_validation && trigger_post.nil? fail ArgumentError, "Missing the required parameter 'trigger_post' when calling FlagTriggersApi.create_trigger_workflow" end # resource path local_var_path = '/api/v2/flags/{projectKey}/{featureFlagKey}/triggers/{environmentKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)).sub('{' + 'featureFlagKey' + '}', CGI.escape(feature_flag_key.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(trigger_post) # return_type return_type = opts[:debug_return_type] || 'TriggerWorkflowRep' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] = opts.merge( :operation => :"FlagTriggersApi.create_trigger_workflow", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: FlagTriggersApi#create_trigger_workflow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_trigger_workflow(project_key, environment_key, feature_flag_key, id, opts = {}) ⇒ nil
Delete flag trigger Delete a flag trigger by ID.
116 117 118 119 |
# File 'lib/launchdarkly_api/api/flag_triggers_api.rb', line 116 def delete_trigger_workflow(project_key, environment_key, feature_flag_key, id, opts = {}) delete_trigger_workflow_with_http_info(project_key, environment_key, feature_flag_key, id, opts) nil end |
#delete_trigger_workflow_with_http_info(project_key, environment_key, feature_flag_key, id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete flag trigger Delete a flag trigger by ID.
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 |
# File 'lib/launchdarkly_api/api/flag_triggers_api.rb', line 129 def delete_trigger_workflow_with_http_info(project_key, environment_key, feature_flag_key, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FlagTriggersApi.delete_trigger_workflow ...' end # verify the required parameter 'project_key' is set if @api_client.config.client_side_validation && project_key.nil? fail ArgumentError, "Missing the required parameter 'project_key' when calling FlagTriggersApi.delete_trigger_workflow" end # verify the required parameter 'environment_key' is set if @api_client.config.client_side_validation && environment_key.nil? fail ArgumentError, "Missing the required parameter 'environment_key' when calling FlagTriggersApi.delete_trigger_workflow" end # verify the required parameter 'feature_flag_key' is set if @api_client.config.client_side_validation && feature_flag_key.nil? fail ArgumentError, "Missing the required parameter 'feature_flag_key' when calling FlagTriggersApi.delete_trigger_workflow" end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling FlagTriggersApi.delete_trigger_workflow" end # resource path local_var_path = '/api/v2/flags/{projectKey}/{featureFlagKey}/triggers/{environmentKey}/{id}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)).sub('{' + 'featureFlagKey' + '}', CGI.escape(feature_flag_key.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] = opts.merge( :operation => :"FlagTriggersApi.delete_trigger_workflow", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: FlagTriggersApi#delete_trigger_workflow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_trigger_workflow_by_id(project_key, feature_flag_key, environment_key, id, opts = {}) ⇒ TriggerWorkflowRep
Get flag trigger by ID Get a flag trigger by ID.
197 198 199 200 |
# File 'lib/launchdarkly_api/api/flag_triggers_api.rb', line 197 def get_trigger_workflow_by_id(project_key, feature_flag_key, environment_key, id, opts = {}) data, _status_code, _headers = get_trigger_workflow_by_id_with_http_info(project_key, feature_flag_key, environment_key, id, opts) data end |
#get_trigger_workflow_by_id_with_http_info(project_key, feature_flag_key, environment_key, id, opts = {}) ⇒ Array<(TriggerWorkflowRep, Integer, Hash)>
Get flag trigger by ID Get a flag trigger by ID.
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
# File 'lib/launchdarkly_api/api/flag_triggers_api.rb', line 210 def get_trigger_workflow_by_id_with_http_info(project_key, feature_flag_key, environment_key, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FlagTriggersApi.get_trigger_workflow_by_id ...' end # verify the required parameter 'project_key' is set if @api_client.config.client_side_validation && project_key.nil? fail ArgumentError, "Missing the required parameter 'project_key' when calling FlagTriggersApi.get_trigger_workflow_by_id" end # verify the required parameter 'feature_flag_key' is set if @api_client.config.client_side_validation && feature_flag_key.nil? fail ArgumentError, "Missing the required parameter 'feature_flag_key' when calling FlagTriggersApi.get_trigger_workflow_by_id" end # verify the required parameter 'environment_key' is set if @api_client.config.client_side_validation && environment_key.nil? fail ArgumentError, "Missing the required parameter 'environment_key' when calling FlagTriggersApi.get_trigger_workflow_by_id" end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling FlagTriggersApi.get_trigger_workflow_by_id" end # resource path local_var_path = '/api/v2/flags/{projectKey}/{featureFlagKey}/triggers/{environmentKey}/{id}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'featureFlagKey' + '}', CGI.escape(feature_flag_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'TriggerWorkflowRep' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] = opts.merge( :operation => :"FlagTriggersApi.get_trigger_workflow_by_id", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: FlagTriggersApi#get_trigger_workflow_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_trigger_workflows(project_key, environment_key, feature_flag_key, opts = {}) ⇒ TriggerWorkflowCollectionRep
List flag triggers Get a list of all flag triggers.
277 278 279 280 |
# File 'lib/launchdarkly_api/api/flag_triggers_api.rb', line 277 def get_trigger_workflows(project_key, environment_key, feature_flag_key, opts = {}) data, _status_code, _headers = get_trigger_workflows_with_http_info(project_key, environment_key, feature_flag_key, opts) data end |
#get_trigger_workflows_with_http_info(project_key, environment_key, feature_flag_key, opts = {}) ⇒ Array<(TriggerWorkflowCollectionRep, Integer, Hash)>
List flag triggers Get a list of all flag triggers.
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 |
# File 'lib/launchdarkly_api/api/flag_triggers_api.rb', line 289 def get_trigger_workflows_with_http_info(project_key, environment_key, feature_flag_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FlagTriggersApi.get_trigger_workflows ...' end # verify the required parameter 'project_key' is set if @api_client.config.client_side_validation && project_key.nil? fail ArgumentError, "Missing the required parameter 'project_key' when calling FlagTriggersApi.get_trigger_workflows" end # verify the required parameter 'environment_key' is set if @api_client.config.client_side_validation && environment_key.nil? fail ArgumentError, "Missing the required parameter 'environment_key' when calling FlagTriggersApi.get_trigger_workflows" end # verify the required parameter 'feature_flag_key' is set if @api_client.config.client_side_validation && feature_flag_key.nil? fail ArgumentError, "Missing the required parameter 'feature_flag_key' when calling FlagTriggersApi.get_trigger_workflows" end # resource path local_var_path = '/api/v2/flags/{projectKey}/{featureFlagKey}/triggers/{environmentKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)).sub('{' + 'featureFlagKey' + '}', CGI.escape(feature_flag_key.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'TriggerWorkflowCollectionRep' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] = opts.merge( :operation => :"FlagTriggersApi.get_trigger_workflows", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: FlagTriggersApi#get_trigger_workflows\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#patch_trigger_workflow(project_key, environment_key, feature_flag_key, id, flag_trigger_input, opts = {}) ⇒ TriggerWorkflowRep
Update flag trigger Update a flag trigger. Updating a flag trigger uses the semantic patch format. To make a semantic patch request, you must append ‘domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch). ### Instructions Semantic patch requests support the following `kind` instructions for updating flag triggers. #### replaceTriggerActionInstructions Removes the existing trigger action and replaces it with the new instructions. ##### Parameters - `value`: An array of the new `kind`s of actions to perform when triggering. Supported flag actions are `turnFlagOn` and `turnFlagOff`. For example, to replace the trigger action instructions, use this request body: “`json { "comment": "optional comment", "instructions": [ { "kind": "replaceTriggerActionInstructions", "value": [ "turnFlagOff" ] } ] } “` #### cycleTriggerUrl Generates a new URL for this trigger. You must update any clients using the trigger to use this new URL. #### disableTrigger Disables the trigger. This saves the trigger configuration, but the trigger stops running. To re-enable, use `enableTrigger`. #### enableTrigger Enables the trigger. If you previously disabled the trigger, it begins running again.
354 355 356 357 |
# File 'lib/launchdarkly_api/api/flag_triggers_api.rb', line 354 def patch_trigger_workflow(project_key, environment_key, feature_flag_key, id, flag_trigger_input, opts = {}) data, _status_code, _headers = patch_trigger_workflow_with_http_info(project_key, environment_key, feature_flag_key, id, flag_trigger_input, opts) data end |
#patch_trigger_workflow_with_http_info(project_key, environment_key, feature_flag_key, id, flag_trigger_input, opts = {}) ⇒ Array<(TriggerWorkflowRep, Integer, Hash)>
Update flag trigger Update a flag trigger. Updating a flag trigger uses the semantic patch format. To make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch). ### Instructions Semantic patch requests support the following `kind` instructions for updating flag triggers. #### replaceTriggerActionInstructions Removes the existing trigger action and replaces it with the new instructions. ##### Parameters - `value`: An array of the new `kind`s of actions to perform when triggering. Supported flag actions are `turnFlagOn` and `turnFlagOff`. For example, to replace the trigger action instructions, use this request body: ```json { "comment": "optional comment", "instructions": [ { "kind": "replaceTriggerActionInstructions", "value": [ "turnFlagOff" ] } ] } ``` #### cycleTriggerUrl Generates a new URL for this trigger. You must update any clients using the trigger to use this new URL. #### disableTrigger Disables the trigger. This saves the trigger configuration, but the trigger stops running. To re-enable, use `enableTrigger`. #### enableTrigger Enables the trigger. If you previously disabled the trigger, it begins running again.
368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 |
# File 'lib/launchdarkly_api/api/flag_triggers_api.rb', line 368 def patch_trigger_workflow_with_http_info(project_key, environment_key, feature_flag_key, id, flag_trigger_input, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FlagTriggersApi.patch_trigger_workflow ...' end # verify the required parameter 'project_key' is set if @api_client.config.client_side_validation && project_key.nil? fail ArgumentError, "Missing the required parameter 'project_key' when calling FlagTriggersApi.patch_trigger_workflow" end # verify the required parameter 'environment_key' is set if @api_client.config.client_side_validation && environment_key.nil? fail ArgumentError, "Missing the required parameter 'environment_key' when calling FlagTriggersApi.patch_trigger_workflow" end # verify the required parameter 'feature_flag_key' is set if @api_client.config.client_side_validation && feature_flag_key.nil? fail ArgumentError, "Missing the required parameter 'feature_flag_key' when calling FlagTriggersApi.patch_trigger_workflow" end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling FlagTriggersApi.patch_trigger_workflow" end # verify the required parameter 'flag_trigger_input' is set if @api_client.config.client_side_validation && flag_trigger_input.nil? fail ArgumentError, "Missing the required parameter 'flag_trigger_input' when calling FlagTriggersApi.patch_trigger_workflow" end # resource path local_var_path = '/api/v2/flags/{projectKey}/{featureFlagKey}/triggers/{environmentKey}/{id}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)).sub('{' + 'featureFlagKey' + '}', CGI.escape(feature_flag_key.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(flag_trigger_input) # return_type return_type = opts[:debug_return_type] || 'TriggerWorkflowRep' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] = opts.merge( :operation => :"FlagTriggersApi.patch_trigger_workflow", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: FlagTriggersApi#patch_trigger_workflow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |