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

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



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

def self.all(params = {}, options = {})
  list(params, options)
end

.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`
query_user_id - int64 - Return results that are actions performed by the user indiciated by this User ID
query_file_id - int64 - Return results that are file actions related to the file indicated by this File ID
query_parent_id - int64 - 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`
query_target_id - int64 - 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 - int64 - 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.


311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
# File 'lib/files.com/models/history_export.rb', line 311

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

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

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



339
340
341
342
343
344
345
346
347
# File 'lib/files.com/models/history_export.rb', line 339

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

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

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



349
350
351
# File 'lib/files.com/models/history_export.rb', line 349

def self.destroy(id, params = {}, options = {})
  delete(id, params, options)
end

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

Parameters:

id (required) - int64 - History Export ID.


274
275
276
277
278
279
280
281
282
# File 'lib/files.com/models/history_export.rb', line 274

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

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

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



284
285
286
# File 'lib/files.com/models/history_export.rb', line 284

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

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

Parameters:

user_id - int64 - User ID.  Provide a value of `0` to operate the current session's user.
page - int64 - Current page number.
per_page - int64 - Number of records to show per page.  (Max: 10,000, 1,000 or less is recommended).
action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.


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

def self.list(params = {}, options = {})
  raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params.dig(:user_id) and !params.dig(:user_id).is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)

  response, options = Api.send_request("/history_exports", :get, params, options)
  response.data.map do |entity_data|
    HistoryExport.new(entity_data, options)
  end
end

Instance Method Details

#delete(params = {}) ⇒ Object



228
229
230
231
232
233
234
235
236
# File 'lib/files.com/models/history_export.rb', line 228

def delete(params = {})
  params ||= {}
  params[:id] = @attributes[:id]
  raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
  raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
  raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)

  Api.send_request("/history_exports/#{@attributes[:id]}", :delete, params, @options)
end

#destroy(params = {}) ⇒ Object



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

def destroy(params = {})
  delete(params)
end

#end_atObject

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



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

def end_at
  @attributes[:end_at]
end

#end_at=(value) ⇒ Object



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

def end_at=(value)
  @attributes[:end_at] = 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`



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

def query_action
  @attributes[:query_action]
end

#query_action=(value) ⇒ Object



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

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

#query_destinationObject

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



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

def query_destination
  @attributes[:query_destination]
end

#query_destination=(value) ⇒ Object



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

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`



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

def query_failure_type
  @attributes[:query_failure_type]
end

#query_failure_type=(value) ⇒ Object



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

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

#query_file_idObject

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



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

def query_file_id
  @attributes[:query_file_id]
end

#query_file_id=(value) ⇒ Object



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

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.



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

def query_folder
  @attributes[:query_folder]
end

#query_folder=(value) ⇒ Object



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

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`



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

def query_interface
  @attributes[:query_interface]
end

#query_interface=(value) ⇒ Object



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

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

#query_ipObject

string - Filter results by this IP address.



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

def query_ip
  @attributes[:query_ip]
end

#query_ip=(value) ⇒ Object



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

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

#query_parent_idObject

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



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

def query_parent_id
  @attributes[:query_parent_id]
end

#query_parent_id=(value) ⇒ Object



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

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

#query_pathObject

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



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

def query_path
  @attributes[:query_path]
end

#query_path=(value) ⇒ Object



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

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

#query_srcObject

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



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

def query_src
  @attributes[:query_src]
end

#query_src=(value) ⇒ Object



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

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

#query_target_idObject

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



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

def query_target_id
  @attributes[:query_target_id]
end

#query_target_id=(value) ⇒ Object



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

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.



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

def query_target_name
  @attributes[:query_target_name]
end

#query_target_name=(value) ⇒ Object



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

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.



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

def query_target_permission
  @attributes[:query_target_permission]
end

#query_target_permission=(value) ⇒ Object



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

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.



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

def query_target_permission_set
  @attributes[:query_target_permission_set]
end

#query_target_permission_set=(value) ⇒ Object



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

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.



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

def query_target_platform
  @attributes[:query_target_platform]
end

#query_target_platform=(value) ⇒ Object



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

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

#query_target_user_idObject

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



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

def query_target_user_id
  @attributes[:query_target_user_id]
end

#query_target_user_id=(value) ⇒ Object



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

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.



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

def query_target_username
  @attributes[:query_target_username]
end

#query_target_username=(value) ⇒ Object



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

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

#query_user_idObject

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



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

def query_user_id
  @attributes[:query_user_id]
end

#query_user_id=(value) ⇒ Object



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

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

#query_usernameObject

string - Filter results by this username.



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

def query_username
  @attributes[:query_username]
end

#query_username=(value) ⇒ Object



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

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

#saveObject



242
243
244
245
246
247
248
249
# File 'lib/files.com/models/history_export.rb', line 242

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.



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

def start_at
  @attributes[:start_at]
end

#start_at=(value) ⇒ Object



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

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

#statusObject

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



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

def status
  @attributes[:status]
end

#status=(value) ⇒ Object



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

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

#user_idObject

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



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

def user_id
  @attributes[:user_id]
end

#user_id=(value) ⇒ Object



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

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