Class: Uiza::User

Inherits:
Object
  • Object
show all
Extended by:
APIOperation::Create, APIOperation::Delete, APIOperation::List, APIOperation::Retrieve, APIOperation::Update
Defined in:
lib/uiza/user.rb

Constant Summary collapse

OBJECT_API_PATH =
"admin/user".freeze
{
  create: "https://docs.uiza.io/#create-an-user",
  retrieve: "https://docs.uiza.io/#retrieve-an-user",
  list: "https://docs.uiza.io/#list-all-users",
  update: "https://docs.uiza.io/#update-an-user",
  delete: "https://docs.uiza.io/#delete-an-user",
  change_password: "https://docs.uiza.io/#update-password",
  logout: "https://docs.uiza.io/#log-out"
}.freeze

Class Method Summary collapse

Methods included from APIOperation::Create

create

Methods included from APIOperation::Retrieve

retrieve

Methods included from APIOperation::List

list

Methods included from APIOperation::Update

update

Methods included from APIOperation::Delete

delete

Class Method Details

.change_password(params) ⇒ Object



21
22
23
24
25
26
27
28
# File 'lib/uiza/user.rb', line 21

def change_password params
  url = "https://#{Uiza.workspace_api_domain}/api/public/v3/#{OBJECT_API_PATH}/changepassword"
  method = :post
  headers = {"Authorization" => Uiza.authorization}

  uiza_client = UizaClient.new url, method, headers, params, OBJECT_API_DESCRIPTION_LINK[:change_password]
  uiza_client.execute_request
end

.logoutObject



30
31
32
33
34
35
36
37
38
# File 'lib/uiza/user.rb', line 30

def logout
  url = "https://#{Uiza.workspace_api_domain}/api/public/v3/#{OBJECT_API_PATH}/logout"
  method = :post
  headers = {"Authorization" => Uiza.authorization}
  params = {}

  uiza_client = UizaClient.new url, method, headers, params, OBJECT_API_DESCRIPTION_LINK[:logout]
  uiza_client.execute_request
end