Class: Hanko::Api::Admin::Users::UserContext

Inherits:
Object
  • Object
show all
Defined in:
lib/hanko/api/admin/users.rb

Overview

Provides access to sub-resources scoped to a specific user.

Instance Method Summary collapse

Constructor Details

#initialize(connection, user_id) ⇒ UserContext

Initialize a user-scoped context.

Parameters:

  • connection (Hanko::Connection)

    the HTTP connection to use

  • user_id (String)

    the unique identifier of the user



33
34
35
36
37
# File 'lib/hanko/api/admin/users.rb', line 33

def initialize(connection, user_id)
  @connection = connection
  @user_id = user_id
  @base_path = "/users/#{user_id}"
end

Instance Method Details

#emailsEmails

Access the emails sub-resource for this user.

Returns:

  • (Emails)

    the emails resource scoped to this user



42
43
44
# File 'lib/hanko/api/admin/users.rb', line 42

def emails
  Emails.new(@connection, @base_path)
end

#metadataMetadata

Access the metadata sub-resource for this user.

Returns:

  • (Metadata)

    the metadata resource scoped to this user



70
71
72
# File 'lib/hanko/api/admin/users.rb', line 70

def 
  .new(@connection, @base_path)
end

#passwordsPasswords

Access the passwords sub-resource for this user.

Returns:

  • (Passwords)

    the passwords resource scoped to this user



49
50
51
# File 'lib/hanko/api/admin/users.rb', line 49

def passwords
  Passwords.new(@connection, @base_path)
end

#sessionsSessions

Access the sessions sub-resource for this user.

Returns:

  • (Sessions)

    the sessions resource scoped to this user



56
57
58
# File 'lib/hanko/api/admin/users.rb', line 56

def sessions
  Sessions.new(@connection, @base_path)
end

#webauthn_credentialsWebauthnCredentials

Access the WebAuthn credentials sub-resource for this user.

Returns:



63
64
65
# File 'lib/hanko/api/admin/users.rb', line 63

def webauthn_credentials
  WebauthnCredentials.new(@connection, @base_path)
end