Class: Files::HistoryExport

Inherits:
Object
  • Object
show all
Defined in:
lib/files.com/models/history_export.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}, options = {}) ⇒ HistoryExport

Returns a new instance of HistoryExport.



7
8
9
10
# File 'lib/files.com/models/history_export.rb', line 7

def initialize(attributes = {}, options = {})
  @attributes = attributes || {}
  @options = options || {}
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



5
6
7
# File 'lib/files.com/models/history_export.rb', line 5

def attributes
  @attributes
end

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/files.com/models/history_export.rb', line 5

def options
  @options
end

Class Method Details

.create(params = {}, options = {}) ⇒ Object

Parameters:

user_id - int64 - User ID.  Provide a value of `0` to operate the current session's user.
start_at - string - Start date/time of export range.
end_at - string - End date/time of export range.
query_action - string - Filter results by this this action type. Valid values: `create`, `read`, `update`, `destroy`, `move`, `login`, `failedlogin`, `copy`, `user_create`, `user_update`, `user_destroy`, `group_create`, `group_update`, `group_destroy`, `permission_create`, `permission_destroy`, `api_key_create`, `api_key_update`, `api_key_destroy`
query_interface - string - Filter results by this this interface type. Valid values: `web`, `ftp`, `robot`, `jsapi`, `webdesktopapi`, `sftp`, `dav`, `desktop`, `restapi`, `scim`, `office`, `mobile`, `as2`, `inbound_email`, `remote`
query_user_id - string - Return results that are actions performed by the user indiciated by this User ID
query_file_id - string - Return results that are file actions related to the file indicated by this File ID
query_parent_id - string - Return results that are file actions inside the parent folder specified by this folder ID
query_path - string - Return results that are file actions related to this path.
query_folder - string - Return results that are file actions related to files or folders inside this folder path.
query_src - string - Return results that are file moves originating from this path.
query_destination - string - Return results that are file moves with this path as destination.
query_ip - string - Filter results by this IP address.
query_username - string - Filter results by this username.
query_failure_type - string - If searching for Histories about login failures, this parameter restricts results to failures of this specific type.  Valid values: `expired_trial`, `account_overdue`, `locked_out`, `ip_mismatch`, `password_mismatch`, `site_mismatch`, `username_not_found`, `none`, `no_ftp_permission`, `no_web_permission`, `no_directory`, `errno_enoent`, `no_sftp_permission`, `no_dav_permission`, `no_restapi_permission`, `key_mismatch`, `region_mismatch`, `expired_access`, `desktop_ip_mismatch`, `desktop_api_key_not_used_quickly_enough`, `disabled`, `country_mismatch`
query_target_id - string - If searching for Histories about specific objects (such as Users, or API Keys), this paremeter restricts results to objects that match this ID.
query_target_name - string - If searching for Histories about Users, Groups or other objects with names, this parameter restricts results to objects with this name/username.
query_target_permission - string - If searching for Histories about Permisisons, this parameter restricts results to permissions of this level.
query_target_user_id - string - If searching for Histories about API keys, this parameter restricts results to API keys created by/for this user ID.
query_target_username - string - If searching for Histories about API keys, this parameter restricts results to API keys created by/for this username.
query_target_platform - string - If searching for Histories about API keys, this parameter restricts results to API keys associated with this platform.
query_target_permission_set - string - If searching for Histories about API keys, this parameter restricts results to API keys with this permission set.


294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
# File 'lib/files.com/models/history_export.rb', line 294

def self.create(params = {}, options = {})
  raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params[:user_id] and !params[:user_id].is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: start_at must be an String") if params[:start_at] and !params[:start_at].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: end_at must be an String") if params[:end_at] and !params[:end_at].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: query_action must be an String") if params[:query_action] and !params[:query_action].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: query_interface must be an String") if params[:query_interface] and !params[:query_interface].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: query_user_id must be an String") if params[:query_user_id] and !params[:query_user_id].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: query_file_id must be an String") if params[:query_file_id] and !params[:query_file_id].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: query_parent_id must be an String") if params[:query_parent_id] and !params[:query_parent_id].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: query_path must be an String") if params[:query_path] and !params[:query_path].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: query_folder must be an String") if params[:query_folder] and !params[:query_folder].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: query_src must be an String") if params[:query_src] and !params[:query_src].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: query_destination must be an String") if params[:query_destination] and !params[:query_destination].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: query_ip must be an String") if params[:query_ip] and !params[:query_ip].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: query_username must be an String") if params[:query_username] and !params[:query_username].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: query_failure_type must be an String") if params[:query_failure_type] and !params[:query_failure_type].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: query_target_id must be an String") if params[:query_target_id] and !params[:query_target_id].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: query_target_name must be an String") if params[:query_target_name] and !params[:query_target_name].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: query_target_permission must be an String") if params[:query_target_permission] and !params[:query_target_permission].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: query_target_user_id must be an String") if params[:query_target_user_id] and !params[:query_target_user_id].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: query_target_username must be an String") if params[:query_target_username] and !params[:query_target_username].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: query_target_platform must be an String") if params[:query_target_platform] and !params[:query_target_platform].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: query_target_permission_set must be an String") if params[:query_target_permission_set] and !params[:query_target_permission_set].is_a?(String)

  response, options = Api.send_request("/history_exports", :post, params, options)
  HistoryExport.new(response.data, options)
