Class: SafeTRest

Inherits:
Object
  • Object
show all
Defined in:
lib/safe-t-rest.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#extenstion_idObject

Returns the value of attribute extenstion_id



4
5
6
# File 'lib/safe-t-rest.rb', line 4

def extenstion_id
  @extenstion_id
end

#guidObject

Returns the value of attribute guid



4
5
6
# File 'lib/safe-t-rest.rb', line 4

def guid
  @guid
end

#passwordObject

Returns the value of attribute password



4
5
6
# File 'lib/safe-t-rest.rb', line 4

def password
  @password
end

#role_idObject

Returns the value of attribute role_id



4
5
6
# File 'lib/safe-t-rest.rb', line 4

def role_id
  @role_id
end

#urlObject

Returns the value of attribute url



4
5
6
# File 'lib/safe-t-rest.rb', line 4

def url
  @url
end

#usernameObject

Returns the value of attribute username



4
5
6
# File 'lib/safe-t-rest.rb', line 4

def username
  @username
end

Instance Method Details

#getAppsProcessStateObject



6
7
8
9
10
11
12
13
14
15
# File 'lib/safe-t-rest.rb', line 6

def getAppsProcessState
	RestClient::Request.execute(
		:method => :post,
		:url => @url,
		:headers => {
		   :servletRequestID => 'MethodRequest',
		   :BusinessLogic => "{Username:'', Password:'', RoleID: '#{@role_id}', ExtensionID: '#{@extenstion_id}', GetAppsProcessState: ['#{@guid}', false]}"
		}
	)
end

#getPackageFileListObject



17
18
19
20
21
22
23
24
25
26
# File 'lib/safe-t-rest.rb', line 17

def getPackageFileList
	RestClient::Request.execute(
		:method => :post,
		:url => @url,
		:headers => {
		   :servletRequestID => 'MethodRequest',
		   :BusinessLogic => "{Username:'', Password:'', RoleID: '#{@role_id}', ExtensionID: '#{@extenstion_id}', GetPackageFileList: ['#{@guid}']}"
		}
	)
end

#iFileDownload(args) ⇒ Object



94
95
96
97
98
99
100
101
102
103
# File 'lib/safe-t-rest.rb', line 94

def iFileDownload(args)
   RestClient::Request.execute(
      :method => :post,
      :url => @url,
      :headers => {
         :servletRequestID => 'MethodRequest',
         :BusinessLogic => "{Username:'', Password:'', RoleID: '#{@role_id}', ExtensionID: '#{@extenstion_id}', iFileDownload: ['#{@username}', '#{@password}', '#{args[:file_name]}', '#{args[:folder_path]}', #{args[:root_folder_id]}]}"
      }
   )
end

#iFileUpload(args) ⇒ Object



83
84
85
86
87
88
89
90
91
92
# File 'lib/safe-t-rest.rb', line 83

def iFileUpload(args)
   RestClient::Request.execute(
      :method => :post,
      :url => @url,
      :headers => {
         :servletRequestID => 'MethodRequest',
         :BusinessLogic => "{Username:'', Password:'', RoleID: '#{@role_id}', ExtensionID: '#{@extenstion_id}', iFileUpload: ['#{@username}', '#{@password}', '#{args[:file_base64]}', '#{args[:file_name]}', '#{args[:folder_path]}', #{args[:root_folder_id]}]}"
      }
   )
end

#iGetFolderList(path) ⇒ Object



61
62
63
64
65
66
67
68
69
70
# File 'lib/safe-t-rest.rb', line 61

def iGetFolderList(path)
   RestClient::Request.execute(
      :method => :post,
      :url => @url,
      :headers => {
         :servletRequestID => 'MethodRequest',
         :BusinessLogic => "{Username:'', Password:'', RoleID: '#{@role_id}', ExtensionID: '#{@extenstion_id}', iGetFolderList: ['#{@username}', '#{@password}', #{false}, #{true}, '#{path}', 417]}"
      }
   )
end

#iGetHistory(days) ⇒ Object



39
40
41
42
43
44
45
46
47
48
# File 'lib/safe-t-rest.rb', line 39

def iGetHistory(days)
   RestClient::Request.execute(
      :method => :post,
      :url => @url,
      :headers => {
         :servletRequestID => 'MethodRequest',
         :BusinessLogic => "{Username:'', Password:'', RoleID: '#{@role_id}', ExtensionID: '#{@extenstion_id}', iGetHistory: ['#{@username}', '#{@password}', #{days}]}"
      }
   )
end

#iSafeShareFile(args) ⇒ Object



72
73
74
75
76
77
78
79
80
81
# File 'lib/safe-t-rest.rb', line 72

def iSafeShareFile(args)
   RestClient::Request.execute(
      :method => :post,
      :url => @url,
      :headers => {
         :servletRequestID => 'MethodRequest',
         :BusinessLogic => "{Username:'', Password:'', RoleID: '#{@role_id}', ExtensionID: '#{@extenstion_id}', iSafeShareFile: ['#{@username}', '#{@password}', '#{args[:files]}', '#{args[:recipients]}', '#{args[:sender_name]}', '#{args[:sender_address]}', '#{args[:subject]}', '#{args[:message]}', #{args[:message_encryption_level]}, #{args[:delivery_method]}, '#{args[:mobile_recipient]}', #{args[:return_receipt]}, #{args[:safe_reply]}, #{args[:max_downloads]}, #{args[:package_expiry]}, '#{args[:folder_path]}', #{args[:root_folder_id]}]}"
      }
   )
end

#iUserAccountAddressListObject



50
51
52
53
54
55
56
57
58
59
# File 'lib/safe-t-rest.rb', line 50

def iUserAccountAddressList
   RestClient::Request.execute(
      :method => :post,
      :url => @url,
      :headers => {
         :servletRequestID => 'MethodRequest',
         :BusinessLogic => "{Username:'', Password:'', RoleID: '#{@role_id}', ExtensionID: '#{@extenstion_id}', iUserAccountAddressList: ['#{@username}', '#{@password}']}"
      }
   )
end

#iVerifyUserAccountObject



28
29
30
31
32
33
34
35
36
37
# File 'lib/safe-t-rest.rb', line 28

def iVerifyUserAccount
	RestClient::Request.execute(
		:method => :post,
		:url => @url,
		:headers => {
		   :servletRequestID => 'MethodRequest',
		   :BusinessLogic => "{Username:'', Password:'', RoleID: '#{@role_id}', ExtensionID: '#{@extenstion_id}', iVerifyUserAccount: ['#{@username}', '#{@password}', true]}"
		}
	)
end