files.com 1.1.254 → 1.1.255

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3974055c632b326ea859daaf03104aa9b6d227771e50bf66e2a95c61e4dadb93
4
- data.tar.gz: acd9ec08e008f20cb50975aa1998a1aa25e778f15c3df61935d591c2ad9422e9
3
+ metadata.gz: fa8f23cf49e5643257139825e9eec2f879cd2df43f255e8e87e6b1f1992cb4b2
4
+ data.tar.gz: 50c942f98356099c42e311f3944b498698718343a6d73ce427cb1f8cc98b28bb
5
5
  SHA512:
6
- metadata.gz: 78288326d35c1f0236daaa107b1d020780122d0434b6fb487fc789720d0a90ae38911811b8f406da0dd34faf9763749dfa8ff950115e00d80402538da47f2776
7
- data.tar.gz: 5100483123b00f4abade43f0dce6eb58955596f9ced5b33c0e2f7ee2c281fe1d1c4c7262320eb403bfba2ff98f54e4a49d2c94c46b01ec033626b366b3acbe44
6
+ metadata.gz: e8dd2ce19aa031eb49ad5ccc9fd56a40da41506f2da6f9035aafe40445d91a0d8a3a8a00d3168d80b1d969c988409ecea69976343c4b25f64738aa1e1df14bd2
7
+ data.tar.gz: 02a8201e3d81f0365ec52b843834bf2db748cfe2633a8c84763a2d211d55290ef2e89be885092b634c79d8a96e924ce8cca48f3fbdb356cbcd61f7e84477b61f
data/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.254
1
+ 1.1.255
@@ -0,0 +1,100 @@
1
+ # UserLifecycleRule
2
+
3
+ ## Example UserLifecycleRule Object
4
+
5
+ ```
6
+ {
7
+ "id": 1,
8
+ "authentication_method": "password",
9
+ "inactivity_days": 12,
10
+ "include_folder_admins": true,
11
+ "include_site_admins": true,
12
+ "action": "disable",
13
+ "site_id": 1
14
+ }
15
+ ```
16
+
17
+ * `id` (int64): User Lifecycle Rule ID
18
+ * `authentication_method` (string): User authentication method for the rule
19
+ * `inactivity_days` (int64): Number of days of inactivity before the rule applies
20
+ * `include_folder_admins` (boolean): Include folder admins in the rule
21
+ * `include_site_admins` (boolean): Include site admins in the rule
22
+ * `action` (string): Action to take on inactive users (disable or delete)
23
+ * `site_id` (int64): Site ID
24
+
25
+
26
+ ---
27
+
28
+ ## List User Lifecycle Rules
29
+
30
+ ```
31
+ Files::UserLifecycleRule.list
32
+ ```
33
+
34
+ ### Parameters
35
+
36
+ * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
37
+ * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
38
+
39
+
40
+ ---
41
+
42
+ ## Show User Lifecycle Rule
43
+
44
+ ```
45
+ Files::UserLifecycleRule.find(id)
46
+ ```
47
+
48
+ ### Parameters
49
+
50
+ * `id` (int64): Required - User Lifecycle Rule ID.
51
+
52
+
53
+ ---
54
+
55
+ ## Create User Lifecycle Rule
56
+
57
+ ```
58
+ Files::UserLifecycleRule.create(
59
+ authentication_method: "password",
60
+ inactivity_days: 12,
61
+ include_site_admins: true,
62
+ include_folder_admins: true
63
+ )
64
+ ```
65
+
66
+ ### Parameters
67
+
68
+ * `action` (string): Required - Action to take on inactive users (disable or delete)
69
+ * `authentication_method` (string): Required - User authentication method for the rule
70
+ * `inactivity_days` (int64): Required - Number of days of inactivity before the rule applies
71
+ * `include_site_admins` (boolean): Include site admins in the rule
72
+ * `include_folder_admins` (boolean): Include folder admins in the rule
73
+
74
+
75
+ ---
76
+
77
+ ## Delete User Lifecycle Rule
78
+
79
+ ```
80
+ Files::UserLifecycleRule.delete(id)
81
+ ```
82
+
83
+ ### Parameters
84
+
85
+ * `id` (int64): Required - User Lifecycle Rule ID.
86
+
87
+
88
+ ---
89
+
90
+ ## Delete User Lifecycle Rule
91
+
92
+ ```
93
+ user_lifecycle_rule = Files::UserLifecycleRule.find(id)
94
+
95
+ user_lifecycle_rule.delete
96
+ ```
97
+
98
+ ### Parameters
99
+
100
+ * `id` (int64): Required - User Lifecycle Rule ID.
@@ -0,0 +1,166 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Files
4
+ class UserLifecycleRule
5
+ attr_reader :options, :attributes
6
+
7
+ def initialize(attributes = {}, options = {})
8
+ @attributes = attributes || {}
9
+ @options = options || {}
10
+ end
11
+
12
+ # int64 - User Lifecycle Rule ID
13
+ def id
14
+ @attributes[:id]
15
+ end
16
+
17
+ def id=(value)
18
+ @attributes[:id] = value
19
+ end
20
+
21
+ # string - User authentication method for the rule
22
+ def authentication_method
23
+ @attributes[:authentication_method]
24
+ end
25
+
26
+ def authentication_method=(value)
27
+ @attributes[:authentication_method] = value
28
+ end
29
+
30
+ # int64 - Number of days of inactivity before the rule applies
31
+ def inactivity_days
32
+ @attributes[:inactivity_days]
33
+ end
34
+
35
+ def inactivity_days=(value)
36
+ @attributes[:inactivity_days] = value
37
+ end
38
+
39
+ # boolean - Include folder admins in the rule
40
+ def include_folder_admins
41
+ @attributes[:include_folder_admins]
42
+ end
43
+
44
+ def include_folder_admins=(value)
45
+ @attributes[:include_folder_admins] = value
46
+ end
47
+
48
+ # boolean - Include site admins in the rule
49
+ def include_site_admins
50
+ @attributes[:include_site_admins]
51
+ end
52
+
53
+ def include_site_admins=(value)
54
+ @attributes[:include_site_admins] = value
55
+ end
56
+
57
+ # string - Action to take on inactive users (disable or delete)
58
+ def action
59
+ @attributes[:action]
60
+ end
61
+
62
+ def action=(value)
63
+ @attributes[:action] = value
64
+ end
65
+
66
+ # int64 - Site ID
67
+ def site_id
68
+ @attributes[:site_id]
69
+ end
70
+
71
+ def site_id=(value)
72
+ @attributes[:site_id] = value
73
+ end
74
+
75
+ def delete(params = {})
76
+ params ||= {}
77
+ params[:id] = @attributes[:id]
78
+ raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
79
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
80
+ raise MissingParameterError.new("Parameter missing: id") unless params[:id]
81
+
82
+ Api.send_request("/user_lifecycle_rules/#{@attributes[:id]}", :delete, params, @options)
83
+ end
84
+
85
+ def destroy(params = {})
86
+ delete(params)
87
+ nil
88
+ end
89
+
90
+ def save
91
+ if @attributes[:id]
92
+ raise NotImplementedError.new("The UserLifecycleRule object doesn't support updates.")
93
+ else
94
+ new_obj = UserLifecycleRule.create(@attributes, @options)
95
+ end
96
+
97
+ @attributes = new_obj.attributes
98
+ true
99
+ end
100
+
101
+ # Parameters:
102
+ # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
103
+ # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
104
+ def self.list(params = {}, options = {})
105
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
106
+ raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
107
+
108
+ List.new(UserLifecycleRule, params) do
109
+ Api.send_request("/user_lifecycle_rules", :get, params, options)
110
+ end
111
+ end
112
+
113
+ def self.all(params = {}, options = {})
114
+ list(params, options)
115
+ end
116
+
117
+ # Parameters:
118
+ # id (required) - int64 - User Lifecycle Rule ID.
119
+ def self.find(id, params = {}, options = {})
120
+ params ||= {}
121
+ params[:id] = id
122
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
123
+ raise MissingParameterError.new("Parameter missing: id") unless params[:id]
124
+
125
+ response, options = Api.send_request("/user_lifecycle_rules/#{params[:id]}", :get, params, options)
126
+ UserLifecycleRule.new(response.data, options)
127
+ end
128
+
129
+ def self.get(id, params = {}, options = {})
130
+ find(id, params, options)
131
+ end
132
+
133
+ # Parameters:
134
+ # action (required) - string - Action to take on inactive users (disable or delete)
135
+ # authentication_method (required) - string - User authentication method for the rule
136
+ # inactivity_days (required) - int64 - Number of days of inactivity before the rule applies
137
+ # include_site_admins - boolean - Include site admins in the rule
138
+ # include_folder_admins - boolean - Include folder admins in the rule
139
+ def self.create(params = {}, options = {})
140
+ raise InvalidParameterError.new("Bad parameter: action must be an String") if params[:action] and !params[:action].is_a?(String)
141
+ raise InvalidParameterError.new("Bad parameter: authentication_method must be an String") if params[:authentication_method] and !params[:authentication_method].is_a?(String)
142
+ raise InvalidParameterError.new("Bad parameter: inactivity_days must be an Integer") if params[:inactivity_days] and !params[:inactivity_days].is_a?(Integer)
143
+ raise MissingParameterError.new("Parameter missing: action") unless params[:action]
144
+ raise MissingParameterError.new("Parameter missing: authentication_method") unless params[:authentication_method]
145
+ raise MissingParameterError.new("Parameter missing: inactivity_days") unless params[:inactivity_days]
146
+
147
+ response, options = Api.send_request("/user_lifecycle_rules", :post, params, options)
148
+ UserLifecycleRule.new(response.data, options)
149
+ end
150
+
151
+ def self.delete(id, params = {}, options = {})
152
+ params ||= {}
153
+ params[:id] = id
154
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
155
+ raise MissingParameterError.new("Parameter missing: id") unless params[:id]
156
+
157
+ Api.send_request("/user_lifecycle_rules/#{params[:id]}", :delete, params, options)
158
+ nil
159
+ end
160
+
161
+ def self.destroy(id, params = {}, options = {})
162
+ delete(id, params, options)
163
+ nil
164
+ end
165
+ end
166
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Files
4
- VERSION = "1.1.254"
4
+ VERSION = "1.1.255"
5
5
  end