end

.find(id, params = {}, options = {}) ⇒ Object

Parameters:

id (required) - int64 - History Export ID.


257
258
259
260
261
262
263
264
265
# File 'lib/files.com/models/history_export.rb', line 257

def self.find(id, params = {}, options = {})
  params ||= {}
  params[:id] = id
  raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
  raise MissingParameterError.new("Parameter missing: id") unless params[:id]

  response, options = Api.send_request("/history_exports/#{params[:id]}", :get, params, options)
  HistoryExport.new(response.data, options)
end

.get(id, params = {}, options = {}) ⇒ Object



267
268
269
# File 'lib/files.com/models/history_export.rb', line 267

def self.get(id, params = {}, options = {})
  find(id, params, options)
end

Instance Method Details

#end_atObject

date-time - End date/time of export range.



40
41
42
# File 'lib/files.com/models/history_export.rb', line 40

def end_at
  @attributes[:end_at]
end

#end_at=(value) ⇒ Object



44
45
46
# File 'lib/files.com/models/history_export.rb', line 44

def end_at=(value)
  @attributes[:end_at] = value
end

#history_versionObject

string - Version of the history for the export.



22
23
24
# File 'lib/files.com/models/history_export.rb', line 22

def history_version
  @attributes[:history_version]
end

#history_version=(value) ⇒ Object



26
27
28
# File 'lib/files.com/models/history_export.rb', line 26

def history_version=(value)
  @attributes[:history_version] = value
end

#idObject

int64 - History Export ID



13
14
15
# File 'lib/files.com/models/history_export.rb', line 13

def id
  @attributes[:id]
end

#id=(value) ⇒ Object



17
18
19
# File 'lib/files.com/models/history_export.rb', line 17

def id=(value)
  @attributes[:id] = value
end

#query_actionObject

string - Filter results by this this action type. Valid values: ‘create`, `read`, `update`, `destroy`, `move`, `login`, `failedlogin`, `copy`, `user_create`, `user_update`, `user_destroy`, `group_create`, `group_update`, `group_destroy`, `permission_create`, `permission_destroy`, `api_key_create`, `api_key_update`, `api_key_destroy`



58
59
60
# File 'lib/files.com/models/history_export.rb', line 58

def query_action
  @attributes[:query_action]
end

#query_action=(value) ⇒ Object



62
63
64
# File 'lib/files.com/models/history_export.rb', line 62

def query_action=(value)
  @attributes[:query_action] = value
end

#query_destinationObject

string - Return results that are file moves with this path as destination.



130
131
132
# File 'lib/files.com/models/history_export.rb', line 130

def query_destination
  @attributes[:query_destination]
end

#query_destination=(value) ⇒ Object



134
135
136
# File 'lib/files.com/models/history_export.rb', line 134

def query_destination=(value)
  @attributes[:query_destination] = value
end

#query_failure_typeObject

string - If searching for Histories about login failures, this parameter restricts results to failures of this specific type. Valid values: ‘expired_trial`, `account_overdue`, `locked_out`, `ip_mismatch`, `password_mismatch`, `site_mismatch`, `username_not_found`, `none`, `no_ftp_permission`, `no_web_permission`, `no_directory`, `errno_enoent`, `no_sftp_permission`, `no_dav_permission`, `no_restapi_permission`, `key_mismatch`, `region_mismatch`, `expired_access`, `desktop_ip_mismatch`, `desktop_api_key_not_used_quickly_enough`, `disabled`, `country_mismatch`



157
158
159
# File 'lib/files.com/models/history_export.rb', line 157

def query_failure_type
  @attributes[:query_failure_type]
