Class: InfluxDB2::API::UsersApi
- Inherits:
-
Object
- Object
- InfluxDB2::API::UsersApi
- Defined in:
- lib/influxdb2/apis/generated/api/users_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#delete_users_id(user_id, opts = {}) ⇒ nil
Delete a user.
-
#delete_users_id_with_http_info(user_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete a user.
-
#get_flags(opts = {}) ⇒ Hash<String, Object>
Return the feature flags for the currently authenticated user.
-
#get_flags_with_http_info(opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
Return the feature flags for the currently authenticated user.
-
#get_me(opts = {}) ⇒ UserResponse
Retrieve the currently authenticated user.
-
#get_me_with_http_info(opts = {}) ⇒ Array<(UserResponse, Integer, Hash)>
Retrieve the currently authenticated user.
-
#get_users(opts = {}) ⇒ Users
List all users.
-
#get_users_id(user_id, opts = {}) ⇒ UserResponse
Retrieve a user.
-
#get_users_id_with_http_info(user_id, opts = {}) ⇒ Array<(UserResponse, Integer, Hash)>
Retrieve a user.
-
#get_users_with_http_info(opts = {}) ⇒ Array<(Users, Integer, Hash)>
List all users.
-
#initialize(api_client = ApiClient.default) ⇒ UsersApi
constructor
A new instance of UsersApi.
-
#patch_users_id(user_id, user, opts = {}) ⇒ UserResponse
Update a user.
-
#patch_users_id_with_http_info(user_id, user, opts = {}) ⇒ Array<(UserResponse, Integer, Hash)>
Update a user.
-
#post_users(user, opts = {}) ⇒ UserResponse
Create a user.
-
#post_users_id_password(user_id, password_reset_body, opts = {}) ⇒ nil
Update a password.
-
#post_users_id_password_with_http_info(user_id, password_reset_body, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Update a password.
-
#post_users_with_http_info(user, opts = {}) ⇒ Array<(UserResponse, Integer, Hash)>
Create a user.
-
#put_me_password(password_reset_body, opts = {}) ⇒ nil
Update a password.
-
#put_me_password_with_http_info(password_reset_body, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Update a password.
Constructor Details
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
16 17 18 |
# File 'lib/influxdb2/apis/generated/api/users_api.rb', line 16 def api_client @api_client end |
Instance Method Details
#delete_users_id(user_id, opts = {}) ⇒ nil
Delete a user
26 27 28 29 |
# File 'lib/influxdb2/apis/generated/api/users_api.rb', line 26 def delete_users_id(user_id, opts = {}) delete_users_id_with_http_info(user_id, opts) nil end |
#delete_users_id_with_http_info(user_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete a user
36 37 38 39 40 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 |
# File 'lib/influxdb2/apis/generated/api/users_api.rb', line 36 def delete_users_id_with_http_info(user_id, opts = {}) # verify the required parameter 'user_id' is set if @api_client.config.client_side_validation && user_id.nil? fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.delete_users_id" end # resource path local_var_path = '/users/{userID}'.sub('{' + 'userID' + '}', CGI.escape(user_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']) header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? # 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] || ['header'] = opts.merge( :operation => :"UsersApi.delete_users_id", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) return data, status_code, headers end |
#get_flags(opts = {}) ⇒ Hash<String, Object>
Return the feature flags for the currently authenticated user
83 84 85 86 |
# File 'lib/influxdb2/apis/generated/api/users_api.rb', line 83 def get_flags(opts = {}) data, _status_code, _headers = get_flags_with_http_info(opts) data end |
#get_flags_with_http_info(opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
Return the feature flags for the currently authenticated user
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/influxdb2/apis/generated/api/users_api.rb', line 92 def get_flags_with_http_info(opts = {}) # resource path local_var_path = '/flags' # 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']) header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash<String, Object>' # auth_names auth_names = opts[:debug_auth_names] || ['header'] = opts.merge( :operation => :"UsersApi.get_flags", :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, ) return data, status_code, headers end |
#get_me(opts = {}) ⇒ UserResponse
Retrieve the currently authenticated user
135 136 137 138 |
# File 'lib/influxdb2/apis/generated/api/users_api.rb', line 135 def get_me(opts = {}) data, _status_code, _headers = get_me_with_http_info(opts) data end |
#get_me_with_http_info(opts = {}) ⇒ Array<(UserResponse, Integer, Hash)>
Retrieve the currently authenticated user
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 |
# File 'lib/influxdb2/apis/generated/api/users_api.rb', line 144 def get_me_with_http_info(opts = {}) # resource path local_var_path = '/me' # 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']) header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'UserResponse' # auth_names auth_names = opts[:debug_auth_names] || ['header'] = opts.merge( :operation => :"UsersApi.get_me", :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, ) return data, status_code, headers end |
#get_users(opts = {}) ⇒ Users
List all users
192 193 194 195 |
# File 'lib/influxdb2/apis/generated/api/users_api.rb', line 192 def get_users(opts = {}) data, _status_code, _headers = get_users_with_http_info(opts) data end |
#get_users_id(user_id, opts = {}) ⇒ UserResponse
Retrieve a user
267 268 269 270 |
# File 'lib/influxdb2/apis/generated/api/users_api.rb', line 267 def get_users_id(user_id, opts = {}) data, _status_code, _headers = get_users_id_with_http_info(user_id, opts) data end |
#get_users_id_with_http_info(user_id, opts = {}) ⇒ Array<(UserResponse, Integer, Hash)>
Retrieve a user
277 278 279 280 281 282 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 |
# File 'lib/influxdb2/apis/generated/api/users_api.rb', line 277 def get_users_id_with_http_info(user_id, opts = {}) # verify the required parameter 'user_id' is set if @api_client.config.client_side_validation && user_id.nil? fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.get_users_id" end # resource path local_var_path = '/users/{userID}'.sub('{' + 'userID' + '}', CGI.escape(user_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']) header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'UserResponse' # auth_names auth_names = opts[:debug_auth_names] || ['header'] = opts.merge( :operation => :"UsersApi.get_users_id", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) return data, status_code, headers end |
#get_users_with_http_info(opts = {}) ⇒ Array<(Users, Integer, Hash)>
List all users
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/influxdb2/apis/generated/api/users_api.rb', line 206 def get_users_with_http_info(opts = {}) if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0 fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling UsersApi.get_users, must be greater than or equal to 0.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling UsersApi.get_users, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling UsersApi.get_users, must be greater than or equal to 1.' end # resource path local_var_path = '/users' # query parameters query_params = opts[:query_params] || {} query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil? query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil? query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? # 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] || ['header'] = 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, ) return data, status_code, headers end |
#patch_users_id(user_id, user, opts = {}) ⇒ UserResponse
Update a user
326 327 328 329 |
# File 'lib/influxdb2/apis/generated/api/users_api.rb', line 326 def patch_users_id(user_id, user, opts = {}) data, _status_code, _headers = patch_users_id_with_http_info(user_id, user, opts) data end |
#patch_users_id_with_http_info(user_id, user, opts = {}) ⇒ Array<(UserResponse, Integer, Hash)>
Update a user
337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 |
# File 'lib/influxdb2/apis/generated/api/users_api.rb', line 337 def patch_users_id_with_http_info(user_id, user, opts = {}) # verify the required parameter 'user_id' is set if @api_client.config.client_side_validation && user_id.nil? fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.patch_users_id" end # verify the required parameter 'user' is set if @api_client.config.client_side_validation && user.nil? fail ArgumentError, "Missing the required parameter 'user' when calling UsersApi.patch_users_id" end # resource path local_var_path = '/users/{userID}'.sub('{' + 'userID' + '}', CGI.escape(user_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(user) # return_type return_type = opts[:debug_return_type] || 'UserResponse' # auth_names auth_names = opts[:debug_auth_names] || ['header'] = opts.merge( :operation => :"UsersApi.patch_users_id", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, ) return data, status_code, headers end |
#post_users(user, opts = {}) ⇒ UserResponse
Create a user
391 392 393 394 |
# File 'lib/influxdb2/apis/generated/api/users_api.rb', line 391 def post_users(user, opts = {}) data, _status_code, _headers = post_users_with_http_info(user, opts) data end |
#post_users_id_password(user_id, password_reset_body, opts = {}) ⇒ nil
Update a password
452 453 454 455 |
# File 'lib/influxdb2/apis/generated/api/users_api.rb', line 452 def post_users_id_password(user_id, password_reset_body, opts = {}) post_users_id_password_with_http_info(user_id, password_reset_body, opts) nil end |
#post_users_id_password_with_http_info(user_id, password_reset_body, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Update a password
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 497 498 499 500 501 502 503 504 505 506 507 508 509 510 |
# File 'lib/influxdb2/apis/generated/api/users_api.rb', line 463 def post_users_id_password_with_http_info(user_id, password_reset_body, opts = {}) # verify the required parameter 'user_id' is set if @api_client.config.client_side_validation && user_id.nil? fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.post_users_id_password" end # verify the required parameter 'password_reset_body' is set if @api_client.config.client_side_validation && password_reset_body.nil? fail ArgumentError, "Missing the required parameter 'password_reset_body' when calling UsersApi.post_users_id_password" end # resource path local_var_path = '/users/{userID}/password'.sub('{' + 'userID' + '}', CGI.escape(user_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(password_reset_body) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['header'] = opts.merge( :operation => :"UsersApi.post_users_id_password", :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, ) return data, status_code, headers end |
#post_users_with_http_info(user, opts = {}) ⇒ Array<(UserResponse, Integer, Hash)>
Create a user
401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 |
# File 'lib/influxdb2/apis/generated/api/users_api.rb', line 401 def post_users_with_http_info(user, opts = {}) # verify the required parameter 'user' is set if @api_client.config.client_side_validation && user.nil? fail ArgumentError, "Missing the required parameter 'user' when calling UsersApi.post_users" end # resource path local_var_path = '/users' # 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']) header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(user) # return_type return_type = opts[:debug_return_type] || 'UserResponse' # auth_names auth_names = opts[:debug_auth_names] || ['header'] = opts.merge( :operation => :"UsersApi.post_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(:POST, local_var_path, ) return data, status_code, headers end |
#put_me_password(password_reset_body, opts = {}) ⇒ nil
Update a password
517 518 519 520 |
# File 'lib/influxdb2/apis/generated/api/users_api.rb', line 517 def put_me_password(password_reset_body, opts = {}) put_me_password_with_http_info(password_reset_body, opts) nil end |
#put_me_password_with_http_info(password_reset_body, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Update a password
527 528 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 |
# File 'lib/influxdb2/apis/generated/api/users_api.rb', line 527 def put_me_password_with_http_info(password_reset_body, opts = {}) # verify the required parameter 'password_reset_body' is set if @api_client.config.client_side_validation && password_reset_body.nil? fail ArgumentError, "Missing the required parameter 'password_reset_body' when calling UsersApi.put_me_password" end # resource path local_var_path = '/me/password' # 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']) header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(password_reset_body) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['header'] = opts.merge( :operation => :"UsersApi.put_me_password", :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, ) return data, status_code, headers end |