Module: FileboundClient::Endpoints::Documents
- Defined in:
- lib/filebound_client/endpoints/documents.rb
Overview
Module for Documents resource endpoint
Class Method Summary collapse
-
.included(klass) ⇒ Object
This will call macros to create resource methods on the fly.
Instance Method Summary collapse
-
#document(document_id, query_params = nil) ⇒ Hash
Retrieves a single document.
-
#document_add(document) ⇒ Hash
Adds a document.
-
#document_add_comment(document_id, comment_data, query_params = nil) ⇒ Hash
Adds a comment to document.
-
#document_add_eformdata(document_id, eform_data) ⇒ Hash
Adds eform data to document.
-
#document_add_eformdetail(document_id, eform_detail) ⇒ Hash
Adds eform detail to document.
-
#document_comments(document_id, query_params = nil) ⇒ Object
Returns the document comments for the supplied document key.
-
#document_delete(document_id, query_params = nil) ⇒ bool
Delete a document.
-
#document_eform_data(document_id, query_params = nil) ⇒ Hash
Returns the eform data for the document key.
-
#document_eform_detail(document_id, query_params = nil) ⇒ Hash
Returns the eform detail for the document key.
-
#document_rendition(document_id, query_params = nil) ⇒ String
Returns a rendition for the document key.
-
#document_update(document, query_params = nil) ⇒ int
Updates a document.
-
#document_update_eformdata(document_id, eform_data, query_params = nil) ⇒ Hash
Updates eform data for the document.
-
#document_update_eformdetail(document_id, eform_detail, query_params = nil) ⇒ Hash
Updates eform detail for the document.
Class Method Details
.included(klass) ⇒ Object
This will call macros to create resource methods on the fly
6 7 8 9 10 11 |
# File 'lib/filebound_client/endpoints/documents.rb', line 6 def self.included(klass) klass.instance_eval do allow_new :document allow_all :documents end end |
Instance Method Details
#document(document_id, query_params = nil) ⇒ Hash
Retrieves a single document
16 17 18 |
# File 'lib/filebound_client/endpoints/documents.rb', line 16 def document(document_id, query_params = nil) get("/documents/#{document_id}", query_params) end |
#document_add(document) ⇒ Hash
Adds a document
89 90 91 92 |
# File 'lib/filebound_client/endpoints/documents.rb', line 89 def document_add(document) raise FileboundClientException.new('File Id is required', 0) unless document && document[:fileId].positive? put("/documents/#{document[:fileId]}", nil, document) end |
#document_add_comment(document_id, comment_data, query_params = nil) ⇒ Hash
Adds a comment to document
112 113 114 |
# File 'lib/filebound_client/endpoints/documents.rb', line 112 def document_add_comment(document_id, comment_data, query_params = nil) put("/documents/#{document_id}/comments", nil, comment_data) end |
#document_add_eformdata(document_id, eform_data) ⇒ Hash
Adds eform data to document
48 49 50 |
# File 'lib/filebound_client/endpoints/documents.rb', line 48 def document_add_eformdata(document_id, eform_data) put("/documents/#{document_id}/eformdata", nil, eform_data) end |
#document_add_eformdetail(document_id, eform_detail) ⇒ Hash
Adds eform detail to document
56 57 58 |
# File 'lib/filebound_client/endpoints/documents.rb', line 56 def document_add_eformdetail(document_id, eform_detail) put("/documents/#{document_id}/eformdetail", nil, eform_detail) end |
#document_comments(document_id, query_params = nil) ⇒ Object
Returns the document comments for the supplied document key
104 105 106 |
# File 'lib/filebound_client/endpoints/documents.rb', line 104 def document_comments(document_id, query_params = nil) get("/documents/#{document_id}/comments", query_params) end |
#document_delete(document_id, query_params = nil) ⇒ bool
Delete a document
97 98 99 |
# File 'lib/filebound_client/endpoints/documents.rb', line 97 def document_delete(document_id, query_params = nil) delete("/documents/#{document_id}") end |
#document_eform_data(document_id, query_params = nil) ⇒ Hash
Returns the eform data for the document key
24 25 26 |
# File 'lib/filebound_client/endpoints/documents.rb', line 24 def document_eform_data(document_id, query_params = nil) get("/documents/#{document_id}/eformdata", query_params) end |
#document_eform_detail(document_id, query_params = nil) ⇒ Hash
Returns the eform detail for the document key
32 33 34 |
# File 'lib/filebound_client/endpoints/documents.rb', line 32 def document_eform_detail(document_id, query_params = nil) get("/documents/#{document_id}/eformdetail", query_params) end |
#document_rendition(document_id, query_params = nil) ⇒ String
Returns a rendition for the document key
40 41 42 |
# File 'lib/filebound_client/endpoints/documents.rb', line 40 def document_rendition(document_id, query_params = nil) get("/documents/#{document_id}/rendition", query_params) end |
#document_update(document, query_params = nil) ⇒ int
Updates a document
82 83 84 |
# File 'lib/filebound_client/endpoints/documents.rb', line 82 def document_update(document, query_params = nil) post("/documents/#{document[:id]}", query_params, document) end |
#document_update_eformdata(document_id, eform_data, query_params = nil) ⇒ Hash
Updates eform data for the document
65 66 67 |
# File 'lib/filebound_client/endpoints/documents.rb', line 65 def document_update_eformdata(document_id, eform_data, query_params = nil) post("/documents/#{document_id}/eformdata", query_params, eform_data) end |
#document_update_eformdetail(document_id, eform_detail, query_params = nil) ⇒ Hash
Updates eform detail for the document
74 75 76 |
# File 'lib/filebound_client/endpoints/documents.rb', line 74 def document_update_eformdetail(document_id, eform_detail, query_params = nil) put("/documents/#{document_id}/eformdetail", query_params, eform_detail) end |