files-com 1.6.74__py3-none-any.whl → 1.6.75__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 +1 -1
- {files_com-1.6.74.dist-info → files_com-1.6.75.dist-info}/METADATA +1 -1
- {files_com-1.6.74.dist-info → files_com-1.6.75.dist-info}/RECORD +11 -10
- files_sdk/__init__.py +3 -1
- files_sdk/models/__init__.py +1 -0
- files_sdk/models/partner.py +266 -0
- files_sdk/models/permission.py +9 -2
- files_sdk/models/user.py +14 -0
- {files_com-1.6.74.dist-info → files_com-1.6.75.dist-info}/WHEEL +0 -0
- {files_com-1.6.74.dist-info → files_com-1.6.75.dist-info}/licenses/LICENSE +0 -0
- {files_com-1.6.74.dist-info → files_com-1.6.75.dist-info}/top_level.txt +0 -0
_VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.6.
|
|
1
|
+
1.6.75
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
README.md,sha256=1Rj6T45hiVlUVx3J-b3E4n3JnWQSEEkuNibBeYzwgWQ,31440
|
|
2
|
-
_VERSION,sha256=
|
|
3
|
-
files_com-1.6.
|
|
4
|
-
files_sdk/__init__.py,sha256=
|
|
2
|
+
_VERSION,sha256=D39EsN3sHk5DCutOvySmeqVRsIBEijLCzudWCqdf6Ns,7
|
|
3
|
+
files_com-1.6.75.dist-info/licenses/LICENSE,sha256=ziANl9OTD-5-iE8XYIZNm6IYBDxOCHwQ-mdhci7lNew,1102
|
|
4
|
+
files_sdk/__init__.py,sha256=ZIBrAUBn-7iKVb1EGB7Z2vz83tspAz5J6xC0GznJVhs,13241
|
|
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=1Nrfq2AuyTf86XH1Pwx-ykzIKpPGSUibCGs-QF6_9LI,66643
|
|
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=
|
|
11
|
+
files_sdk/models/__init__.py,sha256=GDW9PgdDCyUUy3uUgE9gdJD2-qk4wFvbfUGHlBQ0odw,6005
|
|
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
|
|
@@ -73,9 +73,10 @@ files_sdk/models/message_comment_reaction.py,sha256=h9Kuk1Y2ztqMG7XkyP-ufGQyS7Od
|
|
|
73
73
|
files_sdk/models/message_reaction.py,sha256=ZGir-4Qj9k_FRC_X3Av7Yek-SZzFBK-IbvPn5HmaG5g,6288
|
|
74
74
|
files_sdk/models/notification.py,sha256=HEPLDynR4lCF_vZ7-RJD8hoxaWMl3BrrkGEIbQk6-yg,21993
|
|
75
75
|
files_sdk/models/outbound_connection_log.py,sha256=tt56csYZrPr3o1hJhbuQ3Rv6j5hsl8TSGF41l086D6A,45948
|
|
76
|
+
files_sdk/models/partner.py,sha256=p28XY4rsiepL50QfyM79pP_fzGseDY0tjs_I2Rlup0E,11354
|
|
76
77
|
files_sdk/models/payment.py,sha256=UUWxK3x2RVYQdRAWeA-WA_Oegh5TDXYPQA_m3BYd0bQ,3753
|
|
77
78
|
files_sdk/models/payment_line_item.py,sha256=x97h4kBtul5S1EqI_jskhbebnucwA-EOnQn1oV8Hid0,1284
|
|
78
|
-
files_sdk/models/permission.py,sha256=
|
|
79
|
+
files_sdk/models/permission.py,sha256=ck4mVLYsX6trNyURAKsm8NDt2S8tCdT0ogL3TKZeaNY,9339
|
|
79
80
|
files_sdk/models/preview.py,sha256=XaKqSEC0RPBW87Kt6qlvRLeui5YeA6JUumUoZKMvARU,1347
|
|
80
81
|
files_sdk/models/priority.py,sha256=kByzhOOVwKVSxrMI5xJb1RwUtQdSuFFBLBNEHYzWSm0,2680
|
|
81
82
|
files_sdk/models/project.py,sha256=nDpX0qc7jY6evRprjQ7l4YgjM9WNH0aXaRbE2mpo6zk,7510
|
|
@@ -107,14 +108,14 @@ files_sdk/models/sync_run.py,sha256=aQX8hT1NmZ2i5J2C1vJLAE1HK5gn-TMFukfTsKydF2Y,
|
|
|
107
108
|
files_sdk/models/usage_by_top_level_dir.py,sha256=o_dETvzcgEA9lsdES_yzwPVAZVFk4ZcnsCTugR8O8eY,1185
|
|
108
109
|
files_sdk/models/usage_daily_snapshot.py,sha256=rWf6GaTlN9spkUPwfF4IJ0Y6z-JTV9TAWjsFrxI-UFg,5477
|
|
109
110
|
files_sdk/models/usage_snapshot.py,sha256=3GzMIxBjKelgNP7ksWq4XlrRlAFcYxzd_J6vAgb52qc,4005
|
|
110
|
-
files_sdk/models/user.py,sha256=
|
|
111
|
+
files_sdk/models/user.py,sha256=u6Ircl64twjan6JCft7qwGSvryMzzeaamoBCbvH3vA4,62098
|
|
111
112
|
files_sdk/models/user_cipher_use.py,sha256=5Mto-oU87rG2jGIq8TQoOdNZgJA4_ViikvOdM9_jdt0,4994
|
|
112
113
|
files_sdk/models/user_lifecycle_rule.py,sha256=ZEG3pHxc-lbtofwu9DOCZQgiAbqxAJbDOdiG8JnB6Qo,13421
|
|
113
114
|
files_sdk/models/user_request.py,sha256=ykA5Lq0MYB7qTDOMMFBuyKa_R_LgQwGVorC-q-6qxgU,6187
|
|
114
115
|
files_sdk/models/user_sftp_client_use.py,sha256=VnOo3ll6fwSc8grG5ZqGK8o3grYKg5P9b5B_hGS4vCs,2827
|
|
115
116
|
files_sdk/models/web_dav_action_log.py,sha256=uMTIkTgSpW5mgKAEWnCmI4U5eqcAL2g8OHqB-lBir3A,76424
|
|
116
117
|
files_sdk/models/webhook_test.py,sha256=AWGH8ULsgltBJL2YtTYGnAJ80cCVekrjZ2sUP0UlWgc,5018
|
|
117
|
-
files_com-1.6.
|
|
118
|
-
files_com-1.6.
|
|
119
|
-
files_com-1.6.
|
|
120
|
-
files_com-1.6.
|
|
118
|
+
files_com-1.6.75.dist-info/METADATA,sha256=8iJyb2oNCeFRvlD_wfkHAo92nroemu9XKjBDaWawSro,31732
|
|
119
|
+
files_com-1.6.75.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
120
|
+
files_com-1.6.75.dist-info/top_level.txt,sha256=p_2P-gluT_8boeXQNixTP3x-tFd1-la2NedKOiln21I,10
|
|
121
|
+
files_com-1.6.75.dist-info/RECORD,,
|
files_sdk/__init__.py
CHANGED
|
@@ -63,6 +63,7 @@ import files_sdk.models.message_comment_reaction as message_comment_reaction
|
|
|
63
63
|
import files_sdk.models.message_reaction as message_reaction
|
|
64
64
|
import files_sdk.models.notification as notification
|
|
65
65
|
import files_sdk.models.outbound_connection_log as outbound_connection_log
|
|
66
|
+
import files_sdk.models.partner as partner
|
|
66
67
|
import files_sdk.models.payment as payment
|
|
67
68
|
import files_sdk.models.payment_line_item as payment_line_item
|
|
68
69
|
import files_sdk.models.permission as permission
|
|
@@ -175,6 +176,7 @@ from files_sdk.models.message_comment_reaction import MessageCommentReaction
|
|
|
175
176
|
from files_sdk.models.message_reaction import MessageReaction
|
|
176
177
|
from files_sdk.models.notification import Notification
|
|
177
178
|
from files_sdk.models.outbound_connection_log import OutboundConnectionLog
|
|
179
|
+
from files_sdk.models.partner import Partner
|
|
178
180
|
from files_sdk.models.payment import Payment
|
|
179
181
|
from files_sdk.models.payment_line_item import PaymentLineItem
|
|
180
182
|
from files_sdk.models.permission import Permission
|
|
@@ -229,7 +231,7 @@ session_id = None
|
|
|
229
231
|
source_ip = None
|
|
230
232
|
base_url = "https://app.files.com"
|
|
231
233
|
base_path = "api/rest/v1"
|
|
232
|
-
version = "1.6.
|
|
234
|
+
version = "1.6.75"
|
|
233
235
|
|
|
234
236
|
__version__ = version
|
|
235
237
|
|
files_sdk/models/__init__.py
CHANGED
|
@@ -68,6 +68,7 @@ from files_sdk.models.message_comment_reaction import MessageCommentReaction
|
|
|
68
68
|
from files_sdk.models.message_reaction import MessageReaction
|
|
69
69
|
from files_sdk.models.notification import Notification
|
|
70
70
|
from files_sdk.models.outbound_connection_log import OutboundConnectionLog
|
|
71
|
+
from files_sdk.models.partner import Partner
|
|
71
72
|
from files_sdk.models.payment import Payment
|
|
72
73
|
from files_sdk.models.payment_line_item import PaymentLineItem
|
|
73
74
|
from files_sdk.models.permission import Permission
|
|
@@ -0,0 +1,266 @@
|
|
|
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 Partner:
|
|
12
|
+
default_attributes = {
|
|
13
|
+
"allow_bypassing_2fa_policies": None, # boolean - Allow users created under this Partner to bypass Two-Factor Authentication policies.
|
|
14
|
+
"allow_credential_changes": None, # boolean - Allow Partner Admins to change or reset credentials for users belonging to this Partner.
|
|
15
|
+
"allow_user_creation": None, # boolean - Allow Partner Admins to create users.
|
|
16
|
+
"id": None, # int64 - The unique ID of the Partner.
|
|
17
|
+
"name": None, # string - The name of the Partner.
|
|
18
|
+
"notes": None, # string - Notes about this Partner.
|
|
19
|
+
"root_folder": None, # string - The root folder path for this Partner.
|
|
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 attribute, default_value in Partner.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 Partner.default_attributes
|
|
38
|
+
if getattr(self, k, None) is not None
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
# Parameters:
|
|
42
|
+
# allow_bypassing_2fa_policies - boolean - Allow users created under this Partner to bypass Two-Factor Authentication policies.
|
|
43
|
+
# allow_credential_changes - boolean - Allow Partner Admins to change or reset credentials for users belonging to this Partner.
|
|
44
|
+
# allow_user_creation - boolean - Allow Partner Admins to create users.
|
|
45
|
+
# name - string - The name of the Partner.
|
|
46
|
+
# notes - string - Notes about this Partner.
|
|
47
|
+
# root_folder - string - The root folder path for this Partner.
|
|
48
|
+
def update(self, params=None):
|
|
49
|
+
if not isinstance(params, dict):
|
|
50
|
+
params = {}
|
|
51
|
+
|
|
52
|
+
if hasattr(self, "id") and self.id:
|
|
53
|
+
params["id"] = self.id
|
|
54
|
+
else:
|
|
55
|
+
raise MissingParameterError("Current object doesn't have a id")
|
|
56
|
+
if "id" not in params:
|
|
57
|
+
raise MissingParameterError("Parameter missing: id")
|
|
58
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
59
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
60
|
+
if "name" in params and not isinstance(params["name"], str):
|
|
61
|
+
raise InvalidParameterError("Bad parameter: name must be an str")
|
|
62
|
+
if "notes" in params and not isinstance(params["notes"], str):
|
|
63
|
+
raise InvalidParameterError("Bad parameter: notes must be an str")
|
|
64
|
+
if "root_folder" in params and not isinstance(
|
|
65
|
+
params["root_folder"], str
|
|
66
|
+
):
|
|
67
|
+
raise InvalidParameterError(
|
|
68
|
+
"Bad parameter: root_folder must be an str"
|
|
69
|
+
)
|
|
70
|
+
response, _options = Api.send_request(
|
|
71
|
+
"PATCH",
|
|
72
|
+
"/partners/{id}".format(id=params["id"]),
|
|
73
|
+
params,
|
|
74
|
+
self.options,
|
|
75
|
+
)
|
|
76
|
+
return response.data
|
|
77
|
+
|
|
78
|
+
def delete(self, params=None):
|
|
79
|
+
if not isinstance(params, dict):
|
|
80
|
+
params = {}
|
|
81
|
+
|
|
82
|
+
if hasattr(self, "id") and self.id:
|
|
83
|
+
params["id"] = self.id
|
|
84
|
+
else:
|
|
85
|
+
raise MissingParameterError("Current object doesn't have a id")
|
|
86
|
+
if "id" not in params:
|
|
87
|
+
raise MissingParameterError("Parameter missing: id")
|
|
88
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
89
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
90
|
+
Api.send_request(
|
|
91
|
+
"DELETE",
|
|
92
|
+
"/partners/{id}".format(id=params["id"]),
|
|
93
|
+
params,
|
|
94
|
+
self.options,
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
def destroy(self, params=None):
|
|
98
|
+
self.delete(params)
|
|
99
|
+
|
|
100
|
+
def save(self):
|
|
101
|
+
if hasattr(self, "id") and self.id:
|
|
102
|
+
new_obj = self.update(self.get_attributes())
|
|
103
|
+
self.set_attributes(new_obj.get_attributes())
|
|
104
|
+
return True
|
|
105
|
+
else:
|
|
106
|
+
new_obj = create(self.get_attributes(), self.options)
|
|
107
|
+
self.set_attributes(new_obj.get_attributes())
|
|
108
|
+
return True
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
# Parameters:
|
|
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.
|
|
113
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
114
|
+
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `name`.
|
|
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
|
+
return ListObj(Partner, "GET", "/partners", params, options)
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
def all(params=None, options=None):
|
|
130
|
+
list(params, options)
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
# Parameters:
|
|
134
|
+
# id (required) - int64 - Partner ID.
|
|
135
|
+
def find(id, params=None, options=None):
|
|
136
|
+
if not isinstance(params, dict):
|
|
137
|
+
params = {}
|
|
138
|
+
if not isinstance(options, dict):
|
|
139
|
+
options = {}
|
|
140
|
+
params["id"] = id
|
|
141
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
142
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
143
|
+
if "id" not in params:
|
|
144
|
+
raise MissingParameterError("Parameter missing: id")
|
|
145
|
+
response, options = Api.send_request(
|
|
146
|
+
"GET", "/partners/{id}".format(id=params["id"]), params, options
|
|
147
|
+
)
|
|
148
|
+
return Partner(response.data, options)
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
def get(id, params=None, options=None):
|
|
152
|
+
find(id, params, options)
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
# Parameters:
|
|
156
|
+
# allow_bypassing_2fa_policies - boolean - Allow users created under this Partner to bypass Two-Factor Authentication policies.
|
|
157
|
+
# allow_credential_changes - boolean - Allow Partner Admins to change or reset credentials for users belonging to this Partner.
|
|
158
|
+
# allow_user_creation - boolean - Allow Partner Admins to create users.
|
|
159
|
+
# name - string - The name of the Partner.
|
|
160
|
+
# notes - string - Notes about this Partner.
|
|
161
|
+
# root_folder - string - The root folder path for this Partner.
|
|
162
|
+
def create(params=None, options=None):
|
|
163
|
+
if not isinstance(params, dict):
|
|
164
|
+
params = {}
|
|
165
|
+
if not isinstance(options, dict):
|
|
166
|
+
options = {}
|
|
167
|
+
if "allow_bypassing_2fa_policies" in params and not isinstance(
|
|
168
|
+
params["allow_bypassing_2fa_policies"], bool
|
|
169
|
+
):
|
|
170
|
+
raise InvalidParameterError(
|
|
171
|
+
"Bad parameter: allow_bypassing_2fa_policies must be an bool"
|
|
172
|
+
)
|
|
173
|
+
if "allow_credential_changes" in params and not isinstance(
|
|
174
|
+
params["allow_credential_changes"], bool
|
|
175
|
+
):
|
|
176
|
+
raise InvalidParameterError(
|
|
177
|
+
"Bad parameter: allow_credential_changes must be an bool"
|
|
178
|
+
)
|
|
179
|
+
if "allow_user_creation" in params and not isinstance(
|
|
180
|
+
params["allow_user_creation"], bool
|
|
181
|
+
):
|
|
182
|
+
raise InvalidParameterError(
|
|
183
|
+
"Bad parameter: allow_user_creation must be an bool"
|
|
184
|
+
)
|
|
185
|
+
if "name" in params and not isinstance(params["name"], str):
|
|
186
|
+
raise InvalidParameterError("Bad parameter: name must be an str")
|
|
187
|
+
if "notes" in params and not isinstance(params["notes"], str):
|
|
188
|
+
raise InvalidParameterError("Bad parameter: notes must be an str")
|
|
189
|
+
if "root_folder" in params and not isinstance(params["root_folder"], str):
|
|
190
|
+
raise InvalidParameterError(
|
|
191
|
+
"Bad parameter: root_folder must be an str"
|
|
192
|
+
)
|
|
193
|
+
response, options = Api.send_request("POST", "/partners", params, options)
|
|
194
|
+
return Partner(response.data, options)
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
# Parameters:
|
|
198
|
+
# allow_bypassing_2fa_policies - boolean - Allow users created under this Partner to bypass Two-Factor Authentication policies.
|
|
199
|
+
# allow_credential_changes - boolean - Allow Partner Admins to change or reset credentials for users belonging to this Partner.
|
|
200
|
+
# allow_user_creation - boolean - Allow Partner Admins to create users.
|
|
201
|
+
# name - string - The name of the Partner.
|
|
202
|
+
# notes - string - Notes about this Partner.
|
|
203
|
+
# root_folder - string - The root folder path for this Partner.
|
|
204
|
+
def update(id, params=None, options=None):
|
|
205
|
+
if not isinstance(params, dict):
|
|
206
|
+
params = {}
|
|
207
|
+
if not isinstance(options, dict):
|
|
208
|
+
options = {}
|
|
209
|
+
params["id"] = id
|
|
210
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
211
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
212
|
+
if "allow_bypassing_2fa_policies" in params and not isinstance(
|
|
213
|
+
params["allow_bypassing_2fa_policies"], bool
|
|
214
|
+
):
|
|
215
|
+
raise InvalidParameterError(
|
|
216
|
+
"Bad parameter: allow_bypassing_2fa_policies must be an bool"
|
|
217
|
+
)
|
|
218
|
+
if "allow_credential_changes" in params and not isinstance(
|
|
219
|
+
params["allow_credential_changes"], bool
|
|
220
|
+
):
|
|
221
|
+
raise InvalidParameterError(
|
|
222
|
+
"Bad parameter: allow_credential_changes must be an bool"
|
|
223
|
+
)
|
|
224
|
+
if "allow_user_creation" in params and not isinstance(
|
|
225
|
+
params["allow_user_creation"], bool
|
|
226
|
+
):
|
|
227
|
+
raise InvalidParameterError(
|
|
228
|
+
"Bad parameter: allow_user_creation must be an bool"
|
|
229
|
+
)
|
|
230
|
+
if "name" in params and not isinstance(params["name"], str):
|
|
231
|
+
raise InvalidParameterError("Bad parameter: name must be an str")
|
|
232
|
+
if "notes" in params and not isinstance(params["notes"], str):
|
|
233
|
+
raise InvalidParameterError("Bad parameter: notes must be an str")
|
|
234
|
+
if "root_folder" in params and not isinstance(params["root_folder"], str):
|
|
235
|
+
raise InvalidParameterError(
|
|
236
|
+
"Bad parameter: root_folder must be an str"
|
|
237
|
+
)
|
|
238
|
+
if "id" not in params:
|
|
239
|
+
raise MissingParameterError("Parameter missing: id")
|
|
240
|
+
response, options = Api.send_request(
|
|
241
|
+
"PATCH", "/partners/{id}".format(id=params["id"]), params, options
|
|
242
|
+
)
|
|
243
|
+
return Partner(response.data, options)
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
def delete(id, params=None, options=None):
|
|
247
|
+
if not isinstance(params, dict):
|
|
248
|
+
params = {}
|
|
249
|
+
if not isinstance(options, dict):
|
|
250
|
+
options = {}
|
|
251
|
+
params["id"] = id
|
|
252
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
253
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
254
|
+
if "id" not in params:
|
|
255
|
+
raise MissingParameterError("Parameter missing: id")
|
|
256
|
+
Api.send_request(
|
|
257
|
+
"DELETE", "/partners/{id}".format(id=params["id"]), params, options
|
|
258
|
+
)
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
def destroy(id, params=None, options=None):
|
|
262
|
+
delete(id, params, options)
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
def new(*args, **kwargs):
|
|
266
|
+
return Partner(*args, **kwargs)
|
files_sdk/models/permission.py
CHANGED
|
@@ -16,6 +16,7 @@ class Permission:
|
|
|
16
16
|
"username": None, # string - Username (if applicable)
|
|
17
17
|
"group_id": None, # int64 - Group ID
|
|
18
18
|
"group_name": None, # string - Group name (if applicable)
|
|
19
|
+
"partner_id": None, # int64 - Partner ID (if applicable)
|
|
19
20
|
"permission": None, # string - Permission type. See the table referenced in the documentation for an explanation of each permission.
|
|
20
21
|
"recursive": None, # boolean - Recursive: does this permission apply to subfolders?
|
|
21
22
|
"site_id": None, # int64 - Site ID
|
|
@@ -76,12 +77,13 @@ class Permission:
|
|
|
76
77
|
# Parameters:
|
|
77
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.
|
|
78
79
|
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
79
|
-
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `site_id`, `group_id`, `path`, `user_id` or `id`.
|
|
80
|
-
# filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `path`, `group_id` or `user_id`. Valid field combinations are `[ group_id, path ]`, `[ user_id, path ]`, `[ user_id, group_id ]` or `[ user_id, group_id, path ]`.
|
|
80
|
+
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `site_id`, `group_id`, `path`, `user_id`, `partner_id` or `id`.
|
|
81
|
+
# filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `path`, `group_id`, `partner_id` or `user_id`. Valid field combinations are `[ group_id, path ]`, `[ partner_id, path ]`, `[ user_id, path ]`, `[ user_id, group_id ]`, `[ user_id, group_id, path ]`, `[ user_id, group_id, partner_id ]` or `[ user_id, group_id, partner_id, path ]`.
|
|
81
82
|
# filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `path`.
|
|
82
83
|
# path - string - Permission path. If provided, will scope all permissions(including upward) to this path.
|
|
83
84
|
# include_groups - boolean - If searching by user or group, also include user's permissions that are inherited from its groups?
|
|
84
85
|
# group_id - string
|
|
86
|
+
# partner_id - string
|
|
85
87
|
# user_id - string
|
|
86
88
|
def list(params=None, options=None):
|
|
87
89
|
if not isinstance(params, dict):
|
|
@@ -112,6 +114,8 @@ def list(params=None, options=None):
|
|
|
112
114
|
)
|
|
113
115
|
if "group_id" in params and not isinstance(params["group_id"], str):
|
|
114
116
|
raise InvalidParameterError("Bad parameter: group_id must be an str")
|
|
117
|
+
if "partner_id" in params and not isinstance(params["partner_id"], str):
|
|
118
|
+
raise InvalidParameterError("Bad parameter: partner_id must be an str")
|
|
115
119
|
if "user_id" in params and not isinstance(params["user_id"], str):
|
|
116
120
|
raise InvalidParameterError("Bad parameter: user_id must be an str")
|
|
117
121
|
return ListObj(Permission, "GET", "/permissions", params, options)
|
|
@@ -126,6 +130,7 @@ def all(params=None, options=None):
|
|
|
126
130
|
# group_id - int64 - Group ID. Provide `group_name` or `group_id`
|
|
127
131
|
# permission - string - Permission type. Can be `admin`, `full`, `readonly`, `writeonly`, `list`, or `history`
|
|
128
132
|
# recursive - boolean - Apply to subfolders recursively?
|
|
133
|
+
# partner_id - int64 - Partner ID if this Permission belongs to a partner.
|
|
129
134
|
# user_id - int64 - User ID. Provide `username` or `user_id`
|
|
130
135
|
# username - string - User username. Provide `username` or `user_id`
|
|
131
136
|
# group_name - string - Group name. Provide `group_name` or `group_id`
|
|
@@ -143,6 +148,8 @@ def create(params=None, options=None):
|
|
|
143
148
|
raise InvalidParameterError("Bad parameter: permission must be an str")
|
|
144
149
|
if "recursive" in params and not isinstance(params["recursive"], bool):
|
|
145
150
|
raise InvalidParameterError("Bad parameter: recursive must be an bool")
|
|
151
|
+
if "partner_id" in params and not isinstance(params["partner_id"], int):
|
|
152
|
+
raise InvalidParameterError("Bad parameter: partner_id must be an int")
|
|
146
153
|
if "user_id" in params and not isinstance(params["user_id"], int):
|
|
147
154
|
raise InvalidParameterError("Bad parameter: user_id must be an int")
|
|
148
155
|
if "username" in params and not isinstance(params["username"], str):
|
files_sdk/models/user.py
CHANGED
|
@@ -50,6 +50,7 @@ class User:
|
|
|
50
50
|
"notes": None, # string - Any internal notes on the user
|
|
51
51
|
"notification_daily_send_time": None, # int64 - Hour of the day at which daily notifications should be sent. Can be in range 0 to 23
|
|
52
52
|
"office_integration_enabled": None, # boolean - Enable integration with Office for the web?
|
|
53
|
+
"partner_id": None, # int64 - Partner ID if this user belongs to a Partner
|
|
53
54
|
"password_set_at": None, # date-time - Last time the user's password was set
|
|
54
55
|
"password_validity_days": None, # int64 - Number of days to allow user to use the same password
|
|
55
56
|
"public_keys_count": None, # int64 - Number of public keys associated with this user
|
|
@@ -200,6 +201,7 @@ class User:
|
|
|
200
201
|
# company - string - User's company
|
|
201
202
|
# notes - string - Any internal notes on the user
|
|
202
203
|
# office_integration_enabled - boolean - Enable integration with Office for the web?
|
|
204
|
+
# partner_id - int64 - Partner ID if this user belongs to a Partner
|
|
203
205
|
# password_validity_days - int64 - Number of days to allow user to use the same password
|
|
204
206
|
# readonly_site_admin - boolean - Is the user an allowed to view all (non-billing) site configuration for this site?
|
|
205
207
|
# receive_admin_alerts - boolean - Should the user receive admin alerts such a certificate expiration notifications and overages?
|
|
@@ -323,6 +325,12 @@ class User:
|
|
|
323
325
|
)
|
|
324
326
|
if "notes" in params and not isinstance(params["notes"], str):
|
|
325
327
|
raise InvalidParameterError("Bad parameter: notes must be an str")
|
|
328
|
+
if "partner_id" in params and not isinstance(
|
|
329
|
+
params["partner_id"], int
|
|
330
|
+
):
|
|
331
|
+
raise InvalidParameterError(
|
|
332
|
+
"Bad parameter: partner_id must be an int"
|
|
333
|
+
)
|
|
326
334
|
if "password_validity_days" in params and not isinstance(
|
|
327
335
|
params["password_validity_days"], int
|
|
328
336
|
):
|
|
@@ -532,6 +540,7 @@ def get(id, params=None, options=None):
|
|
|
532
540
|
# company - string - User's company
|
|
533
541
|
# notes - string - Any internal notes on the user
|
|
534
542
|
# office_integration_enabled - boolean - Enable integration with Office for the web?
|
|
543
|
+
# partner_id - int64 - Partner ID if this user belongs to a Partner
|
|
535
544
|
# password_validity_days - int64 - Number of days to allow user to use the same password
|
|
536
545
|
# readonly_site_admin - boolean - Is the user an allowed to view all (non-billing) site configuration for this site?
|
|
537
546
|
# receive_admin_alerts - boolean - Should the user receive admin alerts such a certificate expiration notifications and overages?
|
|
@@ -689,6 +698,8 @@ def create(params=None, options=None):
|
|
|
689
698
|
raise InvalidParameterError(
|
|
690
699
|
"Bad parameter: office_integration_enabled must be an bool"
|
|
691
700
|
)
|
|
701
|
+
if "partner_id" in params and not isinstance(params["partner_id"], int):
|
|
702
|
+
raise InvalidParameterError("Bad parameter: partner_id must be an int")
|
|
692
703
|
if "password_validity_days" in params and not isinstance(
|
|
693
704
|
params["password_validity_days"], int
|
|
694
705
|
):
|
|
@@ -868,6 +879,7 @@ def user_2fa_reset(id, params=None, options=None):
|
|
|
868
879
|
# company - string - User's company
|
|
869
880
|
# notes - string - Any internal notes on the user
|
|
870
881
|
# office_integration_enabled - boolean - Enable integration with Office for the web?
|
|
882
|
+
# partner_id - int64 - Partner ID if this user belongs to a Partner
|
|
871
883
|
# password_validity_days - int64 - Number of days to allow user to use the same password
|
|
872
884
|
# readonly_site_admin - boolean - Is the user an allowed to view all (non-billing) site configuration for this site?
|
|
873
885
|
# receive_admin_alerts - boolean - Should the user receive admin alerts such a certificate expiration notifications and overages?
|
|
@@ -1029,6 +1041,8 @@ def update(id, params=None, options=None):
|
|
|
1029
1041
|
raise InvalidParameterError(
|
|
1030
1042
|
"Bad parameter: office_integration_enabled must be an bool"
|
|
1031
1043
|
)
|
|
1044
|
+
if "partner_id" in params and not isinstance(params["partner_id"], int):
|
|
1045
|
+
raise InvalidParameterError("Bad parameter: partner_id must be an int")
|
|
1032
1046
|
if "password_validity_days" in params and not isinstance(
|
|
1033
1047
|
params["password_validity_days"], int
|
|
1034
1048
|
):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|