end

#query_failure_type=(value) ⇒ Object



161
162
163
# File 'lib/files.com/models/history_export.rb', line 161

def query_failure_type=(value)
  @attributes[:query_failure_type] = value
end

#query_file_idObject

string - Return results that are file actions related to the file indicated by this File ID



85
86
87
# File 'lib/files.com/models/history_export.rb', line 85

def query_file_id
  @attributes[:query_file_id]
end

#query_file_id=(value) ⇒ Object



89
90
91
# File 'lib/files.com/models/history_export.rb', line 89

def query_file_id=(value)
  @attributes[:query_file_id] = value
end

#query_folderObject

string - Return results that are file actions related to files or folders inside this folder path.



112
113
114
# File 'lib/files.com/models/history_export.rb', line 112

def query_folder
  @attributes[:query_folder]
end

#query_folder=(value) ⇒ Object



116
117
118
# File 'lib/files.com/models/history_export.rb', line 116

def query_folder=(value)
  @attributes[:query_folder] = value
end

#query_interfaceObject

string - Filter results by this this interface type. Valid values: ‘web`, `ftp`, `robot`, `jsapi`, `webdesktopapi`, `sftp`, `dav`, `desktop`, `restapi`, `scim`, `office`, `mobile`, `as2`, `inbound_email`, `remote`



67
68
69
# File 'lib/files.com/models/history_export.rb', line 67

def query_interface
  @attributes[:query_interface]
end

#query_interface=(value) ⇒ Object



71
72
73
# File 'lib/files.com/models/history_export.rb', line 71

def query_interface=(value)
  @attributes[:query_interface] = value
end

#query_ipObject

string - Filter results by this IP address.



139
140
141
# File 'lib/files.com/models/history_export.rb', line 139

def query_ip
  @attributes[:query_ip]
end

#query_ip=(value) ⇒ Object



143
144
145
# File 'lib/files.com/models/history_export.rb', line 143

def query_ip=(value)
  @attributes[:query_ip] = value
end

#query_parent_idObject

string - Return results that are file actions inside the parent folder specified by this folder ID



94
95
96
# File 'lib/files.com/models/history_export.rb', line 94

def query_parent_id
  @attributes[:query_parent_id]
end

#query_parent_id=(value) ⇒ Object



98
99
100
# File 'lib/files.com/models/history_export.rb', line 98

def query_parent_id=(value)
  @attributes[:query_parent_id] = value
end

#query_pathObject

string - Return results that are file actions related to this path.



103
104
105
# File 'lib/files.com/models/history_export.rb', line 103

def query_path
  @attributes[:query_path]
end

#query_path=(value) ⇒ Object



107
108
109
# File 'lib/files.com/models/history_export.rb', line 107

def query_path=(value)
  @attributes[:query_path] = value
end

#query_srcObject

string - Return results that are file moves originating from this path.



121
122
123
# File 'lib/files.com/models/history_export.rb', line 121

def query_src
  @attributes[:query_src]
end

#query_src=(value) ⇒ Object



125
126
127
# File 'lib/files.com/models/history_export.rb', line 125

def query_src=(value)
  @attributes[:query_src] = value
end

#query_target_idObject

string - If searching for Histories about specific objects (such as Users, or API Keys), this paremeter restricts results to objects that match this ID.



166
167
168
# File 'lib/files.com/models/history_export.rb', line 166

def query_target_id
  @attributes[:query_target_id]
end

#query_target_id=(value) ⇒ Object



170
171
172
# File 'lib/files.com/models/history_export.rb', line 170

def query_target_id=(value)
  @attributes[:query_target_id] = value
end

#query_target_nameObject

string - If searching for Histories about Users, Groups or other objects with names, this parameter restricts results to objects with this name/username.



175
176
177
# File 'lib/files.com/models/history_export.rb', line 175

def query_target_name
  @attributes[:query_target_name]
end

#query_target_name=(value) ⇒ Object



179
180
181
# File 'lib/files.com/models/history_export.rb', line 179

def query_target_name=(value)
  @attributes[:query_target_name] = value
end

#query_target_permissionObject

string - If searching for Histories about Permisisons, this parameter restricts results to permissions of this level.



184
185
186
# File 'lib/files.com/models/history_export.rb', line 184

def query_target_permission
  @attributes[:query_target_permission]
end

#query_target_permission=(value) ⇒ Object



188
189
190
# File 'lib/files.com/models/history_export.rb', line 188

def query_target_permission=(value)
  @attributes[:query_target_permission] = value
end

#query_target_permission_setObject

string - If searching for Histories about API keys, this parameter restricts results to API keys with this permission set.



220
221
222
# File 'lib/files.com/models/history_export.rb', line 220

def query_target_permission_set
  @attributes[:query_target_permission_set]
end

#query_target_permission_set=(value) ⇒ Object



224
225
226
# File 'lib/files.com/models/history_export.rb', line 224

def query_target_permission_set=(value)
  @attributes[:query_target_permission_set] = value
end

#query_target_platformObject

string - If searching for Histories about API keys, this parameter restricts results to API keys associated with this platform.



211
212
213
# File 'lib/files.com/models/history_export.rb', line 211

def query_target_platform
  @attributes[:query_target_platform]
end

#query_target_platform=(value) ⇒ Object



215
216
217
# File 'lib/files.com/models/history_export.rb', line 215

def query_target_platform=(value)
  @attributes[:query_target_platform] = value
end

#query_target_user_idObject

string - If searching for Histories about API keys, this parameter restricts results to API keys created by/for this user ID.



193
194
195
# File 'lib/files.com/models/history_export.rb', line 193

def query_target_user_id
  @attributes[:query_target_user_id]
end

#query_target_user_id=(value) ⇒ Object



197
198
199
# File 'lib/files.com/models/history_export.rb', line 197

def query_target_user_id=(value)
  @attributes[:query_target_user_id] = value
end

#query_target_usernameObject

string - If searching for Histories about API keys, this parameter restricts results to API keys created by/for this username.



202
203
204
# File 'lib/files.com/models/history_export.rb', line 202

def query_target_username
  @attributes[:query_target_username]
end

#query_target_username=(value) ⇒ Object



206
207
208
# File 'lib/files.com/models/history_export.rb', line 206

def query_target_username=(value)
  @attributes[:query_target_username] = value
end

#query_user_idObject

string - Return results that are actions performed by the user indiciated by this User ID



76
77
78
# File 'lib/files.com/models/history_export.rb', line 76

def query_user_id
  @attributes[:query_user_id]
end

#query_user_id=(value) ⇒ Object



80
81
82
# File 'lib/files.com/models/history_export.rb', line 80

def query_user_id=(value)
  @attributes[:query_user_id] = value
end

#query_usernameObject

string - Filter results by this username.



148
149
150
# File 'lib/files.com/models/history_export.rb', line 148

def query_username
  @attributes[:query_username]
end

#query_username=(value) ⇒ Object



152
153
154
# File 'lib/files.com/models/history_export.rb', line 152

def query_username=(value)
  @attributes[:query_username] = value
end

#results_urlObject

string - If ‘status` is `ready`, this will be a URL where all the results can be downloaded at once as a CSV.



