files-com 1.6.208__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.
- README.md +758 -0
- _VERSION +1 -0
- files_com-1.6.208.dist-info/METADATA +770 -0
- files_com-1.6.208.dist-info/RECORD +126 -0
- files_com-1.6.208.dist-info/WHEEL +5 -0
- files_com-1.6.208.dist-info/licenses/LICENSE +21 -0
- files_com-1.6.208.dist-info/top_level.txt +1 -0
- files_sdk/__init__.py +309 -0
- files_sdk/api.py +63 -0
- files_sdk/api_client.py +336 -0
- files_sdk/error.py +2981 -0
- files_sdk/list_obj.py +42 -0
- files_sdk/models/__init__.py +119 -0
- files_sdk/models/account_line_item.py +51 -0
- files_sdk/models/action.py +49 -0
- files_sdk/models/action_notification_export.py +153 -0
- files_sdk/models/action_notification_export_result.py +88 -0
- files_sdk/models/agent_push_update.py +44 -0
- files_sdk/models/api_key.py +318 -0
- files_sdk/models/api_request_log.py +105 -0
- files_sdk/models/app.py +89 -0
- files_sdk/models/as2_incoming_message.py +117 -0
- files_sdk/models/as2_outgoing_message.py +113 -0
- files_sdk/models/as2_partner.py +415 -0
- files_sdk/models/as2_station.py +282 -0
- files_sdk/models/auto.py +36 -0
- files_sdk/models/automation.py +823 -0
- files_sdk/models/automation_log.py +94 -0
- files_sdk/models/automation_run.py +112 -0
- files_sdk/models/bandwidth_snapshot.py +91 -0
- files_sdk/models/behavior.py +340 -0
- files_sdk/models/bundle.py +686 -0
- files_sdk/models/bundle_action.py +93 -0
- files_sdk/models/bundle_download.py +94 -0
- files_sdk/models/bundle_notification.py +252 -0
- files_sdk/models/bundle_path.py +37 -0
- files_sdk/models/bundle_recipient.py +133 -0
- files_sdk/models/bundle_registration.py +82 -0
- files_sdk/models/child_site_management_policy.py +278 -0
- files_sdk/models/clickwrap.py +268 -0
- files_sdk/models/dns_record.py +59 -0
- files_sdk/models/email_incoming_message.py +102 -0
- files_sdk/models/email_log.py +84 -0
- files_sdk/models/errors.py +37 -0
- files_sdk/models/exavault_api_request_log.py +102 -0
- files_sdk/models/external_event.py +148 -0
- files_sdk/models/file.py +851 -0
- files_sdk/models/file_action.py +39 -0
- files_sdk/models/file_comment.py +191 -0
- files_sdk/models/file_comment_reaction.py +125 -0
- files_sdk/models/file_migration.py +69 -0
- files_sdk/models/file_migration_log.py +88 -0
- files_sdk/models/file_upload_part.py +54 -0
- files_sdk/models/folder.py +186 -0
- files_sdk/models/form_field.py +43 -0
- files_sdk/models/form_field_set.py +265 -0
- files_sdk/models/ftp_action_log.py +104 -0
- files_sdk/models/gpg_key.py +333 -0
- files_sdk/models/group.py +338 -0
- files_sdk/models/group_user.py +235 -0
- files_sdk/models/history.py +236 -0
- files_sdk/models/history_export.py +238 -0
- files_sdk/models/history_export_result.py +98 -0
- files_sdk/models/holiday_region.py +58 -0
- files_sdk/models/image.py +37 -0
- files_sdk/models/inbound_s3_log.py +95 -0
- files_sdk/models/inbox_recipient.py +124 -0
- files_sdk/models/inbox_registration.py +79 -0
- files_sdk/models/inbox_upload.py +80 -0
- files_sdk/models/invoice.py +91 -0
- files_sdk/models/invoice_line_item.py +51 -0
- files_sdk/models/ip_address.py +119 -0
- files_sdk/models/key_lifecycle_rule.py +243 -0
- files_sdk/models/lock.py +174 -0
- files_sdk/models/message.py +244 -0
- files_sdk/models/message_comment.py +223 -0
- files_sdk/models/message_comment_reaction.py +181 -0
- files_sdk/models/message_reaction.py +170 -0
- files_sdk/models/notification.py +451 -0
- files_sdk/models/outbound_connection_log.py +105 -0
- files_sdk/models/partner.py +307 -0
- files_sdk/models/payment.py +91 -0
- files_sdk/models/payment_line_item.py +42 -0
- files_sdk/models/permission.py +190 -0
- files_sdk/models/preview.py +40 -0
- files_sdk/models/priority.py +63 -0
- files_sdk/models/project.py +205 -0
- files_sdk/models/public_hosting_request_log.py +101 -0
- files_sdk/models/public_ip_address.py +42 -0
- files_sdk/models/public_key.py +269 -0
- files_sdk/models/remote_bandwidth_snapshot.py +91 -0
- files_sdk/models/remote_mount_backend.py +438 -0
- files_sdk/models/remote_server.py +1854 -0
- files_sdk/models/remote_server_configuration_file.py +73 -0
- files_sdk/models/remote_server_credential.py +855 -0
- files_sdk/models/request.py +184 -0
- files_sdk/models/restore.py +142 -0
- files_sdk/models/scim_log.py +88 -0
- files_sdk/models/session.py +100 -0
- files_sdk/models/settings_change.py +71 -0
- files_sdk/models/sftp_action_log.py +108 -0
- files_sdk/models/sftp_host_key.py +215 -0
- files_sdk/models/share_group.py +228 -0
- files_sdk/models/share_group_member.py +41 -0
- files_sdk/models/siem_http_destination.py +1074 -0
- files_sdk/models/site.py +1289 -0
- files_sdk/models/snapshot.py +255 -0
- files_sdk/models/sso_strategy.py +168 -0
- files_sdk/models/status.py +42 -0
- files_sdk/models/style.py +152 -0
- files_sdk/models/sync.py +588 -0
- files_sdk/models/sync_log.py +86 -0
- files_sdk/models/sync_run.py +124 -0
- files_sdk/models/usage_by_top_level_dir.py +41 -0
- files_sdk/models/usage_daily_snapshot.py +93 -0
- files_sdk/models/usage_snapshot.py +73 -0
- files_sdk/models/user.py +1232 -0
- files_sdk/models/user_cipher_use.py +91 -0
- files_sdk/models/user_lifecycle_rule.py +355 -0
- files_sdk/models/user_request.py +166 -0
- files_sdk/models/user_sftp_client_use.py +68 -0
- files_sdk/models/web_dav_action_log.py +104 -0
- files_sdk/models/webhook_test.py +116 -0
- files_sdk/models/workspace.py +202 -0
- files_sdk/path_util.py +42 -0
- files_sdk/util.py +34 -0
|
@@ -0,0 +1,415 @@
|
|
|
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 As2Partner:
|
|
12
|
+
default_attributes = {
|
|
13
|
+
"id": None, # int64 - ID of the AS2 Partner.
|
|
14
|
+
"workspace_id": None, # int64 - ID of the Workspace associated with this AS2 Partner.
|
|
15
|
+
"as2_station_id": None, # int64 - ID of the AS2 Station associated with this partner.
|
|
16
|
+
"name": None, # string - The partner's formal AS2 name.
|
|
17
|
+
"uri": None, # string - Public URI where we will send the AS2 messages (via HTTP/HTTPS).
|
|
18
|
+
"server_certificate": None, # string - Should we require that the remote HTTP server have a valid SSL Certificate for HTTPS? (This only applies to Outgoing AS2 message from Files.com to a Partner.)
|
|
19
|
+
"http_auth_username": None, # string - Username to send to server for HTTP Authentication.
|
|
20
|
+
"additional_http_headers": None, # object - Additional HTTP Headers for outgoing message sent to this partner.
|
|
21
|
+
"default_mime_type": None, # string - Default mime type of the file attached to the encrypted message
|
|
22
|
+
"mdn_validation_level": None, # string - How should Files.com evaluate message transfer success based on a partner's MDN response? This setting does not affect MDN storage; all MDNs received from a partner are always stored. `none`: MDN is stored for informational purposes only, a successful HTTPS transfer is a successful AS2 transfer. `weak`: Inspect the MDN for MIC and Disposition only. `normal`: `weak` plus validate MDN signature matches body, `strict`: `normal` but do not allow signatures from self-signed or incorrectly purposed certificates. `auto`: Automatically set the correct value for this setting based on next mdn received.
|
|
23
|
+
"signature_validation_level": None, # string - Should Files.com require signatures on incoming AS2 messages? `normal`: require that incoming messages are signed with a valid matching signature. `none`: Unsigned incoming messages are allowed. `auto`: Automatically set the correct value for this setting based on next message received.
|
|
24
|
+
"enable_dedicated_ips": None, # boolean - If `true`, we will use your site's dedicated IPs for all outbound connections to this AS2 Partner.
|
|
25
|
+
"hex_public_certificate_serial": None, # string - Serial of public certificate used for message security in hex format.
|
|
26
|
+
"public_certificate": None, # string - Public certificate used for message security.
|
|
27
|
+
"public_certificate_md5": None, # string - MD5 hash of public certificate used for message security.
|
|
28
|
+
"public_certificate_subject": None, # string - Subject of public certificate used for message security.
|
|
29
|
+
"public_certificate_issuer": None, # string - Issuer of public certificate used for message security.
|
|
30
|
+
"public_certificate_serial": None, # string - Serial of public certificate used for message security.
|
|
31
|
+
"public_certificate_not_before": None, # string - Not before value of public certificate used for message security.
|
|
32
|
+
"public_certificate_not_after": None, # string - Not after value of public certificate used for message security.
|
|
33
|
+
"http_auth_password": None, # string - Password to send to server for HTTP Authentication.
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
def __init__(self, attributes=None, options=None):
|
|
37
|
+
if not isinstance(attributes, dict):
|
|
38
|
+
attributes = {}
|
|
39
|
+
if not isinstance(options, dict):
|
|
40
|
+
options = {}
|
|
41
|
+
self.set_attributes(attributes)
|
|
42
|
+
self.options = options
|
|
43
|
+
|
|
44
|
+
def set_attributes(self, attributes):
|
|
45
|
+
for attribute, default_value in As2Partner.default_attributes.items():
|
|
46
|
+
setattr(self, attribute, attributes.get(attribute, default_value))
|
|
47
|
+
|
|
48
|
+
def get_attributes(self):
|
|
49
|
+
return {
|
|
50
|
+
k: getattr(self, k, None)
|
|
51
|
+
for k in As2Partner.default_attributes
|
|
52
|
+
if getattr(self, k, None) is not None
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
# Parameters:
|
|
56
|
+
# enable_dedicated_ips - boolean - If `true`, we will use your site's dedicated IPs for all outbound connections to this AS2 Partner.
|
|
57
|
+
# http_auth_username - string - Username to send to server for HTTP Authentication.
|
|
58
|
+
# http_auth_password - string - Password to send to server for HTTP Authentication.
|
|
59
|
+
# mdn_validation_level - string - How should Files.com evaluate message transfer success based on a partner's MDN response? This setting does not affect MDN storage; all MDNs received from a partner are always stored. `none`: MDN is stored for informational purposes only, a successful HTTPS transfer is a successful AS2 transfer. `weak`: Inspect the MDN for MIC and Disposition only. `normal`: `weak` plus validate MDN signature matches body, `strict`: `normal` but do not allow signatures from self-signed or incorrectly purposed certificates. `auto`: Automatically set the correct value for this setting based on next mdn received.
|
|
60
|
+
# signature_validation_level - string - Should Files.com require signatures on incoming AS2 messages? `normal`: require that incoming messages are signed with a valid matching signature. `none`: Unsigned incoming messages are allowed. `auto`: Automatically set the correct value for this setting based on next message received.
|
|
61
|
+
# server_certificate - string - Should we require that the remote HTTP server have a valid SSL Certificate for HTTPS? (This only applies to Outgoing AS2 message from Files.com to a Partner.)
|
|
62
|
+
# default_mime_type - string - Default mime type of the file attached to the encrypted message
|
|
63
|
+
# additional_http_headers - object - Additional HTTP Headers for outgoing message sent to this partner.
|
|
64
|
+
# name - string - The partner's formal AS2 name.
|
|
65
|
+
# uri - string - Public URI where we will send the AS2 messages (via HTTP/HTTPS).
|
|
66
|
+
# public_certificate - string - Public certificate for AS2 Partner. Note: This is the certificate for AS2 message security, not a certificate used for HTTPS authentication.
|
|
67
|
+
def update(self, params=None):
|
|
68
|
+
if not isinstance(params, dict):
|
|
69
|
+
params = {}
|
|
70
|
+
|
|
71
|
+
if hasattr(self, "id") and self.id:
|
|
72
|
+
params["id"] = self.id
|
|
73
|
+
else:
|
|
74
|
+
raise MissingParameterError("Current object doesn't have a id")
|
|
75
|
+
if "id" not in params:
|
|
76
|
+
raise MissingParameterError("Parameter missing: id")
|
|
77
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
78
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
79
|
+
if "http_auth_username" in params and not isinstance(
|
|
80
|
+
params["http_auth_username"], str
|
|
81
|
+
):
|
|
82
|
+
raise InvalidParameterError(
|
|
83
|
+
"Bad parameter: http_auth_username must be an str"
|
|
84
|
+
)
|
|
85
|
+
if "http_auth_password" in params and not isinstance(
|
|
86
|
+
params["http_auth_password"], str
|
|
87
|
+
):
|
|
88
|
+
raise InvalidParameterError(
|
|
89
|
+
"Bad parameter: http_auth_password must be an str"
|
|
90
|
+
)
|
|
91
|
+
if "mdn_validation_level" in params and not isinstance(
|
|
92
|
+
params["mdn_validation_level"], str
|
|
93
|
+
):
|
|
94
|
+
raise InvalidParameterError(
|
|
95
|
+
"Bad parameter: mdn_validation_level must be an str"
|
|
96
|
+
)
|
|
97
|
+
if "signature_validation_level" in params and not isinstance(
|
|
98
|
+
params["signature_validation_level"], str
|
|
99
|
+
):
|
|
100
|
+
raise InvalidParameterError(
|
|
101
|
+
"Bad parameter: signature_validation_level must be an str"
|
|
102
|
+
)
|
|
103
|
+
if "server_certificate" in params and not isinstance(
|
|
104
|
+
params["server_certificate"], str
|
|
105
|
+
):
|
|
106
|
+
raise InvalidParameterError(
|
|
107
|
+
"Bad parameter: server_certificate must be an str"
|
|
108
|
+
)
|
|
109
|
+
if "default_mime_type" in params and not isinstance(
|
|
110
|
+
params["default_mime_type"], str
|
|
111
|
+
):
|
|
112
|
+
raise InvalidParameterError(
|
|
113
|
+
"Bad parameter: default_mime_type must be an str"
|
|
114
|
+
)
|
|
115
|
+
if "name" in params and not isinstance(params["name"], str):
|
|
116
|
+
raise InvalidParameterError("Bad parameter: name must be an str")
|
|
117
|
+
if "uri" in params and not isinstance(params["uri"], str):
|
|
118
|
+
raise InvalidParameterError("Bad parameter: uri must be an str")
|
|
119
|
+
if "public_certificate" in params and not isinstance(
|
|
120
|
+
params["public_certificate"], str
|
|
121
|
+
):
|
|
122
|
+
raise InvalidParameterError(
|
|
123
|
+
"Bad parameter: public_certificate must be an str"
|
|
124
|
+
)
|
|
125
|
+
response, _options = Api.send_request(
|
|
126
|
+
"PATCH",
|
|
127
|
+
"/as2_partners/{id}".format(id=params["id"]),
|
|
128
|
+
params,
|
|
129
|
+
self.options,
|
|
130
|
+
)
|
|
131
|
+
return response.data
|
|
132
|
+
|
|
133
|
+
def delete(self, params=None):
|
|
134
|
+
if not isinstance(params, dict):
|
|
135
|
+
params = {}
|
|
136
|
+
|
|
137
|
+
if hasattr(self, "id") and self.id:
|
|
138
|
+
params["id"] = self.id
|
|
139
|
+
else:
|
|
140
|
+
raise MissingParameterError("Current object doesn't have a id")
|
|
141
|
+
if "id" not in params:
|
|
142
|
+
raise MissingParameterError("Parameter missing: id")
|
|
143
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
144
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
145
|
+
Api.send_request(
|
|
146
|
+
"DELETE",
|
|
147
|
+
"/as2_partners/{id}".format(id=params["id"]),
|
|
148
|
+
params,
|
|
149
|
+
self.options,
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
def destroy(self, params=None):
|
|
153
|
+
self.delete(params)
|
|
154
|
+
|
|
155
|
+
def save(self):
|
|
156
|
+
if hasattr(self, "id") and self.id:
|
|
157
|
+
new_obj = self.update(self.get_attributes())
|
|
158
|
+
self.set_attributes(new_obj.get_attributes())
|
|
159
|
+
return True
|
|
160
|
+
else:
|
|
161
|
+
new_obj = create(self.get_attributes(), self.options)
|
|
162
|
+
self.set_attributes(new_obj.get_attributes())
|
|
163
|
+
return True
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
# Parameters:
|
|
167
|
+
# 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.
|
|
168
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
169
|
+
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `workspace_id`, `as2_station_id` or `name`.
|
|
170
|
+
# filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `as2_station_id` and `workspace_id`. Valid field combinations are `[ workspace_id, as2_station_id ]`.
|
|
171
|
+
def list(params=None, options=None):
|
|
172
|
+
if not isinstance(params, dict):
|
|
173
|
+
params = {}
|
|
174
|
+
if not isinstance(options, dict):
|
|
175
|
+
options = {}
|
|
176
|
+
if "cursor" in params and not isinstance(params["cursor"], str):
|
|
177
|
+
raise InvalidParameterError("Bad parameter: cursor must be an str")
|
|
178
|
+
if "per_page" in params and not isinstance(params["per_page"], int):
|
|
179
|
+
raise InvalidParameterError("Bad parameter: per_page must be an int")
|
|
180
|
+
if "sort_by" in params and not isinstance(params["sort_by"], dict):
|
|
181
|
+
raise InvalidParameterError("Bad parameter: sort_by must be an dict")
|
|
182
|
+
if "filter" in params and not isinstance(params["filter"], dict):
|
|
183
|
+
raise InvalidParameterError("Bad parameter: filter must be an dict")
|
|
184
|
+
return ListObj(As2Partner, "GET", "/as2_partners", params, options)
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
def all(params=None, options=None):
|
|
188
|
+
list(params, options)
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
# Parameters:
|
|
192
|
+
# id (required) - int64 - As2 Partner ID.
|
|
193
|
+
def find(id, params=None, options=None):
|
|
194
|
+
if not isinstance(params, dict):
|
|
195
|
+
params = {}
|
|
196
|
+
if not isinstance(options, dict):
|
|
197
|
+
options = {}
|
|
198
|
+
params["id"] = id
|
|
199
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
200
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
201
|
+
if "id" not in params:
|
|
202
|
+
raise MissingParameterError("Parameter missing: id")
|
|
203
|
+
response, options = Api.send_request(
|
|
204
|
+
"GET", "/as2_partners/{id}".format(id=params["id"]), params, options
|
|
205
|
+
)
|
|
206
|
+
return As2Partner(response.data, options)
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
def get(id, params=None, options=None):
|
|
210
|
+
find(id, params, options)
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
# Parameters:
|
|
214
|
+
# enable_dedicated_ips - boolean - If `true`, we will use your site's dedicated IPs for all outbound connections to this AS2 Partner.
|
|
215
|
+
# http_auth_username - string - Username to send to server for HTTP Authentication.
|
|
216
|
+
# http_auth_password - string - Password to send to server for HTTP Authentication.
|
|
217
|
+
# mdn_validation_level - string - How should Files.com evaluate message transfer success based on a partner's MDN response? This setting does not affect MDN storage; all MDNs received from a partner are always stored. `none`: MDN is stored for informational purposes only, a successful HTTPS transfer is a successful AS2 transfer. `weak`: Inspect the MDN for MIC and Disposition only. `normal`: `weak` plus validate MDN signature matches body, `strict`: `normal` but do not allow signatures from self-signed or incorrectly purposed certificates. `auto`: Automatically set the correct value for this setting based on next mdn received.
|
|
218
|
+
# signature_validation_level - string - Should Files.com require signatures on incoming AS2 messages? `normal`: require that incoming messages are signed with a valid matching signature. `none`: Unsigned incoming messages are allowed. `auto`: Automatically set the correct value for this setting based on next message received.
|
|
219
|
+
# server_certificate - string - Should we require that the remote HTTP server have a valid SSL Certificate for HTTPS? (This only applies to Outgoing AS2 message from Files.com to a Partner.)
|
|
220
|
+
# default_mime_type - string - Default mime type of the file attached to the encrypted message
|
|
221
|
+
# additional_http_headers - object - Additional HTTP Headers for outgoing message sent to this partner.
|
|
222
|
+
# as2_station_id (required) - int64 - ID of the AS2 Station associated with this partner.
|
|
223
|
+
# name (required) - string - The partner's formal AS2 name.
|
|
224
|
+
# uri (required) - string - Public URI where we will send the AS2 messages (via HTTP/HTTPS).
|
|
225
|
+
# public_certificate (required) - string - Public certificate for AS2 Partner. Note: This is the certificate for AS2 message security, not a certificate used for HTTPS authentication.
|
|
226
|
+
def create(params=None, options=None):
|
|
227
|
+
if not isinstance(params, dict):
|
|
228
|
+
params = {}
|
|
229
|
+
if not isinstance(options, dict):
|
|
230
|
+
options = {}
|
|
231
|
+
if "enable_dedicated_ips" in params and not isinstance(
|
|
232
|
+
params["enable_dedicated_ips"], bool
|
|
233
|
+
):
|
|
234
|
+
raise InvalidParameterError(
|
|
235
|
+
"Bad parameter: enable_dedicated_ips must be an bool"
|
|
236
|
+
)
|
|
237
|
+
if "http_auth_username" in params and not isinstance(
|
|
238
|
+
params["http_auth_username"], str
|
|
239
|
+
):
|
|
240
|
+
raise InvalidParameterError(
|
|
241
|
+
"Bad parameter: http_auth_username must be an str"
|
|
242
|
+
)
|
|
243
|
+
if "http_auth_password" in params and not isinstance(
|
|
244
|
+
params["http_auth_password"], str
|
|
245
|
+
):
|
|
246
|
+
raise InvalidParameterError(
|
|
247
|
+
"Bad parameter: http_auth_password must be an str"
|
|
248
|
+
)
|
|
249
|
+
if "mdn_validation_level" in params and not isinstance(
|
|
250
|
+
params["mdn_validation_level"], str
|
|
251
|
+
):
|
|
252
|
+
raise InvalidParameterError(
|
|
253
|
+
"Bad parameter: mdn_validation_level must be an str"
|
|
254
|
+
)
|
|
255
|
+
if "signature_validation_level" in params and not isinstance(
|
|
256
|
+
params["signature_validation_level"], str
|
|
257
|
+
):
|
|
258
|
+
raise InvalidParameterError(
|
|
259
|
+
"Bad parameter: signature_validation_level must be an str"
|
|
260
|
+
)
|
|
261
|
+
if "server_certificate" in params and not isinstance(
|
|
262
|
+
params["server_certificate"], str
|
|
263
|
+
):
|
|
264
|
+
raise InvalidParameterError(
|
|
265
|
+
"Bad parameter: server_certificate must be an str"
|
|
266
|
+
)
|
|
267
|
+
if "default_mime_type" in params and not isinstance(
|
|
268
|
+
params["default_mime_type"], str
|
|
269
|
+
):
|
|
270
|
+
raise InvalidParameterError(
|
|
271
|
+
"Bad parameter: default_mime_type must be an str"
|
|
272
|
+
)
|
|
273
|
+
if "additional_http_headers" in params and not isinstance(
|
|
274
|
+
params["additional_http_headers"], dict
|
|
275
|
+
):
|
|
276
|
+
raise InvalidParameterError(
|
|
277
|
+
"Bad parameter: additional_http_headers must be an dict"
|
|
278
|
+
)
|
|
279
|
+
if "as2_station_id" in params and not isinstance(
|
|
280
|
+
params["as2_station_id"], int
|
|
281
|
+
):
|
|
282
|
+
raise InvalidParameterError(
|
|
283
|
+
"Bad parameter: as2_station_id must be an int"
|
|
284
|
+
)
|
|
285
|
+
if "name" in params and not isinstance(params["name"], str):
|
|
286
|
+
raise InvalidParameterError("Bad parameter: name must be an str")
|
|
287
|
+
if "uri" in params and not isinstance(params["uri"], str):
|
|
288
|
+
raise InvalidParameterError("Bad parameter: uri must be an str")
|
|
289
|
+
if "public_certificate" in params and not isinstance(
|
|
290
|
+
params["public_certificate"], str
|
|
291
|
+
):
|
|
292
|
+
raise InvalidParameterError(
|
|
293
|
+
"Bad parameter: public_certificate must be an str"
|
|
294
|
+
)
|
|
295
|
+
if "as2_station_id" not in params:
|
|
296
|
+
raise MissingParameterError("Parameter missing: as2_station_id")
|
|
297
|
+
if "name" not in params:
|
|
298
|
+
raise MissingParameterError("Parameter missing: name")
|
|
299
|
+
if "uri" not in params:
|
|
300
|
+
raise MissingParameterError("Parameter missing: uri")
|
|
301
|
+
if "public_certificate" not in params:
|
|
302
|
+
raise MissingParameterError("Parameter missing: public_certificate")
|
|
303
|
+
response, options = Api.send_request(
|
|
304
|
+
"POST", "/as2_partners", params, options
|
|
305
|
+
)
|
|
306
|
+
return As2Partner(response.data, options)
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
# Parameters:
|
|
310
|
+
# enable_dedicated_ips - boolean - If `true`, we will use your site's dedicated IPs for all outbound connections to this AS2 Partner.
|
|
311
|
+
# http_auth_username - string - Username to send to server for HTTP Authentication.
|
|
312
|
+
# http_auth_password - string - Password to send to server for HTTP Authentication.
|
|
313
|
+
# mdn_validation_level - string - How should Files.com evaluate message transfer success based on a partner's MDN response? This setting does not affect MDN storage; all MDNs received from a partner are always stored. `none`: MDN is stored for informational purposes only, a successful HTTPS transfer is a successful AS2 transfer. `weak`: Inspect the MDN for MIC and Disposition only. `normal`: `weak` plus validate MDN signature matches body, `strict`: `normal` but do not allow signatures from self-signed or incorrectly purposed certificates. `auto`: Automatically set the correct value for this setting based on next mdn received.
|
|
314
|
+
# signature_validation_level - string - Should Files.com require signatures on incoming AS2 messages? `normal`: require that incoming messages are signed with a valid matching signature. `none`: Unsigned incoming messages are allowed. `auto`: Automatically set the correct value for this setting based on next message received.
|
|
315
|
+
# server_certificate - string - Should we require that the remote HTTP server have a valid SSL Certificate for HTTPS? (This only applies to Outgoing AS2 message from Files.com to a Partner.)
|
|
316
|
+
# default_mime_type - string - Default mime type of the file attached to the encrypted message
|
|
317
|
+
# additional_http_headers - object - Additional HTTP Headers for outgoing message sent to this partner.
|
|
318
|
+
# name - string - The partner's formal AS2 name.
|
|
319
|
+
# uri - string - Public URI where we will send the AS2 messages (via HTTP/HTTPS).
|
|
320
|
+
# public_certificate - string - Public certificate for AS2 Partner. Note: This is the certificate for AS2 message security, not a certificate used for HTTPS authentication.
|
|
321
|
+
def update(id, params=None, options=None):
|
|
322
|
+
if not isinstance(params, dict):
|
|
323
|
+
params = {}
|
|
324
|
+
if not isinstance(options, dict):
|
|
325
|
+
options = {}
|
|
326
|
+
params["id"] = id
|
|
327
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
328
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
329
|
+
if "enable_dedicated_ips" in params and not isinstance(
|
|
330
|
+
params["enable_dedicated_ips"], bool
|
|
331
|
+
):
|
|
332
|
+
raise InvalidParameterError(
|
|
333
|
+
"Bad parameter: enable_dedicated_ips must be an bool"
|
|
334
|
+
)
|
|
335
|
+
if "http_auth_username" in params and not isinstance(
|
|
336
|
+
params["http_auth_username"], str
|
|
337
|
+
):
|
|
338
|
+
raise InvalidParameterError(
|
|
339
|
+
"Bad parameter: http_auth_username must be an str"
|
|
340
|
+
)
|
|
341
|
+
if "http_auth_password" in params and not isinstance(
|
|
342
|
+
params["http_auth_password"], str
|
|
343
|
+
):
|
|
344
|
+
raise InvalidParameterError(
|
|
345
|
+
"Bad parameter: http_auth_password must be an str"
|
|
346
|
+
)
|
|
347
|
+
if "mdn_validation_level" in params and not isinstance(
|
|
348
|
+
params["mdn_validation_level"], str
|
|
349
|
+
):
|
|
350
|
+
raise InvalidParameterError(
|
|
351
|
+
"Bad parameter: mdn_validation_level must be an str"
|
|
352
|
+
)
|
|
353
|
+
if "signature_validation_level" in params and not isinstance(
|
|
354
|
+
params["signature_validation_level"], str
|
|
355
|
+
):
|
|
356
|
+
raise InvalidParameterError(
|
|
357
|
+
"Bad parameter: signature_validation_level must be an str"
|
|
358
|
+
)
|
|
359
|
+
if "server_certificate" in params and not isinstance(
|
|
360
|
+
params["server_certificate"], str
|
|
361
|
+
):
|
|
362
|
+
raise InvalidParameterError(
|
|
363
|
+
"Bad parameter: server_certificate must be an str"
|
|
364
|
+
)
|
|
365
|
+
if "default_mime_type" in params and not isinstance(
|
|
366
|
+
params["default_mime_type"], str
|
|
367
|
+
):
|
|
368
|
+
raise InvalidParameterError(
|
|
369
|
+
"Bad parameter: default_mime_type must be an str"
|
|
370
|
+
)
|
|
371
|
+
if "additional_http_headers" in params and not isinstance(
|
|
372
|
+
params["additional_http_headers"], dict
|
|
373
|
+
):
|
|
374
|
+
raise InvalidParameterError(
|
|
375
|
+
"Bad parameter: additional_http_headers must be an dict"
|
|
376
|
+
)
|
|
377
|
+
if "name" in params and not isinstance(params["name"], str):
|
|
378
|
+
raise InvalidParameterError("Bad parameter: name must be an str")
|
|
379
|
+
if "uri" in params and not isinstance(params["uri"], str):
|
|
380
|
+
raise InvalidParameterError("Bad parameter: uri must be an str")
|
|
381
|
+
if "public_certificate" in params and not isinstance(
|
|
382
|
+
params["public_certificate"], str
|
|
383
|
+
):
|
|
384
|
+
raise InvalidParameterError(
|
|
385
|
+
"Bad parameter: public_certificate must be an str"
|
|
386
|
+
)
|
|
387
|
+
if "id" not in params:
|
|
388
|
+
raise MissingParameterError("Parameter missing: id")
|
|
389
|
+
response, options = Api.send_request(
|
|
390
|
+
"PATCH", "/as2_partners/{id}".format(id=params["id"]), params, options
|
|
391
|
+
)
|
|
392
|
+
return As2Partner(response.data, options)
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
def delete(id, params=None, options=None):
|
|
396
|
+
if not isinstance(params, dict):
|
|
397
|
+
params = {}
|
|
398
|
+
if not isinstance(options, dict):
|
|
399
|
+
options = {}
|
|
400
|
+
params["id"] = id
|
|
401
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
402
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
403
|
+
if "id" not in params:
|
|
404
|
+
raise MissingParameterError("Parameter missing: id")
|
|
405
|
+
Api.send_request(
|
|
406
|
+
"DELETE", "/as2_partners/{id}".format(id=params["id"]), params, options
|
|
407
|
+
)
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
def destroy(id, params=None, options=None):
|
|
411
|
+
delete(id, params, options)
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
def new(*args, **kwargs):
|
|
415
|
+
return As2Partner(*args, **kwargs)
|