files-com 1.6.1__py3-none-any.whl → 1.6.3__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.1
1
+ 1.6.3
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: files_com
3
- Version: 1.6.1
3
+ Version: 1.6.3
4
4
  Summary: Python bindings for the Files.com API
5
5
  License: MIT
6
6
  Requires-Python: >=3.5
@@ -1,14 +1,14 @@
1
1
  README.md,sha256=GQCCzxqH5x0hd1fryYAQ16MHbnFHYN-GcppNTTCe3x4,28381
2
- _VERSION,sha256=ZDCiQulIYJPvb3HZCG1I9huhAvDS-w9blTNMYAekbbM,6
3
- files_com-1.6.1.dist-info/licenses/LICENSE,sha256=ziANl9OTD-5-iE8XYIZNm6IYBDxOCHwQ-mdhci7lNew,1102
4
- files_sdk/__init__.py,sha256=jcCiqnzFLR4p82DfRKZKRcPRwpvAplk8spQ_LPP0ILw,12329
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
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
8
8
  files_sdk/list_obj.py,sha256=MWgmESLAmfh1uaSw76PWxmnf9f6_08TLUHe8_mCYKL4,1157
9
9
  files_sdk/path_util.py,sha256=7x8X3JLoMkcqNefCaBeHYXD8MGvPby4AOy-xnBX_LNk,1694
10
10
  files_sdk/util.py,sha256=6aA4N0Wq_ykINW7eMrs2ntFAL2hRLM6IvJf6n_yP34c,962
11
- files_sdk/models/__init__.py,sha256=EMUJH1Czex_D7fflGe6S6_xHGGy0Ka8gt9pGmErqYkw,5542
11
+ files_sdk/models/__init__.py,sha256=1kGlrFYXRNv6LCEAMgYrPBb1lZ9_AIUm5HZFn3wV8bI,5609
12
12
  files_sdk/models/account_line_item.py,sha256=8FLg83Aqpz4y_QYy3fZ_KZsZFWv1f1KGD9T5CH1WSGs,1929
13
13
  files_sdk/models/action.py,sha256=M1lyMybE7SKht2nGXtYWp2l8b4oVkeImo6KF8DLiCos,2034
14
14
  files_sdk/models/action_notification_export.py,sha256=4cdEo2ZCDV3RH3GLSqHV7RWyJ2ONRSUq0glCEi94zd0,6636
@@ -29,9 +29,9 @@ files_sdk/models/behavior.py,sha256=uzjgb559rhcwYKDJy3ofnkhQRjzje4bHpOIt9axLuRE,
29
29
  files_sdk/models/bundle.py,sha256=DO6vTAnbdh7A1mkRkHqdv629t701XRwRAl4hrNepUHo,36214
30
30
  files_sdk/models/bundle_action.py,sha256=lgDrrFake0zkxE0Cq5QDwlJi2M2ZyJrquP5sgh_XnA0,5039
31
31
  files_sdk/models/bundle_download.py,sha256=ZSjf6R0kCiFGgjQq7bu5nsFAtaW0sE72IZhCx2g5D10,4832
32
- files_sdk/models/bundle_notification.py,sha256=ZjnS4oYsk-dGEU9hwjMb-oX5CGZXXezy92HrxQ4bqpg,9489
32
+ files_sdk/models/bundle_notification.py,sha256=tMauRH6qmejEisqsneVeprh4rb6UIjB43i6GY022NK8,10081
33
33
  files_sdk/models/bundle_path.py,sha256=UQc3Y1zD6s2AWEoFZ1H5_FuXr3cuNoLw18XGHxauMVA,1249
34
- files_sdk/models/bundle_recipient.py,sha256=g0kULXfY-RgR0SRVoVXQNKTo3Z9Xzt5EqoVZsTRdVo0,5806
34
+ files_sdk/models/bundle_recipient.py,sha256=cOn-pPcT5xzQAcSxMYN5RtfdkZ5c5T7yI9J8gVBNmx0,6398
35
35
  files_sdk/models/bundle_registration.py,sha256=Igvrg3K2dT0re8MO4hmXg6u02ljiR569nOOyG0L7NHE,3910
