lib/nexus/invision/client.rb in nexus-invision-1.6.0 vs lib/nexus/invision/client.rb in nexus-invision-1.7.0
- old
+ new
@@ -11,18 +11,22 @@
require "nexus/invision/requests/delete_member"
require "nexus/invision/requests/edit_member"
require "nexus/invision/requests/list_forum_topics"
require "nexus/invision/requests/remove_member_from_secondary_group"
require "nexus/invision/requests/edit_member_primary_group"
+require "nexus/invision/requests/ensure_member"
+require "nexus/invision/requests/unread_count"
require "nexus/invision/resources/group"
require "nexus/invision/resources/login_link"
require "nexus/invision/resources/member"
require "nexus/invision/resources/page"
require "nexus/invision/resources/post"
require "nexus/invision/resources/topic"
require "nexus/invision/resources/user"
require "nexus/invision/resources/warning"
+require "nexus/invision/resources/ensure_member"
+require "nexus/invision/resources/unread_count"
require "sorbet-runtime"
require "uri"
module Nexus
module Invision
@@ -147,9 +151,31 @@
http_method: HTTPMethod::GET,
endpoint: URI("core/members/#{nexusmods_member_id}"),
)
Resources::Member.from_hash(response.body)
+ end
+
+ sig { params(request: Requests::EnsureMember).returns(Resources::EnsureMember) }
+ def ensure_member(request)
+ response = request(
+ http_method: HTTPMethod::GET,
+ endpoint: URI("core/ensuremember/#{request.id}"),
+ params: request.serialize,
+ )
+
+ Resources::EnsureMember.from_hash(response.body)
+ end
+
+ sig { params(request: Requests::UnreadCount).returns(Resources::UnreadCount) }
+ def unread_count(request)
+ response = request(
+ http_method: HTTPMethod::GET,
+ endpoint: URI("core/unreadcount/#{request.id}"),
+ params: request.serialize,
+ )
+
+ Resources::UnreadCount.from_hash(response.body)
end
sig { params(request: Requests::EditMemberPrimaryGroup).returns(Resources::Member) }
def edit_member_primary_group(request)
response = request(