Module: Frontapp::Client::Links
- Included in:
- Frontapp::Client
- Defined in:
- lib/frontapp/client/links.rb
Instance Method Summary collapse
-
#create_link!(params = {}) ⇒ Object
Allowed attributes: Name Type Description ———————————— name string (optional) Name of the link.
-
#get_link(link_id) ⇒ Object
Parameters Name Type Description ——————————- link_id string Id of the requested link ——————————-.
-
#get_link_conversations(link_id, params = {}) ⇒ Object
Parameters Name Type Description —————————– link_id string Id of the requested link —————————–.
- #links(params = {}) ⇒ Object
-
#update_link!(link_id, params = {}) ⇒ Object
Parameters Name Type Description —————————– link_id string Id of the requested link —————————–.
Instance Method Details
#create_link!(params = {}) ⇒ Object
Allowed attributes: Name Type Description
name string (optional) Name of the link. If none is specified, the external_url is used as a default external_url string Underlying identifying link/url of the link
25 26 27 28 |
# File 'lib/frontapp/client/links.rb', line 25 def create_link!(params = {}) cleaned = params.permit(:name, :external_url) create("links", cleaned) end |
#get_link(link_id) ⇒ Object
Parameters Name Type Description
link_id string Id of the requested link
15 16 17 |
# File 'lib/frontapp/client/links.rb', line 15 def get_link(link_id) get("links/#{link_id}") end |
#get_link_conversations(link_id, params = {}) ⇒ Object
Parameters Name Type Description
link_id string Id of the requested link
Allowed params: Name Type Description
q object (optional) Search query. q.statuses array (optional) List of the statuses of the conversations you want to list
58 59 60 61 |
# File 'lib/frontapp/client/links.rb', line 58 def get_link_conversations(link_id, params = {}) cleaned = params.permit({ q: [:statuses] }) list("links/#{link_id}/conversations", cleaned) end |
#links(params = {}) ⇒ Object
5 6 7 8 |
# File 'lib/frontapp/client/links.rb', line 5 def links(params = {}) cleaned = params.permit({ q: [:statuses] }) list("links", cleaned) end |
#update_link!(link_id, params = {}) ⇒ Object
Parameters Name Type Description
link_id string Id of the requested link
Allowed attributes: Name Type Description
name string New name of the link
41 42 43 44 |
# File 'lib/frontapp/client/links.rb', line 41 def update_link!(link_id, params = {}) cleaned = params.permit(:name) update("links/#{link_id}", cleaned) end |