Class: Morpheus::AccountUsersInterface

Inherits:
RestInterface
  • Object
show all
Defined in:
lib/morpheus/api/account_users_interface.rb

Instance Method Summary collapse

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(, id=nil, params={}, headers={})
  #validate_id!(account_id, "account_id")
  execute(method: :get, url: "#{build_url(, 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()
  if 
    "/api/accounts/#{}/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(, payload, params={}, headers={})
  #validate_id!(account_id, "account_id")
  execute(method: :post, url: "#{build_url()}", 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(, id, params = {}, headers={})
  #validate_id!(account_id, "account_id")
  validate_id!(id)
  execute(method: :delete, url: "#{build_url(, 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 feature_permissions(, id, params={}, headers={})
  #validate_id!(account_id, "account_id")
  validate_id!(id)
  execute(method: :get, url: "#{build_url(, 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(, id, params={}, headers={})
  #validate_id!(account_id, "account_id")
  validate_id!(id)
  execute(method: :get, url: "#{build_url(, 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(, params={}, headers={})
  #validate_id!(account_id, "account_id")
  execute(method: :get, url: "#{build_url()}", 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 permissions(, id, params={}, headers={})
  #validate_id!(account_id, "account_id")
  validate_id!(id)
  execute(method: :get, url: "#{build_url(, 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(, id, payload, params={}, headers={})
  #validate_id!(account_id, "account_id")
  validate_id!(id)
  execute(method: :put, url: "#{build_url(, id)}", params: params, payload: payload, headers: headers)
end