files.com 1.0.15 → 1.0.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/_VERSION +1 -1
  3. data/docs/account_line_item.md +2 -2
  4. data/docs/action.md +4 -4
  5. data/docs/api_key.md +11 -0
  6. data/docs/behavior.md +2 -2
  7. data/docs/bundle.md +2 -2
  8. data/docs/dns_record.md +2 -0
  9. data/docs/group.md +2 -2
  10. data/docs/group_user.md +2 -2
  11. data/docs/history.md +9 -9
  12. data/docs/invoice.md +2 -2
  13. data/docs/ip_address.md +2 -0
  14. data/docs/lock.md +2 -2
  15. data/docs/notification.md +2 -2
  16. data/docs/payment.md +2 -2
  17. data/docs/permission.md +2 -2
  18. data/docs/preview.md +2 -40
  19. data/docs/public_key.md +3 -3
  20. data/docs/session.md +0 -85
  21. data/docs/site.md +3 -92
  22. data/docs/style.md +4 -2
  23. data/docs/usage_daily_snapshot.md +37 -0
  24. data/docs/usage_snapshot.md +22 -4
  25. data/docs/user.md +3 -3
  26. data/docs/user_cipher_use.md +4 -4
  27. data/lib/files.com.rb +1 -14
  28. data/lib/files.com/models/account_line_item.rb +5 -5
  29. data/lib/files.com/models/action.rb +6 -6
  30. data/lib/files.com/models/api_key.rb +14 -0
  31. data/lib/files.com/models/behavior.rb +9 -9
  32. data/lib/files.com/models/bundle.rb +9 -9
  33. data/lib/files.com/models/dns_record.rb +5 -0
  34. data/lib/files.com/models/group.rb +9 -9
  35. data/lib/files.com/models/group_user.rb +9 -9
  36. data/lib/files.com/models/history.rb +6 -6
  37. data/lib/files.com/models/invoice.rb +5 -5
  38. data/lib/files.com/models/ip_address.rb +5 -0
  39. data/lib/files.com/models/lock.rb +9 -9
  40. data/lib/files.com/models/notification.rb +9 -9
  41. data/lib/files.com/models/payment.rb +5 -5
  42. data/lib/files.com/models/permission.rb +9 -9
  43. data/lib/files.com/models/preview.rb +5 -45
  44. data/lib/files.com/models/public_key.rb +9 -9
  45. data/lib/files.com/models/session.rb +0 -66
  46. data/lib/files.com/models/site.rb +5 -72
  47. data/lib/files.com/models/style.rb +14 -5
  48. data/lib/files.com/models/usage_daily_snapshot.rb +49 -0
  49. data/lib/files.com/models/usage_snapshot.rb +27 -10
  50. data/lib/files.com/models/user.rb +9 -9
  51. data/lib/files.com/models/user_cipher_use.rb +10 -10
  52. metadata +4 -2
@@ -18,6 +18,15 @@ module Files
18
18
  @attributes[:id] = value
19
19
  end
20
20
 
21
+ # string - Public key title
22
+ def title
23
+ @attributes[:title]
24
+ end
25
+
26
+ def title=(value)
27
+ @attributes[:title] = value
28
+ end
29
+
21
30
  # date-time - Public key created at date/time
22
31
  def created_at
23
32
  @attributes[:created_at]
@@ -32,15 +41,6 @@ module Files
32
41
  @attributes[:fingerprint] = value
33
42
  end
34
43
 
35
- # string - Public key title
36
- def title
37
- @attributes[:title]
38
- end
39
-
40
- def title=(value)
41
- @attributes[:title] = value
42
- end
43
-
44
44
  # int64 - User ID. Provide a value of `0` to operate the current session's user.
45
45
  def user_id
46
46
  @attributes[:user_id]
@@ -223,72 +223,6 @@ module Files
223
223
  Session.new(response.data, options)
224
224
  end
225
225
 
