files-com 1.6.3__py3-none-any.whl → 1.6.4__py3-none-any.whl

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.

Potentially problematic release.


This version of files-com might be problematic. Click here for more details.

_VERSION CHANGED
@@ -1 +1 @@
1
- 1.6.3
1
+ 1.6.4
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: files_com
3
- Version: 1.6.3
3
+ Version: 1.6.4
4
4
  Summary: Python bindings for the Files.com API
5
5
  License: MIT
6
6
  Requires-Python: >=3.5
@@ -1,7 +1,7 @@
1
1
  README.md,sha256=GQCCzxqH5x0hd1fryYAQ16MHbnFHYN-GcppNTTCe3x4,28381
2
- _VERSION,sha256=hvj6gyp2NYIB1uL88LtHcn7-LbI69zDbZM6tZSd3a-o,6
3
- files_com-1.6.3.dist-info/licenses/LICENSE,sha256=ziANl9OTD-5-iE8XYIZNm6IYBDxOCHwQ-mdhci7lNew,1102
4
- files_sdk/__init__.py,sha256=uKs0F1HAM1n7KIQBUZ_fH3uHmanZkEOMGUef4zXSlrM,12463
2
+ _VERSION,sha256=1-dHLCYhhLoNpJuXwyP9qKDsvu4z17NNtIQF76_WVd4,6
3
+ files_com-1.6.4.dist-info/licenses/LICENSE,sha256=ziANl9OTD-5-iE8XYIZNm6IYBDxOCHwQ-mdhci7lNew,1102
4
+ files_sdk/__init__.py,sha256=s1ROqKR1NbEZ7FgpF0yUxVSoGpriDvO5QUF4q0i5aII,12463
5
5
  files_sdk/api.py,sha256=HOLk50HLQCbnHwnAr9OElQEWvdA_BABBSEvvFSt1S4A,1846
6
6
  files_sdk/api_client.py,sha256=cfFvm-o4Ao8SWADiJv7t7qnJfG_LJmWV3l6ALTC-Opo,11264
7
7
  files_sdk/error.py,sha256=lZKht6lYj9i99CzRbHschmdSs6T2Y51-YrZX_5Y_o7A,64945
@@ -103,12 +103,12 @@ files_sdk/models/usage_daily_snapshot.py,sha256=rWf6GaTlN9spkUPwfF4IJ0Y6z-JTV9TA
103
103
  files_sdk/models/usage_snapshot.py,sha256=3GzMIxBjKelgNP7ksWq4XlrRlAFcYxzd_J6vAgb52qc,4005
104
104
  files_sdk/models/user.py,sha256=o_9dCTD658FFNjUDSVgvZSsAMmJWwgKJi3uflkJGaCg,58958
105
105
  files_sdk/models/user_cipher_use.py,sha256=FugKNQhWaRuqxLiYabpXeskk9DcWVVCN2iL7A3xY-pM,3011
106
- files_sdk/models/user_lifecycle_rule.py,sha256=g6ftdNU3uvU48We6jH3GbLCvvzJ8KBHONgdX3bsrddA,7321
106
+ files_sdk/models/user_lifecycle_rule.py,sha256=Rj4lYUt_11fny42dvpP6WSRz8ipB6E4SP3t8HaHDkPM,11937
107
107
  files_sdk/models/user_request.py,sha256=ykA5Lq0MYB7qTDOMMFBuyKa_R_LgQwGVorC-q-6qxgU,6187
108
108
  files_sdk/models/user_sftp_client_use.py,sha256=VnOo3ll6fwSc8grG5ZqGK8o3grYKg5P9b5B_hGS4vCs,2827
109
109
  files_sdk/models/web_dav_action_log.py,sha256=jPX4sOmR9TbYnsU8DU3b0-KQ8E2cHNaqdmFZKTjzpwE,56358
110
110
  files_sdk/models/webhook_test.py,sha256=AWGH8ULsgltBJL2YtTYGnAJ80cCVekrjZ2sUP0UlWgc,5018
111
- files_com-1.6.3.dist-info/METADATA,sha256=T39kulaXBf_iSBVXSgAg_DEjZ5IUpo9U1nxA7SU-HkM,28672
112
- files_com-1.6.3.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
113
- files_com-1.6.3.dist-info/top_level.txt,sha256=p_2P-gluT_8boeXQNixTP3x-tFd1-la2NedKOiln21I,10
114
- files_com-1.6.3.dist-info/RECORD,,
111
+ files_com-1.6.4.dist-info/METADATA,sha256=v0ORSvOAqgC1g_GXuaQHuZSHq14UvCFR_qdBLEV4haI,28672
112
+ files_com-1.6.4.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
113
+ files_com-1.6.4.dist-info/top_level.txt,sha256=p_2P-gluT_8boeXQNixTP3x-tFd1-la2NedKOiln21I,10
114
+ files_com-1.6.4.dist-info/RECORD,,
files_sdk/__init__.py CHANGED
@@ -215,7 +215,7 @@ session_id = None
215
215
  source_ip = None
216
216
  base_url = "https://app.files.com"
217
217
  base_path = "api/rest/v1"
218
- version = "1.6.3"
218
+ version = "1.6.4"
219
219
 
220
220
  __version__ = version
221
221
 
@@ -41,6 +41,54 @@ class UserLifecycleRule:
41
41
  if getattr(self, k, None) is not None
42
42
  }
43
43
 
