# typed: strict # frozen_string_literal: true require "sorbet-runtime" require "nexus/invision/value_object" require "nexus/invision/resources/member" module Nexus module Invision module Resources class Post < T::Struct include ValueObject const :id, Integer const :item_id, Integer # const :author, Member # const :date, Time # const :content, String # const :hidden, T::Boolean # const :url, String # const :reactions, T::Hash[String, T::Array[String]] class << self extend T::Sig sig { params(response: T::Hash[String, T.untyped]).returns(Post) } def from_response(response) Post.new( id: response["id"], item_id: response["item_id"], ) end end end end end end