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.

Files changed (113) hide show
  1. README.md +682 -0
  2. _VERSION +1 -0
  3. files_com-1.5.0.dist-info/METADATA +694 -0
  4. files_com-1.5.0.dist-info/RECORD +113 -0
  5. files_com-1.5.0.dist-info/WHEEL +5 -0
  6. files_com-1.5.0.dist-info/licenses/LICENSE +21 -0
  7. files_com-1.5.0.dist-info/top_level.txt +1 -0
  8. files_sdk/__init__.py +270 -0
  9. files_sdk/api.py +57 -0
  10. files_sdk/api_client.py +327 -0
  11. files_sdk/error.py +2891 -0
  12. files_sdk/list_obj.py +42 -0
  13. files_sdk/models/__init__.py +104 -0
  14. files_sdk/models/account_line_item.py +51 -0
  15. files_sdk/models/action.py +49 -0
  16. files_sdk/models/action_notification_export.py +147 -0
  17. files_sdk/models/action_notification_export_result.py +88 -0
  18. files_sdk/models/api_key.py +322 -0
  19. files_sdk/models/api_request_log.py +87 -0
  20. files_sdk/models/app.py +89 -0
  21. files_sdk/models/as2_incoming_message.py +123 -0
  22. files_sdk/models/as2_outgoing_message.py +119 -0
  23. files_sdk/models/as2_partner.py +374 -0
  24. files_sdk/models/as2_station.py +271 -0
  25. files_sdk/models/auto.py +36 -0
  26. files_sdk/models/automation.py +691 -0
  27. files_sdk/models/automation_log.py +77 -0
  28. files_sdk/models/automation_run.py +108 -0
  29. files_sdk/models/bandwidth_snapshot.py +91 -0
  30. files_sdk/models/behavior.py +334 -0
  31. files_sdk/models/bundle.py +550 -0
  32. files_sdk/models/bundle_action.py +86 -0
  33. files_sdk/models/bundle_download.py +94 -0
  34. files_sdk/models/bundle_notification.py +217 -0
  35. files_sdk/models/bundle_path.py +37 -0
  36. files_sdk/models/bundle_recipient.py +120 -0
  37. files_sdk/models/bundle_registration.py +79 -0
  38. files_sdk/models/clickwrap.py +268 -0
  39. files_sdk/models/dns_record.py +59 -0
  40. files_sdk/models/email_incoming_message.py +102 -0
  41. files_sdk/models/email_log.py +74 -0
  42. files_sdk/models/errors.py +37 -0
  43. files_sdk/models/exavault_api_request_log.py +85 -0
  44. files_sdk/models/external_event.py +148 -0
  45. files_sdk/models/file.py +791 -0
  46. files_sdk/models/file_action.py +39 -0
  47. files_sdk/models/file_comment.py +191 -0
  48. files_sdk/models/file_comment_reaction.py +125 -0
  49. files_sdk/models/file_migration.py +69 -0
  50. files_sdk/models/file_migration_log.py +78 -0
  51. files_sdk/models/file_upload_part.py +54 -0
  52. files_sdk/models/folder.py +154 -0
  53. files_sdk/models/form_field.py +43 -0
  54. files_sdk/models/form_field_set.py +240 -0
  55. files_sdk/models/ftp_action_log.py +87 -0
  56. files_sdk/models/gpg_key.py +254 -0
  57. files_sdk/models/group.py +276 -0
  58. files_sdk/models/group_user.py +231 -0
  59. files_sdk/models/history.py +236 -0
  60. files_sdk/models/history_export.py +238 -0
  61. files_sdk/models/history_export_result.py +98 -0
  62. files_sdk/models/image.py +37 -0
  63. files_sdk/models/inbox_recipient.py +118 -0
  64. files_sdk/models/inbox_registration.py +79 -0
  65. files_sdk/models/inbox_upload.py +80 -0
  66. files_sdk/models/invoice.py +91 -0
  67. files_sdk/models/invoice_line_item.py +46 -0
  68. files_sdk/models/ip_address.py +119 -0
  69. files_sdk/models/lock.py +158 -0
  70. files_sdk/models/message.py +244 -0
  71. files_sdk/models/message_comment.py +223 -0
  72. files_sdk/models/message_comment_reaction.py +181 -0
  73. files_sdk/models/message_reaction.py +170 -0
  74. files_sdk/models/notification.py +357 -0
  75. files_sdk/models/outbound_connection_log.py +88 -0
  76. files_sdk/models/payment.py +91 -0
  77. files_sdk/models/payment_line_item.py +42 -0
  78. files_sdk/models/permission.py +174 -0
  79. files_sdk/models/preview.py +40 -0
  80. files_sdk/models/priority.py +63 -0
  81. files_sdk/models/project.py +205 -0
  82. files_sdk/models/public_hosting_request_log.py +82 -0
  83. files_sdk/models/public_ip_address.py +42 -0
  84. files_sdk/models/public_key.py +212 -0
  85. files_sdk/models/remote_bandwidth_snapshot.py +91 -0
  86. files_sdk/models/remote_server.py +1677 -0
  87. files_sdk/models/remote_server_configuration_file.py +72 -0
  88. files_sdk/models/request.py +180 -0
  89. files_sdk/models/restore.py +104 -0
  90. files_sdk/models/session.py +100 -0
  91. files_sdk/models/settings_change.py +71 -0
  92. files_sdk/models/sftp_action_log.py +91 -0
  93. files_sdk/models/sftp_host_key.py +215 -0
  94. files_sdk/models/share_group.py +228 -0
  95. files_sdk/models/share_group_member.py +41 -0
  96. files_sdk/models/siem_http_destination.py +773 -0
  97. files_sdk/models/site.py +767 -0
  98. files_sdk/models/snapshot.py +255 -0
  99. files_sdk/models/sso_strategy.py +167 -0
  100. files_sdk/models/status.py +42 -0
  101. files_sdk/models/style.py +152 -0
  102. files_sdk/models/sync_log.py +75 -0
  103. files_sdk/models/usage_by_top_level_dir.py +41 -0
  104. files_sdk/models/usage_daily_snapshot.py +93 -0
  105. files_sdk/models/usage_snapshot.py +73 -0
  106. files_sdk/models/user.py +893 -0
  107. files_sdk/models/user_cipher_use.py +68 -0
  108. files_sdk/models/user_request.py +166 -0
  109. files_sdk/models/user_sftp_client_use.py +68 -0
  110. files_sdk/models/web_dav_action_log.py +87 -0
  111. files_sdk/models/webhook_test.py +104 -0
  112. files_sdk/path_util.py +42 -0
  113. files_sdk/util.py +34 -0