36
36
  files_sdk/models/clickwrap.py,sha256=6xCBvo38zlA2s7U0lIH1nmbEjv2U2A_FL_5pAtbjkGE,11563
37
37
  files_sdk/models/dns_record.py,sha256=iXrDPyaovMmPopCGaiPcK1hcuKCYaqnhnsj0Olxjq8g,2370
@@ -103,11 +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
107
  files_sdk/models/user_request.py,sha256=ykA5Lq0MYB7qTDOMMFBuyKa_R_LgQwGVorC-q-6qxgU,6187
107
108
  files_sdk/models/user_sftp_client_use.py,sha256=VnOo3ll6fwSc8grG5ZqGK8o3grYKg5P9b5B_hGS4vCs,2827
108
109
  files_sdk/models/web_dav_action_log.py,sha256=jPX4sOmR9TbYnsU8DU3b0-KQ8E2cHNaqdmFZKTjzpwE,56358
109
110
  files_sdk/models/webhook_test.py,sha256=AWGH8ULsgltBJL2YtTYGnAJ80cCVekrjZ2sUP0UlWgc,5018
110
- files_com-1.6.1.dist-info/METADATA,sha256=V5RmWEW8fZW21RmFzxtsrtmhotmIK2n5WpGjWXmA4_Q,28672
111
- files_com-1.6.1.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
112
- files_com-1.6.1.dist-info/top_level.txt,sha256=p_2P-gluT_8boeXQNixTP3x-tFd1-la2NedKOiln21I,10
113
- files_com-1.6.1.dist-info/RECORD,,
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,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.3.1)
2
+ Generator: setuptools (80.7.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
files_sdk/__init__.py CHANGED
@@ -93,6 +93,7 @@ import files_sdk.models.usage_daily_snapshot as usage_daily_snapshot
93
93
  import files_sdk.models.usage_snapshot as usage_snapshot
94
94
  import files_sdk.models.user as user
95
95
  import files_sdk.models.user_cipher_use as user_cipher_use
96
+ import files_sdk.models.user_lifecycle_rule as user_lifecycle_rule
96
97
  import files_sdk.models.user_request as user_request
97
98
  import files_sdk.models.user_sftp_client_use as user_sftp_client_use
98
99
  import files_sdk.models.web_dav_action_log as web_dav_action_log
@@ -198,6 +199,7 @@ from files_sdk.models.usage_daily_snapshot import UsageDailySnapshot
198
199
  from files_sdk.models.usage_snapshot import UsageSnapshot
199
200
  from files_sdk.models.user import User
200
201
  from files_sdk.models.user_cipher_use import UserCipherUse
202
+ from files_sdk.models.user_lifecycle_rule import UserLifecycleRule
201
203
  from files_sdk.models.user_request import UserRequest
202
204
  from files_sdk.models.user_sftp_client_use import UserSftpClientUse
203
205
  from files_sdk.models.web_dav_action_log import WebDavActionLog
@@ -213,7 +215,7 @@ session_id = None
213
215
  source_ip = None
214
216
  base_url = "https://app.files.com"
215
217
  base_path = "api/rest/v1"
216
- version = "1.6.1"
218
+ version = "1.6.3"
217
219
 
218
220
  __version__ = version
219
221
 
@@ -98,6 +98,7 @@ from files_sdk.models.usage_daily_snapshot import UsageDailySnapshot
98
98
  from files_sdk.models.usage_snapshot import UsageSnapshot
99
99
  from files_sdk.models.user import User
100
100
  from files_sdk.models.user_cipher_use import UserCipherUse
101
+ from files_sdk.models.user_lifecycle_rule import UserLifecycleRule
101
102
  from files_sdk.models.user_request import UserRequest
102
103
  from files_sdk.models.user_sftp_client_use import UserSftpClientUse
103
104
  from files_sdk.models.web_dav_action_log import WebDavActionLog
@@ -15,6 +15,7 @@ class BundleNotification:
15
15
  "notify_on_registration": None, # boolean - Triggers bundle notification when a registration action occurs for it.
16
16
  "notify_on_upload": None, # boolean - Triggers bundle notification when a upload action occurs for it.
17
17
  "notify_user_id": None, # int64 - The id of the user to notify.
18
+ "user_id": None, # int64 - User ID. Provide a value of `0` to operate the current session's user.
18
19
  }
