Sha256: ca9afd25cbccbf378cd8514976b426d904b721e2240f87b8126983d754ed3c2b

Contents?: true

Size: 990 Bytes

Versions: 6

Compression:

Stored size: 990 Bytes

Contents

module PostmanMta
  class Conversation < ApplicationModel
    def index(params = {})
      get('/conversations', body: params)
    end

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

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

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

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

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

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

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

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

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
postman_mta-0.2.8 app/models/postman_mta/conversation.rb
postman_mta-0.2.7 app/models/postman_mta/conversation.rb
postman_mta-0.2.6 app/models/postman_mta/conversation.rb
postman_mta-0.2.4 app/models/postman_mta/conversation.rb
postman_mta-0.2.3 app/models/postman_mta/conversation.rb
postman_mta-0.2.2 app/models/postman_mta/conversation.rb