Class: Supabase::Auth::Types::User

Inherits:
Struct
  • Object
show all
Defined in:
lib/supabase/auth/types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

Returns the value of attribute action_link

Returns:

  • (Object)

    the current value of action_link



84
85
86
# File 'lib/supabase/auth/types.rb', line 84

def action_link
  @action_link
end

#app_metadataObject

Returns the value of attribute app_metadata

Returns:

  • (Object)

    the current value of app_metadata



84
85
86
# File 'lib/supabase/auth/types.rb', line 84

def 
  @app_metadata
end

#audObject

Returns the value of attribute aud

Returns:

  • (Object)

    the current value of aud



84
85
86
# File 'lib/supabase/auth/types.rb', line 84

def aud
  @aud
end

#banned_untilObject

Returns the value of attribute banned_until

Returns:

  • (Object)

    the current value of banned_until



84
85
86
# File 'lib/supabase/auth/types.rb', line 84

def banned_until
  @banned_until
end

#confirmation_sent_atObject

Returns the value of attribute confirmation_sent_at

Returns:

  • (Object)

    the current value of confirmation_sent_at



84
85
86
# File 'lib/supabase/auth/types.rb', line 84

def confirmation_sent_at
  @confirmation_sent_at
end

#confirmed_atObject

Returns the value of attribute confirmed_at

Returns:

  • (Object)

    the current value of confirmed_at



84
85
86
# File 'lib/supabase/auth/types.rb', line 84

def confirmed_at
  @confirmed_at
end

#created_atObject

Returns the value of attribute created_at

Returns:

  • (Object)

    the current value of created_at



84
85
86
# File 'lib/supabase/auth/types.rb', line 84

def created_at
  @created_at
end

#deleted_atObject

Returns the value of attribute deleted_at

Returns:

  • (Object)

    the current value of deleted_at



84
85
86
# File 'lib/supabase/auth/types.rb', line 84

def deleted_at
  @deleted_at
end

#emailObject

Returns the value of attribute email

Returns:

  • (Object)

    the current value of email



84
85
86
# File 'lib/supabase/auth/types.rb', line 84

def email
  @email
end

#email_change_sent_atObject

Returns the value of attribute email_change_sent_at

Returns:

  • (Object)

    the current value of email_change_sent_at



84
85
86
# File 'lib/supabase/auth/types.rb', line 84

def email_change_sent_at
  @email_change_sent_at
end

#email_confirmed_atObject

Returns the value of attribute email_confirmed_at

Returns:

  • (Object)

    the current value of email_confirmed_at



84
85
86
# File 'lib/supabase/auth/types.rb', line 84

def email_confirmed_at
  @email_confirmed_at
end

#factorsObject

Returns the value of attribute factors

Returns:

  • (Object)

    the current value of factors



84
85
86
# File 'lib/supabase/auth/types.rb', line 84

def factors
  @factors
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



84
85
86
# File 'lib/supabase/auth/types.rb', line 84

def id
  @id
end

#identitiesObject

Returns the value of attribute identities

Returns:

  • (Object)

    the current value of identities



84
85
86
# File 'lib/supabase/auth/types.rb', line 84

def identities
  @identities
end

#invited_atObject

Returns the value of attribute invited_at

Returns:

  • (Object)

    the current value of invited_at



84
85
86
# File 'lib/supabase/auth/types.rb', line 84

def invited_at
  @invited_at
end

#is_anonymousObject

Returns the value of attribute is_anonymous

Returns:

  • (Object)

    the current value of is_anonymous



84
85
86
# File 'lib/supabase/auth/types.rb', line 84

def is_anonymous
  @is_anonymous
end

#is_sso_userObject

Returns the value of attribute is_sso_user

Returns:

  • (Object)

    the current value of is_sso_user



84
85
86
# File 'lib/supabase/auth/types.rb', line 84

def is_sso_user
  @is_sso_user
end

#last_sign_in_atObject

Returns the value of attribute last_sign_in_at

Returns:

  • (Object)

    the current value of last_sign_in_at



84
85
86
# File 'lib/supabase/auth/types.rb', line 84

def 
  @last_sign_in_at
end

#new_emailObject

Returns the value of attribute new_email

Returns:

  • (Object)

    the current value of new_email



84
85
86
# File 'lib/supabase/auth/types.rb', line 84

