Class: Ilovepdf::Signature::Management

Inherits:
Task show all
Defined in:
lib/ilovepdf/signature/management.rb

Constant Summary

Constants inherited from Task

Task::API_PARAMS, Task::DOWNLOAD_INFO

Constants included from Ilovepdf

VERSION

Instance Attribute Summary

Attributes inherited from Task

#ignore_errors, #ignore_password, #output_filename, #packaged_filename, #result, #task_id, #tool, #try_pdf_repair

Instance Method Summary collapse

Methods inherited from Task

#add_file, #add_file_from_url, #assign_meta_value, #blob, #chained_task?, #delete!, #delete_file, #download, #download_info, #enable_file_encryption, #execute, #files, #next, #status

Methods included from Ilovepdf

root

Constructor Details

#initialize(public_key, secret_key, make_start = false) ⇒ Management

Returns a new instance of Management.



5
6
7
8
# File 'lib/ilovepdf/signature/management.rb', line 5

def initialize(public_key, secret_key, make_start=false)
  self.tool = :sign
  super(public_key, secret_key, make_start)
end

Instance Method Details

#download_audit(signature_token, directory = __dir__, create_directory: true, filename:) ⇒ Object



18
19
20
# File 'lib/ilovepdf/signature/management.rb', line 18

def download_audit(signature_token, directory = __dir__,create_directory: true,filename:)
  download_file("signature/#{signature_token}/download-audit",directory,create_directory: create_directory, filename: filename)
end

#download_original(signature_token, directory = __dir__, create_directory: true, filename:) ⇒ Object



22
23
24
# File 'lib/ilovepdf/signature/management.rb', line 22

def download_original(signature_token, directory = __dir__,create_directory: true,filename:)
  download_file("signature/#{signature_token}/download-original",directory,create_directory: create_directory, filename: filename)
end

#download_signed(signature_token, directory = __dir__, create_directory: true, filename:) ⇒ Object



26
27
28
# File 'lib/ilovepdf/signature/management.rb', line 26

def download_signed(signature_token, directory = __dir__,create_directory: true,filename:)
  download_file("signature/#{signature_token}/download-signed",directory,create_directory: create_directory, filename: filename)
end

#fix_receiver_email(signer_token, new_email) ⇒ Object



48
49
50
51
52
# File 'lib/ilovepdf/signature/management.rb', line 48

def fix_receiver_email(signer_token, new_email)
  body = {email: new_email}
  extracted_body = RequestPayload::FormUrlEncoded.new(body).extract_to_s
  send_request("put","signature/receiver/fix-email/#{signer_token}", body: extracted_body)
end

#fix_receiver_phone(signer_token, new_phone) ⇒ Object



54
55
56
57
58
# File 'lib/ilovepdf/signature/management.rb', line 54

def fix_receiver_phone(signer_token, new_phone)
  body = {phone: new_phone}
  extracted_body = RequestPayload::FormUrlEncoded.new(body).extract_to_s
send_request("put","signature/receiver/fix-phone/#{signer_token}", body: extracted_body)
end

#get_receiver_info(signer_token) ⇒ Object



44
45
46
# File 'lib/ilovepdf/signature/management.rb', line 44

def get_receiver_info(signer_token)
  send_request("get", "signature/receiver/info/#{signer_token}")
end

#get_status(signature_token) ⇒ Object



10
11
12
# File 'lib/ilovepdf/signature/management.rb', line 10

def get_status(signature_token)
  send_request("get", "signature/requesterview/#{signature_token}")
end

#increase_expiration_days(signature_token, days_to_increase) ⇒ Object



38
39
40
41
42
# File 'lib/ilovepdf/signature/management.rb', line 38

def increase_expiration_days(signature_token,days_to_increase)
  body = {days: days_to_increase}
  extracted_body = RequestPayload::FormUrlEncoded.new(body).extract_to_s
  send_request("put","signature/increase-expiration-days/#{signature_token}", body: extracted_body)
end

#list_signatures(current_page: 0, per_page: 20) ⇒ Object



14
15
16
# File 'lib/ilovepdf/signature/management.rb', line 14

def list_signatures(current_page: 0,per_page: 20)
  send_request("get", "signature/list", body: {page: current_page,per_page: per_page})
end

#send_reminders(signature_token) ⇒ Object



30
31
32
# File 'lib/ilovepdf/signature/management.rb', line 30

def send_reminders(signature_token)
  send_request("post","signature/sendReminder/#{signature_token}")
end

#void_signature(signature_token) ⇒ Object



34
35
36
# File 'lib/ilovepdf/signature/management.rb', line 34

def void_signature(signature_token)
  send_request("put","signature/void/#{signature_token}")
end