class LaunchDarklyApi::UserSettingsApi
Attributes
Public Class Methods
# File lib/launchdarkly_api/api/user_settings_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Get expiring dates on flags for user Get a list of flags for which the given user is scheduled for removal. @param proj_key [String] The project key. @param user_key [String] The user key. @param env_key [String] The environment key. @param [Hash] opts the optional parameters @return [ExpiringUserTargetGetResponse]
# File lib/launchdarkly_api/api/user_settings_api.rb, line 29 def get_expiring_flags_for_user(proj_key, user_key, env_key, opts = {}) data, _status_code, _headers = get_expiring_flags_for_user_with_http_info(proj_key, user_key, env_key, opts) data end
Get expiring dates on flags for user Get a list of flags for which the given user is scheduled for removal. @param proj_key [String] The project key. @param user_key [String] The user key. @param env_key [String] The environment key. @param [Hash] opts the optional parameters @return [Array<(ExpiringUserTargetGetResponse
, Integer, Hash)>] ExpiringUserTargetGetResponse
data, response status code and response headers
# File lib/launchdarkly_api/api/user_settings_api.rb, line 41 def get_expiring_flags_for_user_with_http_info(proj_key, user_key, env_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserSettingsApi.get_expiring_flags_for_user ...' end # verify the required parameter 'proj_key' is set if @api_client.config.client_side_validation && proj_key.nil? fail ArgumentError, "Missing the required parameter 'proj_key' when calling UserSettingsApi.get_expiring_flags_for_user" end # verify the required parameter 'user_key' is set if @api_client.config.client_side_validation && user_key.nil? fail ArgumentError, "Missing the required parameter 'user_key' when calling UserSettingsApi.get_expiring_flags_for_user" end # verify the required parameter 'env_key' is set if @api_client.config.client_side_validation && env_key.nil? fail ArgumentError, "Missing the required parameter 'env_key' when calling UserSettingsApi.get_expiring_flags_for_user" end # resource path local_var_path = '/api/v2/users/{projKey}/{userKey}/expiring-user-targets/{envKey}'.sub('{' + 'projKey' + '}', CGI.escape(proj_key.to_s)).sub('{' + 'userKey' + '}', CGI.escape(user_key.to_s)).sub('{' + 'envKey' + '}', CGI.escape(env_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] || 'ExpiringUserTargetGetResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] new_options = opts.merge( :operation => :"UserSettingsApi.get_expiring_flags_for_user", :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, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: UserSettingsApi#get_expiring_flags_for_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get flag setting for user Get a single flag setting for a user by key. The most important attribute in the response is the `_value`. The `_value` is the current setting that the user sees. For a boolean feature toggle, this is `true`, `false`, or `null`. `null` returns if there is no defined fallback value. The example response indicates that the user `Abbie_Braun` has the `sort.order` flag enabled.<br /><br />The setting attribute indicates whether you've explicitly targeted a user to receive a particular variation. For example, if you have turned off a feature flag for a user, this setting will be `false`. A setting of `null` means that you haven't assigned that user to a specific variation. @param proj_key [String] The project key @param env_key [String] The environment key @param key [String] The user key @param feature_key [String] The feature flag key @param [Hash] opts the optional parameters @return [UserFlagSetting]
# File lib/launchdarkly_api/api/user_settings_api.rb, line 105 def get_user_flag_setting(proj_key, env_key, key, feature_key, opts = {}) data, _status_code, _headers = get_user_flag_setting_with_http_info(proj_key, env_key, key, feature_key, opts) data end
Get flag setting for user Get a single flag setting for a user by key. The most important attribute in the response is the `_value`. The `_value` is the current setting that the user sees. For a boolean feature toggle, this is `true`, `false`, or `null`. `null` returns if there is no defined fallback value. The example response indicates that the user `Abbie_Braun` has the `sort.order` flag enabled.<br /><br />The setting attribute indicates whether you've explicitly targeted a user to receive a particular variation. For example, if you have turned off a feature flag for a user, this setting will be `false`. A setting of `null` means that you haven't assigned that user to a specific variation. @param proj_key [String] The project key @param env_key [String] The environment key @param key [String] The user key @param feature_key [String] The feature flag key @param [Hash] opts the optional parameters @return [Array<(UserFlagSetting
, Integer, Hash)>] UserFlagSetting
data, response status code and response headers
# File lib/launchdarkly_api/api/user_settings_api.rb, line 118 def get_user_flag_setting_with_http_info(proj_key, env_key, key, feature_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserSettingsApi.get_user_flag_setting ...' end # verify the required parameter 'proj_key' is set if @api_client.config.client_side_validation && proj_key.nil? fail ArgumentError, "Missing the required parameter 'proj_key' when calling UserSettingsApi.get_user_flag_setting" end # verify the required parameter 'env_key' is set if @api_client.config.client_side_validation && env_key.nil? fail ArgumentError, "Missing the required parameter 'env_key' when calling UserSettingsApi.get_user_flag_setting" 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 UserSettingsApi.get_user_flag_setting" end # verify the required parameter 'feature_key' is set if @api_client.config.client_side_validation && feature_key.nil? fail ArgumentError, "Missing the required parameter 'feature_key' when calling UserSettingsApi.get_user_flag_setting" end # resource path local_var_path = '/api/v2/users/{projKey}/{envKey}/{key}/flags/{featureKey}'.sub('{' + 'projKey' + '}', CGI.escape(proj_key.to_s)).sub('{' + 'envKey' + '}', CGI.escape(env_key.to_s)).sub('{' + 'key' + '}', CGI.escape(key.to_s)).sub('{' + 'featureKey' + '}', CGI.escape(feature_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] || 'UserFlagSetting' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] new_options = opts.merge( :operation => :"UserSettingsApi.get_user_flag_setting", :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, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: UserSettingsApi#get_user_flag_setting\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
List flag settings for user Get the current flag settings for a given user. The most important attribute in the response is the `_value`. The `_value` is the setting that the user sees. For a boolean feature toggle, this is `true`, `false`, or `null`. `null` returns if there is no defined fallthrough value. The example response indicates that the user `Abbie_Braun` has the `sort.order` flag enabled and the `alternate.page` flag disabled.<br /><br />The setting attribute indicates whether you've explicitly targeted a user to receive a particular variation. For example, if you have turned off a feature flag for a user, this setting will be `false`. A setting of `null` means that you haven't assigned that user to a specific variation. @param proj_key [String] The project key @param env_key [String] The environment key @param key [String] The user key @param [Hash] opts the optional parameters @return [UserFlagSettings]
# File lib/launchdarkly_api/api/user_settings_api.rb, line 185 def get_user_flag_settings(proj_key, env_key, key, opts = {}) data, _status_code, _headers = get_user_flag_settings_with_http_info(proj_key, env_key, key, opts) data end
List flag settings for user Get the current flag settings for a given user. The most important attribute in the response is the `_value`. The `_value` is the setting that the user sees. For a boolean feature toggle, this is `true`, `false`, or `null`. `null` returns if there is no defined fallthrough value. The example response indicates that the user `Abbie_Braun` has the `sort.order` flag enabled and the `alternate.page` flag disabled.<br /><br />The setting attribute indicates whether you've explicitly targeted a user to receive a particular variation. For example, if you have turned off a feature flag for a user, this setting will be `false`. A setting of `null` means that you haven't assigned that user to a specific variation. @param proj_key [String] The project key @param env_key [String] The environment key @param key [String] The user key @param [Hash] opts the optional parameters @return [Array<(UserFlagSettings
, Integer, Hash)>] UserFlagSettings
data, response status code and response headers
# File lib/launchdarkly_api/api/user_settings_api.rb, line 197 def get_user_flag_settings_with_http_info(proj_key, env_key, key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserSettingsApi.get_user_flag_settings ...' end # verify the required parameter 'proj_key' is set if @api_client.config.client_side_validation && proj_key.nil? fail ArgumentError, "Missing the required parameter 'proj_key' when calling UserSettingsApi.get_user_flag_settings" end # verify the required parameter 'env_key' is set if @api_client.config.client_side_validation && env_key.nil? fail ArgumentError, "Missing the required parameter 'env_key' when calling UserSettingsApi.get_user_flag_settings" 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 UserSettingsApi.get_user_flag_settings" end # resource path local_var_path = '/api/v2/users/{projKey}/{envKey}/{key}/flags'.sub('{' + 'projKey' + '}', CGI.escape(proj_key.to_s)).sub('{' + 'envKey' + '}', CGI.escape(env_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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'UserFlagSettings' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] new_options = opts.merge( :operation => :"UserSettingsApi.get_user_flag_settings", :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, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: UserSettingsApi#get_user_flag_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Update expiring user target for flags Schedule the specified user for removal from individual user targeting on one or more flags. You can only schedule a user for removal on a single variation per flag. To learn more about semantic patches, read [Updates](/#section/Updates). If you previously patched the flag, and the patch included the user's data, LaunchDarkly continues to use that data. If LaunchDarkly has never encountered the user's key before, it calculates the flag values based on the user key alone. @param proj_key [String] The project key. @param user_key [String] The user key. @param env_key [String] The environment key. @param patch_with_comment [PatchWithComment] @param [Hash] opts the optional parameters @return [ExpiringUserTargetPatchResponse]
# File lib/launchdarkly_api/api/user_settings_api.rb, line 261 def patch_expiring_flags_for_user(proj_key, user_key, env_key, patch_with_comment, opts = {}) data, _status_code, _headers = patch_expiring_flags_for_user_with_http_info(proj_key, user_key, env_key, patch_with_comment, opts) data end
Update expiring user target for flags Schedule the specified user for removal from individual user targeting on one or more flags. You can only schedule a user for removal on a single variation per flag. To learn more about semantic patches, read [Updates](/#section/Updates). If you previously patched the flag, and the patch included the user's data, LaunchDarkly continues to use that data. If LaunchDarkly has never encountered the user's key before, it calculates the flag values based on the user key alone. @param proj_key [String] The project key. @param user_key [String] The user key. @param env_key [String] The environment key. @param patch_with_comment [PatchWithComment] @param [Hash] opts the optional parameters @return [Array<(ExpiringUserTargetPatchResponse
, Integer, Hash)>] ExpiringUserTargetPatchResponse
data, response status code and response headers
# File lib/launchdarkly_api/api/user_settings_api.rb, line 274 def patch_expiring_flags_for_user_with_http_info(proj_key, user_key, env_key, patch_with_comment, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserSettingsApi.patch_expiring_flags_for_user ...' end # verify the required parameter 'proj_key' is set if @api_client.config.client_side_validation && proj_key.nil? fail ArgumentError, "Missing the required parameter 'proj_key' when calling UserSettingsApi.patch_expiring_flags_for_user" end # verify the required parameter 'user_key' is set if @api_client.config.client_side_validation && user_key.nil? fail ArgumentError, "Missing the required parameter 'user_key' when calling UserSettingsApi.patch_expiring_flags_for_user" end # verify the required parameter 'env_key' is set if @api_client.config.client_side_validation && env_key.nil? fail ArgumentError, "Missing the required parameter 'env_key' when calling UserSettingsApi.patch_expiring_flags_for_user" end # verify the required parameter 'patch_with_comment' is set if @api_client.config.client_side_validation && patch_with_comment.nil? fail ArgumentError, "Missing the required parameter 'patch_with_comment' when calling UserSettingsApi.patch_expiring_flags_for_user" end # resource path local_var_path = '/api/v2/users/{projKey}/{userKey}/expiring-user-targets/{envKey}'.sub('{' + 'projKey' + '}', CGI.escape(proj_key.to_s)).sub('{' + 'userKey' + '}', CGI.escape(user_key.to_s)).sub('{' + 'envKey' + '}', CGI.escape(env_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' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(patch_with_comment) # return_type return_type = opts[:debug_return_type] || 'ExpiringUserTargetPatchResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] new_options = opts.merge( :operation => :"UserSettingsApi.patch_expiring_flags_for_user", :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, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: UserSettingsApi#patch_expiring_flags_for_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Update flag settings for user Enable or disable a feature flag for a user based on their key. To change the setting, send a `PUT` request to this URL with a request body containing the flag value. For example, to disable the sort.order flag for the user `test@test.com`, send a `PUT` to `app.launchdarkly.com/api/v2/users/default/production/test@test.com/flags/sort.order` with the following body: “`json { "setting": false } “` Omitting the setting attribute, or a setting of null, in your `PUT` "clears" the current setting for a user. If you previously patched the flag, and the patch included the user's data, LaunchDarkly continues to use that data. If LaunchDarkly has never encountered the user's key before, it calculates the flag values based on the user key alone. @param proj_key [String] The project key @param env_key [String] The environment key @param key [String] The user key @param feature_key [String] The feature flag key @param value_put [ValuePut] @param [Hash] opts the optional parameters @return [nil]
# File lib/launchdarkly_api/api/user_settings_api.rb, line 345 def put_flag_setting(proj_key, env_key, key, feature_key, value_put, opts = {}) put_flag_setting_with_http_info(proj_key, env_key, key, feature_key, value_put, opts) nil end
Update flag settings for user Enable or disable a feature flag for a user based on their key. To change the setting, send a `PUT` request to this URL with a request body containing the flag value. For example, to disable the sort.order flag for the user `test@test.com`, send a `PUT` to `app.launchdarkly.com/api/v2/users/default/production/test@test.com/flags/sort.order`; with the following body: ```json { "setting": false } ``` Omitting the setting attribute, or a setting of null, in your `PUT` "clears" the current setting for a user. If you previously patched the flag, and the patch included the user's data, LaunchDarkly continues to use that data. If LaunchDarkly has never encountered the user's key before, it calculates the flag values based on the user key alone. @param proj_key [String] The project key @param env_key [String] The environment key @param key [String] The user key @param feature_key [String] The feature flag key @param value_put [ValuePut] @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/launchdarkly_api/api/user_settings_api.rb, line 359 def put_flag_setting_with_http_info(proj_key, env_key, key, feature_key, value_put, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserSettingsApi.put_flag_setting ...' end # verify the required parameter 'proj_key' is set if @api_client.config.client_side_validation && proj_key.nil? fail ArgumentError, "Missing the required parameter 'proj_key' when calling UserSettingsApi.put_flag_setting" end # verify the required parameter 'env_key' is set if @api_client.config.client_side_validation && env_key.nil? fail ArgumentError, "Missing the required parameter 'env_key' when calling UserSettingsApi.put_flag_setting" 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 UserSettingsApi.put_flag_setting" end # verify the required parameter 'feature_key' is set if @api_client.config.client_side_validation && feature_key.nil? fail ArgumentError, "Missing the required parameter 'feature_key' when calling UserSettingsApi.put_flag_setting" end # verify the required parameter 'value_put' is set if @api_client.config.client_side_validation && value_put.nil? fail ArgumentError, "Missing the required parameter 'value_put' when calling UserSettingsApi.put_flag_setting" end # resource path local_var_path = '/api/v2/users/{projKey}/{envKey}/{key}/flags/{featureKey}'.sub('{' + 'projKey' + '}', CGI.escape(proj_key.to_s)).sub('{' + 'envKey' + '}', CGI.escape(env_key.to_s)).sub('{' + 'key' + '}', CGI.escape(key.to_s)).sub('{' + 'featureKey' + '}', CGI.escape(feature_key.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(value_put) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] new_options = opts.merge( :operation => :"UserSettingsApi.put_flag_setting", :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, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: UserSettingsApi#put_flag_setting\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end