Class: ScreenshotsPagepixels::Client

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/screenshots_pagepixels/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(bearer_token) ⇒ Client

Returns a new instance of Client.



6
7
8
# File 'lib/screenshots_pagepixels/client.rb', line 6

def initialize(bearer_token)
  @bearer_token = bearer_token
end

Instance Method Details

#capture_screenshot(id) ⇒ Object



64
65
66
67
68
# File 'lib/screenshots_pagepixels/client.rb', line 64

def capture_screenshot(id)
  post_request("/screenshot_configs/#{id}/capture")
rescue StandardError => e
  handle_exception(e)
end

#change_notifications(options = {}) ⇒ Object



76
77
78
79
80
# File 'lib/screenshots_pagepixels/client.rb', line 76

def change_notifications(options = {})
  get_request('/change_notifications', options)
rescue StandardError => e
  handle_exception(e)
end

#create_screenshot_config(options = {}) ⇒ Object



22
23
24
25
26
# File 'lib/screenshots_pagepixels/client.rb', line 22

def create_screenshot_config(options = {})
  post_request('/screenshot_configs', options)
rescue StandardError => e
  handle_exception(e)
end

#delete_screenshot_config(id) ⇒ Object



40
41
42
43
44
# File 'lib/screenshots_pagepixels/client.rb', line 40

def delete_screenshot_config(id)
  delete_request("/screenshot_configs/#{id}")
rescue StandardError => e
  handle_exception(e)
end

#get_screenshot_config(id) ⇒ Object



28
29
30
31
32
# File 'lib/screenshots_pagepixels/client.rb', line 28

def get_screenshot_config(id)
  get_request("/screenshot_configs/#{id}")
rescue StandardError => e
  handle_exception(e)
end

#job_status(job_id) ⇒ Object



58
59
60
61
62
# File 'lib/screenshots_pagepixels/client.rb', line 58

def job_status(job_id)
  get_request("/jobs/#{job_id}")
rescue StandardError => e
  handle_exception(e)
end

#screenshot_config_change_notifications(id, options = {}) ⇒ Object



52
53
54
55
56
# File 'lib/screenshots_pagepixels/client.rb', line 52

def screenshot_config_change_notifications(id, options = {})
  get_request("/screenshot_configs/#{id}/change_notifications", options)
rescue StandardError => e
  handle_exception(e)
end

#screenshot_config_screenshots(id, options = {}) ⇒ Object



46
47
48
49
50
# File 'lib/screenshots_pagepixels/client.rb', line 46

def screenshot_config_screenshots(id, options = {})
  get_request("/screenshot_configs/#{id}/screenshots", options)
rescue StandardError => e
  handle_exception(e)
end

#screenshot_configs(options = {}) ⇒ Object



16
17
18
19
20
# File 'lib/screenshots_pagepixels/client.rb', line 16

def screenshot_configs(options = {})
  get_request('/screenshot_configs', options)
rescue StandardError => e
  handle_exception(e)
end

#screenshots(options = {}) ⇒ Object



70
71
72
73
74
# File 'lib/screenshots_pagepixels/client.rb', line 70

def screenshots(options = {})
  get_request('/screenshots', options)
rescue StandardError => e
  handle_exception(e)
end

#snap(options = {}) ⇒ Object



10
11
12
13
14
# File 'lib/screenshots_pagepixels/client.rb', line 10

def snap(options = {})
  get_request('/snap', options)
rescue StandardError => e
  handle_exception(e)
end

#update_screenshot_config(id, options = {}) ⇒ Object



34
35
36
37
38
# File 'lib/screenshots_pagepixels/client.rb', line 34

def update_screenshot_config(id, options = {})
  patch_request("/screenshot_configs/#{id}", options)
rescue StandardError => e
  handle_exception(e)
end