Class: Superset::Security::User::Create
- Defined in:
- lib/superset/security/user/create.rb
Constant Summary
Constants inherited from Request
Instance Attribute Summary collapse
-
#user_params ⇒ Object
readonly
Returns the value of attribute user_params.
Attributes inherited from Request
Instance Method Summary collapse
-
#initialize(user_params: {}) ⇒ Create
constructor
A new instance of Create.
- #response ⇒ Object
- #validate_user_params ⇒ Object
Methods inherited from Request
call, #query_params, #result, #superset_host
Methods included from Display
#display_headers, #headings, #list, #list_attributes, #result, #rows, #table, #title
Constructor Details
#initialize(user_params: {}) ⇒ Create
Returns a new instance of Create.
7 8 9 |
# File 'lib/superset/security/user/create.rb', line 7 def initialize(user_params: {}) @user_params = user_params.with_indifferent_access end |
Instance Attribute Details
#user_params ⇒ Object (readonly)
Returns the value of attribute user_params.
5 6 7 |
# File 'lib/superset/security/user/create.rb', line 5 def user_params @user_params end |
Instance Method Details
#response ⇒ Object
11 12 13 14 15 |
# File 'lib/superset/security/user/create.rb', line 11 def response validate_user_params @response ||= client.post(route, user_params) end |
#validate_user_params ⇒ Object
17 18 19 20 21 |
# File 'lib/superset/security/user/create.rb', line 17 def validate_user_params raise InvalidParameterError, "Missing user params. Expects #{valid_user_params_keys}" unless symbolized_user_param_keys == valid_user_params_keys raise InvalidParameterError, 'Roles must be an array ' unless user_params[:roles].is_a?(Array) confirm_all_params_present end |