Module: Caplinked::REST::Watermarks

Included in:
API
Defined in:
lib/caplinked/rest/watermarks.rb

Instance Method Summary collapse

Instance Method Details

#create_watermark(options = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/caplinked/rest/watermarks.rb', line 5

def create_watermark(options = {})
  body = options.stringify_keys.slice(
    'team_id',
    'custom_text',
    'color',
    'opacity',
    'font_size',
    'rotation',
    'hposition',
    'vposition',
    'display_user_name',
    'display_user_email',
    'display_ip_address',
    'display_time',
    'display_workspace_name'
  )
  perform_post('/api/v1/watermark', {}, body.to_json, {'Content-Type' => 'application/json'} )
end

#delete_watermark(options = {}) ⇒ Object



50
51
52
53
54
# File 'lib/caplinked/rest/watermarks.rb', line 50

def delete_watermark(options = {})
  body = options.stringify_keys.slice('id')
  id = body.delete('id')
  perform_delete('/api/v1/watermark/' + id.to_s, {}, body.to_json, { 'Content-Type' => 'application/json' } )
end

#get_watermark(options = {}) ⇒ Object



24
25
26
27
28
# File 'lib/caplinked/rest/watermarks.rb', line 24

def get_watermark(options = {})
  params = options.stringify_keys.slice('id')
  id = params.delete('id')
  perform_get('/api/v1/watermark/' + id.to_s, nil)
end

#update_watermark(options = {}) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/caplinked/rest/watermarks.rb', line 30

def update_watermark(options = {})
  body = options.stringify_keys.slice(
    'id',
    'custom_text',
    'color',
    'opacity',
    'font_size',
    'rotation',
    'hposition',
    'vposition',
    'display_user_name',
    'display_user_email',
    'display_ip_address',
    'display_time',
    'display_workspace_name'
  )
  id = body.delete('id')
  perform_put('/api/v1/watermark/' + id.to_s, {}, body.to_json, { 'Content-Type' => 'application/json' } )
end