19
20
 
20
21
  def __init__(self, attributes=None, options=None):
@@ -96,6 +97,7 @@ class BundleNotification:
96
97
 
97
98
 
98
99
  # Parameters:
100
+ # user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
99
101
  # 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.
100
102
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
101
103
  # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `bundle_id`.
@@ -105,6 +107,8 @@ def list(params=None, options=None):
105
107
  params = {}
106
108
  if not isinstance(options, dict):
107
109
  options = {}
110
+ if "user_id" in params and not isinstance(params["user_id"], int):
111
+ raise InvalidParameterError("Bad parameter: user_id must be an int")
108
112
  if "cursor" in params and not isinstance(params["cursor"], str):
109
113
  raise InvalidParameterError("Bad parameter: cursor must be an str")
110
114
  if "per_page" in params and not isinstance(params["per_page"], int):
@@ -148,6 +152,7 @@ def get(id, params=None, options=None):
148
152
 
149
153
 
150
154
  # Parameters:
155
+ # user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
151
156
  # bundle_id (required) - int64 - Bundle ID to notify on
152
157
  # notify_user_id - int64 - The id of the user to notify.
153
158
  # notify_on_registration - boolean - Triggers bundle notification when a registration action occurs for it.
@@ -157,6 +162,8 @@ def create(params=None, options=None):
157
162
  params = {}
158
163
  if not isinstance(options, dict):
159
164
  options = {}
165
+ if "user_id" in params and not isinstance(params["user_id"], int):
166
+ raise InvalidParameterError("Bad parameter: user_id must be an int")
160
167
  if "bundle_id" in params and not isinstance(params["bundle_id"], int):
161
168
  raise InvalidParameterError("Bad parameter: bundle_id must be an int")
162
169
  if "notify_user_id" in params and not isinstance(
@@ -15,6 +15,7 @@ class BundleRecipient:
15
15
  "note": None, # string - A note sent to the recipient with the bundle.
16
16
  "recipient": None, # string - The recipient's email address.
17
17
  "sent_at": None, # date-time - When the Bundle was shared with this recipient.
18
+ "user_id": None, # int64 - User ID. Provide a value of `0` to operate the current session's user.
18
19
  "bundle_id": None, # int64 - Bundle to share.
19
20
  "share_after_create": None, # boolean - Set to true to share the link with the recipient upon creation.
20
21
  }
@@ -53,6 +54,7 @@ class BundleRecipient:
53
54
 
54
55
 
55
56
  # Parameters:
57
+ # user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
56
58
  # 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.
57
59
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
58
60
  # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are .
@@ -63,6 +65,8 @@ def list(params=None, options=None):
63
65
  params = {}
64
66
  if not isinstance(options, dict):
65
67
  options = {}
68
+ if "user_id" in params and not isinstance(params["user_id"], int):
69
+ raise InvalidParameterError("Bad parameter: user_id must be an int")
66
70
  if "cursor" in params and not isinstance(params["cursor"], str):
67
71
  raise InvalidParameterError("Bad parameter: cursor must be an str")
68
72
  if "per_page" in params and not isinstance(params["per_page"], int):
@@ -85,6 +89,7 @@ def all(params=None, options=None):
85
89
 
86
90
 
87
91
  # Parameters:
92
+ # user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
88
93
  # bundle_id (required) - int64 - Bundle to share.
89
94
  # recipient (required) - string - Email addresses to share this bundle with.
90
95
  # name - string - Name of recipient.
@@ -96,6 +101,8 @@ def create(params=None, options=None):
96
101
  params = {}
97
102
  if not isinstance(options, dict):
