files-com 1.6.119__py3-none-any.whl → 1.6.191__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.

Files changed (36) hide show
  1. README.md +1 -0
  2. _VERSION +1 -1
  3. {files_com-1.6.119.dist-info → files_com-1.6.191.dist-info}/METADATA +2 -1
  4. {files_com-1.6.119.dist-info → files_com-1.6.191.dist-info}/RECORD +36 -31
  5. files_sdk/__init__.py +11 -1
  6. files_sdk/error.py +15 -0
  7. files_sdk/models/__init__.py +5 -0
  8. files_sdk/models/agent_push_update.py +44 -0
  9. files_sdk/models/api_key.py +7 -21
  10. files_sdk/models/as2_incoming_message.py +3 -9
  11. files_sdk/models/as2_outgoing_message.py +3 -9
  12. files_sdk/models/as2_partner.py +7 -0
  13. files_sdk/models/as2_station.py +15 -4
  14. files_sdk/models/automation.py +10 -2
  15. files_sdk/models/automation_run.py +2 -1
  16. files_sdk/models/behavior.py +12 -14
  17. files_sdk/models/bundle.py +9 -1
  18. files_sdk/models/file.py +2 -2
  19. files_sdk/models/folder.py +2 -2
  20. files_sdk/models/gpg_key.py +51 -24
  21. files_sdk/models/group.py +10 -2
  22. files_sdk/models/inbound_s3_log.py +95 -0
  23. files_sdk/models/key_lifecycle_rule.py +243 -0
  24. files_sdk/models/partner.py +12 -1
  25. files_sdk/models/public_key.py +3 -2
  26. files_sdk/models/remote_server.py +141 -20
  27. files_sdk/models/remote_server_credential.py +855 -0
  28. files_sdk/models/restore.py +20 -0
  29. files_sdk/models/site.py +12 -12
  30. files_sdk/models/sync.py +14 -0
  31. files_sdk/models/sync_run.py +3 -2
  32. files_sdk/models/user.py +26 -2
  33. files_sdk/models/workspace.py +202 -0
  34. {files_com-1.6.119.dist-info → files_com-1.6.191.dist-info}/WHEEL +0 -0
  35. {files_com-1.6.119.dist-info → files_com-1.6.191.dist-info}/licenses/LICENSE +0 -0
  36. {files_com-1.6.119.dist-info → files_com-1.6.191.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,243 @@
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 KeyLifecycleRule:
12
+ default_attributes = {
13
+ "id": None, # int64 - Key Lifecycle Rule ID
14
+ "key_type": None, # string - Key type for which the rule will apply (gpg or ssh).
15
+ "inactivity_days": None, # int64 - Number of days of inactivity before the rule applies.
16
+ "name": None, # string - Key Lifecycle Rule name
17
+ }
18
+
19
+ def __init__(self, attributes=None, options=None):
20
+ if not isinstance(attributes, dict):
21
+ attributes = {}
22
+ if not isinstance(options, dict):
23
+ options = {}
24
+ self.set_attributes(attributes)
25
+ self.options = options
26
+
27
+ def set_attributes(self, attributes):
28
+ for (
29
+ attribute,
30
+ default_value,
31
+ ) in KeyLifecycleRule.default_attributes.items():
32
+ setattr(self, attribute, attributes.get(attribute, default_value))
33
+
34
+ def get_attributes(self):
35
+ return {
36
+ k: getattr(self, k, None)
37
+ for k in KeyLifecycleRule.default_attributes
38
+ if getattr(self, k, None) is not None
39
+ }
40
+
41
+ # Parameters:
42
+ # key_type - string - Key type for which the rule will apply (gpg or ssh).
43
+ # inactivity_days - int64 - Number of days of inactivity before the rule applies.
44
+ # name - string - Key Lifecycle Rule name
45
+ def update(self, params=None):
46
+ if not isinstance(params, dict):
47
+ params = {}
48
+
49
+ if hasattr(self, "id") and self.id:
50
+ params["id"] = self.id
51
+ else:
52
+ raise MissingParameterError("Current object doesn't have a id")
53
+ if "id" not in params:
54
+ raise MissingParameterError("Parameter missing: id")
55
+ if "id" in params and not isinstance(params["id"], int):
56
+ raise InvalidParameterError("Bad parameter: id must be an int")
57
+ if "key_type" in params and not isinstance(params["key_type"], str):
58
+ raise InvalidParameterError(
59
+ "Bad parameter: key_type must be an str"
60
+ )
61
+ if "inactivity_days" in params and not isinstance(
62
+ params["inactivity_days"], int
63
+ ):
64
+ raise InvalidParameterError(
65
+ "Bad parameter: inactivity_days must be an int"
66
+ )
67
+ if "name" in params and not isinstance(params["name"], str):
68
+ raise InvalidParameterError("Bad parameter: name must be an str")
69
+ response, _options = Api.send_request(
70
+ "PATCH",
71
+ "/key_lifecycle_rules/{id}".format(id=params["id"]),
72
+ params,
73
+ self.options,
74
+ )
75
+ return response.data
76
+
77
+ def delete(self, params=None):
78
+ if not isinstance(params, dict):
79
+ params = {}
80
+
81
+ if hasattr(self, "id") and self.id:
82
+ params["id"] = self.id
83
+ else:
84
+ raise MissingParameterError("Current object doesn't have a id")
85
+ if "id" not in params:
86
+ raise MissingParameterError("Parameter missing: id")
87
+ if "id" in params and not isinstance(params["id"], int):
88
+ raise InvalidParameterError("Bad parameter: id must be an int")
89
+ Api.send_request(
90
+ "DELETE",
91
+ "/key_lifecycle_rules/{id}".format(id=params["id"]),
92
+ params,
93
+ self.options,
94
+ )
95
+
96
+ def destroy(self, params=None):
97
+ self.delete(params)
98
+
99
+ def save(self):
100
+ if hasattr(self, "id") and self.id:
101
+ new_obj = self.update(self.get_attributes())
102
+ self.set_attributes(new_obj.get_attributes())
103
+ return True
104
+ else:
105
+ new_obj = create(self.get_attributes(), self.options)
106
+ self.set_attributes(new_obj.get_attributes())
107
+ return True
108
+
109
+
110
+ # Parameters:
111
+ # 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.
112
+ # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
113
+ # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `key_type`.
114
+ # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `key_type`.
115
+ def list(params=None, options=None):
116
+ if not isinstance(params, dict):
117
+ params = {}
118
+ if not isinstance(options, dict):
119
+ options = {}
120
+ if "cursor" in params and not isinstance(params["cursor"], str):
121
+ raise InvalidParameterError("Bad parameter: cursor must be an str")
122
+ if "per_page" in params and not isinstance(params["per_page"], int):
123
+ raise InvalidParameterError("Bad parameter: per_page must be an int")
124
+ if "sort_by" in params and not isinstance(params["sort_by"], dict):
125
+ raise InvalidParameterError("Bad parameter: sort_by must be an dict")
126
+ if "filter" in params and not isinstance(params["filter"], dict):
127
+ raise InvalidParameterError("Bad parameter: filter must be an dict")
128
+ return ListObj(
129
+ KeyLifecycleRule, "GET", "/key_lifecycle_rules", params, options
130
+ )
131
+
132
+
133
+ def all(params=None, options=None):
134
+ list(params, options)
135
+
136
+
137
+ # Parameters:
138
+ # id (required) - int64 - Key Lifecycle Rule ID.
139
+ def find(id, params=None, options=None):
140
+ if not isinstance(params, dict):
141
+ params = {}
142
+ if not isinstance(options, dict):
143
+ options = {}
144
+ params["id"] = id
145
+ if "id" in params and not isinstance(params["id"], int):
146
+ raise InvalidParameterError("Bad parameter: id must be an int")
147
+ if "id" not in params:
148
+ raise MissingParameterError("Parameter missing: id")
149
+ response, options = Api.send_request(
150
+ "GET",
151
+ "/key_lifecycle_rules/{id}".format(id=params["id"]),
152
+ params,
153
+ options,
154
+ )
155
+ return KeyLifecycleRule(response.data, options)
156
+
157
+
158
+ def get(id, params=None, options=None):
159
+ find(id, params, options)
160
+
161
+
162
+ # Parameters:
163
+ # key_type - string - Key type for which the rule will apply (gpg or ssh).
164
+ # inactivity_days - int64 - Number of days of inactivity before the rule applies.
165
+ # name - string - Key Lifecycle Rule name
166
+ def create(params=None, options=None):
167
+ if not isinstance(params, dict):
168
+ params = {}
169
+ if not isinstance(options, dict):
170
+ options = {}
171
+ if "key_type" in params and not isinstance(params["key_type"], str):
172
+ raise InvalidParameterError("Bad parameter: key_type must be an str")
173
+ if "inactivity_days" in params and not isinstance(
174
+ params["inactivity_days"], int
175
+ ):
176
+ raise InvalidParameterError(
177
+ "Bad parameter: inactivity_days must be an int"
178
+ )
179
+ if "name" in params and not isinstance(params["name"], str):
180
+ raise InvalidParameterError("Bad parameter: name must be an str")
181
+ response, options = Api.send_request(
182
+ "POST", "/key_lifecycle_rules", params, options
183
+ )
184
+ return KeyLifecycleRule(response.data, options)
185
+
186
+
187
+ # Parameters:
188
+ # key_type - string - Key type for which the rule will apply (gpg or ssh).
189
+ # inactivity_days - int64 - Number of days of inactivity before the rule applies.
190
+ # name - string - Key Lifecycle Rule name
191
+ def update(id, params=None, options=None):
192
+ if not isinstance(params, dict):
193
+ params = {}
194
+ if not isinstance(options, dict):
195
+ options = {}
196
+ params["id"] = id
197
+ if "id" in params and not isinstance(params["id"], int):
198
+ raise InvalidParameterError("Bad parameter: id must be an int")
199
+ if "key_type" in params and not isinstance(params["key_type"], str):
200
+ raise InvalidParameterError("Bad parameter: key_type must be an str")
201
+ if "inactivity_days" in params and not isinstance(
202
+ params["inactivity_days"], int
203
+ ):
204
+ raise InvalidParameterError(
205
+ "Bad parameter: inactivity_days must be an int"
206
+ )
207
+ if "name" in params and not isinstance(params["name"], str):
208
+ raise InvalidParameterError("Bad parameter: name must be an str")
209
+ if "id" not in params:
210
+ raise MissingParameterError("Parameter missing: id")
211
+ response, options = Api.send_request(
212
+ "PATCH",
213
+ "/key_lifecycle_rules/{id}".format(id=params["id"]),
214
+ params,
215
+ options,
216
+ )
217
+ return KeyLifecycleRule(response.data, options)
218
+
219
+
220
+ def delete(id, params=None, options=None):
221
+ if not isinstance(params, dict):
222
+ params = {}
223
+ if not isinstance(options, dict):
224
+ options = {}
225
+ params["id"] = id
226
+ if "id" in params and not isinstance(params["id"], int):
227
+ raise InvalidParameterError("Bad parameter: id must be an int")
228
+ if "id" not in params:
229
+ raise MissingParameterError("Parameter missing: id")
230
+ Api.send_request(
231
+ "DELETE",
232
+ "/key_lifecycle_rules/{id}".format(id=params["id"]),
233
+ params,
234
+ options,
235
+ )
236
+
237
+
238
+ def destroy(id, params=None, options=None):
239
+ delete(id, params, options)
240
+
241
+
242
+ def new(*args, **kwargs):
243
+ return KeyLifecycleRule(*args, **kwargs)
@@ -15,6 +15,7 @@ class Partner:
15
15
  "allow_providing_gpg_keys": None, # boolean - Allow Partner Admins to provide GPG keys.
16
16
  "allow_user_creation": None, # boolean - Allow Partner Admins to create users.
17
17
  "id": None, # int64 - The unique ID of the Partner.
18
+ "workspace_id": None, # int64 - ID of the Workspace associated with this Partner.
18
19
  "name": None, # string - The name of the Partner.
19
20
  "notes": None, # string - Notes about this Partner.
20
21
  "partner_admin_ids": None, # array(int64) - Array of User IDs that are Partner Admins for this Partner.
@@ -119,7 +120,8 @@ class Partner:
119
120
  # Parameters:
120
121
  # 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.
121
122
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
122
- # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `name`.
123
+ # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `workspace_id` and `name`.
124
+ # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `workspace_id`.
123
125
  def list(params=None, options=None):
124
126
  if not isinstance(params, dict):
125
127
  params = {}
@@ -131,6 +133,8 @@ def list(params=None, options=None):
131
133
  raise InvalidParameterError("Bad parameter: per_page must be an int")
132
134
  if "sort_by" in params and not isinstance(params["sort_by"], dict):
133
135
  raise InvalidParameterError("Bad parameter: sort_by must be an dict")
136
+ if "filter" in params and not isinstance(params["filter"], dict):
137
+ raise InvalidParameterError("Bad parameter: filter must be an dict")
134
138
  return ListObj(Partner, "GET", "/partners", params, options)
135
139
 
136
140
 
@@ -169,6 +173,7 @@ def get(id, params=None, options=None):
169
173
  # root_folder - string - The root folder path for this Partner.
170
174
  # tags - string - Comma-separated list of Tags for this Partner. Tags are used for other features, such as UserLifecycleRules, which can target specific tags. Tags must only contain lowercase letters, numbers, and hyphens.
171
175
  # name (required) - string - The name of the Partner.
176
+ # workspace_id - int64 - ID of the Workspace associated with this Partner.
172
177
  def create(params=None, options=None):
173
178
  if not isinstance(params, dict):
174
179
  params = {}
@@ -208,6 +213,12 @@ def create(params=None, options=None):
208
213
  raise InvalidParameterError("Bad parameter: tags must be an str")
209
214
  if "name" in params and not isinstance(params["name"], str):
210
215
  raise InvalidParameterError("Bad parameter: name must be an str")
216
+ if "workspace_id" in params and not isinstance(
217
+ params["workspace_id"], int
218
+ ):
219
+ raise InvalidParameterError(
220
+ "Bad parameter: workspace_id must be an int"
221
+ )
211
222
  if "name" not in params:
212
223
  raise MissingParameterError("Parameter missing: name")
213
224
  response, options = Api.send_request("POST", "/partners", params, options)
@@ -11,6 +11,7 @@ from files_sdk.error import ( # noqa: F401
11
11
  class PublicKey:
12
12
  default_attributes = {
13
13
  "id": None, # int64 - Public key ID
14
+ "workspace_id": None, # int64 - Workspace ID (0 for default workspace).
14
15
  "title": None, # string - Public key title
15
16
  "created_at": None, # date-time - Public key created at date/time
16
17
  "fingerprint": None, # string - Public key fingerprint (MD5)
@@ -110,8 +111,8 @@ class PublicKey:
110
111
  # user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
111
112
  # 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.
112
113
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
113
- # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `title`, `created_at` or `user_id`.
114
- # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`.
114
+ # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `workspace_id`, `user_id`, `title` or `created_at`.
115
+ # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at` and `workspace_id`.
115
116
  # filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`.
116
117
  # filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`.
117
118
  # filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`.