229
230
231
# File 'lib/files.com/models/history_export.rb', line 229

def results_url
  @attributes[:results_url]
end

#results_url=(value) ⇒ Object



233
234
235
# File 'lib/files.com/models/history_export.rb', line 233

def results_url=(value)
  @attributes[:results_url] = value
end

#saveObject



246
247
248
249
250
251
252
253
# File 'lib/files.com/models/history_export.rb', line 246

def save
  if @attributes[:id]
    raise NotImplementedError.new("The HistoryExport object doesn't support updates.")
  else
    new_obj = HistoryExport.create(@attributes, @options)
    @attributes = new_obj.attributes
  end
end

#start_atObject

date-time - Start date/time of export range.



31
32
33
# File 'lib/files.com/models/history_export.rb', line 31

def start_at
  @attributes[:start_at]
end

#start_at=(value) ⇒ Object



35
36
37
# File 'lib/files.com/models/history_export.rb', line 35

def start_at=(value)
  @attributes[:start_at] = value
end

#statusObject

string - Status of export. Will be: ‘building`, `ready`, or `failed`



49
50
51
# File 'lib/files.com/models/history_export.rb', line 49

def status
  @attributes[:status]
end

#status=(value) ⇒ Object



53
54
55
# File 'lib/files.com/models/history_export.rb', line 53

def status=(value)
  @attributes[:status] = value
end

#user_idObject

int64 - User ID. Provide a value of ‘0` to operate the current session’s user.



238
239
240
# File 'lib/files.com/models/history_export.rb', line 238

def user_id
  @attributes[:user_id]
end

#user_id=(value) ⇒ Object



242
243
244
# File 'lib/files.com/models/history_export.rb', line 242

def user_id=(value)
  @attributes[:user_id] = value
end