226
- # Parameters:
227
- # code (required) - string
228
- # password (required) - string
229
- # confirm_password - string
230
- # interface - string
231
- # locale - string
232
- # otp - string
233
- def self.forgot_reset(params = {}, options = {})
234
- raise InvalidParameterError.new("Bad parameter: code must be an String") if params.dig(:code) and !params.dig(:code).is_a?(String)
235
- raise InvalidParameterError.new("Bad parameter: password must be an String") if params.dig(:password) and !params.dig(:password).is_a?(String)
236
- raise InvalidParameterError.new("Bad parameter: confirm_password must be an String") if params.dig(:confirm_password) and !params.dig(:confirm_password).is_a?(String)
237
- raise InvalidParameterError.new("Bad parameter: interface must be an String") if params.dig(:interface) and !params.dig(:interface).is_a?(String)
238
- raise InvalidParameterError.new("Bad parameter: locale must be an String") if params.dig(:locale) and !params.dig(:locale).is_a?(String)
239
- raise InvalidParameterError.new("Bad parameter: otp must be an String") if params.dig(:otp) and !params.dig(:otp).is_a?(String)
240
- raise MissingParameterError.new("Parameter missing: code") unless params.dig(:code)
241
- raise MissingParameterError.new("Parameter missing: password") unless params.dig(:password)
242
-
243
- response, _options = Api.send_request("/sessions/forgot/reset", :post, params, options)
244
- response.data
245
- end
246
-
247
- # Parameters:
248
- # code (required) - string
249
- def self.forgot_validate(params = {}, options = {})
250
- raise InvalidParameterError.new("Bad parameter: code must be an String") if params.dig(:code) and !params.dig(:code).is_a?(String)
251
- raise MissingParameterError.new("Parameter missing: code") unless params.dig(:code)
252
-
253
- response, _options = Api.send_request("/sessions/forgot/validate", :post, params, options)
254
- response.data
255
- end
256
-
257
- # Parameters:
258
- # email - string
259
- # username - string
260
- def self.forgot(params = {}, options = {})
261
- raise InvalidParameterError.new("Bad parameter: email must be an String") if params.dig(:email) and !params.dig(:email).is_a?(String)
262
- raise InvalidParameterError.new("Bad parameter: username must be an String") if params.dig(:username) and !params.dig(:username).is_a?(String)
263
-
264
- response, _options = Api.send_request("/sessions/forgot", :post, params, options)
265
- response.data
266
- end
267
-
268
- # Parameters:
269
- # key (required) - string - The pairing key to reserve for login. Cannot be reused
270
- def self.pairing_key(key, params = {}, options = {})
271
- params ||= {}
272
- params[:key] = key
273
- raise InvalidParameterError.new("Bad parameter: key must be an String") if params.dig(:key) and !params.dig(:key).is_a?(String)
274
- raise MissingParameterError.new("Parameter missing: key") unless params.dig(:key)
275
-
276
- response, options = Api.send_request("/sessions/pairing_key/#{params[:key]}", :post, params, options)
277
- PairedApiKey.new(response.data, options)
278
- end
279
-
280
- # Parameters:
281
- # provider (required) - string
282
- # state - string
283
- def self.oauth(params = {}, options = {})
284
- raise InvalidParameterError.new("Bad parameter: provider must be an String") if params.dig(:provider) and !params.dig(:provider).is_a?(String)
285
- raise InvalidParameterError.new("Bad parameter: state must be an String") if params.dig(:state) and !params.dig(:state).is_a?(String)
286
- raise MissingParameterError.new("Parameter missing: provider") unless params.dig(:provider)
287
-
288
- response, options = Api.send_request("/sessions/oauth", :post, params, options)
289
- OauthRedirect.new(response.data, options)
290
- end
291
-
292
226
  def self.delete(params = {}, options = {})
293
227
  response, _options = Api.send_request("/sessions", :delete, params, options)
294
228
  response.data
@@ -9,6 +9,11 @@ module Files
9
9
  @options = options || {}
10
10
  end
11
11
 
