Module: Veryfi::Api::TagOperations
- Included in:
- AnyDocument, BankStatement, BusinessCard, Check, W2, W8, W9
- Defined in:
- lib/veryfi/api/tag_operations.rb
Overview
Mix-in providing the standard per-resource tag endpoints used by
processed-document resources (Any Document, Bank Statement, Business
Card, Check, W-2, W-8, W-9). Each host must define an ENDPOINT
constant pointing at the resource collection (e.g. "/partner/checks/").
When included, the host class exposes:
#tags(id, params = {})→ GET…/{id}/tags#add_tag(id, params)→ PUT…/{id}/tags(single)#add_tags(id, tags)→ POST…/{id}/tags(multiple)#delete_tag(id, tag_id)→ DELETE…/{id}/tags/{tag_id}#delete_tags(id)→ DELETE…/{id}/tags(all)
Instance Method Summary collapse
-
#add_tag(id, params) ⇒ Veryfi::Resource
Add (or link) a single tag.
-
#add_tags(id, tags) ⇒ Veryfi::Resource
Add many tags in a single call.
-
#delete_tag(id, tag_id) ⇒ Veryfi::Resource
Unlink a single tag from the resource.
-
#delete_tags(id) ⇒ Veryfi::Resource
Unlink every tag from the resource.
-
#tags(id, params = {}) ⇒ Veryfi::Resource
List tags on the resource.
Instance Method Details
#add_tag(id, params) ⇒ Veryfi::Resource
Add (or link) a single tag.
32 33 34 |
# File 'lib/veryfi/api/tag_operations.rb', line 32 def add_tag(id, params) request.put("#{self.class::ENDPOINT}#{id}/tags", params) end |
#add_tags(id, tags) ⇒ Veryfi::Resource
Add many tags in a single call.
41 42 43 |
# File 'lib/veryfi/api/tag_operations.rb', line 41 def (id, ) request.post("#{self.class::ENDPOINT}#{id}/tags", tags: ) end |
#delete_tag(id, tag_id) ⇒ Veryfi::Resource
Unlink a single tag from the resource.
50 51 52 |
# File 'lib/veryfi/api/tag_operations.rb', line 50 def delete_tag(id, tag_id) request.delete("#{self.class::ENDPOINT}#{id}/tags/#{tag_id}") end |
#delete_tags(id) ⇒ Veryfi::Resource
Unlink every tag from the resource.
58 59 60 |
# File 'lib/veryfi/api/tag_operations.rb', line 58 def (id) request.delete("#{self.class::ENDPOINT}#{id}/tags") end |
#tags(id, params = {}) ⇒ Veryfi::Resource
List tags on the resource.
23 24 25 |
# File 'lib/veryfi/api/tag_operations.rb', line 23 def (id, params = {}) request.get("#{self.class::ENDPOINT}#{id}/tags", params) end |