binalyze-air-sdk 1.0.2__py3-none-any.whl → 1.0.3__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.
Files changed (142) hide show
  1. binalyze_air/__init__.py +77 -77
  2. binalyze_air/apis/__init__.py +67 -27
  3. binalyze_air/apis/acquisitions.py +107 -0
  4. binalyze_air/apis/api_tokens.py +49 -0
  5. binalyze_air/apis/assets.py +161 -0
  6. binalyze_air/apis/audit_logs.py +26 -0
  7. binalyze_air/apis/{authentication.py → auth.py} +29 -27
  8. binalyze_air/apis/auto_asset_tags.py +79 -75
  9. binalyze_air/apis/backup.py +177 -0
  10. binalyze_air/apis/baseline.py +46 -0
  11. binalyze_air/apis/cases.py +225 -0
  12. binalyze_air/apis/cloud_forensics.py +116 -0
  13. binalyze_air/apis/event_subscription.py +96 -96
  14. binalyze_air/apis/evidence.py +249 -53
  15. binalyze_air/apis/interact.py +153 -36
  16. binalyze_air/apis/investigation_hub.py +234 -0
  17. binalyze_air/apis/license.py +104 -0
  18. binalyze_air/apis/logger.py +83 -0
  19. binalyze_air/apis/multipart_upload.py +201 -0
  20. binalyze_air/apis/notifications.py +115 -0
  21. binalyze_air/apis/organizations.py +267 -0
  22. binalyze_air/apis/params.py +44 -39
  23. binalyze_air/apis/policies.py +186 -0
  24. binalyze_air/apis/preset_filters.py +79 -0
  25. binalyze_air/apis/recent_activities.py +71 -0
  26. binalyze_air/apis/relay_server.py +104 -0
  27. binalyze_air/apis/settings.py +395 -27
  28. binalyze_air/apis/tasks.py +80 -0
  29. binalyze_air/apis/triage.py +197 -0
  30. binalyze_air/apis/user_management.py +183 -74
  31. binalyze_air/apis/webhook_executions.py +50 -0
  32. binalyze_air/apis/webhooks.py +322 -230
  33. binalyze_air/base.py +207 -133
  34. binalyze_air/client.py +217 -1337
  35. binalyze_air/commands/__init__.py +175 -145
  36. binalyze_air/commands/acquisitions.py +661 -387
  37. binalyze_air/commands/api_tokens.py +55 -0
  38. binalyze_air/commands/assets.py +324 -362
  39. binalyze_air/commands/{authentication.py → auth.py} +36 -36
  40. binalyze_air/commands/auto_asset_tags.py +230 -230
  41. binalyze_air/commands/backup.py +47 -0
  42. binalyze_air/commands/baseline.py +32 -396
  43. binalyze_air/commands/cases.py +609 -602
  44. binalyze_air/commands/cloud_forensics.py +88 -0
  45. binalyze_air/commands/event_subscription.py +101 -101
  46. binalyze_air/commands/evidences.py +918 -988
  47. binalyze_air/commands/interact.py +172 -58
  48. binalyze_air/commands/investigation_hub.py +315 -0
  49. binalyze_air/commands/license.py +183 -0
  50. binalyze_air/commands/logger.py +126 -0
  51. binalyze_air/commands/multipart_upload.py +363 -0
  52. binalyze_air/commands/notifications.py +45 -0
  53. binalyze_air/commands/organizations.py +200 -221
  54. binalyze_air/commands/policies.py +175 -203
  55. binalyze_air/commands/preset_filters.py +55 -0
  56. binalyze_air/commands/recent_activities.py +32 -0
  57. binalyze_air/commands/relay_server.py +144 -0
  58. binalyze_air/commands/settings.py +431 -29
  59. binalyze_air/commands/tasks.py +95 -56
  60. binalyze_air/commands/triage.py +224 -360
  61. binalyze_air/commands/user_management.py +351 -126
  62. binalyze_air/commands/webhook_executions.py +77 -0
  63. binalyze_air/config.py +244 -244
  64. binalyze_air/exceptions.py +49 -49
  65. binalyze_air/http_client.py +426 -305
  66. binalyze_air/models/__init__.py +287 -285
  67. binalyze_air/models/acquisitions.py +365 -250
  68. binalyze_air/models/api_tokens.py +73 -0
  69. binalyze_air/models/assets.py +438 -438
  70. binalyze_air/models/audit.py +247 -272
  71. binalyze_air/models/audit_logs.py +14 -0
  72. binalyze_air/models/{authentication.py → auth.py} +69 -69
  73. binalyze_air/models/auto_asset_tags.py +227 -116
  74. binalyze_air/models/backup.py +138 -0
  75. binalyze_air/models/baseline.py +231 -231
  76. binalyze_air/models/cases.py +275 -275
  77. binalyze_air/models/cloud_forensics.py +145 -0
  78. binalyze_air/models/event_subscription.py +170 -171
  79. binalyze_air/models/evidence.py +65 -65
  80. binalyze_air/models/evidences.py +367 -348
  81. binalyze_air/models/interact.py +266 -135
  82. binalyze_air/models/investigation_hub.py +265 -0
  83. binalyze_air/models/license.py +150 -0
  84. binalyze_air/models/logger.py +83 -0
  85. binalyze_air/models/multipart_upload.py +352 -0
  86. binalyze_air/models/notifications.py +138 -0
  87. binalyze_air/models/organizations.py +293 -293
  88. binalyze_air/models/params.py +153 -127
  89. binalyze_air/models/policies.py +260 -249
  90. binalyze_air/models/preset_filters.py +79 -0
  91. binalyze_air/models/recent_activities.py +70 -0
  92. binalyze_air/models/relay_server.py +121 -0
  93. binalyze_air/models/settings.py +538 -84
  94. binalyze_air/models/tasks.py +215 -149
  95. binalyze_air/models/triage.py +141 -142
  96. binalyze_air/models/user_management.py +200 -97
  97. binalyze_air/models/webhook_executions.py +33 -0
  98. binalyze_air/queries/__init__.py +121 -133
  99. binalyze_air/queries/acquisitions.py +155 -155
  100. binalyze_air/queries/api_tokens.py +46 -0
  101. binalyze_air/queries/assets.py +186 -105
  102. binalyze_air/queries/audit.py +400 -416
  103. binalyze_air/queries/{authentication.py → auth.py} +55 -55
  104. binalyze_air/queries/auto_asset_tags.py +59 -59
  105. binalyze_air/queries/backup.py +66 -0
  106. binalyze_air/queries/baseline.py +21 -185
  107. binalyze_air/queries/cases.py +292 -292
  108. binalyze_air/queries/cloud_forensics.py +137 -0
  109. binalyze_air/queries/event_subscription.py +54 -54
  110. binalyze_air/queries/evidence.py +139 -139
  111. binalyze_air/queries/evidences.py +279 -279
  112. binalyze_air/queries/interact.py +140 -28
  113. binalyze_air/queries/investigation_hub.py +329 -0
  114. binalyze_air/queries/license.py +85 -0
  115. binalyze_air/queries/logger.py +58 -0
  116. binalyze_air/queries/multipart_upload.py +180 -0
  117. binalyze_air/queries/notifications.py +71 -0
  118. binalyze_air/queries/organizations.py +222 -222
  119. binalyze_air/queries/params.py +154 -115
  120. binalyze_air/queries/policies.py +149 -149
  121. binalyze_air/queries/preset_filters.py +60 -0
  122. binalyze_air/queries/recent_activities.py +44 -0
  123. binalyze_air/queries/relay_server.py +42 -0
  124. binalyze_air/queries/settings.py +533 -20
  125. binalyze_air/queries/tasks.py +125 -81
  126. binalyze_air/queries/triage.py +230 -230
  127. binalyze_air/queries/user_management.py +193 -83
  128. binalyze_air/queries/webhook_executions.py +39 -0
  129. binalyze_air_sdk-1.0.3.dist-info/METADATA +752 -0
  130. binalyze_air_sdk-1.0.3.dist-info/RECORD +132 -0
  131. {binalyze_air_sdk-1.0.2.dist-info → binalyze_air_sdk-1.0.3.dist-info}/WHEEL +1 -1
  132. binalyze_air/apis/endpoints.py +0 -22
  133. binalyze_air/apis/evidences.py +0 -216
  134. binalyze_air/apis/users.py +0 -68
  135. binalyze_air/commands/users.py +0 -101
  136. binalyze_air/models/endpoints.py +0 -76
  137. binalyze_air/models/users.py +0 -82
  138. binalyze_air/queries/endpoints.py +0 -25
  139. binalyze_air/queries/users.py +0 -69
  140. binalyze_air_sdk-1.0.2.dist-info/METADATA +0 -706
  141. binalyze_air_sdk-1.0.2.dist-info/RECORD +0 -82
  142. {binalyze_air_sdk-1.0.2.dist-info → binalyze_air_sdk-1.0.3.dist-info}/top_level.txt +0 -0
