lib/nexus/invision/resources/member.rb in nexus-invision-1.10.1 vs lib/nexus/invision/resources/member.rb in nexus-invision-1.10.2

- old
+ new

@@ -1,19 +1,59 @@ # typed: strict # frozen_string_literal: true -require "nexus/invision/value_object" require "sorbet-runtime" +require "nexus/invision/value_object" +require "nexus/invision/resources/rank" +require "nexus/invision/resources/field_group" + module Nexus module Invision module Resources # Member is a User with additional information about their membership. class Member < T::Struct include ValueObject const :id, Integer + # const :name, String + # const :title, T.nilable(String) + # const :timeZone, String + # const :formattedName, String const :primaryGroup, Group + # const :secondaryGroups, T::Array[Group] + # const :email, String + # const :joined, Time + # const :registrationIpAddress, String + # const :warningPoints, Integer + # const :reputationPoints, Integer + # const :photoUrl, String + # const :photoUrlIsDefault, T::Boolean + # const :coverPhotoUrl, String + # const :profileUrl, T.nilable(String) + # const :validating, T::Boolean + # const :posts, Integer + # const :lastActivity, Time + # const :lastVisit, Time + # const :birthday, Date + # const :profileViews, Integer + # const :customFields, T::Hash[String, FieldGroup] + # const :rank, Rank + # const :achievements_points, Integer + # const :allowAdminEmails, T::Boolean + # const :completed, T::Boolean + + class << self + extend T::Sig + + sig { params(response: T::Hash[String, T.untyped]).returns(Member) } + def from_response(response) + Member.new( + id: response["id"], + primaryGroup: Group.from_response(response["primaryGroup"]), + ) + end + end end end end end