Class: WassengerClient::Device

Inherits:
OpenStruct
  • Object
show all
Defined in:
app/models/wassenger_client/device.rb

Class Method Summary collapse

Class Method Details

.auto_reply(id = '0', params = {}) ⇒ Object



78
79
80
# File 'app/models/wassenger_client/device.rb', line 78

def auto_reply(id = '0', params = {})
  WassengerClient::Client.post(base_url, id, params, '/autoreply')
end

.base_urlObject



6
7
8
# File 'app/models/wassenger_client/device.rb', line 6

def base_url
  WassengerClient::Client.base_url + 'devices'
end

.create(params = {}) ⇒ Object



14
15
16
# File 'app/models/wassenger_client/device.rb', line 14

def create(params = {})
  WassengerClient::Client.post(base_url, '', params)
end

.delete(id = '0') ⇒ Object



90
91
92
# File 'app/models/wassenger_client/device.rb', line 90

def delete(id = '0')
  WassengerClient::Client.delete(base_url, id)
end

.download_invoice(id = '0', invoice_id = '0') ⇒ Object



62
63
64
# File 'app/models/wassenger_client/device.rb', line 62

def download_invoice(id = '0', invoice_id = '0')
  WassengerClient::Client.get(base_url, id, {}, "/invoices/#{invoice_id}/pdf")
end

.empty_queue(id = '0', query = {}) ⇒ Object



46
47
48
# File 'app/models/wassenger_client/device.rb', line 46

def empty_queue(id = '0', query = {})
  WassengerClient::Client.delete(base_url, id, {}, '/queue', query)
end

.get(query = {}) ⇒ Object



10
11
12
# File 'app/models/wassenger_client/device.rb', line 10

def get(query = {})
  WassengerClient::Client.get(base_url, '', {}, '', query)
end

.get_details(id = '0') ⇒ Object



82
83
84
# File 'app/models/wassenger_client/device.rb', line 82

def get_details(id = '0')
  WassengerClient::Client.get(base_url, id)
end

.get_profile_image(id = '0') ⇒ Object



50
51
52
# File 'app/models/wassenger_client/device.rb', line 50

def get_profile_image(id = '0')
  WassengerClient::Client.get(base_url, id, {}, '/profile/image')
end

.get_profiles(id = '0', query = {}) ⇒ Object



54
55
56
# File 'app/models/wassenger_client/device.rb', line 54

def get_profiles(id = '0', query = {})
  WassengerClient::Client.get(base_url, id, {}, '/profile', query)
end

.groups(id = '0') ⇒ Object



74
75
76
# File 'app/models/wassenger_client/device.rb', line 74

def groups(id = '0')
  WassengerClient::Client.get(base_url, id, {}, '/groups')
end

.health(id = '0') ⇒ Object



70
71
72
# File 'app/models/wassenger_client/device.rb', line 70

def health(id = '0')
  WassengerClient::Client.get(base_url, id, {}, '/health')
end

.invoices(id = '0', query = {}) ⇒ Object



66
67
68
# File 'app/models/wassenger_client/device.rb', line 66

def invoices(id = '0', query = {})
  WassengerClient::Client.get(base_url, id, {}, '/invoices', query)
end

.queue(id = '0') ⇒ Object



38
39
40
# File 'app/models/wassenger_client/device.rb', line 38

def queue(id = '0')
  WassengerClient::Client.get(base_url, id, {}, '/queue')
end

.reboot(id = '0', query = {}) ⇒ Object



34
35
36
# File 'app/models/wassenger_client/device.rb', line 34

def reboot(id = '0', query = {})
  WassengerClient::Client.post(base_url, id, {}, '/reboot', query)
end

.remove_chats(id = '0', params = {}) ⇒ Object



30
31
32
# File 'app/models/wassenger_client/device.rb', line 30

def remove_chats(id = '0', params = {})
  WassengerClient::Client.post(base_url, id, params, '/removechats')
end

.reset(id = '0', query = {}) ⇒ Object



26
27
28
# File 'app/models/wassenger_client/device.rb', line 26

def reset(id = '0', query = {})
  WassengerClient::Client.post(base_url, id, {}, '/reset', query)
end

.route_messages(id = '0', params = {}) ⇒ Object



42
43
44
# File 'app/models/wassenger_client/device.rb', line 42

def route_messages(id = '0', params = {})
  WassengerClient::Client.patch(base_url, id, params, '/queue')
end

.scan(id = '0', query = {}) ⇒ Object



22
23
24
# File 'app/models/wassenger_client/device.rb', line 22

def scan(id = '0', query = {})
  WassengerClient::Client.get(base_url, id, {}, '/scan', query)
end

.sync(id = '0') ⇒ Object



18
19
20
# File 'app/models/wassenger_client/device.rb', line 18

def sync(id = '0')
  WassengerClient::Client.get(base_url, id, {}, '/sync')
end

.update(id = '0', params = {}) ⇒ Object



86
87
88
# File 'app/models/wassenger_client/device.rb', line 86

def update(id = '0', params = {})
  WassengerClient::Client.patch(base_url, id, params)
end

.update_profile(id = '0', params = {}) ⇒ Object



58
59
60
# File 'app/models/wassenger_client/device.rb', line 58

def update_profile(id = '0', params = {})
  WassengerClient::Client.patch(base_url, id, params, '/profile')
end