files.com 1.1.255 → 1.1.256

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: fa8f23cf49e5643257139825e9eec2f879cd2df43f255e8e87e6b1f1992cb4b2
4
- data.tar.gz: 50c942f98356099c42e311f3944b498698718343a6d73ce427cb1f8cc98b28bb
3
+ metadata.gz: 93026386c22bffe0c652b27d9bc0a69afff00876c210d65706ff30f1da69ba1c
4
+ data.tar.gz: 78a166a01106d098d6a0131aa9e85c7751bbac0447f1cd2316f019958300ae86
5
5
  SHA512:
6
- metadata.gz: e8dd2ce19aa031eb49ad5ccc9fd56a40da41506f2da6f9035aafe40445d91a0d8a3a8a00d3168d80b1d969c988409ecea69976343c4b25f64738aa1e1df14bd2
7
- data.tar.gz: 02a8201e3d81f0365ec52b843834bf2db748cfe2633a8c84763a2d211d55290ef2e89be885092b634c79d8a96e924ce8cca48f3fbdb356cbcd61f7e84477b61f
6
+ metadata.gz: 75ffc5d9dd5bda8c2f3b20ebe33022c48c3222071e22d8b8891cb361f86b33523a0062c74f3458f3b3f15efdedc03f8c76c4feeb869a0e147cc82f42804b4cf7
7
+ data.tar.gz: aa2837e605b7dfd84a3b4eacc708e6f267b5c18fbf12b2248598ff8e7d4998b52231912b3cd32d8ade5ee8281c95a305f526f7afa1ef995663aa79d131e6de43
data/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.255
1
+ 1.1.256
@@ -72,6 +72,29 @@ Files::UserLifecycleRule.create(
72
72
  * `include_folder_admins` (boolean): Include folder admins in the rule
73
73
 
74
74
 
75
+ ---
76
+
77
+ ## Update User Lifecycle Rule
78
+
79
+ ```
80
+ Files::UserLifecycleRule.update(id,
81
+ authentication_method: "password",
82
+ inactivity_days: 12,
83
+ include_site_admins: true,
84
+ include_folder_admins: true
85
+ )
86
+ ```
87
+
88
+ ### Parameters
89
+
90
+ * `id` (int64): Required - User Lifecycle Rule ID.
91
+ * `action` (string): Required - Action to take on inactive users (disable or delete)
92
+ * `authentication_method` (string): Required - User authentication method for the rule
93
+ * `inactivity_days` (int64): Required - Number of days of inactivity before the rule applies
94
+ * `include_site_admins` (boolean): Include site admins in the rule
95
+ * `include_folder_admins` (boolean): Include folder admins in the rule
96
+
97
+
75
98
  ---
76
99
 
77
100
  ## Delete User Lifecycle Rule
@@ -85,6 +108,31 @@ Files::UserLifecycleRule.delete(id)
85
108
  * `id` (int64): Required - User Lifecycle Rule ID.
86
109
 
87
110
 
111
+ ---
112
+
113
+ ## Update User Lifecycle Rule
114
+
115
+ ```
116
+ user_lifecycle_rule = Files::UserLifecycleRule.find(id)
117
+
118
+ user_lifecycle_rule.update(
119
+ authentication_method: "password",
120
+ inactivity_days: 12,
121
+ include_site_admins: true,
122
+ include_folder_admins: true
123
+ )
124
+ ```
125
+
126
+ ### Parameters
127
+
128
+ * `id` (int64): Required - User Lifecycle Rule ID.
129
+ * `action` (string): Required - Action to take on inactive users (disable or delete)
130
+ * `authentication_method` (string): Required - User authentication method for the rule
131
+ * `inactivity_days` (int64): Required - Number of days of inactivity before the rule applies
132
+ * `include_site_admins` (boolean): Include site admins in the rule
133
+ * `include_folder_admins` (boolean): Include folder admins in the rule
134
+
135
+
88
136
  ---
89
137
 
90
138
  ## Delete User Lifecycle Rule
@@ -72,6 +72,28 @@ module Files
72
72
  @attributes[:site_id] = value
73
73
  end
74
74
 
75
+ # Parameters:
76
+ # action (required) - string - Action to take on inactive users (disable or delete)
77
+ # authentication_method (required) - string - User authentication method for the rule
78
+ # inactivity_days (required) - int64 - Number of days of inactivity before the rule applies
79
+ # include_site_admins - boolean - Include site admins in the rule
80
+ # include_folder_admins - boolean - Include folder admins in the rule
81
+ def update(params = {})
82
+ params ||= {}
83
+ params[:id] = @attributes[:id]
84
+ raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
85
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
86
+ raise InvalidParameterError.new("Bad parameter: action must be an String") if params[:action] and !params[:action].is_a?(String)
87
+ raise InvalidParameterError.new("Bad parameter: authentication_method must be an String") if params[:authentication_method] and !params[:authentication_method].is_a?(String)
88
+ raise InvalidParameterError.new("Bad parameter: inactivity_days must be an Integer") if params[:inactivity_days] and !params[:inactivity_days].is_a?(Integer)
89
+ raise MissingParameterError.new("Parameter missing: id") unless params[:id]
90
+ raise MissingParameterError.new("Parameter missing: action") unless params[:action]
91
+ raise MissingParameterError.new("Parameter missing: authentication_method") unless params[:authentication_method]
92
+ raise MissingParameterError.new("Parameter missing: inactivity_days") unless params[:inactivity_days]
93
+
94
+ Api.send_request("/user_lifecycle_rules/#{@attributes[:id]}", :patch, params, @options)
95
+ end
96
+
75
97
  def delete(params = {})
76
98
  params ||= {}
77
99
  params[:id] = @attributes[:id]
@@ -89,7 +111,7 @@ module Files
89
111
 
90
112
  def save
91
113
  if @attributes[:id]
92
- raise NotImplementedError.new("The UserLifecycleRule object doesn't support updates.")
114
+ new_obj = update(@attributes)
93
115
  else
94
116
  new_obj = UserLifecycleRule.create(@attributes, @options)
95
117
  end
@@ -148,6 +170,28 @@ module Files
148
170
  UserLifecycleRule.new(response.data, options)
149
171
  end
150
172
 
173
+ # Parameters:
174
+ # action (required) - string - Action to take on inactive users (disable or delete)
175
+ # authentication_method (required) - string - User authentication method for the rule
176
+ # inactivity_days (required) - int64 - Number of days of inactivity before the rule applies
177
+ # include_site_admins - boolean - Include site admins in the rule
178
+ # include_folder_admins - boolean - Include folder admins in the rule
179
+ def self.update(id, params = {}, options = {})
180
+ params ||= {}
181
+ params[:id] = id
182
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
183
+ raise InvalidParameterError.new("Bad parameter: action must be an String") if params[:action] and !params[:action].is_a?(String)
184
+ raise InvalidParameterError.new("Bad parameter: authentication_method must be an String") if params[:authentication_method] and !params[:authentication_method].is_a?(String)
185
+ raise InvalidParameterError.new("Bad parameter: inactivity_days must be an Integer") if params[:inactivity_days] and !params[:inactivity_days].is_a?(Integer)
186
+ raise MissingParameterError.new("Parameter missing: id") unless params[:id]
187
+ raise MissingParameterError.new("Parameter missing: action") unless params[:action]
188
+ raise MissingParameterError.new("Parameter missing: authentication_method") unless params[:authentication_method]
189
+ raise MissingParameterError.new("Parameter missing: inactivity_days") unless params[:inactivity_days]
190
+
191
+ response, options = Api.send_request("/user_lifecycle_rules/#{params[:id]}", :patch, params, options)
192
+ UserLifecycleRule.new(response.data, options)
193
+ end
194
+
151
195
  def self.delete(id, params = {}, options = {})
152
196
  params ||= {}
153
197
  params[:id] = id
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Files
4
- VERSION = "1.1.255"
4
+ VERSION = "1.1.256"
5
5
  end
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.255
4
+ version: 1.1.256
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-15 00:00:00.000000000 Z
11
+ date: 2025-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable