Add resource definitions for all 22 API tags, wire client accessors and require tree
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Fiken
|
||||
module Resources
|
||||
# /companies/{slug}/inbox — documents awaiting bookkeeping.
|
||||
class Inbox < Resource::Base
|
||||
include Resource::Listable
|
||||
include Resource::Findable
|
||||
include Resource::Deletable
|
||||
|
||||
def resource_path
|
||||
"inbox"
|
||||
end
|
||||
|
||||
# POST /inbox — multipart upload of an inbox document.
|
||||
def create(path: nil, io: nil, filename: nil, content_type: "application/octet-stream", **fields)
|
||||
parts = { "file" => build_file_part(path, io, filename, content_type) }
|
||||
fields.each { |key, value| parts[key.to_s] = value.to_s unless value.nil? }
|
||||
build_created(connection.post_multipart(base_path, parts))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user