Class: ScreenshotsPagepixels::Client
- Inherits:
-
Object
- Object
- ScreenshotsPagepixels::Client
- Includes:
- HTTParty
- Defined in:
- lib/screenshots_pagepixels/client.rb
Instance Method Summary collapse
- #capture_screenshot(id) ⇒ Object
- #change_notifications(options = {}) ⇒ Object
- #create_screenshot_config(options = {}) ⇒ Object
- #delete_screenshot_config(id) ⇒ Object
- #get_screenshot_config(id) ⇒ Object
-
#initialize(bearer_token) ⇒ Client
constructor
A new instance of Client.
- #job_status(job_id) ⇒ Object
- #screenshot_config_change_notifications(id, options = {}) ⇒ Object
- #screenshot_config_screenshots(id, options = {}) ⇒ Object
- #screenshot_configs(options = {}) ⇒ Object
- #screenshots(options = {}) ⇒ Object
- #snap(options = {}) ⇒ Object
- #update_screenshot_config(id, options = {}) ⇒ Object
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( = {}) get_request('/change_notifications', ) 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( = {}) post_request('/screenshot_configs', ) 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, = {}) get_request("/screenshot_configs/#{id}/change_notifications", ) 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, = {}) get_request("/screenshot_configs/#{id}/screenshots", ) 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( = {}) get_request('/screenshot_configs', ) 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( = {}) get_request('/screenshots', ) 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( = {}) get_request('/snap', ) 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, = {}) patch_request("/screenshot_configs/#{id}", ) rescue StandardError => e handle_exception(e) end |