class LaunchDarklyApi::UsersApi
Attributes
Public Class Methods
# File lib/launchdarkly_api/api/users_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Delete user Delete a user by key @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 [nil]
# File lib/launchdarkly_api/api/users_api.rb, line 29 def delete_user(proj_key, env_key, key, opts = {}) delete_user_with_http_info(proj_key, env_key, key, opts) nil end
Delete user Delete a user by key @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<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/launchdarkly_api/api/users_api.rb, line 41 def delete_user_with_http_info(proj_key, env_key, key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UsersApi.delete_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 UsersApi.delete_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 UsersApi.delete_user" 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 UsersApi.delete_user" end # resource path local_var_path = '/api/v2/users/{projKey}/{envKey}/{key}'.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] || {} # 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'] new_options = opts.merge( :operation => :"UsersApi.delete_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(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#delete_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Find users Search users in LaunchDarkly based on their last active date, or a search query. Do not use to enumerate all users in LaunchDarkly. Instead use the [List users](getUsers) API resource. > ### `offset` is deprecated > > `offset` is deprecated and will be removed in a future API version. You can still use `offset` and `limit` for pagination, but we recommend you use `sort` and `searchAfter` instead. `searchAfter` allows you to page through more than 10,000 users, but `offset` and `limit` do not. @param proj_key [String] The project key @param env_key [String] The environment key @param [Hash] opts the optional parameters @option opts [String] :q Full-text search for users based on name, first name, last name, e-mail address, or key @option opts [Integer] :limit Specifies the maximum number of items in the collection to return (max: 50, default: 20) @option opts [Integer] :offset Specifies the first item to return in the collection @option opts [Integer] :after A unix epoch time in milliseconds specifying the maximum last time a user requested a feature flag from LaunchDarkly @option opts [String] :search_after Limits results to users with sort values after the value you specify. You can use this for pagination, but we recommend using the `next` link we provide instead. @return [Users]
# File lib/launchdarkly_api/api/users_api.rb, line 106 def get_search_users(proj_key, env_key, opts = {}) data, _status_code, _headers = get_search_users_with_http_info(proj_key, env_key, opts) data end
Find users Search users in LaunchDarkly based on their last active date, or a search query. Do not use to enumerate all users in LaunchDarkly. Instead use the [List users](getUsers) API resource. > ### `offset` is deprecated > > `offset` is deprecated and will be removed in a future API version. You can still use `offset` and `limit` for pagination, but we recommend you use `sort` and `searchAfter` instead. `searchAfter` allows you to page through more than 10,000 users, but `offset` and `limit` do not. @param proj_key [String] The project key @param env_key [String] The environment key @param [Hash] opts the optional parameters @option opts [String] :q Full-text search for users based on name, first name, last name, e-mail address, or key @option opts [Integer] :limit Specifies the maximum number of items in the collection to return (max: 50, default: 20) @option opts [Integer] :offset Specifies the first item to return in the collection @option opts [Integer] :after A unix epoch time in milliseconds specifying the maximum last time a user requested a feature flag from LaunchDarkly @option opts [String] :search_after Limits results to users with sort values after the value you specify. You can use this for pagination, but we recommend using the `next` link we provide instead. @return [Array<(Users
, Integer, Hash)>] Users
data, response status code and response headers
# File lib/launchdarkly_api/api/users_api.rb, line 122 def get_search_users_with_http_info(proj_key, env_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UsersApi.get_search_users ...' 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 UsersApi.get_search_users" 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 UsersApi.get_search_users" end # resource path local_var_path = '/api/v2/user-search/{projKey}/{envKey}'.sub('{' + 'projKey' + '}', CGI.escape(proj_key.to_s)).sub('{' + 'envKey' + '}', CGI.escape(env_key.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil? query_params[:'searchAfter'] = opts[:'search_after'] if !opts[:'search_after'].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] || 'Users' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] new_options = opts.merge( :operation => :"UsersApi.get_search_users", :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: UsersApi#get_search_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get user Get a user by key. The `user` object contains all attributes sent in `variation` calls for that key. @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 [User]
# File lib/launchdarkly_api/api/users_api.rb, line 186 def get_user(proj_key, env_key, key, opts = {}) data, _status_code, _headers = get_user_with_http_info(proj_key, env_key, key, opts) data end
Get user Get a user by key. The `user` object contains all attributes sent in `variation` calls for that key. @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<(User
, Integer, Hash)>] User
data, response status code and response headers
# File lib/launchdarkly_api/api/users_api.rb, line 198 def get_user_with_http_info(proj_key, env_key, key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UsersApi.get_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 UsersApi.get_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 UsersApi.get_user" 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 UsersApi.get_user" end # resource path local_var_path = '/api/v2/users/{projKey}/{envKey}/{key}'.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] || 'User' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] new_options = opts.merge( :operation => :"UsersApi.get_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: UsersApi#get_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
List users List all users in the environment. Includes the total count of users. In each page, there is up to `limit` users returned. The default is 20. This is useful for exporting all users in the system for further analysis. To paginate through, follow the `next` link in the `_links` object, as [described in Representations](/#section/Representations). @param proj_key [String] The project key @param env_key [String] The environment key @param [Hash] opts the optional parameters @option opts [Integer] :limit The number of elements to return per page @option opts [String] :search_after Limits results to users with sort values after the value you specify. You can use this for pagination, but we recommend using the `next` link we provide instead. @return [Users]
# File lib/launchdarkly_api/api/users_api.rb, line 262 def get_users(proj_key, env_key, opts = {}) data, _status_code, _headers = get_users_with_http_info(proj_key, env_key, opts) data end
List users List all users in the environment. Includes the total count of users. In each page, there is up to `limit` users returned. The default is 20. This is useful for exporting all users in the system for further analysis. To paginate through, follow the `next` link in the `_links` object, as [described in Representations](/#section/Representations). @param proj_key [String] The project key @param env_key [String] The environment key @param [Hash] opts the optional parameters @option opts [Integer] :limit The number of elements to return per page @option opts [String] :search_after Limits results to users with sort values after the value you specify. You can use this for pagination, but we recommend using the `next` link we provide instead. @return [Array<(Users
, Integer, Hash)>] Users
data, response status code and response headers
# File lib/launchdarkly_api/api/users_api.rb, line 275 def get_users_with_http_info(proj_key, env_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UsersApi.get_users ...' 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 UsersApi.get_users" 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 UsersApi.get_users" end # resource path local_var_path = '/api/v2/users/{projKey}/{envKey}'.sub('{' + 'projKey' + '}', CGI.escape(proj_key.to_s)).sub('{' + 'envKey' + '}', CGI.escape(env_key.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'searchAfter'] = opts[:'search_after'] if !opts[:'search_after'].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] || 'Users' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] new_options = opts.merge( :operation => :"UsersApi.get_users", :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: UsersApi#get_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end