98
103
  options = {}
104
+ if "user_id" in params and not isinstance(params["user_id"], int):
105
+ raise InvalidParameterError("Bad parameter: user_id must be an int")
99
106
  if "bundle_id" in params and not isinstance(params["bundle_id"], int):
100
107
  raise InvalidParameterError("Bad parameter: bundle_id must be an int")
101
108
  if "recipient" in params and not isinstance(params["recipient"], str):
@@ -0,0 +1,195 @@
1
+ import builtins # noqa: F401
2
+ from files_sdk.api import Api # noqa: F401
3
+ from files_sdk.list_obj import ListObj
4
+ from files_sdk.error import ( # noqa: F401
5
+ InvalidParameterError,
6
+ MissingParameterError,
7
+ NotImplementedError,
8
+ )
9
+
10
+
11
+ class UserLifecycleRule:
12
+ default_attributes = {
13
+ "id": None, # int64 - User Lifecycle Rule ID
14
+ "authentication_method": None, # string - User authentication method for the rule
15
+ "inactivity_days": None, # int64 - Number of days of inactivity before the rule applies
16
+ "include_folder_admins": None, # boolean - Include folder admins in the rule
17
+ "include_site_admins": None, # boolean - Include site admins in the rule
18
+ "action": None, # string - Action to take on inactive users (disable or delete)
19
+ "site_id": None, # int64 - Site ID
20
+ }
21
+
22
+ def __init__(self, attributes=None, options=None):
23
+ if not isinstance(attributes, dict):
24
+ attributes = {}
25
+ if not isinstance(options, dict):
26
+ options = {}
27
+ self.set_attributes(attributes)
28
+ self.options = options
29
+
30
+ def set_attributes(self, attributes):
31
+ for (
32
+ attribute,
33
+ default_value,
34
+ ) in UserLifecycleRule.default_attributes.items():
35
+ setattr(self, attribute, attributes.get(attribute, default_value))
36
+
37
+ def get_attributes(self):
38
+ return {
39
+ k: getattr(self, k, None)
40
+ for k in UserLifecycleRule.default_attributes
41
+ if getattr(self, k, None) is not None
42
+ }
43
+
44
+ def delete(self, params=None):
45
+ if not isinstance(params, dict):
46
+ params = {}
47
+
48
+ if hasattr(self, "id") and self.id:
49
+ params["id"] = self.id
50
+ else:
51
+ raise MissingParameterError("Current object doesn't have a id")
52
+ if "id" not in params:
53
+ raise MissingParameterError("Parameter missing: id")
54
+ if "id" in params and not isinstance(params["id"], int):
55
+ raise InvalidParameterError("Bad parameter: id must be an int")
56
+ Api.send_request(
57
+ "DELETE",
58
+ "/user_lifecycle_rules/{id}".format(id=params["id"]),
59
+ params,
60
+ self.options,
61
+ )
62
+
63
+ def destroy(self, params=None):
64
+ self.delete(params)
65
+
66
+ def save(self):
67
+ if hasattr(self, "id") and self.id:
68
+ raise NotImplementedError(
69
+ "The UserLifecycleRule object doesn't support updates."
70
+ )
71
+ else:
72
+ new_obj = create(self.get_attributes(), self.options)
73
+ self.set_attributes(new_obj.get_attributes())
74
+ return True
75
+
76
+
77
+ # Parameters:
78
+ # 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.
79
+ # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
80
+ def list(params=None, options=None):
81
+ if not isinstance(params, dict):
82
+ params = {}
83
+ if not isinstance(options, dict):
84
+ options = {}
85
+ if "cursor" in params and not isinstance(params["cursor"], str):
86
+ raise InvalidParameterError("Bad parameter: cursor must be an str")
87
+ if "per_page" in params and not isinstance(params["per_page"], int):
88
+ raise InvalidParameterError("Bad parameter: per_page must be an int")
89
+ return ListObj(
90
+ UserLifecycleRule, "GET", "/user_lifecycle_rules", params, options
91
+ )
92
+
93
+
94
+ def all(params=None, options=None):
95
+ list(params, options)
96
+
97
+
98
+ # Parameters:
99
+ # id (required) - int64 - User Lifecycle Rule ID.
100
+ def find(id, params=None, options=None):
101
+ if not isinstance(params, dict):
102
+ params = {}
103
+ if not isinstance(options, dict):
104
+ options = {}
105
+ params["id"] = id
106
+ if "id" in params and not isinstance(params["id"], int):
107
+ raise InvalidParameterError("Bad parameter: id must be an int")
108
+ if "id" not in params:
109
+ raise MissingParameterError("Parameter missing: id")
110
+ response, options = Api.send_request(
111
+ "GET",
112
+ "/user_lifecycle_rules/{id}".format(id=params["id"]),
113
+ params,
114
+ options,
115
+ )
116
+ return UserLifecycleRule(response.data, options)
117
+
118
+
119
+ def get(id, params=None, options=None):
120
+ find(id, params, options)
121
+
122
+
123
+ # Parameters:
124
+ # action (required) - string - Action to take on inactive users (disable or delete)
125
+ # authentication_method (required) - string - User authentication method for the rule
126
+ # inactivity_days (required) - int64 - Number of days of inactivity before the rule applies
127
+ # include_site_admins - boolean - Include site admins in the rule
128
+ # include_folder_admins - boolean - Include folder admins in the rule
129
+ def create(params=None, options=None):
130
+ if not isinstance(params, dict):
131
+ params = {}
132
+ if not isinstance(options, dict):
133
+ options = {}
134
+ if "action" in params and not isinstance(params["action"], str):
135
+ raise InvalidParameterError("Bad parameter: action must be an str")
136
+ if "authentication_method" in params and not isinstance(
137
+ params["authentication_method"], str
138
+ ):
139
+ raise InvalidParameterError(
140
+ "Bad parameter: authentication_method must be an str"
141
+ )
142
+ if "inactivity_days" in params and not isinstance(
143
+ params["inactivity_days"], int
144
+ ):
145
+ raise InvalidParameterError(
146
+ "Bad parameter: inactivity_days must be an int"
147
+ )
148
+ if "include_site_admins" in params and not isinstance(
149
+ params["include_site_admins"], bool
150
+ ):
151
+ raise InvalidParameterError(
152
+ "Bad parameter: include_site_admins must be an bool"
153
+ )
154
+ if "include_folder_admins" in params and not isinstance(
155
+ params["include_folder_admins"], bool
156
+ ):
157
+ raise InvalidParameterError(
158
+ "Bad parameter: include_folder_admins must be an bool"
159
+ )
160
+ if "action" not in params:
161
+ raise MissingParameterError("Parameter missing: action")
162
+ if "authentication_method" not in params:
163
+ raise MissingParameterError("Parameter missing: authentication_method")
164
+ if "inactivity_days" not in params:
165
+ raise MissingParameterError("Parameter missing: inactivity_days")
166
+ response, options = Api.send_request(
167
+ "POST", "/user_lifecycle_rules", params, options
168
+ )
169
+ return UserLifecycleRule(response.data, options)
170
+
171
+
172
+ def delete(id, params=None, options=None):
173
+ if not isinstance(params, dict):
174
+ params = {}
175
+ if not isinstance(options, dict):
176
+ options = {}
177
+ params["id"] = id
178
+ if "id" in params and not isinstance(params["id"], int):
179
+ raise InvalidParameterError("Bad parameter: id must be an int")
180
+ if "id" not in params:
181
+ raise MissingParameterError("Parameter missing: id")
182
+ Api.send_request(
183
+ "DELETE",
184
+ "/user_lifecycle_rules/{id}".format(id=params["id"]),
185
+ params,
186
+ options,
187
+ )
188
+
189
+
190
+ def destroy(id, params=None, options=None):
191
+ delete(id, params, options)
192
+
193
+
194
+ def new(*args, **kwargs):
195
+ return UserLifecycleRule(*args, **kwargs)