files-com 1.5.0__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 +682 -0
- _VERSION +1 -0
- files_com-1.5.0.dist-info/METADATA +694 -0
- files_com-1.5.0.dist-info/RECORD +113 -0
- files_com-1.5.0.dist-info/WHEEL +5 -0
- files_com-1.5.0.dist-info/licenses/LICENSE +21 -0
- files_com-1.5.0.dist-info/top_level.txt +1 -0
- files_sdk/__init__.py +270 -0
- files_sdk/api.py +57 -0
- files_sdk/api_client.py +327 -0
- files_sdk/error.py +2891 -0
- files_sdk/list_obj.py +42 -0
- files_sdk/models/__init__.py +104 -0
- files_sdk/models/account_line_item.py +51 -0
- files_sdk/models/action.py +49 -0
- files_sdk/models/action_notification_export.py +147 -0
- files_sdk/models/action_notification_export_result.py +88 -0
- files_sdk/models/api_key.py +322 -0
- files_sdk/models/api_request_log.py +87 -0
- files_sdk/models/app.py +89 -0
- files_sdk/models/as2_incoming_message.py +123 -0
- files_sdk/models/as2_outgoing_message.py +119 -0
- files_sdk/models/as2_partner.py +374 -0
- files_sdk/models/as2_station.py +271 -0
- files_sdk/models/auto.py +36 -0
- files_sdk/models/automation.py +691 -0
- files_sdk/models/automation_log.py +77 -0
- files_sdk/models/automation_run.py +108 -0
- files_sdk/models/bandwidth_snapshot.py +91 -0
- files_sdk/models/behavior.py +334 -0
- files_sdk/models/bundle.py +550 -0
- files_sdk/models/bundle_action.py +86 -0
- files_sdk/models/bundle_download.py +94 -0
- files_sdk/models/bundle_notification.py +217 -0
- files_sdk/models/bundle_path.py +37 -0
- files_sdk/models/bundle_recipient.py +120 -0
- files_sdk/models/bundle_registration.py +79 -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 +74 -0
- files_sdk/models/errors.py +37 -0
- files_sdk/models/exavault_api_request_log.py +85 -0
- files_sdk/models/external_event.py +148 -0
- files_sdk/models/file.py +791 -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 +78 -0
- files_sdk/models/file_upload_part.py +54 -0
- files_sdk/models/folder.py +154 -0
- files_sdk/models/form_field.py +43 -0
- files_sdk/models/form_field_set.py +240 -0
- files_sdk/models/ftp_action_log.py +87 -0
- files_sdk/models/gpg_key.py +254 -0
- files_sdk/models/group.py +276 -0
- files_sdk/models/group_user.py +231 -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/image.py +37 -0
- files_sdk/models/inbox_recipient.py +118 -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 +46 -0
- files_sdk/models/ip_address.py +119 -0
- files_sdk/models/lock.py +158 -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 +357 -0
- files_sdk/models/outbound_connection_log.py +88 -0
- files_sdk/models/payment.py +91 -0
- files_sdk/models/payment_line_item.py +42 -0
- files_sdk/models/permission.py +174 -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 +82 -0
- files_sdk/models/public_ip_address.py +42 -0
- files_sdk/models/public_key.py +212 -0
- files_sdk/models/remote_bandwidth_snapshot.py +91 -0
- files_sdk/models/remote_server.py +1677 -0
- files_sdk/models/remote_server_configuration_file.py +72 -0
- files_sdk/models/request.py +180 -0
- files_sdk/models/restore.py +104 -0
- files_sdk/models/session.py +100 -0
- files_sdk/models/settings_change.py +71 -0
- files_sdk/models/sftp_action_log.py +91 -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 +773 -0
- files_sdk/models/site.py +767 -0
- files_sdk/models/snapshot.py +255 -0
- files_sdk/models/sso_strategy.py +167 -0
- files_sdk/models/status.py +42 -0
- files_sdk/models/style.py +152 -0
- files_sdk/models/sync_log.py +75 -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 +893 -0
- files_sdk/models/user_cipher_use.py +68 -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 +87 -0
- files_sdk/models/webhook_test.py +104 -0
- files_sdk/path_util.py +42 -0
- files_sdk/util.py +34 -0
|
@@ -0,0 +1,123 @@
|
|
|
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 As2IncomingMessage:
|
|
12
|
+
default_attributes = {
|
|
13
|
+
"id": None, # int64 - Id of the AS2 Partner.
|
|
14
|
+
"as2_partner_id": None, # int64 - Id of the AS2 Partner associated with this message.
|
|
15
|
+
"as2_station_id": None, # int64 - Id of the AS2 Station associated with this message.
|
|
16
|
+
"uuid": None, # string - UUID assigned to this message.
|
|
17
|
+
"content_type": None, # string - Content Type header of the incoming message.
|
|
18
|
+
"http_headers": None, # object - HTTP Headers sent with this message.
|
|
19
|
+
"processing_result": None, # string - Result of processing.
|
|
20
|
+
"processing_result_description": None, # string - Result of processing description.
|
|
21
|
+
"mic": None, # string - AS2 Message Integrity Check
|
|
22
|
+
"mic_algo": None, # string - AS2 Message Integrity Check Algorithm Used
|
|
23
|
+
"as2_to": None, # string - AS2 TO header of message
|
|
24
|
+
"as2_from": None, # string - AS2 FROM header of message
|
|
25
|
+
"message_id": None, # string - AS2 Message Id
|
|
26
|
+
"subject": None, # string - AS2 Subject Header
|
|
27
|
+
"date": None, # string - Date Header
|
|
28
|
+
"body_size": None, # string - Encrypted Payload Body Size
|
|
29
|
+
"attachment_filename": None, # string - Filename of the file being received.
|
|
30
|
+
"ip": None, # string - IP Address of the Sender
|
|
31
|
+
"created_at": None, # date-time - Message creation date/time
|
|
32
|
+
"http_response_code": None, # string - HTTP Response Code sent for this message
|
|
33
|
+
"http_response_headers": None, # object - HTTP Headers sent for this message.
|
|
34
|
+
"recipient_serial": None, # string - Incoming Message Recipient(the Client Cert used to encrypt this message)'s serial
|
|
35
|
+
"hex_recipient_serial": None, # string - Incoming Message Recipient(the Client Cert used to encrypt this message)'s serial in hex format.
|
|
36
|
+
"recipient_issuer": None, # string - Incoming Message Recipient(the Client Cert used to encrypt this message)'s issuer
|
|
37
|
+
"message_received": None, # boolean - Message body received?
|
|
38
|
+
"message_decrypted": None, # boolean - Message decrypted successfully?
|
|
39
|
+
"message_signature_verified": None, # boolean - Message signature verified?
|
|
40
|
+
"message_processing_success": None, # boolean - Message processed successfully?
|
|
41
|
+
"message_mdn_returned": None, # boolean - MDN returned?
|
|
42
|
+
"encrypted_uri": None, # string - URL to download the encrypted signed smime that is to sent as AS2 body
|
|
43
|
+
"smime_signed_uri": None, # string - URL to download the file contents as smime with signature
|
|
44
|
+
"smime_uri": None, # string - URL to download the file contents encoded as smime
|
|
45
|
+
"raw_uri": None, # string - URL to download the original file contents
|
|
46
|
+
"mdn_response_uri": None, # string - URL to download the http response body
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
def __init__(self, attributes=None, options=None):
|
|
50
|
+
if not isinstance(attributes, dict):
|
|
51
|
+
attributes = {}
|
|
52
|
+
if not isinstance(options, dict):
|
|
53
|
+
options = {}
|
|
54
|
+
self.set_attributes(attributes)
|
|
55
|
+
self.options = options
|
|
56
|
+
|
|
57
|
+
def set_attributes(self, attributes):
|
|
58
|
+
for (
|
|
59
|
+
attribute,
|
|
60
|
+
default_value,
|
|
61
|
+
) in As2IncomingMessage.default_attributes.items():
|
|
62
|
+
setattr(self, attribute, attributes.get(attribute, default_value))
|
|
63
|
+
|
|
64
|
+
def get_attributes(self):
|
|
65
|
+
return {
|
|
66
|
+
k: getattr(self, k, None)
|
|
67
|
+
for k in As2IncomingMessage.default_attributes
|
|
68
|
+
if getattr(self, k, None) is not None
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
# Parameters:
|
|
73
|
+
# 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.
|
|
74
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
75
|
+
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at` and `as2_partner_id`.
|
|
76
|
+
# filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`.
|
|
77
|
+
# filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`.
|
|
78
|
+
# filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`.
|
|
79
|
+
# filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`.
|
|
80
|
+
# filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`.
|
|
81
|
+
# as2_partner_id - int64 - As2 Partner ID. If provided, will return message specific to that partner.
|
|
82
|
+
def list(params=None, options=None):
|
|
83
|
+
if not isinstance(params, dict):
|
|
84
|
+
params = {}
|
|
85
|
+
if not isinstance(options, dict):
|
|
86
|
+
options = {}
|
|
87
|
+
if "cursor" in params and not isinstance(params["cursor"], str):
|
|
88
|
+
raise InvalidParameterError("Bad parameter: cursor must be an str")
|
|
89
|
+
if "per_page" in params and not isinstance(params["per_page"], int):
|
|
90
|
+
raise InvalidParameterError("Bad parameter: per_page must be an int")
|
|
91
|
+
if "sort_by" in params and not isinstance(params["sort_by"], dict):
|
|
92
|
+
raise InvalidParameterError("Bad parameter: sort_by must be an dict")
|
|
93
|
+
if "filter" in params and not isinstance(params["filter"], dict):
|
|
94
|
+
raise InvalidParameterError("Bad parameter: filter must be an dict")
|
|
95
|
+
if "filter_gt" in params and not isinstance(params["filter_gt"], dict):
|
|
96
|
+
raise InvalidParameterError("Bad parameter: filter_gt must be an dict")
|
|
97
|
+
if "filter_gteq" in params and not isinstance(params["filter_gteq"], dict):
|
|
98
|
+
raise InvalidParameterError(
|
|
99
|
+
"Bad parameter: filter_gteq must be an dict"
|
|
100
|
+
)
|
|
101
|
+
if "filter_lt" in params and not isinstance(params["filter_lt"], dict):
|
|
102
|
+
raise InvalidParameterError("Bad parameter: filter_lt must be an dict")
|
|
103
|
+
if "filter_lteq" in params and not isinstance(params["filter_lteq"], dict):
|
|
104
|
+
raise InvalidParameterError(
|
|
105
|
+
"Bad parameter: filter_lteq must be an dict"
|
|
106
|
+
)
|
|
107
|
+
if "as2_partner_id" in params and not isinstance(
|
|
108
|
+
params["as2_partner_id"], int
|
|
109
|
+
):
|
|
110
|
+
raise InvalidParameterError(
|
|
111
|
+
"Bad parameter: as2_partner_id must be an int"
|
|
112
|
+
)
|
|
113
|
+
return ListObj(
|
|
114
|
+
As2IncomingMessage, "GET", "/as2_incoming_messages", params, options
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
def all(params=None, options=None):
|
|
119
|
+
list(params, options)
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
def new(*args, **kwargs):
|
|
123
|
+
return As2IncomingMessage(*args, **kwargs)
|
|
@@ -0,0 +1,119 @@
|
|
|
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 As2OutgoingMessage:
|
|
12
|
+
default_attributes = {
|
|
13
|
+
"id": None, # int64 - Id of the AS2 Partner.
|
|
14
|
+
"as2_partner_id": None, # int64 - Id of the AS2 Partner associated with this message.
|
|
15
|
+
"as2_station_id": None, # int64 - Id of the AS2 Station associated with this message.
|
|
16
|
+
"uuid": None, # string - UUID assigned to this message.
|
|
17
|
+
"http_headers": None, # object - HTTP Headers sent with this message.
|
|
18
|
+
"processing_result": None, # string - Result of processing.
|
|
19
|
+
"processing_result_description": None, # string - Result of processing description.
|
|
20
|
+
"mic": None, # string - AS2 Message Integrity Check SHA1
|
|
21
|
+
"mic_sha_256": None, # string - AS2 Message Integrity Check SHA256
|
|
22
|
+
"as2_to": None, # string - AS2 TO
|
|
23
|
+
"as2_from": None, # string - AS2 FROM
|
|
24
|
+
"date": None, # string - Date Header
|
|
25
|
+
"message_id": None, # string - AS2 Message Id
|
|
26
|
+
"body_size": None, # string - Encrypted Payload Body Size
|
|
27
|
+
"attachment_filename": None, # string - Filename of the file being sent.
|
|
28
|
+
"created_at": None, # date-time - Message creation date/time
|
|
29
|
+
"http_response_code": None, # string - HTTP Response Code received for this message
|
|
30
|
+
"http_response_headers": None, # object - HTTP Headers received for this message.
|
|
31
|
+
"http_transmission_duration": None, # double - HTTP transmission duration in seceonds
|
|
32
|
+
"mdn_received": None, # boolean - Did the partner give a response body?
|
|
33
|
+
"mdn_valid": None, # boolean - Is the response in MDN format?
|
|
34
|
+
"mdn_signature_verified": None, # boolean - MDN signature verified?
|
|
35
|
+
"mdn_message_id_matched": None, # boolean - MDN message id matched?
|
|
36
|
+
"mdn_mic_matched": None, # boolean - MDN MIC matched?
|
|
37
|
+
"mdn_processing_success": None, # boolean - MDN disposition indicate a successful processing?
|
|
38
|
+
"raw_uri": None, # string - URL to download the original file contents
|
|
39
|
+
"smime_uri": None, # string - URL to download the file contents encoded as smime
|
|
40
|
+
"smime_signed_uri": None, # string - URL to download the file contents as smime with signature
|
|
41
|
+
"encrypted_uri": None, # string - URL to download the encrypted signed smime that is to sent as AS2 body
|
|
42
|
+
"mdn_response_uri": None, # string - URL to download the http response body
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
def __init__(self, attributes=None, options=None):
|
|
46
|
+
if not isinstance(attributes, dict):
|
|
47
|
+
attributes = {}
|
|
48
|
+
if not isinstance(options, dict):
|
|
49
|
+
options = {}
|
|
50
|
+
self.set_attributes(attributes)
|
|
51
|
+
self.options = options
|
|
52
|
+
|
|
53
|
+
def set_attributes(self, attributes):
|
|
54
|
+
for (
|
|
55
|
+
attribute,
|
|
56
|
+
default_value,
|
|
57
|
+
) in As2OutgoingMessage.default_attributes.items():
|
|
58
|
+
setattr(self, attribute, attributes.get(attribute, default_value))
|
|
59
|
+
|
|
60
|
+
def get_attributes(self):
|
|
61
|
+
return {
|
|
62
|
+
k: getattr(self, k, None)
|
|
63
|
+
for k in As2OutgoingMessage.default_attributes
|
|
64
|
+
if getattr(self, k, None) is not None
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
# Parameters:
|
|
69
|
+
# 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.
|
|
70
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
71
|
+
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at` and `as2_partner_id`.
|
|
72
|
+
# filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`.
|
|
73
|
+
# filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`.
|
|
74
|
+
# filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`.
|
|
75
|
+
# filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`.
|
|
76
|
+
# filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`.
|
|
77
|
+
# as2_partner_id - int64 - As2 Partner ID. If provided, will return message specific to that partner.
|
|
78
|
+
def list(params=None, options=None):
|
|
79
|
+
if not isinstance(params, dict):
|
|
80
|
+
params = {}
|
|
81
|
+
if not isinstance(options, dict):
|
|
82
|
+
options = {}
|
|
83
|
+
if "cursor" in params and not isinstance(params["cursor"], str):
|
|
84
|
+
raise InvalidParameterError("Bad parameter: cursor must be an str")
|
|
85
|
+
if "per_page" in params and not isinstance(params["per_page"], int):
|
|
86
|
+
raise InvalidParameterError("Bad parameter: per_page must be an int")
|
|
87
|
+
if "sort_by" in params and not isinstance(params["sort_by"], dict):
|
|
88
|
+
raise InvalidParameterError("Bad parameter: sort_by must be an dict")
|
|
89
|
+
if "filter" in params and not isinstance(params["filter"], dict):
|
|
90
|
+
raise InvalidParameterError("Bad parameter: filter must be an dict")
|
|
91
|
+
if "filter_gt" in params and not isinstance(params["filter_gt"], dict):
|
|
92
|
+
raise InvalidParameterError("Bad parameter: filter_gt must be an dict")
|
|
93
|
+
if "filter_gteq" in params and not isinstance(params["filter_gteq"], dict):
|
|
94
|
+
raise InvalidParameterError(
|
|
95
|
+
"Bad parameter: filter_gteq must be an dict"
|
|
96
|
+
)
|
|
97
|
+
if "filter_lt" in params and not isinstance(params["filter_lt"], dict):
|
|
98
|
+
raise InvalidParameterError("Bad parameter: filter_lt must be an dict")
|
|
99
|
+
if "filter_lteq" in params and not isinstance(params["filter_lteq"], dict):
|
|
100
|
+
raise InvalidParameterError(
|
|
101
|
+
"Bad parameter: filter_lteq must be an dict"
|
|
102
|
+
)
|
|
103
|
+
if "as2_partner_id" in params and not isinstance(
|
|
104
|
+
params["as2_partner_id"], int
|
|
105
|
+
):
|
|
106
|
+
raise InvalidParameterError(
|
|
107
|
+
"Bad parameter: as2_partner_id must be an int"
|
|
108
|
+
)
|
|
109
|
+
return ListObj(
|
|
110
|
+
As2OutgoingMessage, "GET", "/as2_outgoing_messages", params, options
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
def all(params=None, options=None):
|
|
115
|
+
list(params, options)
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
def new(*args, **kwargs):
|
|
119
|
+
return As2OutgoingMessage(*args, **kwargs)
|
|
@@ -0,0 +1,374 @@
|
|
|
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
|
+
"as2_station_id": None, # int64 - ID of the AS2 Station associated with this partner.
|
|
15
|
+
"name": None, # string - The partner's formal AS2 name.
|
|
16
|
+
"uri": None, # string - Public URI where we will send the AS2 messages (via HTTP/HTTPS).
|
|
17
|
+
"server_certificate": None, # string - Should we require that the remote HTTP server have a valid SSL Certificate for HTTPS?
|
|
18
|
+
"http_auth_username": None, # string - Username to send to server for HTTP Authentication.
|
|
19
|
+
"additional_http_headers": None, # object - Additional HTTP Headers for outgoing message sent to this partner.
|
|
20
|
+
"default_mime_type": None, # string - Default mime type of the file attached to the encrypted message
|
|
21
|
+
"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.
|
|
22
|
+
"enable_dedicated_ips": None, # boolean - If `true`, we will use your site's dedicated IPs for all outbound connections to this AS2 Partner.
|
|
23
|
+
"hex_public_certificate_serial": None, # string - Serial of public certificate used for message security in hex format.
|
|
24
|
+
"public_certificate_md5": None, # string - MD5 hash of public certificate used for message security.
|
|
25
|
+
"public_certificate_subject": None, # string - Subject of public certificate used for message security.
|
|
26
|
+
"public_certificate_issuer": None, # string - Issuer of public certificate used for message security.
|
|
27
|
+
"public_certificate_serial": None, # string - Serial of public certificate used for message security.
|
|
28
|
+
"public_certificate_not_before": None, # string - Not before value of public certificate used for message security.
|
|
29
|
+
"public_certificate_not_after": None, # string - Not after value of public certificate used for message security.
|
|
30
|
+
"http_auth_password": None, # string - Password to send to server for HTTP Authentication.
|
|
31
|
+
"public_certificate": None, # string - Public certificate for AS2 Partner. Note: This is the certificate for AS2 message security, not a certificate used for HTTPS authentication.
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
def __init__(self, attributes=None, options=None):
|
|
35
|
+
if not isinstance(attributes, dict):
|
|
36
|
+
attributes = {}
|
|
37
|
+
if not isinstance(options, dict):
|
|
38
|
+
options = {}
|
|
39
|
+
self.set_attributes(attributes)
|
|
40
|
+
self.options = options
|
|
41
|
+
|
|
42
|
+
def set_attributes(self, attributes):
|
|
43
|
+
for attribute, default_value in As2Partner.default_attributes.items():
|
|
44
|
+
setattr(self, attribute, attributes.get(attribute, default_value))
|
|
45
|
+
|
|
46
|
+
def get_attributes(self):
|
|
47
|
+
return {
|
|
48
|
+
k: getattr(self, k, None)
|
|
49
|
+
for k in As2Partner.default_attributes
|
|
50
|
+
if getattr(self, k, None) is not None
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
# Parameters:
|
|
54
|
+
# enable_dedicated_ips - boolean - If `true`, we will use your site's dedicated IPs for all outbound connections to this AS2 Partner.
|
|
55
|
+
# http_auth_username - string - Username to send to server for HTTP Authentication.
|
|
56
|
+
# http_auth_password - string - Password to send to server for HTTP Authentication.
|
|
57
|
+
# 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.
|
|
58
|
+
# server_certificate - string - Should we require that the remote HTTP server have a valid SSL Certificate for HTTPS?
|
|
59
|
+
# default_mime_type - string - Default mime type of the file attached to the encrypted message
|
|
60
|
+
# additional_http_headers - object - Additional HTTP Headers for outgoing message sent to this partner.
|
|
61
|
+
# name - string - The partner's formal AS2 name.
|
|
62
|
+
# uri - string - Public URI where we will send the AS2 messages (via HTTP/HTTPS).
|
|
63
|
+
# public_certificate - string - Public certificate for AS2 Partner. Note: This is the certificate for AS2 message security, not a certificate used for HTTPS authentication.
|
|
64
|
+
def update(self, params=None):
|
|
65
|
+
if not isinstance(params, dict):
|
|
66
|
+
params = {}
|
|
67
|
+
|
|
68
|
+
if hasattr(self, "id") and self.id:
|
|
69
|
+
params["id"] = self.id
|
|
70
|
+
else:
|
|
71
|
+
raise MissingParameterError("Current object doesn't have a id")
|
|
72
|
+
if "id" not in params:
|
|
73
|
+
raise MissingParameterError("Parameter missing: id")
|
|
74
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
75
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
76
|
+
if "http_auth_username" in params and not isinstance(
|
|
77
|
+
params["http_auth_username"], str
|
|
78
|
+
):
|
|
79
|
+
raise InvalidParameterError(
|
|
80
|
+
"Bad parameter: http_auth_username must be an str"
|
|
81
|
+
)
|
|
82
|
+
if "http_auth_password" in params and not isinstance(
|
|
83
|
+
params["http_auth_password"], str
|
|
84
|
+
):
|
|
85
|
+
raise InvalidParameterError(
|
|
86
|
+
"Bad parameter: http_auth_password must be an str"
|
|
87
|
+
)
|
|
88
|
+
if "mdn_validation_level" in params and not isinstance(
|
|
89
|
+
params["mdn_validation_level"], str
|
|
90
|
+
):
|
|
91
|
+
raise InvalidParameterError(
|
|
92
|
+
"Bad parameter: mdn_validation_level must be an str"
|
|
93
|
+
)
|
|
94
|
+
if "server_certificate" in params and not isinstance(
|
|
95
|
+
params["server_certificate"], str
|
|
96
|
+
):
|
|
97
|
+
raise InvalidParameterError(
|
|
98
|
+
"Bad parameter: server_certificate must be an str"
|
|
99
|
+
)
|
|
100
|
+
if "default_mime_type" in params and not isinstance(
|
|
101
|
+
params["default_mime_type"], str
|
|
102
|
+
):
|
|
103
|
+
raise InvalidParameterError(
|
|
104
|
+
"Bad parameter: default_mime_type must be an str"
|
|
105
|
+
)
|
|
106
|
+
if "name" in params and not isinstance(params["name"], str):
|
|
107
|
+
raise InvalidParameterError("Bad parameter: name must be an str")
|
|
108
|
+
if "uri" in params and not isinstance(params["uri"], str):
|
|
109
|
+
raise InvalidParameterError("Bad parameter: uri must be an str")
|
|
110
|
+
if "public_certificate" in params and not isinstance(
|
|
111
|
+
params["public_certificate"], str
|
|
112
|
+
):
|
|
113
|
+
raise InvalidParameterError(
|
|
114
|
+
"Bad parameter: public_certificate must be an str"
|
|
115
|
+
)
|
|
116
|
+
response, _options = Api.send_request(
|
|
117
|
+
"PATCH",
|
|
118
|
+
"/as2_partners/{id}".format(id=params["id"]),
|
|
119
|
+
params,
|
|
120
|
+
self.options,
|
|
121
|
+
)
|
|
122
|
+
return response.data
|
|
123
|
+
|
|
124
|
+
def delete(self, params=None):
|
|
125
|
+
if not isinstance(params, dict):
|
|
126
|
+
params = {}
|
|
127
|
+
|
|
128
|
+
if hasattr(self, "id") and self.id:
|
|
129
|
+
params["id"] = self.id
|
|
130
|
+
else:
|
|
131
|
+
raise MissingParameterError("Current object doesn't have a id")
|
|
132
|
+
if "id" not in params:
|
|
133
|
+
raise MissingParameterError("Parameter missing: id")
|
|
134
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
135
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
136
|
+
Api.send_request(
|
|
137
|
+
"DELETE",
|
|
138
|
+
"/as2_partners/{id}".format(id=params["id"]),
|
|
139
|
+
params,
|
|
140
|
+
self.options,
|
|
141
|
+
)
|
|
142
|
+
|
|
143
|
+
def destroy(self, params=None):
|
|
144
|
+
self.delete(params)
|
|
145
|
+
|
|
146
|
+
def save(self):
|
|
147
|
+
if hasattr(self, "id") and self.id:
|
|
148
|
+
new_obj = self.update(self.get_attributes())
|
|
149
|
+
self.set_attributes(new_obj.get_attributes())
|
|
150
|
+
return True
|
|
151
|
+
else:
|
|
152
|
+
new_obj = create(self.get_attributes(), self.options)
|
|
153
|
+
self.set_attributes(new_obj.get_attributes())
|
|
154
|
+
return True
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
# Parameters:
|
|
158
|
+
# 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.
|
|
159
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
160
|
+
def list(params=None, options=None):
|
|
161
|
+
if not isinstance(params, dict):
|
|
162
|
+
params = {}
|
|
163
|
+
if not isinstance(options, dict):
|
|
164
|
+
options = {}
|
|
165
|
+
if "cursor" in params and not isinstance(params["cursor"], str):
|
|
166
|
+
raise InvalidParameterError("Bad parameter: cursor must be an str")
|
|
167
|
+
if "per_page" in params and not isinstance(params["per_page"], int):
|
|
168
|
+
raise InvalidParameterError("Bad parameter: per_page must be an int")
|
|
169
|
+
return ListObj(As2Partner, "GET", "/as2_partners", params, options)
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
def all(params=None, options=None):
|
|
173
|
+
list(params, options)
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
# Parameters:
|
|
177
|
+
# id (required) - int64 - As2 Partner ID.
|
|
178
|
+
def find(id, params=None, options=None):
|
|
179
|
+
if not isinstance(params, dict):
|
|
180
|
+
params = {}
|
|
181
|
+
if not isinstance(options, dict):
|
|
182
|
+
options = {}
|
|
183
|
+
params["id"] = id
|
|
184
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
185
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
186
|
+
if "id" not in params:
|
|
187
|
+
raise MissingParameterError("Parameter missing: id")
|
|
188
|
+
response, options = Api.send_request(
|
|
189
|
+
"GET", "/as2_partners/{id}".format(id=params["id"]), params, options
|
|
190
|
+
)
|
|
191
|
+
return As2Partner(response.data, options)
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
def get(id, params=None, options=None):
|
|
195
|
+
find(id, params, options)
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
# Parameters:
|
|
199
|
+
# enable_dedicated_ips - boolean - If `true`, we will use your site's dedicated IPs for all outbound connections to this AS2 Partner.
|
|
200
|
+
# http_auth_username - string - Username to send to server for HTTP Authentication.
|
|
201
|
+
# http_auth_password - string - Password to send to server for HTTP Authentication.
|
|
202
|
+
# 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.
|
|
203
|
+
# server_certificate - string - Should we require that the remote HTTP server have a valid SSL Certificate for HTTPS?
|
|
204
|
+
# default_mime_type - string - Default mime type of the file attached to the encrypted message
|
|
205
|
+
# additional_http_headers - object - Additional HTTP Headers for outgoing message sent to this partner.
|
|
206
|
+
# as2_station_id (required) - int64 - ID of the AS2 Station associated with this partner.
|
|
207
|
+
# name (required) - string - The partner's formal AS2 name.
|
|
208
|
+
# uri (required) - string - Public URI where we will send the AS2 messages (via HTTP/HTTPS).
|
|
209
|
+
# 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.
|
|
210
|
+
def create(params=None, options=None):
|
|
211
|
+
if not isinstance(params, dict):
|
|
212
|
+
params = {}
|
|
213
|
+
if not isinstance(options, dict):
|
|
214
|
+
options = {}
|
|
215
|
+
if "http_auth_username" in params and not isinstance(
|
|
216
|
+
params["http_auth_username"], str
|
|
217
|
+
):
|
|
218
|
+
raise InvalidParameterError(
|
|
219
|
+
"Bad parameter: http_auth_username must be an str"
|
|
220
|
+
)
|
|
221
|
+
if "http_auth_password" in params and not isinstance(
|
|
222
|
+
params["http_auth_password"], str
|
|
223
|
+
):
|
|
224
|
+
raise InvalidParameterError(
|
|
225
|
+
"Bad parameter: http_auth_password must be an str"
|
|
226
|
+
)
|
|
227
|
+
if "mdn_validation_level" in params and not isinstance(
|
|
228
|
+
params["mdn_validation_level"], str
|
|
229
|
+
):
|
|
230
|
+
raise InvalidParameterError(
|
|
231
|
+
"Bad parameter: mdn_validation_level must be an str"
|
|
232
|
+
)
|
|
233
|
+
if "server_certificate" in params and not isinstance(
|
|
234
|
+
params["server_certificate"], str
|
|
235
|
+
):
|
|
236
|
+
raise InvalidParameterError(
|
|
237
|
+
"Bad parameter: server_certificate must be an str"
|
|
238
|
+
)
|
|
239
|
+
if "default_mime_type" in params and not isinstance(
|
|
240
|
+
params["default_mime_type"], str
|
|
241
|
+
):
|
|
242
|
+
raise InvalidParameterError(
|
|
243
|
+
"Bad parameter: default_mime_type must be an str"
|
|
244
|
+
)
|
|
245
|
+
if "additional_http_headers" in params and not isinstance(
|
|
246
|
+
params["additional_http_headers"], dict
|
|
247
|
+
):
|
|
248
|
+
raise InvalidParameterError(
|
|
249
|
+
"Bad parameter: additional_http_headers must be an dict"
|
|
250
|
+
)
|
|
251
|
+
if "as2_station_id" in params and not isinstance(
|
|
252
|
+
params["as2_station_id"], int
|
|
253
|
+
):
|
|
254
|
+
raise InvalidParameterError(
|
|
255
|
+
"Bad parameter: as2_station_id must be an int"
|
|
256
|
+
)
|
|
257
|
+
if "name" in params and not isinstance(params["name"], str):
|
|
258
|
+
raise InvalidParameterError("Bad parameter: name must be an str")
|
|
259
|
+
if "uri" in params and not isinstance(params["uri"], str):
|
|
260
|
+
raise InvalidParameterError("Bad parameter: uri must be an str")
|
|
261
|
+
if "public_certificate" in params and not isinstance(
|
|
262
|
+
params["public_certificate"], str
|
|
263
|
+
):
|
|
264
|
+
raise InvalidParameterError(
|
|
265
|
+
"Bad parameter: public_certificate must be an str"
|
|
266
|
+
)
|
|
267
|
+
if "as2_station_id" not in params:
|
|
268
|
+
raise MissingParameterError("Parameter missing: as2_station_id")
|
|
269
|
+
if "name" not in params:
|
|
270
|
+
raise MissingParameterError("Parameter missing: name")
|
|
271
|
+
if "uri" not in params:
|
|
272
|
+
raise MissingParameterError("Parameter missing: uri")
|
|
273
|
+
if "public_certificate" not in params:
|
|
274
|
+
raise MissingParameterError("Parameter missing: public_certificate")
|
|
275
|
+
response, options = Api.send_request(
|
|
276
|
+
"POST", "/as2_partners", params, options
|
|
277
|
+
)
|
|
278
|
+
return As2Partner(response.data, options)
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
# Parameters:
|
|
282
|
+
# enable_dedicated_ips - boolean - If `true`, we will use your site's dedicated IPs for all outbound connections to this AS2 Partner.
|
|
283
|
+
# http_auth_username - string - Username to send to server for HTTP Authentication.
|
|
284
|
+
# http_auth_password - string - Password to send to server for HTTP Authentication.
|
|
285
|
+
# 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.
|
|
286
|
+
# server_certificate - string - Should we require that the remote HTTP server have a valid SSL Certificate for HTTPS?
|
|
287
|
+
# default_mime_type - string - Default mime type of the file attached to the encrypted message
|
|
288
|
+
# additional_http_headers - object - Additional HTTP Headers for outgoing message sent to this partner.
|
|
289
|
+
# name - string - The partner's formal AS2 name.
|
|
290
|
+
# uri - string - Public URI where we will send the AS2 messages (via HTTP/HTTPS).
|
|
291
|
+
# public_certificate - string - Public certificate for AS2 Partner. Note: This is the certificate for AS2 message security, not a certificate used for HTTPS authentication.
|
|
292
|
+
def update(id, params=None, options=None):
|
|
293
|
+
if not isinstance(params, dict):
|
|
294
|
+
params = {}
|
|
295
|
+
if not isinstance(options, dict):
|
|
296
|
+
options = {}
|
|
297
|
+
params["id"] = id
|
|
298
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
299
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
300
|
+
if "http_auth_username" in params and not isinstance(
|
|
301
|
+
params["http_auth_username"], str
|
|
302
|
+
):
|
|
303
|
+
raise InvalidParameterError(
|
|
304
|
+
"Bad parameter: http_auth_username must be an str"
|
|
305
|
+
)
|
|
306
|
+
if "http_auth_password" in params and not isinstance(
|
|
307
|
+
params["http_auth_password"], str
|
|
308
|
+
):
|
|
309
|
+
raise InvalidParameterError(
|
|
310
|
+
"Bad parameter: http_auth_password must be an str"
|
|
311
|
+
)
|
|
312
|
+
if "mdn_validation_level" in params and not isinstance(
|
|
313
|
+
params["mdn_validation_level"], str
|
|
314
|
+
):
|
|
315
|
+
raise InvalidParameterError(
|
|
316
|
+
"Bad parameter: mdn_validation_level must be an str"
|
|
317
|
+
)
|
|
318
|
+
if "server_certificate" in params and not isinstance(
|
|
319
|
+
params["server_certificate"], str
|
|
320
|
+
):
|
|
321
|
+
raise InvalidParameterError(
|
|
322
|
+
"Bad parameter: server_certificate must be an str"
|
|
323
|
+
)
|
|
324
|
+
if "default_mime_type" in params and not isinstance(
|
|
325
|
+
params["default_mime_type"], str
|
|
326
|
+
):
|
|
327
|
+
raise InvalidParameterError(
|
|
328
|
+
"Bad parameter: default_mime_type must be an str"
|
|
329
|
+
)
|
|
330
|
+
if "additional_http_headers" in params and not isinstance(
|
|
331
|
+
params["additional_http_headers"], dict
|
|
332
|
+
):
|
|
333
|
+
raise InvalidParameterError(
|
|
334
|
+
"Bad parameter: additional_http_headers must be an dict"
|
|
335
|
+
)
|
|
336
|
+
if "name" in params and not isinstance(params["name"], str):
|
|
337
|
+
raise InvalidParameterError("Bad parameter: name must be an str")
|
|
338
|
+
if "uri" in params and not isinstance(params["uri"], str):
|
|
339
|
+
raise InvalidParameterError("Bad parameter: uri must be an str")
|
|
340
|
+
if "public_certificate" in params and not isinstance(
|
|
341
|
+
params["public_certificate"], str
|
|
342
|
+
):
|
|
343
|
+
raise InvalidParameterError(
|
|
344
|
+
"Bad parameter: public_certificate must be an str"
|
|
345
|
+
)
|
|
346
|
+
if "id" not in params:
|
|
347
|
+
raise MissingParameterError("Parameter missing: id")
|
|
348
|
+
response, options = Api.send_request(
|
|
349
|
+
"PATCH", "/as2_partners/{id}".format(id=params["id"]), params, options
|
|
350
|
+
)
|
|
351
|
+
return As2Partner(response.data, options)
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
def delete(id, params=None, options=None):
|
|
355
|
+
if not isinstance(params, dict):
|
|
356
|
+
params = {}
|
|
357
|
+
if not isinstance(options, dict):
|
|
358
|
+
options = {}
|
|
359
|
+
params["id"] = id
|
|
360
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
361
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
362
|
+
if "id" not in params:
|
|
363
|
+
raise MissingParameterError("Parameter missing: id")
|
|
364
|
+
Api.send_request(
|
|
365
|
+
"DELETE", "/as2_partners/{id}".format(id=params["id"]), params, options
|
|
366
|
+
)
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
def destroy(id, params=None, options=None):
|
|
370
|
+
delete(id, params, options)
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
def new(*args, **kwargs):
|
|
374
|
+
return As2Partner(*args, **kwargs)
|