12
+ # string - Site name
13
+ def name
14
+ @attributes[:name]
15
+ end
16
+
12
17
  # boolean - Is SMS two factor authentication allowed?
13
18
  def allowed_2fa_method_sms
14
19
  @attributes[:allowed_2fa_method_sms]
@@ -284,11 +289,6 @@ module Files
284
289
  @attributes[:max_prior_passwords]
285
290
  end
286
291
 
287
- # string - Site name
288
- def name
289
- @attributes[:name]
290
- end
291
-
292
292
  # float - Next billing amount
293
293
  def next_billing_amount
294
294
  @attributes[:next_billing_amount]
@@ -529,21 +529,6 @@ module Files
529
529
  @attributes[:disable_users_from_inactivity_period_days]
530
530
  end
531
531
 
532
- # Change the current billing plan for the site
533
- #
534
- # Parameters:
535
- # billing_frequency - integer - The billing frequency for the site. Must be 1(monthly) or 12(annual).
536
- def update_plan(params = {})
537
- params ||= {}
538
- params[:id] = @attributes[:id]
539
- raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
540
- raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
541
- raise InvalidParameterError.new("Bad parameter: billing_frequency must be an Integer") if params.dig(:billing_frequency) and !params.dig(:billing_frequency).is_a?(Integer)
542
- raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
543
-
544
- Api.send_request("/site/plan", :patch, params, @options)
545
- end
546
-
547
532
  def self.get(params = {}, options = {})
548
533
  response, options = Api.send_request("/site", :get, params, options)
549
534
  Site.new(response.data, options)
@@ -554,43 +539,6 @@ module Files
554
539
  UsageSnapshot.new(response.data, options)
555
540
  end
556
541
 
557
- def self.get_switch_to_plan(params = {}, options = {})
558
- response, options = Api.send_request("/site/switch_to_plan", :get, params, options)
559
- Plan.new(response.data, options)
560
- end
561
-
562
- # Parameters:
563
- # currency - string - Currency.
564
- def self.get_plan(params = {}, options = {})
565
- raise InvalidParameterError.new("Bad parameter: currency must be an String") if params.dig(:currency) and !params.dig(:currency).is_a?(String)
566
-
567
- response, options = Api.send_request("/site/plan", :get, params, options)
568
- Plan.new(response.data, options)
569
- end
570
-
571
- # Parameters:
572
- # paypal_token (required) - string - Billing token for use with paypal.
573
- def self.get_paypal_express_info(params = {}, options = {})
574
- raise InvalidParameterError.new("Bad parameter: paypal_token must be an String") if params.dig(:paypal_token) and !params.dig(:paypal_token).is_a?(String)
575
- raise MissingParameterError.new("Parameter missing: paypal_token") unless params.dig(:paypal_token)
576
-
577
- response, options = Api.send_request("/site/paypal_express_info", :get, params, options)
578
- PaypalExpressInfo.new(response.data, options)
579
- end
580
-
581
- # Parameters:
582
- # return_to_url (required) - string - URL that paypal express forwards the user to.
583
- # plan_id (required) - integer - Plan ID to switch to.
584
- def self.get_paypal_express(params = {}, options = {})
585
- raise InvalidParameterError.new("Bad parameter: return_to_url must be an String") if params.dig(:return_to_url) and !params.dig(:return_to_url).is_a?(String)
586
- raise InvalidParameterError.new("Bad parameter: plan_id must be an Integer") if params.dig(:plan_id) and !params.dig(:plan_id).is_a?(Integer)
587
- raise MissingParameterError.new("Parameter missing: return_to_url") unless params.dig(:return_to_url)
588
- raise MissingParameterError.new("Parameter missing: plan_id") unless params.dig(:plan_id)
589
-
590
- response, options = Api.send_request("/site/paypal_express", :get, params, options)
591
- PaypalExpressUrl.new(response.data, options)
592
- end
593
-
594
542
  # Parameters:
595
543
  # name - string - Site name
596
544
  # subdomain - string - Site subdomain
@@ -748,20 +696,5 @@ module Files
748
696
  response, options = Api.send_request("/site", :patch, params, options)
749
697
  Site.new(response.data, options)
750
698
  end
751
-
752
- # Change the current billing plan for the site
753
- #
754
- # Parameters:
755
- # billing_frequency - integer - The billing frequency for the site. Must be 1(monthly) or 12(annual).
756
- def self.update_plan(id, params = {}, options = {})
757
- params ||= {}
758
- params[:id] = id
759
- raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
760
- raise InvalidParameterError.new("Bad parameter: billing_frequency must be an Integer") if params.dig(:billing_frequency) and !params.dig(:billing_frequency).is_a?(Integer)
761
- raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
762
-
763
- response, options = Api.send_request("/site/plan", :patch, params, options)
764
- Plan.new(response.data, options)
765
- end
766
699
  end
767
700
  end
@@ -9,13 +9,13 @@ module Files
9
9
  @options = options || {}
10
10
  end
11
11
 
12
- # Logo
13
- def logo
14
- @attributes[:logo]
12
+ # int64 - Style ID
13
+ def id
14
+ @attributes[:id]
15
15
  end
16
16
 
17
- def logo=(value)
18
- @attributes[:logo] = value
17
+ def id=(value)
18
+ @attributes[:id] = value
19
19
  end
20
20
 
21
21
  # string - Folder path This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
@@ -27,6 +27,15 @@ module Files
27
27
  @attributes[:path] = value
28
28
  end
29
29
 
30
+ # Logo
31
+ def logo
32
+ @attributes[:logo]
33
+ end
34
+
35
+ def logo=(value)
36
+ @attributes[:logo] = value
37
+ end
38
+
30
39
  # Logo thumbnail
31
40
  def thumbnail
32
41
  @attributes[:thumbnail]
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Files
4
+ class UsageDailySnapshot
5
+ attr_reader :options, :attributes
6
+
7
+ def initialize(attributes = {}, options = {})
8
+ @attributes = attributes || {}
9
+ @options = options || {}
10
+ end
11
+
12
+ # int64 - ID of the usage record
13
+ def id
14
+ @attributes[:id]
15
+ end
16
+
17
+ # date - The date of this usage record
18
+ def date
19
+ @attributes[:date]
20
+ end
21
+
22
+ # int64 - The quantity of storage held for this site
23
+ def current_storage
24
+ @attributes[:current_storage]
25
+ end
26
+
27
+ # array - Usage broken down by each top-level folder
28
+ def usage_by_top_level_dir
29
+ @attributes[:usage_by_top_level_dir]
30
+ end
31
+
32
+ # Parameters:
33
+ # page - integer - Current page number.
34
+ # per_page - integer - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
35
+ # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
36
+ def self.list(params = {}, options = {})
37
+ raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
38
+ raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
39
+ raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
40
+
41
+ response, options = Api.send_request("/usage_daily_snapshots", :get, params, options)
42
+ response.data.map { |object| UsageDailySnapshot.new(object, options) }
43
+ end
44
+
45
+ def self.all(params = {}, options = {})
46
+ list(params, options)
47
+ end
48
+ end
49
+ end
@@ -14,6 +14,16 @@ module Files
14
14
  @attributes[:id]
15
15
  end
16
16
 
17
+ # date-time - Site usage report start date/time
18
+ def start_at
19
+ @attributes[:start_at]
20
+ end
21
+
22
+ # date-time - Site usage report end date/time
23
+ def end_at
24
+ @attributes[:end_at]
25
+ end
26
+
17
27
  # date-time - Site usage report created at date/time
18
28
  def created_at
19
29
  @attributes[:created_at]
@@ -24,21 +34,11 @@ module Files
24
34
  @attributes[:current_storage]
25
35
  end
26
36
 
27
- # date-time - Site usage report end date/time
28
- def end_at
29
- @attributes[:end_at]
30
- end
31
-
32
37
  # float - Site usage report highest usage in time period
33
38
  def high_water_storage
34
39
  @attributes[:high_water_storage]