data/lib/files.com.rb CHANGED
@@ -126,6 +126,7 @@ require "files.com/models/usage_daily_snapshot"
126
126
  require "files.com/models/usage_snapshot"
127
127
  require "files.com/models/user"
128
128
  require "files.com/models/user_cipher_use"
129
+ require "files.com/models/user_lifecycle_rule"
129
130
  require "files.com/models/user_request"
130
131
  require "files.com/models/user_sftp_client_use"
131
132
  require "files.com/models/web_dav_action_log"
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.1.254
4
+ version: 1.1.255
5
5
  platform: ruby
6
6
  authors:
7
7
  - files.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-05-12 00:00:00.000000000 Z
11
+ date: 2025-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -209,6 +209,7 @@ files:
209
209
  - docs/usage_snapshot.md
210
210
  - docs/user.md
211
211
  - docs/user_cipher_use.md
212
+ - docs/user_lifecycle_rule.md
212
213
  - docs/user_request.md
213
214
  - docs/user_sftp_client_use.md
214
215
  - docs/web_dav_action_log.md
@@ -315,6 +316,7 @@ files:
315
316
  - lib/files.com/models/usage_snapshot.rb
316
317
  - lib/files.com/models/user.rb
317
318
  - lib/files.com/models/user_cipher_use.rb
319
+ - lib/files.com/models/user_lifecycle_rule.rb
318
320
  - lib/files.com/models/user_request.rb
319
321
  - lib/files.com/models/user_sftp_client_use.rb
320
322
  - lib/files.com/models/web_dav_action_log.rb