Class: PostmanMta::Conversation

Inherits:
ApplicationModel show all
Defined in:
app/models/postman_mta/conversation.rb

Direct Known Subclasses

Archive::Conversation

Instance Method Summary collapse

Instance Method Details

#archive(params = {}) ⇒ Object



7
8
9
# File 'app/models/postman_mta/conversation.rb', line 7

def archive(params = {})
  get('/archive/conversations', body: params)
end

#find(conversation_id) ⇒ Object



19
20
21
# File 'app/models/postman_mta/conversation.rb', line 19

def find(conversation_id)
  get("/conversations/#{conversation_id}")
end

#folder(folder, params = {}) ⇒ Object



11
12
13
14
15
16
17
# File 'app/models/postman_mta/conversation.rb', line 11

def folder(folder, params = {})
  params = {
    folder: folder
  }.merge!(params)

  get('/conversations', body: params)
end

#index(params = {}) ⇒ Object



3
4
5
# File 'app/models/postman_mta/conversation.rb', line 3

def index(params = {})
  get('/conversations', body: params)
end

#mark_as_read(params = {}) ⇒ Object



27
28
29
# File 'app/models/postman_mta/conversation.rb', line 27

def mark_as_read(params = {})
  patch('/conversations/mark', body: params.merge(event: 'mark_as_read'))
end

#mark_as_unread(params = {}) ⇒ Object



31
32
33
# File 'app/models/postman_mta/conversation.rb', line 31

def mark_as_unread(params = {})
  patch('/conversations/mark', body: params.merge(event: 'mark_as_unread'))
end

#move(params = {}) ⇒ Object



35
36
37
# File 'app/models/postman_mta/conversation.rb', line 35

def move(params = {})
  patch('/conversations/move', body: params)
end

#move_to_trash(conversation_id) ⇒ Object



23
24
25
# File 'app/models/postman_mta/conversation.rb', line 23

def move_to_trash(conversation_id)
  delete("/conversations/#{conversation_id}/trash")
end

#search(params = {}) ⇒ Object



39
40
41
# File 'app/models/postman_mta/conversation.rb', line 39

def search(params = {})
  get('/search/conversations', body: params)
end