35
40
  end
36
41
 
37
- # date-time - Site usage report start date/time
38
- def start_at
39
- @attributes[:start_at]
40
- end
41
-
42
42
  # int64 - Number of downloads in report time period
43
43
  def total_downloads
44
44
  @attributes[:total_downloads]
@@ -73,5 +73,22 @@ module Files
73
73
  def deleted_files_storage
74
74
  @attributes[:deleted_files_storage]
75
75
  end
76
+
77
+ # Parameters:
78
+ # page - integer - Current page number.
79
+ # per_page - integer - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
80
+ # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
81
+ def self.list(params = {}, options = {})
82
+ raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
83
+ raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
84
+ raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
85
+
86
+ response, options = Api.send_request("/usage_snapshots", :get, params, options)
87
+ response.data.map { |object| UsageSnapshot.new(object, options) }
88
+ end
89
+
90
+ def self.all(params = {}, options = {})
91
+ list(params, options)
92
+ end
76
93
  end
77
94
  end
@@ -18,6 +18,15 @@ module Files
18
18
  @attributes[:id] = value
19
19
  end
20
20
 
21
+ # string - User's username
22
+ def username
23
+ @attributes[:username]
24
+ end
25
+
26
+ def username=(value)
27
+ @attributes[:username] = value
28
+ end
29
+
21
30
  # array - List of group IDs of which this user is an administrator
22
31
  def admin_group_ids
23
32
  @attributes[:admin_group_ids]
@@ -365,15 +374,6 @@ module Files
365
374
  @attributes[:user_root] = value
366
375
  end
367
376
 
368
- # string - User's username
369
- def username
370
- @attributes[:username]
371
- end
372
-
373
- def username=(value)
374
- @attributes[:username] = value
375
- end
376
-
377
377
  # file - An image file for your user avatar.
378
378
  def avatar_file
379
379
  @attributes[:avatar_file]
@@ -9,26 +9,26 @@ module Files
9
9
  @options = options || {}
10
10
  end
11
11
 
12
- # date-time - The earliest recorded use of this combination of interface and protocol and cipher (for this user)
13
- def created_at
14
- @attributes[:created_at]
15
- end
16
-
17
12
  # int64 - UserCipherUse ID
18
13
  def id
19
14
  @attributes[:id]
20
15
  end
21
16
 
22
- # string - The interface accessed
23
- def interface
24
- @attributes[:interface]
25
- end
26
-
27
17
  # string - The protocol and cipher employed
28
18
  def protocol_cipher
29
19
  @attributes[:protocol_cipher]
30
20
  end
31
21
 
22
+ # date-time - The earliest recorded use of this combination of interface and protocol and cipher (for this user)
23
+ def created_at
24
+ @attributes[:created_at]
25
+ end
26
+
27
+ # string - The interface accessed
28
+ def interface
29
+ @attributes[:interface]
30
+ end
31
+
32
32
  # date-time - The most recent use of this combination of interface and protocol and cipher (for this user)
33
33
  def updated_at
34
34
  @attributes[:updated_at]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: files.com
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.15
4
+ version: 1.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - files.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-19 00:00:00.000000000 Z
11
+ date: 2020-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -111,6 +111,7 @@ files:
111
111
  - docs/u2f_sign_request.md
112
112
  - docs/upload.md
113
113
  - docs/upsell.md
114
+ - docs/usage_daily_snapshot.md
114
115
  - docs/usage_snapshot.md
115
116
  - docs/user.md
116
117
  - docs/user_cipher_use.md
@@ -192,6 +193,7 @@ files:
192
193
  - lib/files.com/models/u2f_sign_request.rb
193
194
  - lib/files.com/models/upload.rb
194
195
  - lib/files.com/models/upsell.rb
196
+ - lib/files.com/models/usage_daily_snapshot.rb
195
197
  - lib/files.com/models/usage_snapshot.rb
196
198
  - lib/files.com/models/user.rb
197
199
  - lib/files.com/models/user_cipher_use.rb