Module: Desk::Client::Case
- Included in:
- Desk::Client
- Defined in:
- lib/desk/client/case.rb
Overview
Defines methods related to cases
Instance Method Summary collapse
- #case_endpoints ⇒ Object
- #case_url(case_id) ⇒ Object
- #create_case_message_attachment(case_id, *args) ⇒ Object
- #create_case_reply_attachment(case_id, reply_id, *args) ⇒ Object
- #delete_case_message_attachment(case_id, attachment_id) ⇒ Object
- #delete_case_reply_attachment(case_id, reply_id, attachment_id) ⇒ Object
- #list_case_message_attachments(case_id, *args) ⇒ Object (also: #case_message_attachments)
- #list_case_reply_attachments(case_id, reply_id, *args) ⇒ Object (also: #case_reply_attachments)
- #show_case(case_id, *args) ⇒ Object (also: #case)
- #show_case_message(case_id) ⇒ Object (also: #case_message)
- #show_case_message_attachment(case_id, attachment_id) ⇒ Object (also: #case_message_attachment)
- #show_case_reply_attachment(case_id, reply_id, attachment_id) ⇒ Object (also: #case_reply_attachment)
Instance Method Details
#case_endpoints ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/desk/client/case.rb', line 6 def case_endpoints [ :list, :search, :create, :update, :delete, :list_replies, :show_reply, :create_reply, :update_reply, :list_notes, :show_note, :create_note, :list_attachments, :show_attachment, :create_attachment, :delete_attachment, :list_history ] end |
#case_url(case_id) ⇒ Object
67 68 69 |
# File 'lib/desk/client/case.rb', line 67 def case_url(case_id) "https://#{subdomain}.#{domain}/agent/case/#{case_id}" end |
#create_case_message_attachment(case_id, *args) ⇒ Object
49 50 51 52 |
# File 'lib/desk/client/case.rb', line 49 def (case_id, *args) = args.last.is_a?(Hash) ? args.pop : {} post("cases/#{case_id}/message/attachments", ) end |
#create_case_reply_attachment(case_id, reply_id, *args) ⇒ Object
54 55 56 57 |
# File 'lib/desk/client/case.rb', line 54 def (case_id, reply_id, *args) = args.last.is_a?(Hash) ? args.pop : {} post("cases/#{case_id}/replies/#{reply_id}/attachments", ) end |
#delete_case_message_attachment(case_id, attachment_id) ⇒ Object
59 60 61 |
# File 'lib/desk/client/case.rb', line 59 def (case_id, ) delete("cases/#{case_id}/message/attachments/#{}") end |
#delete_case_reply_attachment(case_id, reply_id, attachment_id) ⇒ Object
63 64 65 |
# File 'lib/desk/client/case.rb', line 63 def (case_id, reply_id, ) delete("cases/#{case_id}/replies/#{reply_id}/attachments/#{}") end |
#list_case_message_attachments(case_id, *args) ⇒ Object Also known as: case_message_attachments
27 28 29 30 |
# File 'lib/desk/client/case.rb', line 27 def (case_id, *args) = args.last.is_a?(Hash) ? args.pop : {} get("cases/#{case_id}/message/attachments", ) end |
#list_case_reply_attachments(case_id, reply_id, *args) ⇒ Object Also known as: case_reply_attachments
33 34 35 36 |
# File 'lib/desk/client/case.rb', line 33 def (case_id, reply_id, *args) = args.last.is_a?(Hash) ? args.pop : {} get("cases/#{case_id}/replies/#{reply_id}/attachments", ) end |
#show_case(case_id, *args) ⇒ Object Also known as: case
15 16 17 18 19 |
# File 'lib/desk/client/case.rb', line 15 def show_case(case_id, *args) = args.last.is_a?(Hash) ? args.pop : {} case_id = "e-#{case_id}" if [:by] == "external_id" get("cases/#{case_id}") end |
#show_case_message(case_id) ⇒ Object Also known as: case_message
22 23 24 |
# File 'lib/desk/client/case.rb', line 22 def (case_id) get("cases/#{case_id}/message") end |
#show_case_message_attachment(case_id, attachment_id) ⇒ Object Also known as: case_message_attachment
39 40 41 |
# File 'lib/desk/client/case.rb', line 39 def (case_id, ) get("cases/#{case_id}/message/attachments/#{}") end |
#show_case_reply_attachment(case_id, reply_id, attachment_id) ⇒ Object Also known as: case_reply_attachment
44 45 46 |
# File 'lib/desk/client/case.rb', line 44 def (case_id, reply_id, ) get("cases/#{case_id}/replies/#{reply_id}/attachments/#{}") end |