@@ -0,0 +1,94 @@
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 BundleDownload:
12
+ default_attributes = {
13
+ "bundle_registration": None, # BundleRegistration
14
+ "download_method": None, # string - Download method (file or full_zip)
15
+ "path": None, # string - Download path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
16
+ "created_at": None, # date-time - Download date/time
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 (
29
+ attribute,
30
+ default_value,
31
+ ) in BundleDownload.default_attributes.items():
32
+ setattr(self, attribute, attributes.get(attribute, default_value))
33
+
34
+ def get_attributes(self):
35
+ return {
36
+ k: getattr(self, k, None)
37
+ for k in BundleDownload.default_attributes
38
+ if getattr(self, k, None) is not None
39
+ }
40
+
41
+
42
+ # Parameters:
43
+ # 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.
44
+ # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
45
+ # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`.
46
+ # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`.
47
+ # filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`.
48
+ # filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`.
49
+ # filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`.
50
+ # filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`.
51
+ # bundle_id - int64 - Bundle ID
52
+ # bundle_registration_id - int64 - BundleRegistration ID
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 "sort_by" in params and not isinstance(params["sort_by"], dict):
63
+ raise InvalidParameterError("Bad parameter: sort_by must be an dict")
64
+ if "filter" in params and not isinstance(params["filter"], dict):
65
+ raise InvalidParameterError("Bad parameter: filter must be an dict")
66
+ if "filter_gt" in params and not isinstance(params["filter_gt"], dict):
67
+ raise InvalidParameterError("Bad parameter: filter_gt must be an dict")
68
+ if "filter_gteq" in params and not isinstance(params["filter_gteq"], dict):
69
+ raise InvalidParameterError(
70
+ "Bad parameter: filter_gteq must be an dict"
71
+ )
72
+ if "filter_lt" in params and not isinstance(params["filter_lt"], dict):
73
+ raise InvalidParameterError("Bad parameter: filter_lt must be an dict")
74
+ if "filter_lteq" in params and not isinstance(params["filter_lteq"], dict):
75
+ raise InvalidParameterError(
76
+ "Bad parameter: filter_lteq must be an dict"
77
+ )
78
+ if "bundle_id" in params and not isinstance(params["bundle_id"], int):
79
+ raise InvalidParameterError("Bad parameter: bundle_id must be an int")
80
+ if "bundle_registration_id" in params and not isinstance(
81
+ params["bundle_registration_id"], int
82
+ ):
83
+ raise InvalidParameterError(
84
+ "Bad parameter: bundle_registration_id must be an int"
85
+ )
86
+ return ListObj(BundleDownload, "GET", "/bundle_downloads", params, options)
87
+
88
+
89
+ def all(params=None, options=None):
90
+ list(params, options)
91
+
92
+
93
+ def new(*args, **kwargs):
94
+ return BundleDownload(*args, **kwargs)
@@ -0,0 +1,217 @@
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 BundleNotification:
12
+ default_attributes = {
13
+ "bundle_id": None, # int64 - Bundle ID to notify on
14
+ "id": None, # int64 - Bundle Notification ID
15
+ "notify_on_registration": None, # boolean - Triggers bundle notification when a registration action occurs for it.
16
+ "notify_on_upload": None, # boolean - Triggers bundle notification when a upload action occurs for it.
17
+ "user_id": None, # int64 - The id of the user to notify.
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 BundleNotification.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 BundleNotification.default_attributes
39
+ if getattr(self, k, None) is not None
40
+ }
41
+
42
+ # Parameters:
43
+ # notify_on_registration - boolean - Triggers bundle notification when a registration action occurs for it.
44
+ # notify_on_upload - boolean - Triggers bundle notification when a upload action occurs for it.
45
+ def update(self, params=None):
46
+ if not isinstance(params, dict):
47
+ params = {}
48
+
49
+ if hasattr(self, "id") and self.id:
50
+ params["id"] = self.id
51
+ else:
52
+ raise MissingParameterError("Current object doesn't have a id")
53
+ if "id" not in params:
54
+ raise MissingParameterError("Parameter missing: id")
55
+ if "id" in params and not isinstance(params["id"], int):
56
+ raise InvalidParameterError("Bad parameter: id must be an int")
57
+ response, _options = Api.send_request(
58
+ "PATCH",
59
+ "/bundle_notifications/{id}".format(id=params["id"]),
60
+ params,
61
+ self.options,
62
+ )
63
+ return response.data
64
+
65
+ def delete(self, params=None):
66
+ if not isinstance(params, dict):
67
+ params = {}
68
+
69
+ if hasattr(self, "id") and self.id:
70
+ params["id"] = self.id
71
+ else:
72
+ raise MissingParameterError("Current object doesn't have a id")
73
+ if "id" not in params:
74
+ raise MissingParameterError("Parameter missing: id")
75
+ if "id" in params and not isinstance(params["id"], int):
76
+ raise InvalidParameterError("Bad parameter: id must be an int")
77
+ Api.send_request(
78
+ "DELETE",
79
+ "/bundle_notifications/{id}".format(id=params["id"]),
80
+ params,
81
+ self.options,
82
+ )
83
+
84
+ def destroy(self, params=None):
85
+ self.delete(params)
86
+
87
+ def save(self):
88
+ if hasattr(self, "id") and self.id:
89
+ new_obj = self.update(self.get_attributes())
90
+ self.set_attributes(new_obj.get_attributes())
91
+ return True
92
+ else:
93
+ new_obj = create(self.get_attributes(), self.options)
94
+ self.set_attributes(new_obj.get_attributes())
95
+ return True
96
+
97
+
98
+ # Parameters:
99
+ # 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.
100
+ # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
101
+ # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `bundle_id`.
102
+ # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `bundle_id`.
103
+ def list(params=None, options=None):
104
+ if not isinstance(params, dict):
105
+ params = {}
106
+ if not isinstance(options, dict):
107
+ options = {}
108
+ if "cursor" in params and not isinstance(params["cursor"], str):
109
+ raise InvalidParameterError("Bad parameter: cursor must be an str")
110
+ if "per_page" in params and not isinstance(params["per_page"], int):
111
+ raise InvalidParameterError("Bad parameter: per_page must be an int")
112
+ if "sort_by" in params and not isinstance(params["sort_by"], dict):
113
+ raise InvalidParameterError("Bad parameter: sort_by must be an dict")
114
+ if "filter" in params and not isinstance(params["filter"], dict):
115
+ raise InvalidParameterError("Bad parameter: filter must be an dict")
116
+ return ListObj(
117
+ BundleNotification, "GET", "/bundle_notifications", params, options
118
+ )
119
+
120
+
121
+ def all(params=None, options=None):
122
+ list(params, options)
123
+
124
+
125
+ # Parameters:
126
+ # id (required) - int64 - Bundle Notification ID.
127
+ def find(id, params=None, options=None):
128
+ if not isinstance(params, dict):
129
+ params = {}
130
+ if not isinstance(options, dict):
131
+ options = {}
132
+ params["id"] = id
133
+ if "id" in params and not isinstance(params["id"], int):
134
+ raise InvalidParameterError("Bad parameter: id must be an int")
135
+ if "id" not in params:
136
+ raise MissingParameterError("Parameter missing: id")
137
+ response, options = Api.send_request(
138
+ "GET",
139
+ "/bundle_notifications/{id}".format(id=params["id"]),
140
+ params,
141
+ options,
142
+ )
143
+ return BundleNotification(response.data, options)
144
+
145
+
146
+ def get(id, params=None, options=None):
147
+ find(id, params, options)
148
+
149
+
150
+ # Parameters:
151
+ # bundle_id (required) - int64 - Bundle ID to notify on
152
+ # user_id - int64 - The id of the user to notify.
153
+ # notify_on_registration - boolean - Triggers bundle notification when a registration action occurs for it.
154
+ # notify_on_upload - boolean - Triggers bundle notification when a upload action occurs for it.
155
+ def create(params=None, options=None):
156
+ if not isinstance(params, dict):
157
+ params = {}
158
+ if not isinstance(options, dict):
159
+ options = {}
160
+ if "bundle_id" in params and not isinstance(params["bundle_id"], int):
161
+ raise InvalidParameterError("Bad parameter: bundle_id must be an int")
162
+ if "user_id" in params and not isinstance(params["user_id"], int):
163
+ raise InvalidParameterError("Bad parameter: user_id must be an int")
164
+ if "bundle_id" not in params:
165
+ raise MissingParameterError("Parameter missing: bundle_id")
166
+ response, options = Api.send_request(
167
+ "POST", "/bundle_notifications", params, options
168
+ )
169
+ return BundleNotification(response.data, options)
170
+
171
+
172
+ # Parameters:
173
+ # notify_on_registration - boolean - Triggers bundle notification when a registration action occurs for it.
174
+ # notify_on_upload - boolean - Triggers bundle notification when a upload action occurs for it.
175
+ def update(id, params=None, options=None):
176
+ if not isinstance(params, dict):
177
+ params = {}
178
+ if not isinstance(options, dict):
179
+ options = {}
180
+ params["id"] = id
181
+ if "id" in params and not isinstance(params["id"], int):
182
+ raise InvalidParameterError("Bad parameter: id must be an int")
183
+ if "id" not in params:
184
+ raise MissingParameterError("Parameter missing: id")
185
+ response, options = Api.send_request(
186
+ "PATCH",
187
+ "/bundle_notifications/{id}".format(id=params["id"]),
188
+ params,
189
+ options,
190
+ )
191
+ return BundleNotification(response.data, options)
192
+
193
+
194
+ def delete(id, params=None, options=None):
195
+ if not isinstance(params, dict):
196
+ params = {}
197
+ if not isinstance(options, dict):
198
+ options = {}
199
+ params["id"] = id
200
+ if "id" in params and not isinstance(params["id"], int):
201
+ raise InvalidParameterError("Bad parameter: id must be an int")
202
+ if "id" not in params:
203
+ raise MissingParameterError("Parameter missing: id")
204
+ Api.send_request(
205
+ "DELETE",
206
+ "/bundle_notifications/{id}".format(id=params["id"]),
207
+ params,
208
+ options,
209
+ )
210
+
211
+
212
+ def destroy(id, params=None, options=None):
213
+ delete(id, params, options)
214
+
215
+
216
+ def new(*args, **kwargs):
217
+ return BundleNotification(*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 BundlePath:
11
+ default_attributes = {
12
+ "recursive": None, # boolean - Allow access to subfolders content?
13
+ "path": None, # string - The path to the resource relative to filesystem. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
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 BundlePath.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 BundlePath.default_attributes
32
+ if getattr(self, k, None) is not None
33
+ }
34
+
35
+
36
+ def new(*args, **kwargs):
37
+ return BundlePath(*args, **kwargs)
@@ -0,0 +1,120 @@
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 BundleRecipient:
12
+ default_attributes = {
13
+ "company": None, # string - The recipient's company.
14
+ "name": None, # string - The recipient's name.
15
+ "note": None, # string - A note sent to the recipient with the bundle.
16
+ "recipient": None, # string - The recipient's email address.
17
+ "sent_at": None, # date-time - When the Bundle was shared with this recipient.
18
+ "bundle_id": None, # int64 - Bundle to share.
19
+ "share_after_create": None, # boolean - Set to true to share the link with the recipient upon creation.
20
+ }
21
+
22
+ def __init__(self, attributes=None, options=None):
23
+ if not isinstance(attributes, dict):
24
+ attributes = {}
25
+ if not isinstance(options, dict):
26
+ options = {}
27
+ self.set_attributes(attributes)
28
+ self.options = options
29
+
30
+ def set_attributes(self, attributes):
31
+ for (
32
+ attribute,
33
+ default_value,
34
+ ) in BundleRecipient.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 BundleRecipient.default_attributes
41
+ if getattr(self, k, None) is not None
42
+ }
43
+
44
+ def save(self):
45
+ if hasattr(self, "id") and self.id:
46
+ raise NotImplementedError(
47
+ "The BundleRecipient object doesn't support updates."
48
+ )
49
+ else:
50
+ new_obj = create(self.get_attributes(), self.options)
51
+ self.set_attributes(new_obj.get_attributes())
52
+ return True
53
+
54
+
55
+ # Parameters:
56
+ # 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.
57
+ # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
58
+ # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are .
59
+ # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `has_registrations`.
60
+ # bundle_id (required) - int64 - List recipients for the bundle with this ID.
61
+ def list(params=None, options=None):
62
+ if not isinstance(params, dict):
63
+ params = {}
64
+ if not isinstance(options, dict):
65
+ options = {}
66
+ if "cursor" in params and not isinstance(params["cursor"], str):
67
+ raise InvalidParameterError("Bad parameter: cursor must be an str")
68
+ if "per_page" in params and not isinstance(params["per_page"], int):
69
+ raise InvalidParameterError("Bad parameter: per_page must be an int")
70
+ if "sort_by" in params and not isinstance(params["sort_by"], dict):
71
+ raise InvalidParameterError("Bad parameter: sort_by must be an dict")
72
+ if "filter" in params and not isinstance(params["filter"], dict):
73
+ raise InvalidParameterError("Bad parameter: filter must be an dict")
74
+ if "bundle_id" in params and not isinstance(params["bundle_id"], int):
75
+ raise InvalidParameterError("Bad parameter: bundle_id must be an int")
76
+ if "bundle_id" not in params:
77
+ raise MissingParameterError("Parameter missing: bundle_id")
78
+ return ListObj(
79
+ BundleRecipient, "GET", "/bundle_recipients", params, options
80
+ )
81
+
82
+
83
+ def all(params=None, options=None):
84
+ list(params, options)
85
+
86
+
87
+ # Parameters:
88
+ # bundle_id (required) - int64 - Bundle to share.
89
+ # recipient (required) - string - Email addresses to share this bundle with.
90
+ # name - string - Name of recipient.
91
+ # company - string - Company of recipient.
92
+ # note - string - Note to include in email.
93
+ # share_after_create - boolean - Set to true to share the link with the recipient upon creation.
94
+ def create(params=None, options=None):
95
+ if not isinstance(params, dict):
96
+ params = {}
97
+ if not isinstance(options, dict):
98
+ options = {}
99
+ if "bundle_id" in params and not isinstance(params["bundle_id"], int):
100
+ raise InvalidParameterError("Bad parameter: bundle_id must be an int")
101
+ if "recipient" in params and not isinstance(params["recipient"], str):
102
+ raise InvalidParameterError("Bad parameter: recipient must be an str")
103
+ if "name" in params and not isinstance(params["name"], str):
104
+ raise InvalidParameterError("Bad parameter: name must be an str")
105
+ if "company" in params and not isinstance(params["company"], str):
106
+ raise InvalidParameterError("Bad parameter: company must be an str")
107
+ if "note" in params and not isinstance(params["note"], str):
108
+ raise InvalidParameterError("Bad parameter: note must be an str")
109
+ if "bundle_id" not in params:
110
+ raise MissingParameterError("Parameter missing: bundle_id")
111
+ if "recipient" not in params:
112
+ raise MissingParameterError("Parameter missing: recipient")
113
+ response, options = Api.send_request(
114
+ "POST", "/bundle_recipients", params, options
115
+ )
116
+ return BundleRecipient(response.data, options)
117
+
118
+
119
+ def new(*args, **kwargs):
120
+ return BundleRecipient(*args, **kwargs)
@@ -0,0 +1,79 @@
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 BundleRegistration:
12
+ default_attributes = {
13
+ "code": None, # string - Registration cookie code
14
+ "name": None, # string - Registrant name
15
+ "company": None, # string - Registrant company name
16
+ "email": None, # string - Registrant email address
17
+ "ip": None, # string - Registrant IP Address
18
+ "inbox_code": None, # string - InboxRegistration cookie code, if there is an associated InboxRegistration
19
+ "clickwrap_body": None, # string - Clickwrap text that was shown to the registrant
20
+ "form_field_set_id": None, # int64 - Id of associated form field set
21
+ "form_field_data": None, # object - Data for form field set with form field ids as keys and user data as values
22
+ "bundle_code": None, # string - Bundle URL code
23
+ "bundle_id": None, # int64 - Id of associated bundle
24
+ "bundle_recipient_id": None, # int64 - Id of associated bundle recipient
25
+ "created_at": None, # date-time - Registration creation date/time
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 BundleRegistration.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 BundleRegistration.default_attributes
47
+ if getattr(self, k, None) is not None
48
+ }
49
+
50
+
51
+ # Parameters:
52
+ # 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.
53
+ # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
54
+ # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `bundle_id`.
55
+ # bundle_id - int64 - ID of the associated Bundle
56
+ def list(params=None, options=None):
57
+ if not isinstance(params, dict):
58
+ params = {}
59
+ if not isinstance(options, dict):
60
+ options = {}
61
+ if "cursor" in params and not isinstance(params["cursor"], str):
62
+ raise InvalidParameterError("Bad parameter: cursor must be an str")
63
+ if "per_page" in params and not isinstance(params["per_page"], int):
64
+ raise InvalidParameterError("Bad parameter: per_page must be an int")
65
+ if "sort_by" in params and not isinstance(params["sort_by"], dict):
66
+ raise InvalidParameterError("Bad parameter: sort_by must be an dict")
67
+ if "bundle_id" in params and not isinstance(params["bundle_id"], int):
68
+ raise InvalidParameterError("Bad parameter: bundle_id must be an int")
69
+ return ListObj(
70
+ BundleRegistration, "GET", "/bundle_registrations", params, options
71
+ )
72
+
73
+
74
+ def all(params=None, options=None):
75
+ list(params, options)
76
+
77
+
78
+ def new(*args, **kwargs):
79
+ return BundleRegistration(*args, **kwargs)