def new_email
  @new_email
end

#new_phoneObject

Returns the value of attribute new_phone

Returns:

  • (Object)

    the current value of new_phone



84
85
86
# File 'lib/supabase/auth/types.rb', line 84

def new_phone
  @new_phone
end

#phoneObject

Returns the value of attribute phone

Returns:

  • (Object)

    the current value of phone



84
85
86
# File 'lib/supabase/auth/types.rb', line 84

def phone
  @phone
end

#phone_confirmed_atObject

Returns the value of attribute phone_confirmed_at

Returns:

  • (Object)

    the current value of phone_confirmed_at



84
85
86
# File 'lib/supabase/auth/types.rb', line 84

def phone_confirmed_at
  @phone_confirmed_at
end

#recovery_sent_atObject

Returns the value of attribute recovery_sent_at

Returns:

  • (Object)

    the current value of recovery_sent_at



84
85
86
# File 'lib/supabase/auth/types.rb', line 84

def recovery_sent_at
  @recovery_sent_at
end

#roleObject

Returns the value of attribute role

Returns:

  • (Object)

    the current value of role



84
85
86
# File 'lib/supabase/auth/types.rb', line 84

def role
  @role
end

#updated_atObject

Returns the value of attribute updated_at

Returns:

  • (Object)

    the current value of updated_at



84
85
86
# File 'lib/supabase/auth/types.rb', line 84

def updated_at
  @updated_at
end

#user_metadataObject

Returns the value of attribute user_metadata

Returns:

  • (Object)

    the current value of user_metadata



84
85
86
# File 'lib/supabase/auth/types.rb', line 84

def 
  @user_metadata
end

Class Method Details

.from_hash(hash) ⇒ Object



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/supabase/auth/types.rb', line 113

def self.from_hash(hash)
  return nil if hash.nil?

  identities = (hash["identities"] || hash[:identities])&.map { |i| Identity.from_hash(i) }
  factors = (hash["factors"] || hash[:factors])&.map { |f| Factor.from_hash(f) }

  new(
    id: hash["id"] || hash[:id],
    aud: hash["aud"] || hash[:aud],
    role: hash["role"] || hash[:role],
    email: hash["email"] || hash[:email],
    email_confirmed_at: Types.parse_timestamp(hash["email_confirmed_at"] || hash[:email_confirmed_at]),
    phone: hash["phone"] || hash[:phone],
    phone_confirmed_at: Types.parse_timestamp(hash["phone_confirmed_at"] || hash[:phone_confirmed_at]),
    confirmed_at: Types.parse_timestamp(hash["confirmed_at"] || hash[:confirmed_at]),
    last_sign_in_at: Types.parse_timestamp(hash["last_sign_in_at"] || hash[:last_sign_in_at]),
    app_metadata: hash["app_metadata"] || hash[:app_metadata] || {},
    user_metadata: hash["user_metadata"] || hash[:user_metadata] || {},
    identities: identities,
    factors: factors,
    created_at: Types.parse_timestamp(hash["created_at"] || hash[:created_at]),
    updated_at: Types.parse_timestamp(hash["updated_at"] || hash[:updated_at]),
    new_email: hash["new_email"] || hash[:new_email],
    new_phone: hash["new_phone"] || hash[:new_phone],
    invited_at: Types.parse_timestamp(hash["invited_at"] || hash[:invited_at]),
    is_anonymous: hash.key?("is_anonymous") ? hash["is_anonymous"] : (hash.key?(:is_anonymous) ? hash[:is_anonymous] : false),
    is_sso_user: hash.key?("is_sso_user") ? hash["is_sso_user"] : (hash.key?(:is_sso_user) ? hash[:is_sso_user] : false),
    deleted_at: hash["deleted_at"] || hash[:deleted_at],
    banned_until: hash["banned_until"] || hash[:banned_until],
    confirmation_sent_at: Types.parse_timestamp(hash["confirmation_sent_at"] || hash[:confirmation_sent_at]),
    recovery_sent_at: Types.parse_timestamp(hash["recovery_sent_at"] || hash[:recovery_sent_at]),
    email_change_sent_at: Types.parse_timestamp(hash["email_change_sent_at"] || hash[:email_change_sent_at]),
    action_link: hash["action_link"] || hash[:action_link]
  )
end