Class: Seam::Clients::UserIdentities

Inherits:
Object
  • Object
show all
Defined in:
lib/seam/routes/clients/user_identities.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:, defaults:) ⇒ UserIdentities

Returns a new instance of UserIdentities.



6
7
8
9
# File 'lib/seam/routes/clients/user_identities.rb', line 6

def initialize(client:, defaults:)
  @client = client
  @defaults = defaults
end

Instance Method Details

#add_acs_user(acs_user_id:, user_identity_id:) ⇒ Object



11
12
13
14
15
# File 'lib/seam/routes/clients/user_identities.rb', line 11

def add_acs_user(acs_user_id:, user_identity_id:)
  @client.post("/user_identities/add_acs_user", {acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact)

  nil
end

#create(acs_system_ids: nil, email_address: nil, full_name: nil, phone_number: nil, user_identity_key: nil) ⇒ Object



17
18
19
20
21
# File 'lib/seam/routes/clients/user_identities.rb', line 17

def create(acs_system_ids: nil, email_address: nil, full_name: nil, phone_number: nil, user_identity_key: nil)
  res = @client.post("/user_identities/create", {acs_system_ids: acs_system_ids, email_address: email_address, full_name: full_name, phone_number: phone_number, user_identity_key: user_identity_key}.compact)

  Seam::Resources::UserIdentity.load_from_response(res.body["user_identity"])
end

#delete(user_identity_id:) ⇒ Object



23
24
25
26
27
# File 'lib/seam/routes/clients/user_identities.rb', line 23

def delete(user_identity_id:)
  @client.post("/user_identities/delete", {user_identity_id: user_identity_id}.compact)

  nil
end

#generate_instant_key(user_identity_id:, customization_profile_id: nil, max_use_count: nil) ⇒ Object



29
30
31
32
33
# File 'lib/seam/routes/clients/user_identities.rb', line 29

def generate_instant_key(user_identity_id:, customization_profile_id: nil, max_use_count: nil)
  res = @client.post("/user_identities/generate_instant_key", {user_identity_id: user_identity_id, customization_profile_id: customization_profile_id, max_use_count: max_use_count}.compact)

  Seam::Resources::InstantKey.load_from_response(res.body["instant_key"])
end

#get(user_identity_id: nil, user_identity_key: nil) ⇒ Object



35
36
37
38
39
# File 'lib/seam/routes/clients/user_identities.rb', line 35

def get(user_identity_id: nil, user_identity_key: nil)
  res = @client.post("/user_identities/get", {user_identity_id: user_identity_id, user_identity_key: user_identity_key}.compact)

  Seam::Resources::UserIdentity.load_from_response(res.body["user_identity"])
end

#grant_access_to_device(device_id:, user_identity_id:) ⇒ Object



41
42
43
44
45
# File 'lib/seam/routes/clients/user_identities.rb', line 41

def grant_access_to_device(device_id:, user_identity_id:)
  @client.post("/user_identities/grant_access_to_device", {device_id: device_id, user_identity_id: user_identity_id}.compact)

  nil
end

#list(credential_manager_acs_system_id: nil, search: nil) ⇒ Object



47
48
49
50
51
# File 'lib/seam/routes/clients/user_identities.rb', line 47

def list(credential_manager_acs_system_id: nil, search: nil)
  res = @client.post("/user_identities/list", {credential_manager_acs_system_id: credential_manager_acs_system_id, search: search}.compact)

  Seam::Resources::UserIdentity.load_from_response(res.body["user_identities"])
end

#list_accessible_devices(user_identity_id:) ⇒ Object



53
54
55
56
57
# File 'lib/seam/routes/clients/user_identities.rb', line 53

def list_accessible_devices(user_identity_id:)
  res = @client.post("/user_identities/list_accessible_devices", {user_identity_id: user_identity_id}.compact)

  Seam::Resources::Device.load_from_response(res.body["devices"])
end

#list_acs_systems(user_identity_id:) ⇒ Object



59
60
61
62
63
# File 'lib/seam/routes/clients/user_identities.rb', line 59

def list_acs_systems(user_identity_id:)
  res = @client.post("/user_identities/list_acs_systems", {user_identity_id: user_identity_id}.compact)

  Seam::Resources::AcsSystem.load_from_response(res.body["acs_systems"])
end

#list_acs_users(user_identity_id:) ⇒ Object



65
66
67
68
69
# File 'lib/seam/routes/clients/user_identities.rb', line 65

def list_acs_users(user_identity_id:)
  res = @client.post("/user_identities/list_acs_users", {user_identity_id: user_identity_id}.compact)

  Seam::Resources::AcsUser.load_from_response(res.body["acs_users"])
end

#remove_acs_user(acs_user_id:, user_identity_id:) ⇒ Object



71
72
73
74
75
# File 'lib/seam/routes/clients/user_identities.rb', line 71

def remove_acs_user(acs_user_id:, user_identity_id:)
  @client.post("/user_identities/remove_acs_user", {acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact)

  nil
end

#revoke_access_to_device(device_id:, user_identity_id:) ⇒ Object



77
78
79
80
81
# File 'lib/seam/routes/clients/user_identities.rb', line 77

def revoke_access_to_device(device_id:, user_identity_id:)
  @client.post("/user_identities/revoke_access_to_device", {device_id: device_id, user_identity_id: user_identity_id}.compact)

  nil
end

#update(user_identity_id:, email_address: nil, full_name: nil, phone_number: nil, user_identity_key: nil) ⇒ Object



83
84
85
86
87
# File 'lib/seam/routes/clients/user_identities.rb', line 83

def update(user_identity_id:, email_address: nil, full_name: nil, phone_number: nil, user_identity_key: nil)
  @client.post("/user_identities/update", {user_identity_id: user_identity_id, email_address: email_address, full_name: full_name, phone_number: phone_number, user_identity_key: user_identity_key}.compact)

  nil
end