Class: LaunchDarklyApi::ContextsApi
- Inherits:
-
Object
- Object
- LaunchDarklyApi::ContextsApi
- Defined in:
- lib/launchdarkly_api/api/contexts_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#delete_context_instances(project_key, environment_key, id, opts = {}) ⇒ nil
Delete context instances Delete context instances by ID.
-
#delete_context_instances_with_http_info(project_key, environment_key, id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete context instances Delete context instances by ID.
-
#evaluate_context_instance(project_key, environment_key, request_body, opts = {}) ⇒ ContextInstanceEvaluations
Evaluate flags for context instance Evaluate flags for a context instance, for example, to determine the expected flag variation.
-
#evaluate_context_instance_with_http_info(project_key, environment_key, request_body, opts = {}) ⇒ Array<(ContextInstanceEvaluations, Integer, Hash)>
Evaluate flags for context instance Evaluate flags for a context instance, for example, to determine the expected flag variation.
-
#get_context_attribute_names(project_key, environment_key, opts = {}) ⇒ ContextAttributeNamesCollection
Get context attribute names Get context attribute names.
-
#get_context_attribute_names_with_http_info(project_key, environment_key, opts = {}) ⇒ Array<(ContextAttributeNamesCollection, Integer, Hash)>
Get context attribute names Get context attribute names.
-
#get_context_attribute_values(project_key, environment_key, attribute_name, opts = {}) ⇒ ContextAttributeValuesCollection
Get context attribute values Get context attribute values.
-
#get_context_attribute_values_with_http_info(project_key, environment_key, attribute_name, opts = {}) ⇒ Array<(ContextAttributeValuesCollection, Integer, Hash)>
Get context attribute values Get context attribute values.
-
#get_context_instances(project_key, environment_key, id, opts = {}) ⇒ ContextInstances
Get context instances Get context instances by ID.
-
#get_context_instances_with_http_info(project_key, environment_key, id, opts = {}) ⇒ Array<(ContextInstances, Integer, Hash)>
Get context instances Get context instances by ID.
-
#get_context_kinds_by_project_key(project_key, opts = {}) ⇒ ContextKindsCollectionRep
Get context kinds Get all context kinds for a given project.
-
#get_context_kinds_by_project_key_with_http_info(project_key, opts = {}) ⇒ Array<(ContextKindsCollectionRep, Integer, Hash)>
Get context kinds Get all context kinds for a given project.
-
#get_contexts(project_key, environment_key, kind, key, opts = {}) ⇒ Contexts
Get contexts Get contexts based on kind and key.
-
#get_contexts_with_http_info(project_key, environment_key, kind, key, opts = {}) ⇒ Array<(Contexts, Integer, Hash)>
Get contexts Get contexts based on kind and key.
-
#initialize(api_client = ApiClient.default) ⇒ ContextsApi
constructor
A new instance of ContextsApi.
-
#put_context_kind(project_key, key, upsert_context_kind_payload, opts = {}) ⇒ UpsertResponseRep
Create or update context kind Create or update a context kind by key.
-
#put_context_kind_with_http_info(project_key, key, upsert_context_kind_payload, opts = {}) ⇒ Array<(UpsertResponseRep, Integer, Hash)>
Create or update context kind Create or update a context kind by key.
-
#search_context_instances(project_key, environment_key, context_instance_search, opts = {}) ⇒ ContextInstances
Search for context instances Search for context instances.
-
#search_context_instances_with_http_info(project_key, environment_key, context_instance_search, opts = {}) ⇒ Array<(ContextInstances, Integer, Hash)>
Search for context instances Search for context instances.
-
#search_contexts(project_key, environment_key, context_search, opts = {}) ⇒ Contexts
Search for contexts Search for contexts.
-
#search_contexts_with_http_info(project_key, environment_key, context_search, opts = {}) ⇒ Array<(Contexts, Integer, Hash)>
Search for contexts Search for contexts.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ ContextsApi
Returns a new instance of ContextsApi.
19 20 21 |
# File 'lib/launchdarkly_api/api/contexts_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/contexts_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#delete_context_instances(project_key, environment_key, id, opts = {}) ⇒ nil
Delete context instances Delete context instances by ID.
29 30 31 32 |
# File 'lib/launchdarkly_api/api/contexts_api.rb', line 29 def delete_context_instances(project_key, environment_key, id, opts = {}) delete_context_instances_with_http_info(project_key, environment_key, id, opts) nil end |
#delete_context_instances_with_http_info(project_key, environment_key, id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete context instances Delete context instances by ID.
41 42 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 |
# File 'lib/launchdarkly_api/api/contexts_api.rb', line 41 def delete_context_instances_with_http_info(project_key, environment_key, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContextsApi.delete_context_instances ...' 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 ContextsApi.delete_context_instances" 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 ContextsApi.delete_context_instances" 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 ContextsApi.delete_context_instances" end # resource path local_var_path = '/api/v2/projects/{projectKey}/environments/{environmentKey}/context-instances/{id}'.sub('{' + 'projectKey' + '}', CGI.escape(project_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] # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] = opts.merge( :operation => :"ContextsApi.delete_context_instances", :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: ContextsApi#delete_context_instances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#evaluate_context_instance(project_key, environment_key, request_body, opts = {}) ⇒ ContextInstanceEvaluations
Evaluate flags for context instance Evaluate flags for a context instance, for example, to determine the expected flag variation. **Do not use this API instead of an SDK.** The LaunchDarkly SDKs are specialized for the tasks of evaluating feature flags in your application at scale and generating analytics events based on those evaluations. This API is not designed for that use case. Any evaluations you perform with this API will not be reflected in features such as flag statuses and flag insights. Context instances evaluated by this API will not appear in the Contexts list. To learn more, read [Comparing LaunchDarkly’s SDKs and REST API](launchdarkly.com/docs/guides/api/comparing-sdk-rest-api). ### Filtering LaunchDarkly supports the ‘filter` query param for filtering, with the following fields: - `query` filters for a string that matches against the flags’ keys and names. It is not case sensitive. For example: ‘filter=query equals dark-mode`. - `tags` filters the list to flags that have all of the tags in the list. For example: `filter=tags contains ["beta","q1"]`. You can also apply multiple filters at once. For example, setting `filter=query equals dark-mode, tags contains ["beta","q1"]` matches flags which match the key or name `dark-mode` and are tagged `beta` and `q1`.
108 109 110 111 |
# File 'lib/launchdarkly_api/api/contexts_api.rb', line 108 def evaluate_context_instance(project_key, environment_key, request_body, opts = {}) data, _status_code, _headers = evaluate_context_instance_with_http_info(project_key, environment_key, request_body, opts) data end |
#evaluate_context_instance_with_http_info(project_key, environment_key, request_body, opts = {}) ⇒ Array<(ContextInstanceEvaluations, Integer, Hash)>
Evaluate flags for context instance Evaluate flags for a context instance, for example, to determine the expected flag variation. **Do not use this API instead of an SDK.** The LaunchDarkly SDKs are specialized for the tasks of evaluating feature flags in your application at scale and generating analytics events based on those evaluations. This API is not designed for that use case. Any evaluations you perform with this API will not be reflected in features such as flag statuses and flag insights. Context instances evaluated by this API will not appear in the Contexts list. To learn more, read [Comparing LaunchDarkly's SDKs and REST API](launchdarkly.com/docs/guides/api/comparing-sdk-rest-api). ### Filtering LaunchDarkly supports the `filter` query param for filtering, with the following fields: - `query` filters for a string that matches against the flags' keys and names. It is not case sensitive. For example: `filter=query equals dark-mode`. - `tags` filters the list to flags that have all of the tags in the list. For example: `filter=tags contains ["beta","q1"]`. You can also apply multiple filters at once. For example, setting `filter=query equals dark-mode, tags contains ["beta","q1"]` matches flags which match the key or name `dark-mode` and are tagged `beta` and `q1`.
124 125 126 127 128 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/contexts_api.rb', line 124 def evaluate_context_instance_with_http_info(project_key, environment_key, request_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContextsApi.evaluate_context_instance ...' 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 ContextsApi.evaluate_context_instance" 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 ContextsApi.evaluate_context_instance" end # verify the required parameter 'request_body' is set if @api_client.config.client_side_validation && request_body.nil? fail ArgumentError, "Missing the required parameter 'request_body' when calling ContextsApi.evaluate_context_instance" end # resource path local_var_path = '/api/v2/projects/{projectKey}/environments/{environmentKey}/flags/evaluate'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? # 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(request_body) # return_type return_type = opts[:debug_return_type] || 'ContextInstanceEvaluations' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] = opts.merge( :operation => :"ContextsApi.evaluate_context_instance", :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: ContextsApi#evaluate_context_instance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_context_attribute_names(project_key, environment_key, opts = {}) ⇒ ContextAttributeNamesCollection
Get context attribute names Get context attribute names.
197 198 199 200 |
# File 'lib/launchdarkly_api/api/contexts_api.rb', line 197 def get_context_attribute_names(project_key, environment_key, opts = {}) data, _status_code, _headers = get_context_attribute_names_with_http_info(project_key, environment_key, opts) data end |
#get_context_attribute_names_with_http_info(project_key, environment_key, opts = {}) ⇒ Array<(ContextAttributeNamesCollection, Integer, Hash)>
Get context attribute names Get context attribute names.
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 |
# File 'lib/launchdarkly_api/api/contexts_api.rb', line 210 def get_context_attribute_names_with_http_info(project_key, environment_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContextsApi.get_context_attribute_names ...' 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 ContextsApi.get_context_attribute_names" 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 ContextsApi.get_context_attribute_names" end # resource path local_var_path = '/api/v2/projects/{projectKey}/environments/{environmentKey}/context-attributes'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? # 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] || 'ContextAttributeNamesCollection' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] = opts.merge( :operation => :"ContextsApi.get_context_attribute_names", :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: ContextsApi#get_context_attribute_names\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_context_attribute_values(project_key, environment_key, attribute_name, opts = {}) ⇒ ContextAttributeValuesCollection
Get context attribute values Get context attribute values.
273 274 275 276 |
# File 'lib/launchdarkly_api/api/contexts_api.rb', line 273 def get_context_attribute_values(project_key, environment_key, attribute_name, opts = {}) data, _status_code, _headers = get_context_attribute_values_with_http_info(project_key, environment_key, attribute_name, opts) data end |
#get_context_attribute_values_with_http_info(project_key, environment_key, attribute_name, opts = {}) ⇒ Array<(ContextAttributeValuesCollection, Integer, Hash)>
Get context attribute values Get context attribute values.
287 288 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/contexts_api.rb', line 287 def get_context_attribute_values_with_http_info(project_key, environment_key, attribute_name, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContextsApi.get_context_attribute_values ...' 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 ContextsApi.get_context_attribute_values" 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 ContextsApi.get_context_attribute_values" end # verify the required parameter 'attribute_name' is set if @api_client.config.client_side_validation && attribute_name.nil? fail ArgumentError, "Missing the required parameter 'attribute_name' when calling ContextsApi.get_context_attribute_values" end # resource path local_var_path = '/api/v2/projects/{projectKey}/environments/{environmentKey}/context-attributes/{attributeName}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)).sub('{' + 'attributeName' + '}', CGI.escape(attribute_name.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? # 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] || 'ContextAttributeValuesCollection' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] = opts.merge( :operation => :"ContextsApi.get_context_attribute_values", :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: ContextsApi#get_context_attribute_values\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_context_instances(project_key, environment_key, id, opts = {}) ⇒ ContextInstances
Get context instances Get context instances by ID.
357 358 359 360 |
# File 'lib/launchdarkly_api/api/contexts_api.rb', line 357 def get_context_instances(project_key, environment_key, id, opts = {}) data, _status_code, _headers = get_context_instances_with_http_info(project_key, environment_key, id, opts) data end |
#get_context_instances_with_http_info(project_key, environment_key, id, opts = {}) ⇒ Array<(ContextInstances, Integer, Hash)>
Get context instances Get context instances by ID.
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 |
# File 'lib/launchdarkly_api/api/contexts_api.rb', line 374 def get_context_instances_with_http_info(project_key, environment_key, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContextsApi.get_context_instances ...' 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 ContextsApi.get_context_instances" 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 ContextsApi.get_context_instances" 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 ContextsApi.get_context_instances" end # resource path local_var_path = '/api/v2/projects/{projectKey}/environments/{environmentKey}/context-instances/{id}'.sub('{' + 'projectKey' + '}', CGI.escape(project_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] || {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'continuationToken'] = opts[:'continuation_token'] if !opts[:'continuation_token'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'includeTotalCount'] = opts[:'include_total_count'] if !opts[:'include_total_count'].nil? # 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] || 'ContextInstances' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] = opts.merge( :operation => :"ContextsApi.get_context_instances", :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: ContextsApi#get_context_instances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_context_kinds_by_project_key(project_key, opts = {}) ⇒ ContextKindsCollectionRep
Get context kinds Get all context kinds for a given project.
440 441 442 443 |
# File 'lib/launchdarkly_api/api/contexts_api.rb', line 440 def get_context_kinds_by_project_key(project_key, opts = {}) data, _status_code, _headers = get_context_kinds_by_project_key_with_http_info(project_key, opts) data end |
#get_context_kinds_by_project_key_with_http_info(project_key, opts = {}) ⇒ Array<(ContextKindsCollectionRep, Integer, Hash)>
Get context kinds Get all context kinds for a given project.
450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 |
# File 'lib/launchdarkly_api/api/contexts_api.rb', line 450 def get_context_kinds_by_project_key_with_http_info(project_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContextsApi.get_context_kinds_by_project_key ...' 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 ContextsApi.get_context_kinds_by_project_key" end # resource path local_var_path = '/api/v2/projects/{projectKey}/context-kinds'.sub('{' + 'projectKey' + '}', CGI.escape(project_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] || 'ContextKindsCollectionRep' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] = opts.merge( :operation => :"ContextsApi.get_context_kinds_by_project_key", :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: ContextsApi#get_context_kinds_by_project_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_contexts(project_key, environment_key, kind, key, opts = {}) ⇒ Contexts
Get contexts Get contexts based on kind and key.
511 512 513 514 |
# File 'lib/launchdarkly_api/api/contexts_api.rb', line 511 def get_contexts(project_key, environment_key, kind, key, opts = {}) data, _status_code, _headers = get_contexts_with_http_info(project_key, environment_key, kind, key, opts) data end |
#get_contexts_with_http_info(project_key, environment_key, kind, key, opts = {}) ⇒ Array<(Contexts, Integer, Hash)>
Get contexts Get contexts based on kind and key.
529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 |
# File 'lib/launchdarkly_api/api/contexts_api.rb', line 529 def get_contexts_with_http_info(project_key, environment_key, kind, key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContextsApi.get_contexts ...' 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 ContextsApi.get_contexts" 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 ContextsApi.get_contexts" end # verify the required parameter 'kind' is set if @api_client.config.client_side_validation && kind.nil? fail ArgumentError, "Missing the required parameter 'kind' when calling ContextsApi.get_contexts" end # verify the required parameter 'key' is set if @api_client.config.client_side_validation && key.nil? fail ArgumentError, "Missing the required parameter 'key' when calling ContextsApi.get_contexts" end # resource path local_var_path = '/api/v2/projects/{projectKey}/environments/{environmentKey}/contexts/{kind}/{key}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)).sub('{' + 'kind' + '}', CGI.escape(kind.to_s)).sub('{' + 'key' + '}', CGI.escape(key.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'continuationToken'] = opts[:'continuation_token'] if !opts[:'continuation_token'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'includeTotalCount'] = opts[:'include_total_count'] if !opts[:'include_total_count'].nil? # 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] || 'Contexts' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] = opts.merge( :operation => :"ContextsApi.get_contexts", :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: ContextsApi#get_contexts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#put_context_kind(project_key, key, upsert_context_kind_payload, opts = {}) ⇒ UpsertResponseRep
Create or update context kind Create or update a context kind by key. Only the included fields will be updated.
601 602 603 604 |
# File 'lib/launchdarkly_api/api/contexts_api.rb', line 601 def put_context_kind(project_key, key, upsert_context_kind_payload, opts = {}) data, _status_code, _headers = put_context_kind_with_http_info(project_key, key, upsert_context_kind_payload, opts) data end |
#put_context_kind_with_http_info(project_key, key, upsert_context_kind_payload, opts = {}) ⇒ Array<(UpsertResponseRep, Integer, Hash)>
Create or update context kind Create or update a context kind by key. Only the included fields will be updated.
613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 |
# File 'lib/launchdarkly_api/api/contexts_api.rb', line 613 def put_context_kind_with_http_info(project_key, key, upsert_context_kind_payload, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContextsApi.put_context_kind ...' 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 ContextsApi.put_context_kind" end # verify the required parameter 'key' is set if @api_client.config.client_side_validation && key.nil? fail ArgumentError, "Missing the required parameter 'key' when calling ContextsApi.put_context_kind" end # verify the required parameter 'upsert_context_kind_payload' is set if @api_client.config.client_side_validation && upsert_context_kind_payload.nil? fail ArgumentError, "Missing the required parameter 'upsert_context_kind_payload' when calling ContextsApi.put_context_kind" end # resource path local_var_path = '/api/v2/projects/{projectKey}/context-kinds/{key}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'key' + '}', CGI.escape(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(upsert_context_kind_payload) # return_type return_type = opts[:debug_return_type] || 'UpsertResponseRep' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] = opts.merge( :operation => :"ContextsApi.put_context_kind", :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(:PUT, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContextsApi#put_context_kind\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#search_context_instances(project_key, environment_key, context_instance_search, opts = {}) ⇒ ContextInstances
Search for context instances
Search for context instances. You can use either the query parameters or the request body parameters. If both are provided, there is an error. To learn more about the filter syntax, read [Filtering contexts and context instances](https://launchdarkly.com/docs/api/contexts#filtering-contexts-and-context-instances). To learn more about context instances, read [Context instances](https://launchdarkly.com/docs/home/observability/multi-contexts#context-instances).
686 687 688 689 |
# File 'lib/launchdarkly_api/api/contexts_api.rb', line 686 def search_context_instances(project_key, environment_key, context_instance_search, opts = {}) data, _status_code, _headers = search_context_instances_with_http_info(project_key, environment_key, context_instance_search, opts) data end |
#search_context_instances_with_http_info(project_key, environment_key, context_instance_search, opts = {}) ⇒ Array<(ContextInstances, Integer, Hash)>
Search for context instances
Search for context instances. You can use either the query parameters or the request body parameters. If both are provided, there is an error. To learn more about the filter syntax, read [Filtering contexts and context instances](https://launchdarkly.com/docs/api/contexts#filtering-contexts-and-context-instances). To learn more about context instances, read [Context instances](https://launchdarkly.com/docs/home/observability/multi-contexts#context-instances).
703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 |
# File 'lib/launchdarkly_api/api/contexts_api.rb', line 703 def search_context_instances_with_http_info(project_key, environment_key, context_instance_search, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContextsApi.search_context_instances ...' 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 ContextsApi.search_context_instances" 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 ContextsApi.search_context_instances" end # verify the required parameter 'context_instance_search' is set if @api_client.config.client_side_validation && context_instance_search.nil? fail ArgumentError, "Missing the required parameter 'context_instance_search' when calling ContextsApi.search_context_instances" end # resource path local_var_path = '/api/v2/projects/{projectKey}/environments/{environmentKey}/context-instances/search'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'continuationToken'] = opts[:'continuation_token'] if !opts[:'continuation_token'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'includeTotalCount'] = opts[:'include_total_count'] if !opts[:'include_total_count'].nil? # 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(context_instance_search) # return_type return_type = opts[:debug_return_type] || 'ContextInstances' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] = opts.merge( :operation => :"ContextsApi.search_context_instances", :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: ContextsApi#search_context_instances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#search_contexts(project_key, environment_key, context_search, opts = {}) ⇒ Contexts
Search for contexts
Search for contexts. You can use either the query parameters or the request body parameters. If both are provided, there is an error. To learn more about the filter syntax, read [Filtering contexts and context instances](https://launchdarkly.com/docs/api/contexts#filtering-contexts-and-context-instances). To learn more about contexts, read [Contexts and context kinds](https://launchdarkly.com/docs/home/observability/contexts#contexts-and-context-kinds).
781 782 783 784 |
# File 'lib/launchdarkly_api/api/contexts_api.rb', line 781 def search_contexts(project_key, environment_key, context_search, opts = {}) data, _status_code, _headers = search_contexts_with_http_info(project_key, environment_key, context_search, opts) data end |
#search_contexts_with_http_info(project_key, environment_key, context_search, opts = {}) ⇒ Array<(Contexts, Integer, Hash)>
Search for contexts
Search for contexts. You can use either the query parameters or the request body parameters. If both are provided, there is an error. To learn more about the filter syntax, read [Filtering contexts and context instances](https://launchdarkly.com/docs/api/contexts#filtering-contexts-and-context-instances). To learn more about contexts, read [Contexts and context kinds](https://launchdarkly.com/docs/home/observability/contexts#contexts-and-context-kinds).
798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 |
# File 'lib/launchdarkly_api/api/contexts_api.rb', line 798 def search_contexts_with_http_info(project_key, environment_key, context_search, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContextsApi.search_contexts ...' 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 ContextsApi.search_contexts" 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 ContextsApi.search_contexts" end # verify the required parameter 'context_search' is set if @api_client.config.client_side_validation && context_search.nil? fail ArgumentError, "Missing the required parameter 'context_search' when calling ContextsApi.search_contexts" end # resource path local_var_path = '/api/v2/projects/{projectKey}/environments/{environmentKey}/contexts/search'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'continuationToken'] = opts[:'continuation_token'] if !opts[:'continuation_token'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'includeTotalCount'] = opts[:'include_total_count'] if !opts[:'include_total_count'].nil? # 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(context_search) # return_type return_type = opts[:debug_return_type] || 'Contexts' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] = opts.merge( :operation => :"ContextsApi.search_contexts", :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: ContextsApi#search_contexts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |