files.com 1.0.87 → 1.0.92

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -2
  3. data/Gemfile.lock +3 -3
  4. data/SECURITY.md +24 -0
  5. data/_VERSION +1 -1
  6. data/docs/api_key.md +13 -1
  7. data/docs/app.md +14 -0
  8. data/docs/automation.md +9 -1
  9. data/docs/behavior.md +30 -14
  10. data/docs/bundle.md +8 -0
  11. data/docs/file.md +0 -4
  12. data/docs/group.md +8 -0
  13. data/docs/history.md +16 -0
  14. data/docs/ip_address.md +18 -0
  15. data/docs/notification.md +10 -2
  16. data/docs/permission.md +11 -3
  17. data/docs/public_ip_address.md +13 -0
  18. data/docs/request.md +6 -25
  19. data/docs/session.md +2 -2
  20. data/docs/style.md +1 -1
  21. data/docs/usage_daily_snapshot.md +8 -0
  22. data/docs/user.md +8 -2
  23. data/lib/files.com.rb +1 -0
  24. data/lib/files.com/models/api_key.rb +30 -4
  25. data/lib/files.com/models/app.rb +33 -3
  26. data/lib/files.com/models/automation.rb +19 -4
  27. data/lib/files.com/models/behavior.rb +53 -23
  28. data/lib/files.com/models/bundle.rb +19 -4
  29. data/lib/files.com/models/file.rb +7 -11
  30. data/lib/files.com/models/file_action.rb +6 -6
  31. data/lib/files.com/models/file_comment.rb +1 -1
  32. data/lib/files.com/models/folder.rb +2 -2
  33. data/lib/files.com/models/group.rb +18 -3
  34. data/lib/files.com/models/history.rb +43 -16
  35. data/lib/files.com/models/ip_address.rb +15 -0
  36. data/lib/files.com/models/lock.rb +4 -4
  37. data/lib/files.com/models/notification.rb +20 -5
  38. data/lib/files.com/models/permission.rb +21 -6
  39. data/lib/files.com/models/public_ip_address.rb +22 -0
  40. data/lib/files.com/models/request.rb +15 -28
  41. data/lib/files.com/models/session.rb +1 -1
  42. data/lib/files.com/models/style.rb +8 -8
  43. data/lib/files.com/models/usage_daily_snapshot.rb +18 -3
  44. data/lib/files.com/models/user.rb +18 -5
  45. metadata +5 -2
@@ -13,7 +13,7 @@ module Files
13
13
  @options = options || {}
14
14
  end
15
15
 
16
- # int64 - Session ID
16
+ # string - Session ID
17
17
  def id
18
18
  @attributes[:id]
19
19
  end
@@ -64,7 +64,7 @@ module Files
64
64
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
65
65
  raise MissingParameterError.new("Parameter missing: file") unless params.dig(:file)
66
66
 
67
- Api.send_request("/styles/#{Addressable::URI.encode_component(params[:path])}", :patch, params, @options)
67
+ Api.send_request("/styles/#{@attributes[:path]}", :patch, params, @options)
68
68
  end
69
69
 
70
70
  def delete(params = {})
@@ -74,7 +74,7 @@ module Files
74
74
  raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
75
75
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
76
76
 
77
- Api.send_request("/styles/#{Addressable::URI.encode_component(params[:path])}", :delete, params, @options)
77
+ Api.send_request("/styles/#{@attributes[:path]}", :delete, params, @options)
78
78
  end
79
79
 
80
80
  def destroy(params = {})
@@ -87,18 +87,18 @@ module Files
87
87
 
88
88
  # Parameters:
89
89
  # path (required) - string - Style path.
90
- def self.list(path, params = {}, options = {})
90
+ def self.find(path, params = {}, options = {})
91
91
  params ||= {}
92
92
  params[:path] = path
93
93
  raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
94
94
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
95
95
 
96
- response, options = Api.send_request("/styles/#{Addressable::URI.encode_component(params[:path])}", :get, params, options)
96
+ response, options = Api.send_request("/styles/#{params[:path]}", :get, params, options)
97
97
  Style.new(response.data, options)
98
98
  end
99
99
 
100
- def self.all(path, params = {}, options = {})
101
- list(path, params, options)
100
+ def self.get(path, params = {}, options = {})
101
+ find(path, params, options)
102
102
  end
103
103
 
104
104
  # Parameters:
