Class: Morpheus::AccountUsersInterface
- Inherits:
-
RestInterface
- Object
- RestInterface
- Morpheus::AccountUsersInterface
- Defined in:
- lib/morpheus/api/account_users_interface.rb
Instance Method Summary collapse
- #available_roles(account_id, id = nil, params = {}, headers = {}) ⇒ Object
- #base_path(account_id) ⇒ Object
- #create(account_id, payload, params = {}, headers = {}) ⇒ Object
- #destroy(account_id, id, params = {}, headers = {}) ⇒ Object
- #feature_permissions(account_id, id, params = {}, headers = {}) ⇒ Object
- #get(account_id, id, params = {}, headers = {}) ⇒ Object
- #list(account_id, params = {}, headers = {}) ⇒ Object
- #permissions(account_id, id, params = {}, headers = {}) ⇒ Object
- #update(account_id, id, payload, params = {}, headers = {}) ⇒ Object
Instance Method Details
#available_roles(account_id, id = nil, params = {}, headers = {}) ⇒ Object
53 54 55 56 |
# File 'lib/morpheus/api/account_users_interface.rb', line 53 def available_roles(account_id, id=nil, params={}, headers={}) #validate_id!(account_id, "account_id") execute(method: :get, url: "#{build_url(account_id, id)}/available-roles", params: params, headers: headers) end |
#base_path(account_id) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/morpheus/api/account_users_interface.rb', line 5 def base_path(account_id) if account_id "/api/accounts/#{account_id}/users" else "/api/users" end end |
#create(account_id, payload, params = {}, headers = {}) ⇒ Object
24 25 26 27 |
# File 'lib/morpheus/api/account_users_interface.rb', line 24 def create(account_id, payload, params={}, headers={}) #validate_id!(account_id, "account_id") execute(method: :post, url: "#{build_url(account_id)}", params: params, payload: payload, headers: headers) end |
#destroy(account_id, id, params = {}, headers = {}) ⇒ Object
35 36 37 38 39 |
# File 'lib/morpheus/api/account_users_interface.rb', line 35 def destroy(account_id, id, params = {}, headers={}) #validate_id!(account_id, "account_id") validate_id!(id) execute(method: :delete, url: "#{build_url(account_id, id)}", params: params, headers: headers) end |
#feature_permissions(account_id, id, params = {}, headers = {}) ⇒ Object
41 42 43 44 45 |
# File 'lib/morpheus/api/account_users_interface.rb', line 41 def (account_id, id, params={}, headers={}) #validate_id!(account_id, "account_id") validate_id!(id) execute(method: :get, url: "#{build_url(account_id, id)}/feature-permissions", params: params, headers: headers) end |
#get(account_id, id, params = {}, headers = {}) ⇒ Object
18 19 20 21 22 |
# File 'lib/morpheus/api/account_users_interface.rb', line 18 def get(account_id, id, params={}, headers={}) #validate_id!(account_id, "account_id") validate_id!(id) execute(method: :get, url: "#{build_url(account_id, id)}", params: params, headers: headers) end |
#list(account_id, params = {}, headers = {}) ⇒ Object
13 14 15 16 |
# File 'lib/morpheus/api/account_users_interface.rb', line 13 def list(account_id, params={}, headers={}) #validate_id!(account_id, "account_id") execute(method: :get, url: "#{build_url(account_id)}", params: params, headers: headers) end |
#permissions(account_id, id, params = {}, headers = {}) ⇒ Object
47 48 49 50 51 |
# File 'lib/morpheus/api/account_users_interface.rb', line 47 def (account_id, id, params={}, headers={}) #validate_id!(account_id, "account_id") validate_id!(id) execute(method: :get, url: "#{build_url(account_id, id)}/permissions", params: params, headers: headers) end |
#update(account_id, id, payload, params = {}, headers = {}) ⇒ Object
29 30 31 32 33 |
# File 'lib/morpheus/api/account_users_interface.rb', line 29 def update(account_id, id, payload, params={}, headers={}) #validate_id!(account_id, "account_id") validate_id!(id) execute(method: :put, url: "#{build_url(account_id, id)}", params: params, payload: payload, headers: headers) end |