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
files_sdk/list_obj.py
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
from files_sdk.api import Api
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class ListObj:
|
|
5
|
+
def __init__(self, klass, path, method, params, options):
|
|
6
|
+
self.klass = klass
|
|
7
|
+
self.path = path
|
|
8
|
+
self.method = method
|
|
9
|
+
self.params = params
|
|
10
|
+
self.options = options
|
|
11
|
+
self.data = []
|
|
12
|
+
self.cursor = None
|
|
13
|
+
|
|
14
|
+
self.load_next_page()
|
|
15
|
+
|
|
16
|
+
def load_next_page(self):
|
|
17
|
+
if self.cursor is not None:
|
|
18
|
+
self.params["cursor"] = self.cursor
|
|
19
|
+
response, _options = Api.send_request(
|
|
20
|
+
self.path, self.method, self.params, self.options
|
|
21
|
+
)
|
|
22
|
+
self.data = [self.klass(d, self.options) for d in response.data]
|
|
23
|
+
self.cursor = response.headers.get("X-Files-Cursor", None)
|
|
24
|
+
return self
|
|
25
|
+
|
|
26
|
+
def __iter__(self):
|
|
27
|
+
return self.data.__iter__()
|
|
28
|
+
|
|
29
|
+
def __len__(self):
|
|
30
|
+
return self.data.__len__()
|
|
31
|
+
|
|
32
|
+
def auto_paging_iter(self):
|
|
33
|
+
while True:
|
|
34
|
+
for item in self.data:
|
|
35
|
+
yield item
|
|
36
|
+
if not self.has_next_page:
|
|
37
|
+
break
|
|
38
|
+
self.load_next_page()
|
|
39
|
+
|
|
40
|
+
@property
|
|
41
|
+
def has_next_page(self):
|
|
42
|
+
return True if self.cursor is not None else False
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
from files_sdk.models.account_line_item import AccountLineItem
|
|
2
|
+
from files_sdk.models.action import Action
|
|
3
|
+
from files_sdk.models.action_notification_export import (
|
|
4
|
+
ActionNotificationExport,
|
|
5
|
+
)
|
|
6
|
+
from files_sdk.models.action_notification_export_result import (
|
|
7
|
+
ActionNotificationExportResult,
|
|
8
|
+
)
|
|
9
|
+
from files_sdk.models.agent_push_update import AgentPushUpdate
|
|
10
|
+
from files_sdk.models.api_key import ApiKey
|
|
11
|
+
from files_sdk.models.api_request_log import ApiRequestLog
|
|
12
|
+
from files_sdk.models.app import App
|
|
13
|
+
from files_sdk.models.as2_incoming_message import As2IncomingMessage
|
|
14
|
+
from files_sdk.models.as2_outgoing_message import As2OutgoingMessage
|
|
15
|
+
from files_sdk.models.as2_partner import As2Partner
|
|
16
|
+
from files_sdk.models.as2_station import As2Station
|
|
17
|
+
from files_sdk.models.auto import Auto
|
|
18
|
+
from files_sdk.models.automation import Automation
|
|
19
|
+
from files_sdk.models.automation_log import AutomationLog
|
|
20
|
+
from files_sdk.models.automation_run import AutomationRun
|
|
21
|
+
from files_sdk.models.bandwidth_snapshot import BandwidthSnapshot
|
|
22
|
+
from files_sdk.models.behavior import Behavior
|
|
23
|
+
from files_sdk.models.bundle import Bundle
|
|
24
|
+
from files_sdk.models.bundle_action import BundleAction
|
|
25
|
+
from files_sdk.models.bundle_download import BundleDownload
|
|
26
|
+
from files_sdk.models.bundle_notification import BundleNotification
|
|
27
|
+
from files_sdk.models.bundle_path import BundlePath
|
|
28
|
+
from files_sdk.models.bundle_recipient import BundleRecipient
|
|
29
|
+
from files_sdk.models.bundle_registration import BundleRegistration
|
|
30
|
+
from files_sdk.models.child_site_management_policy import (
|
|
31
|
+
ChildSiteManagementPolicy,
|
|
32
|
+
)
|
|
33
|
+
from files_sdk.models.clickwrap import Clickwrap
|
|
34
|
+
from files_sdk.models.dns_record import DnsRecord
|
|
35
|
+
from files_sdk.models.email_incoming_message import EmailIncomingMessage
|
|
36
|
+
from files_sdk.models.email_log import EmailLog
|
|
37
|
+
from files_sdk.models.errors import Errors
|
|
38
|
+
from files_sdk.models.exavault_api_request_log import ExavaultApiRequestLog
|
|
39
|
+
from files_sdk.models.external_event import ExternalEvent
|
|
40
|
+
from files_sdk.models.file import File
|
|
41
|
+
from files_sdk.models.file_action import FileAction
|
|
42
|
+
from files_sdk.models.file_comment import FileComment
|
|
43
|
+
from files_sdk.models.file_comment_reaction import FileCommentReaction
|
|
44
|
+
from files_sdk.models.file_migration import FileMigration
|
|
45
|
+
from files_sdk.models.file_migration_log import FileMigrationLog
|
|
46
|
+
from files_sdk.models.file_upload_part import FileUploadPart
|
|
47
|
+
from files_sdk.models.folder import Folder
|
|
48
|
+
from files_sdk.models.form_field import FormField
|
|
49
|
+
from files_sdk.models.form_field_set import FormFieldSet
|
|
50
|
+
from files_sdk.models.ftp_action_log import FtpActionLog
|
|
51
|
+
from files_sdk.models.gpg_key import GpgKey
|
|
52
|
+
from files_sdk.models.group import Group
|
|
53
|
+
from files_sdk.models.group_user import GroupUser
|
|
54
|
+
from files_sdk.models.history import History
|
|
55
|
+
from files_sdk.models.history_export import HistoryExport
|
|
56
|
+
from files_sdk.models.history_export_result import HistoryExportResult
|
|
57
|
+
from files_sdk.models.holiday_region import HolidayRegion
|
|
58
|
+
from files_sdk.models.image import Image
|
|
59
|
+
from files_sdk.models.inbound_s3_log import InboundS3Log
|
|
60
|
+
from files_sdk.models.inbox_recipient import InboxRecipient
|
|
61
|
+
from files_sdk.models.inbox_registration import InboxRegistration
|
|
62
|
+
from files_sdk.models.inbox_upload import InboxUpload
|
|
63
|
+
from files_sdk.models.invoice import Invoice
|
|
64
|
+
from files_sdk.models.invoice_line_item import InvoiceLineItem
|
|
65
|
+
from files_sdk.models.ip_address import IpAddress
|
|
66
|
+
from files_sdk.models.key_lifecycle_rule import KeyLifecycleRule
|
|
67
|
+
from files_sdk.models.lock import Lock
|
|
68
|
+
from files_sdk.models.message import Message
|
|
69
|
+
from files_sdk.models.message_comment import MessageComment
|
|
70
|
+
from files_sdk.models.message_comment_reaction import MessageCommentReaction
|
|
71
|
+
from files_sdk.models.message_reaction import MessageReaction
|
|
72
|
+
from files_sdk.models.notification import Notification
|
|
73
|
+
from files_sdk.models.outbound_connection_log import OutboundConnectionLog
|
|
74
|
+
from files_sdk.models.partner import Partner
|
|
75
|
+
from files_sdk.models.payment import Payment
|
|
76
|
+
from files_sdk.models.payment_line_item import PaymentLineItem
|
|
77
|
+
from files_sdk.models.permission import Permission
|
|
78
|
+
from files_sdk.models.preview import Preview
|
|
79
|
+
from files_sdk.models.priority import Priority
|
|
80
|
+
from files_sdk.models.project import Project
|
|
81
|
+
from files_sdk.models.public_hosting_request_log import PublicHostingRequestLog
|
|
82
|
+
from files_sdk.models.public_ip_address import PublicIpAddress
|
|
83
|
+
from files_sdk.models.public_key import PublicKey
|
|
84
|
+
from files_sdk.models.remote_bandwidth_snapshot import RemoteBandwidthSnapshot
|
|
85
|
+
from files_sdk.models.remote_mount_backend import RemoteMountBackend
|
|
86
|
+
from files_sdk.models.remote_server import RemoteServer
|
|
87
|
+
from files_sdk.models.remote_server_configuration_file import (
|
|
88
|
+
RemoteServerConfigurationFile,
|
|
89
|
+
)
|
|
90
|
+
from files_sdk.models.remote_server_credential import RemoteServerCredential
|
|
91
|
+
from files_sdk.models.request import Request
|
|
92
|
+
from files_sdk.models.restore import Restore
|
|
93
|
+
from files_sdk.models.scim_log import ScimLog
|
|
94
|
+
from files_sdk.models.session import Session
|
|
95
|
+
from files_sdk.models.settings_change import SettingsChange
|
|
96
|
+
from files_sdk.models.sftp_action_log import SftpActionLog
|
|
97
|
+
from files_sdk.models.sftp_host_key import SftpHostKey
|
|
98
|
+
from files_sdk.models.share_group import ShareGroup
|
|
99
|
+
from files_sdk.models.share_group_member import ShareGroupMember
|
|
100
|
+
from files_sdk.models.siem_http_destination import SiemHttpDestination
|
|
101
|
+
from files_sdk.models.site import Site
|
|
102
|
+
from files_sdk.models.snapshot import Snapshot
|
|
103
|
+
from files_sdk.models.sso_strategy import SsoStrategy
|
|
104
|
+
from files_sdk.models.status import Status
|
|
105
|
+
from files_sdk.models.style import Style
|
|
106
|
+
from files_sdk.models.sync import Sync
|
|
107
|
+
from files_sdk.models.sync_log import SyncLog
|
|
108
|
+
from files_sdk.models.sync_run import SyncRun
|
|
109
|
+
from files_sdk.models.usage_by_top_level_dir import UsageByTopLevelDir
|
|
110
|
+
from files_sdk.models.usage_daily_snapshot import UsageDailySnapshot
|
|
111
|
+
from files_sdk.models.usage_snapshot import UsageSnapshot
|
|
112
|
+
from files_sdk.models.user import User
|
|
113
|
+
from files_sdk.models.user_cipher_use import UserCipherUse
|
|
114
|
+
from files_sdk.models.user_lifecycle_rule import UserLifecycleRule
|
|
115
|
+
from files_sdk.models.user_request import UserRequest
|
|
116
|
+
from files_sdk.models.user_sftp_client_use import UserSftpClientUse
|
|
117
|
+
from files_sdk.models.web_dav_action_log import WebDavActionLog
|
|
118
|
+
from files_sdk.models.webhook_test import WebhookTest
|
|
119
|
+
from files_sdk.models.workspace import Workspace
|
|
@@ -0,0 +1,51 @@
|
|
|
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 AccountLineItem:
|
|
11
|
+
default_attributes = {
|
|
12
|
+
"id": None, # int64 - Line item Id
|
|
13
|
+
"amount": None, # double - Line item amount
|
|
14
|
+
"balance": None, # double - Line item balance
|
|
15
|
+
"created_at": None, # date-time - Line item created at
|
|
16
|
+
"currency": None, # string - Line item currency
|
|
17
|
+
"download_uri": None, # string - Line item download uri
|
|
18
|
+
"invoice_line_items": None, # array(object) - Associated invoice line items
|
|
19
|
+
"method": None, # string - Line item payment method
|
|
20
|
+
"payment_line_items": None, # array(object) - Associated payment line items
|
|
21
|
+
"payment_reversed_at": None, # date-time - Date/time payment was reversed if applicable
|
|
22
|
+
"payment_type": None, # string - Type of payment if applicable
|
|
23
|
+
"site_name": None, # string - Site name this line item is for
|
|
24
|
+
"type": None, # string - Type of line item, either payment or invoice
|
|
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 AccountLineItem.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 AccountLineItem.default_attributes
|
|
46
|
+
if getattr(self, k, None) is not None
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def new(*args, **kwargs):
|
|
51
|
+
return AccountLineItem(*args, **kwargs)
|
|
@@ -0,0 +1,49 @@
|
|
|
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 Action:
|
|
11
|
+
default_attributes = {
|
|
12
|
+
"id": None, # int64 - Action ID
|
|
13
|
+
"path": None, # string - Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
|
|
14
|
+
"when": None, # date-time - Action occurrence date/time
|
|
15
|
+
"destination": None, # string - The destination path for this action, if applicable
|
|
16
|
+
"display": None, # string - Friendly displayed output
|
|
17
|
+
"ip": None, # string - IP Address that performed this action
|
|
18
|
+
"source": None, # string - The source path for this action, if applicable
|
|
19
|
+
"targets": None, # object - Targets
|
|
20
|
+
"user_id": None, # int64 - User ID
|
|
21
|
+
"username": None, # string - Username
|
|
22
|
+
"user_is_from_parent_site": None, # boolean - true if this change was performed by a user on a parent site.
|
|
23
|
+
"action": None, # string - Type of action
|
|
24
|
+
"failure_type": None, # string - Failure type. If action was a user login or session failure, why did it fail?
|
|
25
|
+
"interface": None, # string - Interface on which this action occurred.
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
def __init__(self, attributes=None, options=None):
|
|
29
|
+
if not isinstance(attributes, dict):
|
|
30
|
+
attributes = {}
|
|
31
|
+
if not isinstance(options, dict):
|
|
32
|
+
options = {}
|
|
33
|
+
self.set_attributes(attributes)
|
|
34
|
+
self.options = options
|
|
35
|
+
|
|
36
|
+
def set_attributes(self, attributes):
|
|
37
|
+
for attribute, default_value in Action.default_attributes.items():
|
|
38
|
+
setattr(self, attribute, attributes.get(attribute, default_value))
|
|
39
|
+
|
|
40
|
+
def get_attributes(self):
|
|
41
|
+
return {
|
|
42
|
+
k: getattr(self, k, None)
|
|
43
|
+
for k in Action.default_attributes
|
|
44
|
+
if getattr(self, k, None) is not None
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def new(*args, **kwargs):
|
|
49
|
+
return Action(*args, **kwargs)
|
|
@@ -0,0 +1,153 @@
|
|
|
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 ActionNotificationExport:
|
|
11
|
+
default_attributes = {
|
|
12
|
+
"id": None, # int64 - History Export ID
|
|
13
|
+
"export_version": None, # string - Version of the underlying records for the export.
|
|
14
|
+
"start_at": None, # date-time - Start date/time of export range.
|
|
15
|
+
"end_at": None, # date-time - End date/time of export range.
|
|
16
|
+
"status": None, # string - Status of export. Valid values: `building`, `ready`, or `failed`
|
|
17
|
+
"query_path": None, # string - Return notifications that were triggered by actions on this specific path.
|
|
18
|
+
"query_folder": None, # string - Return notifications that were triggered by actions in this folder.
|
|
19
|
+
"query_message": None, # string - Error message associated with the request, if any.
|
|
20
|
+
"query_request_method": None, # string - The HTTP request method used by the webhook.
|
|
21
|
+
"query_request_url": None, # string - The target webhook URL.
|
|
22
|
+
"query_status": None, # string - The HTTP status returned from the server in response to the webhook request.
|
|
23
|
+
"query_success": None, # boolean - true if the webhook request succeeded (i.e. returned a 200 or 204 response status). false otherwise.
|
|
24
|
+
"results_url": None, # string - If `status` is `ready`, this will be a URL where all the results can be downloaded at once as a CSV.
|
|
25
|
+
"user_id": None, # int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
def __init__(self, attributes=None, options=None):
|
|
29
|
+
if not isinstance(attributes, dict):
|
|
30
|
+
attributes = {}
|
|
31
|
+
if not isinstance(options, dict):
|
|
32
|
+
options = {}
|
|
33
|
+
self.set_attributes(attributes)
|
|
34
|
+
self.options = options
|
|
35
|
+
|
|
36
|
+
def set_attributes(self, attributes):
|
|
37
|
+
for (
|
|
38
|
+
attribute,
|
|
39
|
+
default_value,
|
|
40
|
+
) in ActionNotificationExport.default_attributes.items():
|
|
41
|
+
setattr(self, attribute, attributes.get(attribute, default_value))
|
|
42
|
+
|
|
43
|
+
def get_attributes(self):
|
|
44
|
+
return {
|
|
45
|
+
k: getattr(self, k, None)
|
|
46
|
+
for k in ActionNotificationExport.default_attributes
|
|
47
|
+
if getattr(self, k, None) is not None
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
def save(self):
|
|
51
|
+
if hasattr(self, "id") and self.id:
|
|
52
|
+
raise NotImplementedError(
|
|
53
|
+
"The ActionNotificationExport object doesn't support updates."
|
|
54
|
+
)
|
|
55
|
+
else:
|
|
56
|
+
new_obj = create(self.get_attributes(), self.options)
|
|
57
|
+
self.set_attributes(new_obj.get_attributes())
|
|
58
|
+
return True
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
# Parameters:
|
|
62
|
+
# id (required) - int64 - Action Notification Export ID.
|
|
63
|
+
def find(id, params=None, options=None):
|
|
64
|
+
if not isinstance(params, dict):
|
|
65
|
+
params = {}
|
|
66
|
+
if not isinstance(options, dict):
|
|
67
|
+
options = {}
|
|
68
|
+
params["id"] = id
|
|
69
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
70
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
71
|
+
if "id" not in params:
|
|
72
|
+
raise MissingParameterError("Parameter missing: id")
|
|
73
|
+
response, options = Api.send_request(
|
|
74
|
+
"GET",
|
|
75
|
+
"/action_notification_exports/{id}".format(id=params["id"]),
|
|
76
|
+
params,
|
|
77
|
+
options,
|
|
78
|
+
)
|
|
79
|
+
return ActionNotificationExport(response.data, options)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def get(id, params=None, options=None):
|
|
83
|
+
find(id, params, options)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
# Parameters:
|
|
87
|
+
# user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
88
|
+
# start_at - string - Start date/time of export range.
|
|
89
|
+
# end_at - string - End date/time of export range.
|
|
90
|
+
# query_message - string - Error message associated with the request, if any.
|
|
91
|
+
# query_request_method - string - The HTTP request method used by the webhook.
|
|
92
|
+
# query_request_url - string - The target webhook URL.
|
|
93
|
+
# query_status - string - The HTTP status returned from the server in response to the webhook request.
|
|
94
|
+
# query_success - boolean - true if the webhook request succeeded (i.e. returned a 200 or 204 response status). false otherwise.
|
|
95
|
+
# query_path - string - Return notifications that were triggered by actions on this specific path.
|
|
96
|
+
# query_folder - string - Return notifications that were triggered by actions in this folder.
|
|
97
|
+
def create(params=None, options=None):
|
|
98
|
+
if not isinstance(params, dict):
|
|
99
|
+
params = {}
|
|
100
|
+
if not isinstance(options, dict):
|
|
101
|
+
options = {}
|
|
102
|
+
if "user_id" in params and not isinstance(params["user_id"], int):
|
|
103
|
+
raise InvalidParameterError("Bad parameter: user_id must be an int")
|
|
104
|
+
if "start_at" in params and not isinstance(params["start_at"], str):
|
|
105
|
+
raise InvalidParameterError("Bad parameter: start_at must be an str")
|
|
106
|
+
if "end_at" in params and not isinstance(params["end_at"], str):
|
|
107
|
+
raise InvalidParameterError("Bad parameter: end_at must be an str")
|
|
108
|
+
if "query_message" in params and not isinstance(
|
|
109
|
+
params["query_message"], str
|
|
110
|
+
):
|
|
111
|
+
raise InvalidParameterError(
|
|
112
|
+
"Bad parameter: query_message must be an str"
|
|
113
|
+
)
|
|
114
|
+
if "query_request_method" in params and not isinstance(
|
|
115
|
+
params["query_request_method"], str
|
|
116
|
+
):
|
|
117
|
+
raise InvalidParameterError(
|
|
118
|
+
"Bad parameter: query_request_method must be an str"
|
|
119
|
+
)
|
|
120
|
+
if "query_request_url" in params and not isinstance(
|
|
121
|
+
params["query_request_url"], str
|
|
122
|
+
):
|
|
123
|
+
raise InvalidParameterError(
|
|
124
|
+
"Bad parameter: query_request_url must be an str"
|
|
125
|
+
)
|
|
126
|
+
if "query_status" in params and not isinstance(
|
|
127
|
+
params["query_status"], str
|
|
128
|
+
):
|
|
129
|
+
raise InvalidParameterError(
|
|
130
|
+
"Bad parameter: query_status must be an str"
|
|
131
|
+
)
|
|
132
|
+
if "query_success" in params and not isinstance(
|
|
133
|
+
params["query_success"], bool
|
|
134
|
+
):
|
|
135
|
+
raise InvalidParameterError(
|
|
136
|
+
"Bad parameter: query_success must be an bool"
|
|
137
|
+
)
|
|
138
|
+
if "query_path" in params and not isinstance(params["query_path"], str):
|
|
139
|
+
raise InvalidParameterError("Bad parameter: query_path must be an str")
|
|
140
|
+
if "query_folder" in params and not isinstance(
|
|
141
|
+
params["query_folder"], str
|
|
142
|
+
):
|
|
143
|
+
raise InvalidParameterError(
|
|
144
|
+
"Bad parameter: query_folder must be an str"
|
|
145
|
+
)
|
|
146
|
+
response, options = Api.send_request(
|
|
147
|
+
"POST", "/action_notification_exports", params, options
|
|
148
|
+
)
|
|
149
|
+
return ActionNotificationExport(response.data, options)
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
def new(*args, **kwargs):
|
|
153
|
+
return ActionNotificationExport(*args, **kwargs)
|
|
@@ -0,0 +1,88 @@
|
|
|
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 ActionNotificationExportResult:
|
|
12
|
+
default_attributes = {
|
|
13
|
+
"id": None, # int64 - Notification ID
|
|
14
|
+
"created_at": None, # int64 - When the notification was sent.
|
|
15
|
+
"status": None, # int64 - HTTP status code returned in the webhook response.
|
|
16
|
+
"message": None, # string - A message indicating the overall status of the webhook notification.
|
|
17
|
+
"success": None, # boolean - `true` if the webhook succeeded by receiving a 200 or 204 response.
|
|
18
|
+
"request_headers": None, # string - A JSON-encoded string with headers that were sent with the webhook.
|
|
19
|
+
"request_method": None, # string - The HTTP verb used to perform the webhook.
|
|
20
|
+
"request_url": None, # string - The webhook request URL.
|
|
21
|
+
"path": None, # string - The path to the actual file that triggered this notification. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
|
|
22
|
+
"folder": None, # string - The folder associated with the triggering action for this notification.
|
|
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 (
|
|
35
|
+
attribute,
|
|
36
|
+
default_value,
|
|
37
|
+
) in ActionNotificationExportResult.default_attributes.items():
|
|
38
|
+
setattr(self, attribute, attributes.get(attribute, default_value))
|
|
39
|
+
|
|
40
|
+
def get_attributes(self):
|
|
41
|
+
return {
|
|
42
|
+
k: getattr(self, k, None)
|
|
43
|
+
for k in ActionNotificationExportResult.default_attributes
|
|
44
|
+
if getattr(self, k, None) is not None
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
# Parameters:
|
|
49
|
+
# user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
50
|
+
# 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.
|
|
51
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
52
|
+
# action_notification_export_id (required) - int64 - ID of the associated action notification export.
|
|
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 "user_id" in params and not isinstance(params["user_id"], int):
|
|
59
|
+
raise InvalidParameterError("Bad parameter: user_id must be an int")
|
|
60
|
+
if "cursor" in params and not isinstance(params["cursor"], str):
|
|
61
|
+
raise InvalidParameterError("Bad parameter: cursor must be an str")
|
|
62
|
+
if "per_page" in params and not isinstance(params["per_page"], int):
|
|
63
|
+
raise InvalidParameterError("Bad parameter: per_page must be an int")
|
|
64
|
+
if "action_notification_export_id" in params and not isinstance(
|
|
65
|
+
params["action_notification_export_id"], int
|
|
66
|
+
):
|
|
67
|
+
raise InvalidParameterError(
|
|
68
|
+
"Bad parameter: action_notification_export_id must be an int"
|
|
69
|
+
)
|
|
70
|
+
if "action_notification_export_id" not in params:
|
|
71
|
+
raise MissingParameterError(
|
|
72
|
+
"Parameter missing: action_notification_export_id"
|
|
73
|
+
)
|
|
74
|
+
return ListObj(
|
|
75
|
+
ActionNotificationExportResult,
|
|
76
|
+
"GET",
|
|
77
|
+
"/action_notification_export_results",
|
|
78
|
+
params,
|
|
79
|
+
options,
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def all(params=None, options=None):
|
|
84
|
+
list(params, options)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def new(*args, **kwargs):
|
|
88
|
+
return ActionNotificationExportResult(*args, **kwargs)
|
|
@@ -0,0 +1,44 @@
|
|
|
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 AgentPushUpdate:
|
|
11
|
+
default_attributes = {
|
|
12
|
+
"version": None, # string - Pushed agent version
|
|
13
|
+
"message": None, # string - Update accepted or reason
|
|
14
|
+
"current_version": None, # string - Installed agent version
|
|
15
|
+
"pending_version": None, # string - Pending agent version or null
|
|
16
|
+
"last_error": None, # string - Last error message or null
|
|
17
|
+
"error": None, # string - Error code
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
def __init__(self, attributes=None, options=None):
|
|
21
|
+
if not isinstance(attributes, dict):
|
|
22
|
+
attributes = {}
|
|
23
|
+
if not isinstance(options, dict):
|
|
24
|
+
options = {}
|
|
25
|
+
self.set_attributes(attributes)
|
|
26
|
+
self.options = options
|
|
27
|
+
|
|
28
|
+
def set_attributes(self, attributes):
|
|
29
|
+
for (
|
|
30
|
+
attribute,
|
|
31
|
+
default_value,
|
|
32
|
+
) in AgentPushUpdate.default_attributes.items():
|
|
33
|
+
setattr(self, attribute, attributes.get(attribute, default_value))
|
|
34
|
+
|
|
35
|
+
def get_attributes(self):
|
|
36
|
+
return {
|
|
37
|
+
k: getattr(self, k, None)
|
|
38
|
+
for k in AgentPushUpdate.default_attributes
|
|
39
|
+
if getattr(self, k, None) is not None
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def new(*args, **kwargs):
|
|
44
|
+
return AgentPushUpdate(*args, **kwargs)
|