@@ -1,27 +1,395 @@
1
- """
2
- Settings API for the Binalyze AIR SDK.
3
- """
4
-
5
- from ..http_client import HTTPClient
6
- from ..models.settings import BannerSettings, UpdateBannerSettingsRequest
7
- from ..queries.settings import GetBannerSettingsQuery
8
- from ..commands.settings import UpdateBannerSettingsCommand
9
-
10
-
11
- class SettingsAPI:
12
- """Settings API with CQRS pattern - separated queries and commands."""
13
-
14
- def __init__(self, http_client: HTTPClient):
15
- self.http_client = http_client
16
-
17
- # QUERIES (Read operations)
18
- def get_banner_settings(self) -> BannerSettings:
19
- """Get current banner settings."""
20
- query = GetBannerSettingsQuery(self.http_client)
21
- return query.execute()
22
-
23
- # COMMANDS (Write operations)
24
- def update_banner_settings(self, request: UpdateBannerSettingsRequest) -> BannerSettings:
25
- """Update banner settings."""
26
- command = UpdateBannerSettingsCommand(self.http_client, request)
27
- return command.execute()
1
+ """
2
+ Settings API for the Binalyze AIR SDK.
3
+ """
4
+
5
+ from typing import Union, Dict, Any
6
+
7
+ from ..http_client import HTTPClient
8
+ from ..models.settings import (
9
+ BannerSettings, UpdateBannerSettingsRequest, AllSettings, GeneralSettingsRequest,
10
+ UpdateProxySettingsRequest, ValidateProxySettingsRequest, ProxySettings,
11
+ UpdateActiveDirectorySettingsRequest, ValidateActiveDirectorySettingsRequest,
12
+ ActiveDirectorySettings, UpdateSMTPSettingsRequest, ValidateSMTPSettingsRequest,
13
+ UpdateConsoleAddressSettingsRequest, ValidateConsoleAddressSettingsRequest,
14
+ UpdatePolicySettingsRequest, UpdateEnforceTFASettingsRequest,
15
+ UpdateAutoAssetTaggingSettingsRequest, UpdateInteractSettingsRequest,
16
+ UpdateRFC3161SettingsRequest, UpdateResponderSettingsRequest,
17
+ UpdateLocardSettingsRequest, UpdateUninstallationPasswordProtectionSettingsRequest,
18
+ UpdateSyslogSettingsRequest, ValidateSyslogSettingsRequest,
19
+ UpdateBackupRestoreSettingsRequest, ValidateBackupSftpSettingsRequest,
20
+ UpdateSslSettingsRequest, ValidateSslSettingsRequest,
21
+ UpdateSingleSignOnSettingsRequest, SslCertificateValidation
22
+ )
23
+ from ..queries.settings import (
24
+ GetSettingsQuery, GetBannerSettingsQuery, UpdateProxySettingsQuery,
25
+ ValidateProxySettingsQuery, UpdateActiveDirectorySettingsQuery,
26
+ ValidateActiveDirectorySettingsQuery, UpdateSMTPSettingsQuery,
27
+ ValidateSMTPSettingsQuery, UpdateConsoleAddressSettingsQuery,
28
+ ValidateConsoleAddressSettingsQuery, UpdatePolicySettingsQuery,
29
+ UpdateEnforceTFASettingsQuery, UpdateAutoAssetTaggingSettingsQuery,
30
+ UpdateInteractSettingsQuery, UpdateRFC3161SettingsQuery,
31
+ UpdateResponderSettingsQuery, UpdateLocardSettingsQuery,
32
+ UpdateUninstallationPasswordProtectionSettingsQuery,
33
+ UpdateSyslogSettingsQuery, ValidateSyslogSettingsQuery,
34
+ UpdateBackupRestoreSettingsQuery, ValidateBackupSftpSettingsQuery,
35
+ UpdateSslSettingsQuery, ValidateSslSettingsQuery,
36
+ UpdateSingleSignOnSettingsQuery, GetSsoCallbackUrlQuery
37
+ )
38
+ from ..commands.settings import (
39
+ UpdateBannerSettingsCommand, UpdateGeneralSettingsCommand,
40
+ UpdateProxySettingsCommand, ValidateProxySettingsCommand,
41
+ UpdateActiveDirectorySettingsCommand, ValidateActiveDirectorySettingsCommand,
42
+ UpdateSMTPSettingsCommand, ValidateSMTPSettingsCommand,
43
+ UpdateConsoleAddressSettingsCommand, ValidateConsoleAddressSettingsCommand,
44
+ UpdatePolicySettingsCommand, UpdateEnforceTFASettingsCommand,
45
+ UpdateAutoAssetTaggingSettingsCommand, UpdateInteractSettingsCommand,
46
+ UpdateRFC3161SettingsCommand, UpdateResponderSettingsCommand,
47
+ UpdateLocardSettingsCommand, UpdateUninstallationPasswordProtectionSettingsCommand,
48
+ UpdateSyslogSettingsCommand, ValidateSyslogSettingsCommand,
49
+ UpdateBackupRestoreSettingsCommand, ValidateBackupSftpSettingsCommand,
50
+ UpdateSslSettingsCommand, ValidateSslSettingsCommand,
51
+ UpdateSingleSignOnSettingsCommand, GetSsoCallbackUrlCommand
52
+ )
53
+
54
+
55
+ class SettingsAPI:
56
+ """Settings API with CQRS pattern - separated queries and commands."""
57
+
58
+ def __init__(self, http_client: HTTPClient):
59
+ self._http_client = http_client
60
+
61
+ # QUERIES (Read operations)
62
+ def get_settings(self) -> AllSettings:
63
+ """Get all system settings (includes banner settings in result.banner)."""
64
+ query = GetSettingsQuery(self._http_client)
65
+ return query.execute()
66
+
67
+ # COMMANDS (Write operations)
68
+ def update_general_settings(self, request: Union[GeneralSettingsRequest, Dict[str, Any]]) -> Dict[str, Any]:
69
+ """Update general settings."""
70
+ command = UpdateGeneralSettingsCommand(self._http_client, request)
71
+ return command.execute()
72
+
73
+ def update_banner_settings(self, request: Union[UpdateBannerSettingsRequest, Dict[str, Any]]) -> Dict[str, Any]:
74
+ """Update banner settings."""
75
+ command = UpdateBannerSettingsCommand(self._http_client, request)
76
+ return command.execute()
77
+
78
+ def update_proxy_settings(self, request: Union[UpdateProxySettingsRequest, Dict[str, Any]]) -> Dict[str, Any]:
79
+ """Update proxy settings.
80
+
81
+ Args:
82
+ request: Proxy settings request containing enabled status, address, port,
83
+ credentials, and optional certificate information
84
+
85
+ Returns:
86
+ Dictionary with operation result
87
+
88
+ Raises:
89
+ APIError: If the request fails
90
+ """
91
+ command = UpdateProxySettingsCommand(self._http_client, request)
92
+ return command.execute()
93
+
94
+ def validate_proxy_settings(self, request: Union[ValidateProxySettingsRequest, Dict[str, Any]]) -> Dict[str, Any]:
95
+ """Validate proxy settings without applying them.
96
+
97
+ Args:
98
+ request: Proxy settings request to validate containing enabled status,
99
+ address, port, credentials, and optional certificate information
100
+
101
+ Returns:
102
+ Dictionary with validation result
103
+
104
+ Raises:
105
+ APIError: If the request fails
106
+ """
107
+ command = ValidateProxySettingsCommand(self._http_client, request)
108
+ return command.execute()
109
+
110
+ def update_active_directory_settings(self, request: Union[UpdateActiveDirectorySettingsRequest, Dict[str, Any]]) -> Dict[str, Any]:
111
+ """Update Active Directory settings.
112
+
113
+ Args:
114
+ request: Active Directory settings request containing enabled status,
115
+ server, domain, authentication credentials, and connection options
116
+
117
+ Returns:
118
+ Dictionary with operation result
119
+
120
+ Raises:
121
+ APIError: If the request fails
122
+ """
123
+ command = UpdateActiveDirectorySettingsCommand(self._http_client, request)
124
+ return command.execute()
125
+
126
+ def validate_active_directory_settings(self, request: Union[ValidateActiveDirectorySettingsRequest, Dict[str, Any]]) -> Dict[str, Any]:
127
+ """Validate Active Directory settings without applying them.
128
+
129
+ Args:
130
+ request: Active Directory settings request to validate containing
131
+ server, domain, authentication credentials, and connection options
132
+
133
+ Returns:
134
+ Dictionary with validation result
135
+
136
+ Raises:
137
+ APIError: If the request fails
138
+ """
139
+ command = ValidateActiveDirectorySettingsCommand(self._http_client, request)
140
+ return command.execute()
141
+
142
+ def update_smtp_settings(self, request: Union[UpdateSMTPSettingsRequest, Dict[str, Any]]) -> Dict[str, Any]:
143
+ """Update SMTP settings.
144
+
145
+ Args:
146
+ request: SMTP settings request containing enabled status, server configuration,
147
+ authentication credentials, and email addresses
148
+
149
+ Returns:
150
+ Dictionary with operation result
151
+
152
+ Raises:
153
+ APIError: If the request fails
154
+ """
155
+ command = UpdateSMTPSettingsCommand(self._http_client, request)
156
+ return command.execute()
157
+
158
+ def validate_smtp_settings(self, request: Union[ValidateSMTPSettingsRequest, Dict[str, Any]]) -> Dict[str, Any]:
159
+ """Validate SMTP settings without applying them.
160
+
161
+ Args:
162
+ request: SMTP settings request to validate containing enabled status,
163
+ server configuration, authentication credentials, and email addresses
164
+
165
+ Returns:
166
+ Dictionary with validation result
167
+
168
+ Raises:
169
+ APIError: If the request fails
170
+ """
171
+ command = ValidateSMTPSettingsCommand(self._http_client, request)
172
+ return command.execute()
173
+
174
+ def update_console_address_settings(self, request: Union[UpdateConsoleAddressSettingsRequest, Dict[str, Any]]) -> Dict[str, Any]:
175
+ """Update console address settings.
176
+
177
+ Args:
178
+ request: Console address settings request containing console address
179
+ and optional SSL certificate information
180
+
181
+ Returns:
182
+ Dictionary with operation result
183
+
184
+ Raises:
185
+ APIError: If the request fails
186
+ """
187
+ command = UpdateConsoleAddressSettingsCommand(self._http_client, request)
188
+ return command.execute()
189
+
190
+ def validate_console_address_settings(self, request: Union[ValidateConsoleAddressSettingsRequest, Dict[str, Any]]) -> Dict[str, Any]:
191
+ """Validate console address settings without applying them.
192
+
193
+ Args:
194
+ request: Console address settings request to validate
195
+
196
+ Returns:
197
+ Dictionary with validation result
198
+
199
+ Raises:
200
+ APIError: If the request fails
201
+ """
202
+ command = ValidateConsoleAddressSettingsCommand(self._http_client, request)
203
+ return command.execute()
204
+
205
+ def update_policy_settings(self, request: Union[UpdatePolicySettingsRequest, Dict[str, Any]]) -> Dict[str, Any]:
206
+ """Update policy settings.
207
+
208
+ Args:
209
+ request: Policy settings request containing enabled status
210
+
211
+ Returns:
212
+ Dictionary with operation result
213
+
214
+ Raises:
215
+ APIError: If the request fails
216
+ """
217
+ command = UpdatePolicySettingsCommand(self._http_client, request)
218
+ return command.execute()
219
+
220
+ def update_enforce_tfa_settings(self, request: Union[UpdateEnforceTFASettingsRequest, Dict[str, Any]]) -> Dict[str, Any]:
221
+ """Update enforce TFA settings.
222
+
223
+ Args:
224
+ request: Enforce TFA settings request containing enabled status
225
+
226
+ Returns:
227
+ Dictionary with operation result
228
+
229
+ Raises:
230
+ APIError: If the request fails
231
+ """
232
+ command = UpdateEnforceTFASettingsCommand(self._http_client, request)
233
+ return command.execute()
234
+
235
+ def update_auto_asset_tagging_settings(self, request: Union[UpdateAutoAssetTaggingSettingsRequest, Dict[str, Any]]) -> Dict[str, Any]:
236
+ """Update auto asset tagging settings.
237
+
238
+ Args:
239
+ request: Auto asset tagging settings request containing enabled status
240
+
241
+ Returns:
242
+ Dictionary with operation result
243
+
244
+ Raises:
245
+ APIError: If the request fails
246
+ """
247
+ command = UpdateAutoAssetTaggingSettingsCommand(self._http_client, request)
248
+ return command.execute()
249
+
250
+ def update_interact_settings(self, request: Union[UpdateInteractSettingsRequest, Dict[str, Any]]) -> Dict[str, Any]:
251
+ """Update InterACT settings.
252
+
253
+ Args:
254
+ request: InterACT settings request containing enabled status
255
+
256
+ Returns:
257
+ Dictionary with operation result
258
+
259
+ Raises:
260
+ APIError: If the request fails
261
+ """
262
+ command = UpdateInteractSettingsCommand(self._http_client, request)
263
+ return command.execute()
264
+
265
+ def update_rfc3161_settings(self, request: Union[UpdateRFC3161SettingsRequest, Dict[str, Any]]) -> Dict[str, Any]:
266
+ """Update RFC3161 settings.
267
+
268
+ Args:
269
+ request: RFC3161 settings request containing enabled status
270
+
271
+ Returns:
272
+ Dictionary with operation result
273
+
274
+ Raises:
275
+ APIError: If the request fails
276
+ """
277
+ command = UpdateRFC3161SettingsCommand(self._http_client, request)
278
+ return command.execute()
279
+
280
+ def update_responder_settings(self, request: Union[UpdateResponderSettingsRequest, Dict[str, Any]]) -> Dict[str, Any]:
281
+ """Update responder/agent settings.
282
+
283
+ Args:
284
+ request: Responder settings request containing enabled status
285
+
286
+ Returns:
287
+ Dictionary with operation result
288
+
289
+ Raises:
290
+ APIError: If the request fails
291
+ """
292
+ command = UpdateResponderSettingsCommand(self._http_client, request)
293
+ return command.execute()
294
+
295
+ def update_locard_settings(self, request: Union[UpdateLocardSettingsRequest, Dict[str, Any]]) -> Dict[str, Any]:
296
+ """Update Locard settings.
297
+
298
+ Args:
299
+ request: Locard settings request containing enabled status and configuration
300
+
301
+ Returns:
302
+ Dictionary with operation result
303
+
304
+ Raises:
305
+ APIError: If the request fails
306
+ """
307
+ command = UpdateLocardSettingsCommand(self._http_client, request)
308
+ return command.execute()
309
+
310
+ def update_uninstallation_password_protection_settings(
311
+ self,
312
+ request: Union[UpdateUninstallationPasswordProtectionSettingsRequest, Dict[str, Any]]
313
+ ) -> Dict[str, Any]:
314
+ """Update uninstallation password protection settings."""
315
+ query = UpdateUninstallationPasswordProtectionSettingsQuery(request)
316
+ command = UpdateUninstallationPasswordProtectionSettingsCommand(self._http_client)
317
+ return command.execute(query)
318
+
319
+ def update_syslog_settings(
320
+ self,
321
+ request: Union[UpdateSyslogSettingsRequest, Dict[str, Any]]
322
+ ) -> Dict[str, Any]:
323
+ """Update syslog settings."""
324
+ query = UpdateSyslogSettingsQuery(request)
325
+ command = UpdateSyslogSettingsCommand(self._http_client)
326
+ return command.execute(query)
327
+
328
+ def validate_syslog_settings(
329
+ self,
330
+ request: Union[ValidateSyslogSettingsRequest, Dict[str, Any]]
331
+ ) -> Dict[str, Any]:
332
+ """Validate syslog settings."""
333
+ query = ValidateSyslogSettingsQuery(request)
334
+ command = ValidateSyslogSettingsCommand(self._http_client)
335
+ return command.execute(query)
336
+
337
+ def update_backup_restore_settings(
338
+ self,
339
+ request: Union[UpdateBackupRestoreSettingsRequest, Dict[str, Any]]
340
+ ) -> Dict[str, Any]:
341
+ """Update backup restore settings."""
342
+ query = UpdateBackupRestoreSettingsQuery(request)
343
+ command = UpdateBackupRestoreSettingsCommand(self._http_client)
344
+ return command.execute(query)
345
+
346
+ def validate_backup_sftp_settings(
347
+ self,
348
+ request: Union[ValidateBackupSftpSettingsRequest, Dict[str, Any]]
349
+ ) -> Dict[str, Any]:
350
+ """Validate backup SFTP settings."""
351
+ query = ValidateBackupSftpSettingsQuery(request)
352
+ command = ValidateBackupSftpSettingsCommand(self._http_client)
353
+ return command.execute(query)
354
+
355
+ def update_ssl_settings(
356
+ self,
357
+ request: Union[UpdateSslSettingsRequest, Dict[str, Any]],
358
+ cert_file: bytes,
359
+ key_file: bytes
360
+ ) -> Dict[str, Any]:
361
+ """Update SSL settings with certificate and key files."""
362
+ query = UpdateSslSettingsQuery(request, cert_file, key_file)
363
+ command = UpdateSslSettingsCommand(self._http_client)
364
+ return command.execute(query)
365
+
366
+ def validate_ssl_settings(
367
+ self,
368
+ request: Union[ValidateSslSettingsRequest, Dict[str, Any]],
369
+ cert_file: bytes,
370
+ key_file: bytes
371
+ ) -> SslCertificateValidation:
372
+ """Validate SSL settings with certificate and key files."""
373
+ query = ValidateSslSettingsQuery(request, cert_file, key_file)
374
+ command = ValidateSslSettingsCommand(self._http_client)
375
+ response = command.execute(query)
376
+ return SslCertificateValidation(**response.get('result', {}))
377
+
378
+ def update_single_sign_on_settings(
379
+ self,
380
+ request: Union[UpdateSingleSignOnSettingsRequest, Dict[str, Any]]
381
+ ) -> Dict[str, Any]:
382
+ """Update single sign-on settings."""
383
+ query = UpdateSingleSignOnSettingsQuery(request)
384
+ command = UpdateSingleSignOnSettingsCommand(self._http_client)
385
+ return command.execute(query)
386
+
387
+ def get_sso_callback_url_by_type(
388
+ self,
389
+ sso_type: str
390
+ ) -> str:
391
+ """Get SSO callback URL by type (azure or okta)."""
392
+ query = GetSsoCallbackUrlQuery(sso_type)
393
+ command = GetSsoCallbackUrlCommand(self._http_client)
394
+ response = command.execute(query)
395
+ return response.get('result', '')
@@ -0,0 +1,80 @@
1
+ """
2
+ Tasks API for the Binalyze AIR SDK using CQRS pattern.
3
+ """
4
+
5
+ from typing import List, Optional, Dict, Any, Union
6
+ from ..http_client import HTTPClient
7
+ from ..models.tasks import Task, TaskFilter, TaskAssignment, CancelTaskByFilterRequest, GenerateOffNetworkZipPasswordRequest
8
+ from ..queries.tasks import (
9
+ ListTasksQuery,
10
+ GetTaskQuery,
11
+ GetTaskAssignmentsQuery,
12
+ )
13
+ from ..commands.tasks import (
14
+ CancelTaskCommand,
15
+ CancelTaskAssignmentCommand,
16
+ DeleteTaskAssignmentCommand,
17
+ DeleteTaskCommand,
18
+ CancelTaskByFilterCommand,
19
+ GenerateOffNetworkZipPasswordCommand,
20
+ )
21
+
22
+
23
+ class TasksAPI:
24
+ """Tasks API with CQRS pattern - separated queries and commands."""
25
+
26
+ def __init__(self, http_client: HTTPClient):
27
+ self.http_client = http_client
28
+
29
+ # QUERIES (Read operations)
30
+ def list(self, filter_params: Optional[TaskFilter] = None, organization_ids: Optional[List[int]] = None) -> List[Task]:
31
+ """List tasks with optional filtering."""
32
+ query = ListTasksQuery(self.http_client, filter_params, organization_ids)
33
+ return query.execute()
34
+
35
+ def get(self, task_id: str) -> Task:
36
+ """Get a specific task by ID."""
37
+ query = GetTaskQuery(self.http_client, task_id)
38
+ return query.execute()
39
+
40
+ def get_assignments(self, task_id: str) -> List[TaskAssignment]:
41
+ """Get task assignments for a specific task."""
42
+ query = GetTaskAssignmentsQuery(self.http_client, task_id)
43
+ return query.execute()
44
+
45
+ # COMMANDS (Write operations)
46
+ def cancel(self, task_id: str) -> Dict[str, Any]:
47
+ """Cancel a task."""
48
+ command = CancelTaskCommand(self.http_client, task_id)
49
+ return command.execute()
50
+
51
+ def cancel_assignment(self, assignment_id: str) -> Dict[str, Any]:
52
+ """Cancel a task assignment."""
53
+ command = CancelTaskAssignmentCommand(self.http_client, assignment_id)
54
+ return command.execute()
55
+
56
+ def delete_assignment(self, assignment_id: str) -> Dict[str, Any]:
57
+ """Delete a task assignment."""
58
+ command = DeleteTaskAssignmentCommand(self.http_client, assignment_id)
59
+ return command.execute()
60
+
61
+ def delete(self, task_id: str) -> Dict[str, Any]:
62
+ """Delete a task."""
63
+ command = DeleteTaskCommand(self.http_client, task_id)
64
+ return command.execute()
65
+
66
+ def delete_task(self, task_id: str) -> Dict[str, Any]:
67
+ """Delete a task (alias for delete)."""
68
+ return self.delete(task_id)
69
+
70
+ def cancel_by_filter(self, request_data: Union[CancelTaskByFilterRequest, Dict[str, Any]]) -> Dict[str, Any]:
71
+ """Cancel tasks by filter criteria."""
72
+ command = CancelTaskByFilterCommand(self.http_client, request_data)
73
+ return command.execute()
74
+
75
+ def generate_off_network_zip_password(
76
+ self, request_data: Union[GenerateOffNetworkZipPasswordRequest, Dict[str, Any]]
77
+ ) -> Dict[str, Any]:
78
+ """Generate off-network zip password."""
79
+ command = GenerateOffNetworkZipPasswordCommand(self.http_client, request_data)
80
+ return command.execute()