Class: LaunchDarklyApi::UsersApi
- Inherits:
-
Object
- Object
- LaunchDarklyApi::UsersApi
- Defined in:
- lib/launchdarkly_api/api/users_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#delete_user(project_key, environment_key, user_key, opts = {}) ⇒ nil
Delete user Delete a user by key.
-
#delete_user_with_http_info(project_key, environment_key, user_key, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete user Delete a user by key.
-
#get_search_users(project_key, environment_key, opts = {}) ⇒ Users
Find users Search users in LaunchDarkly based on their last active date, a user attribute filter set, or a search query.
-
#get_search_users_with_http_info(project_key, environment_key, opts = {}) ⇒ Array<(Users, Integer, Hash)>
Find users Search users in LaunchDarkly based on their last active date, a user attribute filter set, or a search query.
-
#get_user(project_key, environment_key, user_key, opts = {}) ⇒ UserRecord
Get user Get a user by key.
-
#get_user_with_http_info(project_key, environment_key, user_key, opts = {}) ⇒ Array<(UserRecord, Integer, Hash)>
Get user Get a user by key.
-
#get_users(project_key, environment_key, opts = {}) ⇒ Users
List users List all users in the environment.
-
#get_users_with_http_info(project_key, environment_key, opts = {}) ⇒ Array<(Users, Integer, Hash)>
List users List all users in the environment.
-
#initialize(api_client = ApiClient.default) ⇒ UsersApi
constructor
A new instance of UsersApi.
Constructor Details
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/launchdarkly_api/api/users_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#delete_user(project_key, environment_key, user_key, opts = {}) ⇒ nil
Delete user Delete a user by key
29 30 31 32 |
# File 'lib/launchdarkly_api/api/users_api.rb', line 29 def delete_user(project_key, environment_key, user_key, opts = {}) delete_user_with_http_info(project_key, environment_key, user_key, opts) nil end |
#delete_user_with_http_info(project_key, environment_key, user_key, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete user Delete a user by key
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/users_api.rb', line 41 def delete_user_with_http_info(project_key, environment_key, user_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UsersApi.delete_user ...' 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 UsersApi.delete_user" 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 UsersApi.delete_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 UsersApi.delete_user" end # resource path local_var_path = '/api/v2/users/{projectKey}/{environmentKey}/{userKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)).sub('{' + 'userKey' + '}', CGI.escape(user_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] # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] = 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, ) 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 |
#get_search_users(project_key, environment_key, opts = {}) ⇒ Users
Find users Search users in LaunchDarkly based on their last active date, a user attribute filter set, or a search query. An example user attribute filter set is ‘filter=firstName:Anna,activeTrial:false`. This matches users that have the user attribute `firstName` set to `Anna`, that also have the attribute `activeTrial` set to `false`. To paginate through results, follow the `next` link in the `_links` object. To learn more, read [Representations](/#section/Representations). > ### `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.
110 111 112 113 |
# File 'lib/launchdarkly_api/api/users_api.rb', line 110 def get_search_users(project_key, environment_key, opts = {}) data, _status_code, _headers = get_search_users_with_http_info(project_key, environment_key, opts) data end |
#get_search_users_with_http_info(project_key, environment_key, opts = {}) ⇒ Array<(Users, Integer, Hash)>
Find users Search users in LaunchDarkly based on their last active date, a user attribute filter set, or a search query. An example user attribute filter set is `filter=firstName:Anna,activeTrial:false`. This matches users that have the user attribute `firstName` set to `Anna`, that also have the attribute `activeTrial` set to `false`. To paginate through results, follow the `next` link in the `_links` object. To learn more, read [Representations](/#section/Representations). > ### `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.
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 |
# File 'lib/launchdarkly_api/api/users_api.rb', line 128 def get_search_users_with_http_info(project_key, environment_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UsersApi.get_search_users ...' 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 UsersApi.get_search_users" 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 UsersApi.get_search_users" end # resource path local_var_path = '/api/v2/user-search/{projectKey}/{environmentKey}'.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[:'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[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'searchAfter'] = opts[:'search_after'] if !opts[:'search_after'].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']) # 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'] = 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, ) 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(project_key, environment_key, user_key, opts = {}) ⇒ UserRecord
Get user Get a user by key. The ‘user` object contains all attributes sent in `variation` calls for that key.
194 195 196 197 |
# File 'lib/launchdarkly_api/api/users_api.rb', line 194 def get_user(project_key, environment_key, user_key, opts = {}) data, _status_code, _headers = get_user_with_http_info(project_key, environment_key, user_key, opts) data end |
#get_user_with_http_info(project_key, environment_key, user_key, opts = {}) ⇒ Array<(UserRecord, Integer, Hash)>
Get user Get a user by key. The `user` object contains all attributes sent in `variation` calls for that key.
206 207 208 209 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 |
# File 'lib/launchdarkly_api/api/users_api.rb', line 206 def get_user_with_http_info(project_key, environment_key, user_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UsersApi.get_user ...' 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 UsersApi.get_user" 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 UsersApi.get_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 UsersApi.get_user" end # resource path local_var_path = '/api/v2/users/{projectKey}/{environmentKey}/{userKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)).sub('{' + 'userKey' + '}', CGI.escape(user_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] || 'UserRecord' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] = 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, ) 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 |
#get_users(project_key, environment_key, opts = {}) ⇒ Users
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).
270 271 272 273 |
# File 'lib/launchdarkly_api/api/users_api.rb', line 270 def get_users(project_key, environment_key, opts = {}) data, _status_code, _headers = get_users_with_http_info(project_key, environment_key, opts) data end |
#get_users_with_http_info(project_key, environment_key, opts = {}) ⇒ Array<(Users, Integer, Hash)>
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).
283 284 285 286 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 |
# File 'lib/launchdarkly_api/api/users_api.rb', line 283 def get_users_with_http_info(project_key, environment_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UsersApi.get_users ...' 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 UsersApi.get_users" 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 UsersApi.get_users" end # resource path local_var_path = '/api/v2/users/{projectKey}/{environmentKey}'.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[:'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'] = 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, ) 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 |