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,59 @@
|
|
|
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 DnsRecord:
|
|
12
|
+
default_attributes = {
|
|
13
|
+
"id": None, # string - Unique label for DNS record; used by Zapier and other integrations.
|
|
14
|
+
"domain": None, # string - DNS record domain name
|
|
15
|
+
"rrtype": None, # string - DNS record type
|
|
16
|
+
"value": None, # string - DNS record value
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
def __init__(self, attributes=None, options=None):
|
|
20
|
+
if not isinstance(attributes, dict):
|
|
21
|
+
attributes = {}
|
|
22
|
+
if not isinstance(options, dict):
|
|
23
|
+
options = {}
|
|
24
|
+
self.set_attributes(attributes)
|
|
25
|
+
self.options = options
|
|
26
|
+
|
|
27
|
+
def set_attributes(self, attributes):
|
|
28
|
+
for attribute, default_value in DnsRecord.default_attributes.items():
|
|
29
|
+
setattr(self, attribute, attributes.get(attribute, default_value))
|
|
30
|
+
|
|
31
|
+
def get_attributes(self):
|
|
32
|
+
return {
|
|
33
|
+
k: getattr(self, k, None)
|
|
34
|
+
for k in DnsRecord.default_attributes
|
|
35
|
+
if getattr(self, k, None) is not None
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
# Parameters:
|
|
40
|
+
# 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.
|
|
41
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
42
|
+
def list(params=None, options=None):
|
|
43
|
+
if not isinstance(params, dict):
|
|
44
|
+
params = {}
|
|
45
|
+
if not isinstance(options, dict):
|
|
46
|
+
options = {}
|
|
47
|
+
if "cursor" in params and not isinstance(params["cursor"], str):
|
|
48
|
+
raise InvalidParameterError("Bad parameter: cursor must be an str")
|
|
49
|
+
if "per_page" in params and not isinstance(params["per_page"], int):
|
|
50
|
+
raise InvalidParameterError("Bad parameter: per_page must be an int")
|
|
51
|
+
return ListObj(DnsRecord, "GET", "/dns_records", params, options)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def all(params=None, options=None):
|
|
55
|
+
list(params, options)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def new(*args, **kwargs):
|
|
59
|
+
return DnsRecord(*args, **kwargs)
|
|
@@ -0,0 +1,102 @@
|
|
|
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 EmailIncomingMessage:
|
|
12
|
+
default_attributes = {
|
|
13
|
+
"id": None, # int64 - Id of the Email Incoming Message
|
|
14
|
+
"inbox_id": None, # int64 - Id of the Inbox associated with this message
|
|
15
|
+
"sender": None, # string - Sender of the email
|
|
16
|
+
"sender_name": None, # string - Sender name
|
|
17
|
+
"status": None, # string - Status of the message
|
|
18
|
+
"body": None, # string - Body of the email
|
|
19
|
+
"message": None, # string - Message describing the failure
|
|
20
|
+
"created_at": None, # date-time - Message creation date/time
|
|
21
|
+
"inbox_title": None, # string - Title of the Inbox associated with this message
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
def __init__(self, attributes=None, options=None):
|
|
25
|
+
if not isinstance(attributes, dict):
|
|
26
|
+
attributes = {}
|
|
27
|
+
if not isinstance(options, dict):
|
|
28
|
+
options = {}
|
|
29
|
+
self.set_attributes(attributes)
|
|
30
|
+
self.options = options
|
|
31
|
+
|
|
32
|
+
def set_attributes(self, attributes):
|
|
33
|
+
for (
|
|
34
|
+
attribute,
|
|
35
|
+
default_value,
|
|
36
|
+
) in EmailIncomingMessage.default_attributes.items():
|
|
37
|
+
setattr(self, attribute, attributes.get(attribute, default_value))
|
|
38
|
+
|
|
39
|
+
def get_attributes(self):
|
|
40
|
+
return {
|
|
41
|
+
k: getattr(self, k, None)
|
|
42
|
+
for k in EmailIncomingMessage.default_attributes
|
|
43
|
+
if getattr(self, k, None) is not None
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
# Parameters:
|
|
48
|
+
# 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.
|
|
49
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
50
|
+
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`, `sender`, `status` or `inbox_id`.
|
|
51
|
+
# filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `inbox_id`, `sender` or `status`. Valid field combinations are `[ inbox_id, created_at ]`, `[ sender, created_at ]`, `[ status, created_at ]`, `[ inbox_id, status ]`, `[ status, sender ]`, `[ inbox_id, status, created_at ]`, `[ status, sender, created_at ]`, `[ inbox_id, status, sender ]` or `[ inbox_id, status, sender, created_at ]`.
|
|
52
|
+
# filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`.
|
|
53
|
+
# filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`.
|
|
54
|
+
# filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `sender`.
|
|
55
|
+
# filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`.
|
|
56
|
+
# filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`.
|
|
57
|
+
def list(params=None, options=None):
|
|
58
|
+
if not isinstance(params, dict):
|
|
59
|
+
params = {}
|
|
60
|
+
if not isinstance(options, dict):
|
|
61
|
+
options = {}
|
|
62
|
+
if "cursor" in params and not isinstance(params["cursor"], str):
|
|
63
|
+
raise InvalidParameterError("Bad parameter: cursor must be an str")
|
|
64
|
+
if "per_page" in params and not isinstance(params["per_page"], int):
|
|
65
|
+
raise InvalidParameterError("Bad parameter: per_page must be an int")
|
|
66
|
+
if "sort_by" in params and not isinstance(params["sort_by"], dict):
|
|
67
|
+
raise InvalidParameterError("Bad parameter: sort_by must be an dict")
|
|
68
|
+
if "filter" in params and not isinstance(params["filter"], dict):
|
|
69
|
+
raise InvalidParameterError("Bad parameter: filter must be an dict")
|
|
70
|
+
if "filter_gt" in params and not isinstance(params["filter_gt"], dict):
|
|
71
|
+
raise InvalidParameterError("Bad parameter: filter_gt must be an dict")
|
|
72
|
+
if "filter_gteq" in params and not isinstance(params["filter_gteq"], dict):
|
|
73
|
+
raise InvalidParameterError(
|
|
74
|
+
"Bad parameter: filter_gteq must be an dict"
|
|
75
|
+
)
|
|
76
|
+
if "filter_prefix" in params and not isinstance(
|
|
77
|
+
params["filter_prefix"], dict
|
|
78
|
+
):
|
|
79
|
+
raise InvalidParameterError(
|
|
80
|
+
"Bad parameter: filter_prefix must be an dict"
|
|
81
|
+
)
|
|
82
|
+
if "filter_lt" in params and not isinstance(params["filter_lt"], dict):
|
|
83
|
+
raise InvalidParameterError("Bad parameter: filter_lt must be an dict")
|
|
84
|
+
if "filter_lteq" in params and not isinstance(params["filter_lteq"], dict):
|
|
85
|
+
raise InvalidParameterError(
|
|
86
|
+
"Bad parameter: filter_lteq must be an dict"
|
|
87
|
+
)
|
|
88
|
+
return ListObj(
|
|
89
|
+
EmailIncomingMessage,
|
|
90
|
+
"GET",
|
|
91
|
+
"/email_incoming_messages",
|
|
92
|
+
params,
|
|
93
|
+
options,
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def all(params=None, options=None):
|
|
98
|
+
list(params, options)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def new(*args, **kwargs):
|
|
102
|
+
return EmailIncomingMessage(*args, **kwargs)
|
|
@@ -0,0 +1,84 @@
|
|
|
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 EmailLog:
|
|
12
|
+
default_attributes = {
|
|
13
|
+
"timestamp": None, # date-time - Start Time of Action. Deprecrated: Use created_at.
|
|
14
|
+
"message": None, # string - Log Message
|
|
15
|
+
"status": None, # string - Status of E-Mail delivery
|
|
16
|
+
"subject": None, # string - Subject line of E-Mail
|
|
17
|
+
"to": None, # string - To field of E-Mail
|
|
18
|
+
"cc": None, # string - CC field of E-Mail
|
|
19
|
+
"delivery_method": None, # string - How was the email delivered? `customer_smtp` or `files.com`
|
|
20
|
+
"smtp_hostname": None, # string - Customer SMTP Hostname used.
|
|
21
|
+
"smtp_ip": None, # string - Customer SMTP IP address as resolved for use (useful for troubleshooting DNS issues with customer SMTP).
|
|
22
|
+
"created_at": None, # date-time - Start Time of Action
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
def __init__(self, attributes=None, options=None):
|
|
26
|
+
if not isinstance(attributes, dict):
|
|
27
|
+
attributes = {}
|
|
28
|
+
if not isinstance(options, dict):
|
|
29
|
+
options = {}
|
|
30
|
+
self.set_attributes(attributes)
|
|
31
|
+
self.options = options
|
|
32
|
+
|
|
33
|
+
def set_attributes(self, attributes):
|
|
34
|
+
for attribute, default_value in EmailLog.default_attributes.items():
|
|
35
|
+
setattr(self, attribute, attributes.get(attribute, default_value))
|
|
36
|
+
|
|
37
|
+
def get_attributes(self):
|
|
38
|
+
return {
|
|
39
|
+
k: getattr(self, k, None)
|
|
40
|
+
for k in EmailLog.default_attributes
|
|
41
|
+
if getattr(self, k, None) is not None
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
# Parameters:
|
|
46
|
+
# 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.
|
|
47
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
48
|
+
# filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `status` and `created_at`. Valid field combinations are `[ status ]`, `[ created_at ]` or `[ status, created_at ]`.
|
|
49
|
+
# filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`. Valid field combinations are `[ status ]`, `[ created_at ]` or `[ status, created_at ]`.
|
|
50
|
+
# filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`. Valid field combinations are `[ status ]`, `[ created_at ]` or `[ status, created_at ]`.
|
|
51
|
+
# filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`. Valid field combinations are `[ status ]`, `[ created_at ]` or `[ status, created_at ]`.
|
|
52
|
+
# filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`. Valid field combinations are `[ status ]`, `[ created_at ]` or `[ status, created_at ]`.
|
|
53
|
+
def list(params=None, options=None):
|
|
54
|
+
if not isinstance(params, dict):
|
|
55
|
+
params = {}
|
|
56
|
+
if not isinstance(options, dict):
|
|
57
|
+
options = {}
|
|
58
|
+
if "cursor" in params and not isinstance(params["cursor"], str):
|
|
59
|
+
raise InvalidParameterError("Bad parameter: cursor must be an str")
|
|
60
|
+
if "per_page" in params and not isinstance(params["per_page"], int):
|
|
61
|
+
raise InvalidParameterError("Bad parameter: per_page must be an int")
|
|
62
|
+
if "filter" in params and not isinstance(params["filter"], dict):
|
|
63
|
+
raise InvalidParameterError("Bad parameter: filter must be an dict")
|
|
64
|
+
if "filter_gt" in params and not isinstance(params["filter_gt"], dict):
|
|
65
|
+
raise InvalidParameterError("Bad parameter: filter_gt must be an dict")
|
|
66
|
+
if "filter_gteq" in params and not isinstance(params["filter_gteq"], dict):
|
|
67
|
+
raise InvalidParameterError(
|
|
68
|
+
"Bad parameter: filter_gteq must be an dict"
|
|
69
|
+
)
|
|
70
|
+
if "filter_lt" in params and not isinstance(params["filter_lt"], dict):
|
|
71
|
+
raise InvalidParameterError("Bad parameter: filter_lt must be an dict")
|
|
72
|
+
if "filter_lteq" in params and not isinstance(params["filter_lteq"], dict):
|
|
73
|
+
raise InvalidParameterError(
|
|
74
|
+
"Bad parameter: filter_lteq must be an dict"
|
|
75
|
+
)
|
|
76
|
+
return ListObj(EmailLog, "GET", "/email_logs", params, options)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def all(params=None, options=None):
|
|
80
|
+
list(params, options)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def new(*args, **kwargs):
|
|
84
|
+
return EmailLog(*args, **kwargs)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import builtins # noqa: F401
|
|
2
|
+
from files_sdk.api import Api # noqa: F401
|
|
3
|
+
from files_sdk.error import ( # noqa: F401
|
|
4
|
+
InvalidParameterError,
|
|
5
|
+
MissingParameterError,
|
|
6
|
+
NotImplementedError,
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Errors:
|
|
11
|
+
default_attributes = {
|
|
12
|
+
"fields": None, # array(string) - A list of fields where errors occur
|
|
13
|
+
"messages": None, # array(string) - A list of error messages
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
def __init__(self, attributes=None, options=None):
|
|
17
|
+
if not isinstance(attributes, dict):
|
|
18
|
+
attributes = {}
|
|
19
|
+
if not isinstance(options, dict):
|
|
20
|
+
options = {}
|
|
21
|
+
self.set_attributes(attributes)
|
|
22
|
+
self.options = options
|
|
23
|
+
|
|
24
|
+
def set_attributes(self, attributes):
|
|
25
|
+
for attribute, default_value in Errors.default_attributes.items():
|
|
26
|
+
setattr(self, attribute, attributes.get(attribute, default_value))
|
|
27
|
+
|
|
28
|
+
def get_attributes(self):
|
|
29
|
+
return {
|
|
30
|
+
k: getattr(self, k, None)
|
|
31
|
+
for k in Errors.default_attributes
|
|
32
|
+
if getattr(self, k, None) is not None
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def new(*args, **kwargs):
|
|
37
|
+
return Errors(*args, **kwargs)
|
|
@@ -0,0 +1,102 @@
|
|
|
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 ExavaultApiRequestLog:
|
|
12
|
+
default_attributes = {
|
|
13
|
+
"timestamp": None, # date-time - Start Time of Action. Deprecrated: Use created_at.
|
|
14
|
+
"endpoint": None, # string - Name of API Endpoint
|
|
15
|
+
"version": None, # int64 - Exavault API Version
|
|
16
|
+
"request_ip": None, # string - IP of requesting client
|
|
17
|
+
"request_method": None, # string - HTTP Method
|
|
18
|
+
"error_type": None, # string - Error type, if applicable
|
|
19
|
+
"error_message": None, # string - Error message, if applicable
|
|
20
|
+
"user_agent": None, # string - User-Agent
|
|
21
|
+
"response_code": None, # int64 - HTTP Response Code
|
|
22
|
+
"success": None, # boolean - `false` if HTTP Response Code is 4xx or 5xx
|
|
23
|
+
"duration_ms": None, # int64 - Duration (in milliseconds)
|
|
24
|
+
"created_at": None, # date-time - Start Time of Action
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
def __init__(self, attributes=None, options=None):
|
|
28
|
+
if not isinstance(attributes, dict):
|
|
29
|
+
attributes = {}
|
|
30
|
+
if not isinstance(options, dict):
|
|
31
|
+
options = {}
|
|
32
|
+
self.set_attributes(attributes)
|
|
33
|
+
self.options = options
|
|
34
|
+
|
|
35
|
+
def set_attributes(self, attributes):
|
|
36
|
+
for (
|
|
37
|
+
attribute,
|
|
38
|
+
default_value,
|
|
39
|
+
) in ExavaultApiRequestLog.default_attributes.items():
|
|
40
|
+
setattr(self, attribute, attributes.get(attribute, default_value))
|
|
41
|
+
|
|
42
|
+
def get_attributes(self):
|
|
43
|
+
return {
|
|
44
|
+
k: getattr(self, k, None)
|
|
45
|
+
for k in ExavaultApiRequestLog.default_attributes
|
|
46
|
+
if getattr(self, k, None) is not None
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
# Parameters:
|
|
51
|
+
# 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.
|
|
52
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
53
|
+
# filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `request_ip`, `request_method`, `success` or `created_at`. Valid field combinations are `[ request_ip ]`, `[ request_method ]`, `[ success ]`, `[ created_at ]`, `[ request_ip, request_method ]`, `[ request_ip, success ]`, `[ request_ip, created_at ]`, `[ request_method, success ]`, `[ request_method, created_at ]`, `[ success, created_at ]`, `[ request_ip, request_method, success ]`, `[ request_ip, request_method, created_at ]`, `[ request_ip, success, created_at ]`, `[ request_method, success, created_at ]` or `[ request_ip, request_method, success, created_at ]`.
|
|
54
|
+
# filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`. Valid field combinations are `[ request_ip ]`, `[ request_method ]`, `[ success ]`, `[ created_at ]`, `[ request_ip, request_method ]`, `[ request_ip, success ]`, `[ request_ip, created_at ]`, `[ request_method, success ]`, `[ request_method, created_at ]`, `[ success, created_at ]`, `[ request_ip, request_method, success ]`, `[ request_ip, request_method, created_at ]`, `[ request_ip, success, created_at ]`, `[ request_method, success, created_at ]` or `[ request_ip, request_method, success, created_at ]`.
|
|
55
|
+
# filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`. Valid field combinations are `[ request_ip ]`, `[ request_method ]`, `[ success ]`, `[ created_at ]`, `[ request_ip, request_method ]`, `[ request_ip, success ]`, `[ request_ip, created_at ]`, `[ request_method, success ]`, `[ request_method, created_at ]`, `[ success, created_at ]`, `[ request_ip, request_method, success ]`, `[ request_ip, request_method, created_at ]`, `[ request_ip, success, created_at ]`, `[ request_method, success, created_at ]` or `[ request_ip, request_method, success, created_at ]`.
|
|
56
|
+
# filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `request_ip` and `request_method`. Valid field combinations are `[ request_ip ]`, `[ request_method ]`, `[ success ]`, `[ created_at ]`, `[ request_ip, request_method ]`, `[ request_ip, success ]`, `[ request_ip, created_at ]`, `[ request_method, success ]`, `[ request_method, created_at ]`, `[ success, created_at ]`, `[ request_ip, request_method, success ]`, `[ request_ip, request_method, created_at ]`, `[ request_ip, success, created_at ]`, `[ request_method, success, created_at ]` or `[ request_ip, request_method, success, created_at ]`.
|
|
57
|
+
# filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`. Valid field combinations are `[ request_ip ]`, `[ request_method ]`, `[ success ]`, `[ created_at ]`, `[ request_ip, request_method ]`, `[ request_ip, success ]`, `[ request_ip, created_at ]`, `[ request_method, success ]`, `[ request_method, created_at ]`, `[ success, created_at ]`, `[ request_ip, request_method, success ]`, `[ request_ip, request_method, created_at ]`, `[ request_ip, success, created_at ]`, `[ request_method, success, created_at ]` or `[ request_ip, request_method, success, created_at ]`.
|
|
58
|
+
# filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`. Valid field combinations are `[ request_ip ]`, `[ request_method ]`, `[ success ]`, `[ created_at ]`, `[ request_ip, request_method ]`, `[ request_ip, success ]`, `[ request_ip, created_at ]`, `[ request_method, success ]`, `[ request_method, created_at ]`, `[ success, created_at ]`, `[ request_ip, request_method, success ]`, `[ request_ip, request_method, created_at ]`, `[ request_ip, success, created_at ]`, `[ request_method, success, created_at ]` or `[ request_ip, request_method, success, created_at ]`.
|
|
59
|
+
def list(params=None, options=None):
|
|
60
|
+
if not isinstance(params, dict):
|
|
61
|
+
params = {}
|
|
62
|
+
if not isinstance(options, dict):
|
|
63
|
+
options = {}
|
|
64
|
+
if "cursor" in params and not isinstance(params["cursor"], str):
|
|
65
|
+
raise InvalidParameterError("Bad parameter: cursor must be an str")
|
|
66
|
+
if "per_page" in params and not isinstance(params["per_page"], int):
|
|
67
|
+
raise InvalidParameterError("Bad parameter: per_page must be an int")
|
|
68
|
+
if "filter" in params and not isinstance(params["filter"], dict):
|
|
69
|
+
raise InvalidParameterError("Bad parameter: filter must be an dict")
|
|
70
|
+
if "filter_gt" in params and not isinstance(params["filter_gt"], dict):
|
|
71
|
+
raise InvalidParameterError("Bad parameter: filter_gt must be an dict")
|
|
72
|
+
if "filter_gteq" in params and not isinstance(params["filter_gteq"], dict):
|
|
73
|
+
raise InvalidParameterError(
|
|
74
|
+
"Bad parameter: filter_gteq must be an dict"
|
|
75
|
+
)
|
|
76
|
+
if "filter_prefix" in params and not isinstance(
|
|
77
|
+
params["filter_prefix"], dict
|
|
78
|
+
):
|
|
79
|
+
raise InvalidParameterError(
|
|
80
|
+
"Bad parameter: filter_prefix must be an dict"
|
|
81
|
+
)
|
|
82
|
+
if "filter_lt" in params and not isinstance(params["filter_lt"], dict):
|
|
83
|
+
raise InvalidParameterError("Bad parameter: filter_lt must be an dict")
|
|
84
|
+
if "filter_lteq" in params and not isinstance(params["filter_lteq"], dict):
|
|
85
|
+
raise InvalidParameterError(
|
|
86
|
+
"Bad parameter: filter_lteq must be an dict"
|
|
87
|
+
)
|
|
88
|
+
return ListObj(
|
|
89
|
+
ExavaultApiRequestLog,
|
|
90
|
+
"GET",
|
|
91
|
+
"/exavault_api_request_logs",
|
|
92
|
+
params,
|
|
93
|
+
options,
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def all(params=None, options=None):
|
|
98
|
+
list(params, options)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def new(*args, **kwargs):
|
|
102
|
+
return ExavaultApiRequestLog(*args, **kwargs)
|
|
@@ -0,0 +1,148 @@
|
|
|
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 ExternalEvent:
|
|
12
|
+
default_attributes = {
|
|
13
|
+
"id": None, # int64 - Event ID
|
|
14
|
+
"event_type": None, # string - Type of event being recorded.
|
|
15
|
+
"status": None, # string - Status of event.
|
|
16
|
+
"body": None, # string - Event body
|
|
17
|
+
"created_at": None, # date-time - External event create date/time
|
|
18
|
+
"body_url": None, # string - Link to log file.
|
|
19
|
+
"folder_behavior_id": None, # int64 - Folder Behavior ID
|
|
20
|
+
"siem_http_destination_id": None, # int64 - SIEM HTTP Destination ID.
|
|
21
|
+
"successful_files": None, # int64 - For sync events, the number of files handled successfully.
|
|
22
|
+
"errored_files": None, # int64 - For sync events, the number of files that encountered errors.
|
|
23
|
+
"bytes_synced": None, # int64 - For sync events, the total number of bytes synced.
|
|
24
|
+
"compared_files": None, # int64 - For sync events, the number of files considered for the sync.
|
|
25
|
+
"compared_folders": None, # int64 - For sync events, the number of folders listed and considered for the sync.
|
|
26
|
+
"remote_server_type": None, # string - Associated Remote Server type, if any
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
def __init__(self, attributes=None, options=None):
|
|
30
|
+
if not isinstance(attributes, dict):
|
|
31
|
+
attributes = {}
|
|
32
|
+
if not isinstance(options, dict):
|
|
33
|
+
options = {}
|
|
34
|
+
self.set_attributes(attributes)
|
|
35
|
+
self.options = options
|
|
36
|
+
|
|
37
|
+
def set_attributes(self, attributes):
|
|
38
|
+
for (
|
|
39
|
+
attribute,
|
|
40
|
+
default_value,
|
|
41
|
+
) in ExternalEvent.default_attributes.items():
|
|
42
|
+
setattr(self, attribute, attributes.get(attribute, default_value))
|
|
43
|
+
|
|
44
|
+
def get_attributes(self):
|
|
45
|
+
return {
|
|
46
|
+
k: getattr(self, k, None)
|
|
47
|
+
for k in ExternalEvent.default_attributes
|
|
48
|
+
if getattr(self, k, None) is not None
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
def save(self):
|
|
52
|
+
if hasattr(self, "id") and self.id:
|
|
53
|
+
raise NotImplementedError(
|
|
54
|
+
"The ExternalEvent object doesn't support updates."
|
|
55
|
+
)
|
|
56
|
+
else:
|
|
57
|
+
new_obj = create(self.get_attributes(), self.options)
|
|
58
|
+
self.set_attributes(new_obj.get_attributes())
|
|
59
|
+
return True
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
# Parameters:
|
|
63
|
+
# 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.
|
|
64
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
65
|
+
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `siem_http_destination_id`, `created_at`, `event_type`, `status` or `folder_behavior_id`.
|
|
66
|
+
# filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `event_type`, `remote_server_type`, `status`, `folder_behavior_id` or `siem_http_destination_id`. Valid field combinations are `[ event_type, created_at ]`, `[ remote_server_type, created_at ]`, `[ status, created_at ]`, `[ folder_behavior_id, created_at ]`, `[ event_type, status ]`, `[ remote_server_type, status ]`, `[ folder_behavior_id, status ]`, `[ event_type, status, created_at ]`, `[ remote_server_type, status, created_at ]` or `[ folder_behavior_id, status, created_at ]`.
|
|
67
|
+
# filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`.
|
|
68
|
+
# filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`.
|
|
69
|
+
# filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`.
|
|
70
|
+
# filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`.
|
|
71
|
+
def list(params=None, options=None):
|
|
72
|
+
if not isinstance(params, dict):
|
|
73
|
+
params = {}
|
|
74
|
+
if not isinstance(options, dict):
|
|
75
|
+
options = {}
|
|
76
|
+
if "cursor" in params and not isinstance(params["cursor"], str):
|
|
77
|
+
raise InvalidParameterError("Bad parameter: cursor must be an str")
|
|
78
|
+
if "per_page" in params and not isinstance(params["per_page"], int):
|
|
79
|
+
raise InvalidParameterError("Bad parameter: per_page must be an int")
|
|
80
|
+
if "sort_by" in params and not isinstance(params["sort_by"], dict):
|
|
81
|
+
raise InvalidParameterError("Bad parameter: sort_by must be an dict")
|
|
82
|
+
if "filter" in params and not isinstance(params["filter"], dict):
|
|
83
|
+
raise InvalidParameterError("Bad parameter: filter must be an dict")
|
|
84
|
+
if "filter_gt" in params and not isinstance(params["filter_gt"], dict):
|
|
85
|
+
raise InvalidParameterError("Bad parameter: filter_gt must be an dict")
|
|
86
|
+
if "filter_gteq" in params and not isinstance(params["filter_gteq"], dict):
|
|
87
|
+
raise InvalidParameterError(
|
|
88
|
+
"Bad parameter: filter_gteq must be an dict"
|
|
89
|
+
)
|
|
90
|
+
if "filter_lt" in params and not isinstance(params["filter_lt"], dict):
|
|
91
|
+
raise InvalidParameterError("Bad parameter: filter_lt must be an dict")
|
|
92
|
+
if "filter_lteq" in params and not isinstance(params["filter_lteq"], dict):
|
|
93
|
+
raise InvalidParameterError(
|
|
94
|
+
"Bad parameter: filter_lteq must be an dict"
|
|
95
|
+
)
|
|
96
|
+
return ListObj(ExternalEvent, "GET", "/external_events", params, options)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def all(params=None, options=None):
|
|
100
|
+
list(params, options)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
# Parameters:
|
|
104
|
+
# id (required) - int64 - External Event ID.
|
|
105
|
+
def find(id, params=None, options=None):
|
|
106
|
+
if not isinstance(params, dict):
|
|
107
|
+
params = {}
|
|
108
|
+
if not isinstance(options, dict):
|
|
109
|
+
options = {}
|
|
110
|
+
params["id"] = id
|
|
111
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
112
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
113
|
+
if "id" not in params:
|
|
114
|
+
raise MissingParameterError("Parameter missing: id")
|
|
115
|
+
response, options = Api.send_request(
|
|
116
|
+
"GET", "/external_events/{id}".format(id=params["id"]), params, options
|
|
117
|
+
)
|
|
118
|
+
return ExternalEvent(response.data, options)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def get(id, params=None, options=None):
|
|
122
|
+
find(id, params, options)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
# Parameters:
|
|
126
|
+
# status (required) - string - Status of event.
|
|
127
|
+
# body (required) - string - Event body
|
|
128
|
+
def create(params=None, options=None):
|
|
129
|
+
if not isinstance(params, dict):
|
|
130
|
+
params = {}
|
|
131
|
+
if not isinstance(options, dict):
|
|
132
|
+
options = {}
|
|
133
|
+
if "status" in params and not isinstance(params["status"], str):
|
|
134
|
+
raise InvalidParameterError("Bad parameter: status must be an str")
|
|
135
|
+
if "body" in params and not isinstance(params["body"], str):
|
|
136
|
+
raise InvalidParameterError("Bad parameter: body must be an str")
|
|
137
|
+
if "status" not in params:
|
|
138
|
+
raise MissingParameterError("Parameter missing: status")
|
|
139
|
+
if "body" not in params:
|
|
140
|
+
raise MissingParameterError("Parameter missing: body")
|
|
141
|
+
response, options = Api.send_request(
|
|
142
|
+
"POST", "/external_events", params, options
|
|
143
|
+
)
|
|
144
|
+
return ExternalEvent(response.data, options)
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
def new(*args, **kwargs):
|
|
148
|
+
return ExternalEvent(*args, **kwargs)
|