Add resource definitions for all 22 API tags, wire client accessors and require tree

This commit is contained in:
2026-05-29 15:01:12 +02:00
parent 8185659f9c
commit 3b4d5ae5c3
21 changed files with 566 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
# frozen_string_literal: true
module Fiken
module Resources
# /companies/{slug}/contacts and nested contact persons.
class Contacts < Resource::Base
include Resource::Listable
include Resource::Findable
include Resource::Creatable
include Resource::Updatable # PUT
include Resource::Deletable
include Resource::Attachable
def resource_path
"contacts"
end
# Contacts only support uploading attachments, not listing them.
def attachments_listable?
false
end
def contact_persons(contact_id)
ContactPersons.new(client, company_slug, "#{base_path}/#{contact_id}")
end
end
# /companies/{slug}/contacts/{id}/contactPerson
class ContactPersons < Resource::Base
include Resource::Listable
include Resource::Findable
include Resource::Creatable
include Resource::Updatable # PUT
include Resource::Deletable
def initialize(client, company_slug, parent_path)
super(client, company_slug)
@parent_path = parent_path
end
def base_path
"#{@parent_path}/contactPerson"
end
end
end
end