@@ -110,7 +110,7 @@ module Files
110
110
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
111
111
  raise MissingParameterError.new("Parameter missing: file") unless params.dig(:file)
112
112
 
113
- response, options = Api.send_request("/styles/#{Addressable::URI.encode_component(params[:path])}", :patch, params, options)
113
+ response, options = Api.send_request("/styles/#{params[:path]}", :patch, params, options)
114
114
  Style.new(response.data, options)
115
115
  end
116
116
 
@@ -120,7 +120,7 @@ module Files
120
120
  raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
121
121
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
122
122
 
123
- response, _options = Api.send_request("/styles/#{Addressable::URI.encode_component(params[:path])}", :delete, params, options)
123
+ response, _options = Api.send_request("/styles/#{params[:path]}", :delete, params, options)
124
124
  response.data
125
125
  end
126
126
 
@@ -33,14 +33,29 @@ module Files
33
33
  # page - int64 - Current page number.
34
34
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
35
35
  # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
36
+ # cursor - string - Send cursor to resume an existing list from the point at which you left off. Get a cursor from an existing list via the X-Files-Cursor-Next header.
37
+ # sort_by - object - If set, sort records by the specified field in either 'asc' or 'desc' direction (e.g. sort_by[last_login_at]=desc). Valid fields are `site_id`, `date` or `usage_snapshot_id`.
38
+ # filter - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `date` and `usage_snapshot_id`.
39
+ # filter_gt - object - If set, return records where the specifiied field is greater than the supplied value. Valid fields are `date` and `usage_snapshot_id`.
40
+ # filter_gteq - object - If set, return records where the specifiied field is greater than or equal to the supplied value. Valid fields are `date` and `usage_snapshot_id`.
41
+ # filter_like - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `date` and `usage_snapshot_id`.
42
+ # filter_lt - object - If set, return records where the specifiied field is less than the supplied value. Valid fields are `date` and `usage_snapshot_id`.
43
+ # filter_lteq - object - If set, return records where the specifiied field is less than or equal to the supplied value. Valid fields are `date` and `usage_snapshot_id`.
36
44
  def self.list(params = {}, options = {})
37
45
  raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
38
46
  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
47
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
48
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params.dig(:cursor) and !params.dig(:cursor).is_a?(String)
49
+ raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params.dig(:sort_by) and !params.dig(:sort_by).is_a?(Hash)
50
+ raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params.dig(:filter) and !params.dig(:filter).is_a?(Hash)
51
+ raise InvalidParameterError.new("Bad parameter: filter_gt must be an Hash") if params.dig(:filter_gt) and !params.dig(:filter_gt).is_a?(Hash)
52
+ raise InvalidParameterError.new("Bad parameter: filter_gteq must be an Hash") if params.dig(:filter_gteq) and !params.dig(:filter_gteq).is_a?(Hash)
53
+ raise InvalidParameterError.new("Bad parameter: filter_like must be an Hash") if params.dig(:filter_like) and !params.dig(:filter_like).is_a?(Hash)
54
+ raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params.dig(:filter_lt) and !params.dig(:filter_lt).is_a?(Hash)
55
+ raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params.dig(:filter_lteq) and !params.dig(:filter_lteq).is_a?(Hash)
40
56
 
41
- response, options = Api.send_request("/usage_daily_snapshots", :get, params, options)
42
- response.data.map do |entity_data|
43
- UsageDailySnapshot.new(entity_data, options)
57
+ List.new(UsageDailySnapshot, params) do
58
+ Api.send_request("/usage_daily_snapshots", :get, params, options)
44
59
  end
45
60
  end
46
61
 
@@ -625,6 +625,14 @@ module Files
625
625
  # page - int64 - Current page number.
626
626
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
627
627
  # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
