Module: Frontapp::Client::Tags

Included in:
Frontapp::Client
Defined in:
lib/frontapp/client/tags.rb

Instance Method Summary collapse

Instance Method Details

#create_tag!(params = {}) ⇒ Object

Allowed attributes: Name Type Description


name string Name of the tag to create




23
24
25
26
# File 'lib/frontapp/client/tags.rb', line 23

def create_tag!(params = {})
  cleaned = params.permit(:name)
  create("tags", cleaned)
end

#delete_tag!(tag_id) ⇒ Object

Parameters Name Type Description


tag_id string Id of the requested tag




50
51
52
# File 'lib/frontapp/client/tags.rb', line 50

def delete_tag!(tag_id)
  delete("tags/#{tag_id}")
end

#get_tag(tag_id) ⇒ Object

Parameters Name Type Description


tag_id string Id of the requested tag




14
15
16
# File 'lib/frontapp/client/tags.rb', line 14

def get_tag(tag_id)
  get("tags/#{tag_id}")
end

#get_tag_conversations(tag_id, params = {}) ⇒ Object

Parameters Name Type Description


tag_id string Id of the requested tag


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




40
41
42
43
# File 'lib/frontapp/client/tags.rb', line 40

def get_tag_conversations(tag_id, params = {})
  cleaned = params.permit({ q: [:statuses] })
  list("tags/#{tag_id}/conversations", cleaned)
end

#tags(params = {}) ⇒ Object



5
6
7
# File 'lib/frontapp/client/tags.rb', line 5

def tags(params = {})
  list("tags", params)
end