class Attio::Comment
def self.create(content: nil, format: "plaintext", author: nil, thread_id: nil, created_at: nil, **opts)
def self.create(content: nil, format: "plaintext", author: nil, thread_id: nil, created_at: nil, **opts) raise ArgumentError, "Content is required" if content.nil? || content.to_s.empty? raise ArgumentError, "Thread ID is required" if thread_id.nil? || thread_id.to_s.empty? raise ArgumentError, "Author is required" if author.nil? request_params = { data: { format: format, content: content, author: author, thread_id: thread_id } } # Only add created_at if provided request_params[:data][:created_at] = created_at if created_at response = execute_request(:POST, resource_path, request_params, opts) new(response["data"] || response, opts) end