module FileboundClient::Endpoints::Documents
Module for Documents
resource endpoint
Public Class Methods
This will call macros to create resource methods on the fly
# 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
Public Instance Methods
Retrieves a single document @param [int] document_id the document key @return [Hash] the document hash
# File lib/filebound_client/endpoints/documents.rb, line 16 def document(document_id, query_params = nil) get("/documents/#{document_id}", query_params) end
Adds a document @param [Hash] document the document hash to add @return [Hash] the newly added document hash
# 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
Adds a comment to document @param [int] document_id the document key @param [Hash] comment_data the comment to add @return [Hash] the newly added document comment hash
# 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
Adds eform data to document @param [int] document_id the document key @param [Hash] eform_data the eform data hash to add @return [Hash] the newly added eform data hash
# 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
Adds eform detail to document @param [int] document_id the document key @param [Hash] eform_detail the eform detail to add @return [Hash] the newly added eform detail hash
# 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
Returns the document comments for the supplied document key @param [int] document_id the document key @param [Hash] query_params the additional query params to send in the request
# 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
Delete a document @param [int] document_id the document key @return [bool] true if document was deleted successfully
# File lib/filebound_client/endpoints/documents.rb, line 97 def document_delete(document_id, query_params = nil) delete("/documents/#{document_id}") end
Returns the eform data for the document key @param [int] document_id the document key @param [Hash] query_params the additional query params to send in the request @return [Hash] the EFormData
hash
# 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
Returns the eform detail for the document key @param [int] document_id the document key @param [Hash] query_params the additional query params to send in the request @return [Hash] the EFormDetail
hash
# 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
Returns a rendition for the document key @param [int] document_id the document key @param [Hash] query_params the additional query params to send in the request (optional: page(int)) @return [String] rendition for the document
# 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
Updates a document @param [Hash] document the document hash to update @param [Hash] query_params additional query parameters to pass to the request (optional: setBinaryData(bool)) @return [int] the document id that was updated
# File lib/filebound_client/endpoints/documents.rb, line 82 def document_update(document, query_params = nil) post("/documents/#{document[:id]}", query_params, document) end
Updates eform data for the document @param [int] document_id the document key @param [Hash] eform_data the eform data hash to update @param [Hash] query_params additional query parameters to pass to the request (optional: deleteNonMatches(bool)) @return [Hash] the updated eform data hash
# 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
Updates eform detail for the document @param [int] document_id the document key @param [Hash] eform_detail the eform detail hash to update @param [Hash] query_params additional query parameters to pass to the request (optional: deleteNonMatches(bool)) @return [Hash] the updated eform detail hash
# 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