44
+ # Parameters:
45
+ # action (required) - string - Action to take on inactive users (disable or delete)
46
+ # authentication_method (required) - string - User authentication method for the rule
47
+ # inactivity_days (required) - int64 - Number of days of inactivity before the rule applies
48
+ # include_site_admins - boolean - Include site admins in the rule
49
+ # include_folder_admins - boolean - Include folder admins in the rule
50
+ def update(self, params=None):
51
+ if not isinstance(params, dict):
52
+ params = {}
53
+
54
+ if hasattr(self, "id") and self.id:
55
+ params["id"] = self.id
56
+ else:
57
+ raise MissingParameterError("Current object doesn't have a id")
58
+ if "id" not in params:
59
+ raise MissingParameterError("Parameter missing: id")
60
+ if "action" not in params:
61
+ raise MissingParameterError("Parameter missing: action")
62
+ if "authentication_method" not in params:
63
+ raise MissingParameterError(
64
+ "Parameter missing: authentication_method"
65
+ )
66
+ if "inactivity_days" not in params:
67
+ raise MissingParameterError("Parameter missing: inactivity_days")
68
+ if "id" in params and not isinstance(params["id"], int):
69
+ raise InvalidParameterError("Bad parameter: id must be an int")
70
+ if "action" in params and not isinstance(params["action"], str):
71
+ raise InvalidParameterError("Bad parameter: action must be an str")
72
+ if "authentication_method" in params and not isinstance(
73
+ params["authentication_method"], str
74
+ ):
75
+ raise InvalidParameterError(
76
+ "Bad parameter: authentication_method must be an str"
77
+ )
78
+ if "inactivity_days" in params and not isinstance(
79
+ params["inactivity_days"], int
80
+ ):
81
+ raise InvalidParameterError(
82
+ "Bad parameter: inactivity_days must be an int"
83
+ )
84
+ response, _options = Api.send_request(
85
+ "PATCH",
86
+ "/user_lifecycle_rules/{id}".format(id=params["id"]),
87
+ params,
88
+ self.options,
89
+ )
90
+ return response.data
91
+
44
92
  def delete(self, params=None):
45
93
  if not isinstance(params, dict):
46
94
  params = {}
@@ -65,9 +113,9 @@ class UserLifecycleRule:
65
113
 
66
114
  def save(self):
67
115
  if hasattr(self, "id") and self.id:
68
- raise NotImplementedError(
69
- "The UserLifecycleRule object doesn't support updates."
70
- )
116
+ new_obj = self.update(self.get_attributes())
117
+ self.set_attributes(new_obj.get_attributes())
118
+ return True
71
119
  else:
72
120
  new_obj = create(self.get_attributes(), self.options)
73
121
  self.set_attributes(new_obj.get_attributes())
@@ -169,6 +217,63 @@ def create(params=None, options=None):
169
217
  return UserLifecycleRule(response.data, options)
170
218
 
171
219
 
220
+ # Parameters:
221
+ # action (required) - string - Action to take on inactive users (disable or delete)
222
+ # authentication_method (required) - string - User authentication method for the rule
223
+ # inactivity_days (required) - int64 - Number of days of inactivity before the rule applies
224
+ # include_site_admins - boolean - Include site admins in the rule
225
+ # include_folder_admins - boolean - Include folder admins in the rule
226
+ def update(id, params=None, options=None):
227
+ if not isinstance(params, dict):
228
+ params = {}
229
+ if not isinstance(options, dict):
230
+ options = {}
231
+ params["id"] = id
232
+ if "id" in params and not isinstance(params["id"], int):
233
+ raise InvalidParameterError("Bad parameter: id must be an int")
234
+ if "action" in params and not isinstance(params["action"], str):
235
+ raise InvalidParameterError("Bad parameter: action must be an str")
236
+ if "authentication_method" in params and not isinstance(
237
+ params["authentication_method"], str
238
+ ):
239
+ raise InvalidParameterError(
240
+ "Bad parameter: authentication_method must be an str"
241
+ )
242
+ if "inactivity_days" in params and not isinstance(
243
+ params["inactivity_days"], int
244
+ ):
245
+ raise InvalidParameterError(
246
+ "Bad parameter: inactivity_days must be an int"
247
+ )
248
+ if "include_site_admins" in params and not isinstance(
249
+ params["include_site_admins"], bool
250
+ ):
251
+ raise InvalidParameterError(
252
+ "Bad parameter: include_site_admins must be an bool"
253
+ )
254
+ if "include_folder_admins" in params and not isinstance(
255
+ params["include_folder_admins"], bool
256
+ ):
257
+ raise InvalidParameterError(
258
+ "Bad parameter: include_folder_admins must be an bool"
259
+ )
260
+ if "id" not in params:
261
+ raise MissingParameterError("Parameter missing: id")
262
+ if "action" not in params:
263
+ raise MissingParameterError("Parameter missing: action")
264
+ if "authentication_method" not in params:
265
+ raise MissingParameterError("Parameter missing: authentication_method")
266
+ if "inactivity_days" not in params:
267
+ raise MissingParameterError("Parameter missing: inactivity_days")
268
+ response, options = Api.send_request(
269
+ "PATCH",
270
+ "/user_lifecycle_rules/{id}".format(id=params["id"]),
271
+ params,
272
+ options,
273
+ )
274
+ return UserLifecycleRule(response.data, options)
275
+
276
+
172
277
  def delete(id, params=None, options=None):
173
278
  if not isinstance(params, dict):
174
279
  params = {}