628
+ # cursor - string - Send cursor to resume an existing list from the point at which you left off. Get a cursor from an existing list via the X-Files-Cursor-Next header.
629
+ # sort_by - object - If set, sort records by the specified field in either 'asc' or 'desc' direction (e.g. sort_by[last_login_at]=desc). Valid fields are `active`, `master_admin`, `site_id`, `authenticate_until`, `email`, `last_desktop_login_at`, `last_login_at`, `username`, `notes`, `site_admin`, `receive_admin_alerts`, `allowed_ips`, `password_validity_days`, `ssl_required` or `not_site_admin`.
630
+ # filter - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `username`, `email`, `notes`, `site_admin`, `allowed_ips`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
631
+ # filter_gt - object - If set, return records where the specifiied field is greater than the supplied value. Valid fields are `username`, `email`, `notes`, `site_admin`, `allowed_ips`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
632
+ # filter_gteq - object - If set, return records where the specifiied field is greater than or equal to the supplied value. Valid fields are `username`, `email`, `notes`, `site_admin`, `allowed_ips`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
633
+ # filter_like - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `username`, `email`, `notes`, `site_admin`, `allowed_ips`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
634
+ # filter_lt - object - If set, return records where the specifiied field is less than the supplied value. Valid fields are `username`, `email`, `notes`, `site_admin`, `allowed_ips`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
635
+ # filter_lteq - object - If set, return records where the specifiied field is less than or equal to the supplied value. Valid fields are `username`, `email`, `notes`, `site_admin`, `allowed_ips`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
628
636
  # ids - string - comma-separated list of User IDs
629
637
  # q[username] - string - List users matching username.
630
638
  # q[email] - string - List users matching email.
@@ -634,18 +642,23 @@ module Files
634
642
  # q[password_validity_days] - string - If set, list only users with overridden password validity days setting.
635
643
  # q[ssl_required] - string - If set, list only users with overridden SSL required setting.
636
644
  # search - string - Searches for partial matches of name, username, or email.
637
- # sort_by[last_login_at] - string - If set, sort users by 'last_login_at' in either 'asc' or 'desc' direction
638
- # sort_by[authenticate_until] - string - If set, sort users by 'authenticate_until' in either 'asc' or 'desc' direction
639
645
  def self.list(params = {}, options = {})
640
646
  raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
641
647
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
642
648
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
649
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params.dig(:cursor) and !params.dig(:cursor).is_a?(String)
650
+ raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params.dig(:sort_by) and !params.dig(:sort_by).is_a?(Hash)
651
+ raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params.dig(:filter) and !params.dig(:filter).is_a?(Hash)
652
+ raise InvalidParameterError.new("Bad parameter: filter_gt must be an Hash") if params.dig(:filter_gt) and !params.dig(:filter_gt).is_a?(Hash)
653
+ raise InvalidParameterError.new("Bad parameter: filter_gteq must be an Hash") if params.dig(:filter_gteq) and !params.dig(:filter_gteq).is_a?(Hash)
654
+ raise InvalidParameterError.new("Bad parameter: filter_like must be an Hash") if params.dig(:filter_like) and !params.dig(:filter_like).is_a?(Hash)
655
+ raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params.dig(:filter_lt) and !params.dig(:filter_lt).is_a?(Hash)
656
+ raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params.dig(:filter_lteq) and !params.dig(:filter_lteq).is_a?(Hash)
643
657
  raise InvalidParameterError.new("Bad parameter: ids must be an String") if params.dig(:ids) and !params.dig(:ids).is_a?(String)
644
658
  raise InvalidParameterError.new("Bad parameter: search must be an String") if params.dig(:search) and !params.dig(:search).is_a?(String)
645
659
 
646
- response, options = Api.send_request("/users", :get, params, options)
647
- response.data.map do |entity_data|
648
- User.new(entity_data, options)
660
+ List.new(User, params) do
661
+ Api.send_request("/users", :get, params, options)
649
662
  end
650
663
  end
651
664
 
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.87
4
+ version: 1.0.92
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-07-14 00:00:00.000000000 Z
11
+ date: 2020-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -81,6 +81,7 @@ files:
81
81
  - LICENSE
82
82
  - README.md
83
83
  - Rakefile
84
+ - SECURITY.md
84
85
  - _VERSION
85
86
  - bin/files
86
87
  - bin/files-console
@@ -123,6 +124,7 @@ files:
123
124
  - docs/permission.md
124
125
  - docs/preview.md
125
126
  - docs/project.md
127
+ - docs/public_ip_address.md
126
128
  - docs/public_key.md
127
129
  - docs/remote_server.md
128
130
  - docs/request.md
@@ -182,6 +184,7 @@ files:
182
184
  - lib/files.com/models/permission.rb
183
185
  - lib/files.com/models/preview.rb
184
186
  - lib/files.com/models/project.rb
187
+ - lib/files.com/models/public_ip_address.rb
185
188
  - lib/files.com/models/public_key.rb
186
189
  - lib/files.com/models/remote_server.rb
187
190
  - lib/files.com/models/request.rb