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,396 +1,32 @@
1
- """
2
- Baseline-related commands for the Binalyze AIR SDK.
3
- """
4
-
5
- from typing import Dict, Any, Union
6
-
7
- from ..base import Command
8
- from ..models.baseline import (
9
- Baseline, BaselineProfile, BaselineComparison, BaselineSchedule, BaselineChange,
10
- CreateBaselineRequest, UpdateBaselineRequest, CreateBaselineProfileRequest,
11
- CompareBaselineRequest
12
- )
13
- from ..http_client import HTTPClient
14
-
15
-
16
- class CreateBaselineCommand(Command[Baseline]):
17
- """Command to create a new baseline."""
18
-
19
- def __init__(self, http_client: HTTPClient, request: CreateBaselineRequest):
20
- self.http_client = http_client
21
- self.request = request
22
-
23
- def execute(self) -> Baseline:
24
- """Execute the command to create a baseline."""
25
- data = self.request.model_dump(exclude_none=True)
26
-
27
- response = self.http_client.post("baselines", json_data=data)
28
-
29
- entity_data = response.get("result", {})
30
-
31
- mapped_data = {
32
- "id": entity_data.get("_id"),
33
- "name": entity_data.get("name"),
34
- "description": entity_data.get("description"),
35
- "type": entity_data.get("type"),
36
- "status": entity_data.get("status", "creating"),
37
- "endpoint_id": entity_data.get("endpointId"),
38
- "endpoint_name": entity_data.get("endpointName"),
39
- "organization_id": entity_data.get("organizationId", 0),
40
- "created_at": entity_data.get("createdAt"),
41
- "updated_at": entity_data.get("updatedAt"),
42
- "created_by": entity_data.get("createdBy"),
43
- "item_count": entity_data.get("itemCount", 0),
44
- "file_count": entity_data.get("fileCount", 0),
45
- "registry_count": entity_data.get("registryCount", 0),
46
- "service_count": entity_data.get("serviceCount", 0),
47
- "process_count": entity_data.get("processCount", 0),
48
- "network_connection_count": entity_data.get("networkConnectionCount", 0),
49
- "tags": entity_data.get("tags", []),
50
- "profile_id": entity_data.get("profileId"),
51
- "profile_name": entity_data.get("profileName"),
52
- "last_comparison": entity_data.get("lastComparison"),
53
- "comparison_count": entity_data.get("comparisonCount", 0),
54
- }
55
-
56
- # Remove None values
57
- mapped_data = {k: v for k, v in mapped_data.items() if v is not None}
58
-
59
- return Baseline(**mapped_data)
60
-
61
-
62
- class UpdateBaselineCommand(Command[Baseline]):
63
- """Command to update an existing baseline."""
64
-
65
- def __init__(self, http_client: HTTPClient, baseline_id: str, request: UpdateBaselineRequest):
66
- self.http_client = http_client
67
- self.baseline_id = baseline_id
68
- self.request = request
69
-
70
- def execute(self) -> Baseline:
71
- """Execute the command to update a baseline."""
72
- data = self.request.model_dump(exclude_none=True)
73
-
74
- response = self.http_client.put(f"baselines/{self.baseline_id}", json_data=data)
75
-
76
- entity_data = response.get("result", {})
77
-
78
- mapped_data = {
79
- "id": entity_data.get("_id"),
80
- "name": entity_data.get("name"),
81
- "description": entity_data.get("description"),
82
- "type": entity_data.get("type"),
83
- "status": entity_data.get("status", "creating"),
84
- "endpoint_id": entity_data.get("endpointId"),
85
- "endpoint_name": entity_data.get("endpointName"),
86
- "organization_id": entity_data.get("organizationId", 0),
87
- "created_at": entity_data.get("createdAt"),
88
- "updated_at": entity_data.get("updatedAt"),
89
- "created_by": entity_data.get("createdBy"),
90
- "item_count": entity_data.get("itemCount", 0),
91
- "file_count": entity_data.get("fileCount", 0),
92
- "registry_count": entity_data.get("registryCount", 0),
93
- "service_count": entity_data.get("serviceCount", 0),
94
- "process_count": entity_data.get("processCount", 0),
95
- "network_connection_count": entity_data.get("networkConnectionCount", 0),
96
- "tags": entity_data.get("tags", []),
97
- "profile_id": entity_data.get("profileId"),
98
- "profile_name": entity_data.get("profileName"),
99
- "last_comparison": entity_data.get("lastComparison"),
100
- "comparison_count": entity_data.get("comparisonCount", 0),
101
- }
102
-
103
- # Remove None values
104
- mapped_data = {k: v for k, v in mapped_data.items() if v is not None}
105
-
106
- return Baseline(**mapped_data)
107
-
108
-
109
- class DeleteBaselineCommand(Command[Dict[str, Any]]):
110
- """Command to delete a baseline."""
111
-
112
- def __init__(self, http_client: HTTPClient, baseline_id: str):
113
- self.http_client = http_client
114
- self.baseline_id = baseline_id
115
-
116
- def execute(self) -> Dict[str, Any]:
117
- """Execute the command to delete a baseline."""
118
- response = self.http_client.delete(f"baselines/{self.baseline_id}")
119
- return response
120
-
121
-
122
- class CompareBaselineCommand(Command[BaselineComparison]):
123
- """Command to run baseline comparison."""
124
-
125
- def __init__(self, http_client: HTTPClient, request: Union[CompareBaselineRequest, Dict[str, Any]]):
126
- self.http_client = http_client
127
- self.request = request
128
-
129
- def execute(self) -> BaselineComparison:
130
- """Execute the command to run baseline comparison."""
131
- # Handle both dict and model objects
132
- if isinstance(self.request, dict):
133
- data = self.request
134
- else:
135
- data = self.request.model_dump(exclude_none=True)
136
-
137
- response = self.http_client.post("baselines/compare", json_data=data)
138
-
139
- entity_data = response.get("result", {})
140
-
141
- # Parse changes if present
142
- changes = []
143
- for change_data in entity_data.get("changes", []):
144
- change_mapped = {
145
- "id": change_data.get("_id"),
146
- "comparison_id": change_data.get("comparisonId"),
147
- "change_type": change_data.get("changeType"),
148
- "item_type": change_data.get("itemType"),
149
- "path": change_data.get("path"),
150
- "old_value": change_data.get("oldValue"),
151
- "new_value": change_data.get("newValue"),
152
- "severity": change_data.get("severity", "medium"),
153
- "category": change_data.get("category"),
154
- "description": change_data.get("description"),
155
- "detected_at": change_data.get("detectedAt"),
156
- "risk_score": change_data.get("riskScore", 0.0),
157
- }
158
-
159
- # Remove None values
160
- change_mapped = {k: v for k, v in change_mapped.items() if v is not None}
161
- changes.append(BaselineChange(**change_mapped))
162
-
163
- mapped_data = {
164
- "id": entity_data.get("_id"),
165
- "baseline_id": entity_data.get("baselineId"),
166
- "baseline_name": entity_data.get("baselineName"),
167
- "endpoint_id": entity_data.get("endpointId"),
168
- "endpoint_name": entity_data.get("endpointName"),
169
- "status": entity_data.get("status", "pending"),
170
- "started_at": entity_data.get("startedAt"),
171
- "completed_at": entity_data.get("completedAt"),
172
- "duration": entity_data.get("duration"),
173
- "total_changes": entity_data.get("totalChanges", 0),
174
- "added_items": entity_data.get("addedItems", 0),
175
- "removed_items": entity_data.get("removedItems", 0),
176
- "modified_items": entity_data.get("modifiedItems", 0),
177
- "moved_items": entity_data.get("movedItems", 0),
178
- "high_risk_changes": entity_data.get("highRiskChanges", 0),
179
- "medium_risk_changes": entity_data.get("mediumRiskChanges", 0),
180
- "low_risk_changes": entity_data.get("lowRiskChanges", 0),
181
- "changes": changes,
182
- "organization_id": entity_data.get("organizationId", 0),
183
- "triggered_by": entity_data.get("triggeredBy"),
184
- "error_message": entity_data.get("errorMessage"),
185
- }
186
-
187
- # Remove None values
188
- mapped_data = {k: v for k, v in mapped_data.items() if v is not None}
189
-
190
- return BaselineComparison(**mapped_data)
191
-
192
-
193
- class CreateBaselineProfileCommand(Command[BaselineProfile]):
194
- """Command to create a new baseline profile."""
195
-
196
- def __init__(self, http_client: HTTPClient, request: CreateBaselineProfileRequest):
197
- self.http_client = http_client
198
- self.request = request
199
-
200
- def execute(self) -> BaselineProfile:
201
- """Execute the command to create a baseline profile."""
202
- data = self.request.model_dump(exclude_none=True)
203
-
204
- response = self.http_client.post("baselines/profiles", json_data=data)
205
-
206
- entity_data = response.get("result", {})
207
-
208
- mapped_data = {
209
- "id": entity_data.get("_id"),
210
- "name": entity_data.get("name"),
211
- "description": entity_data.get("description"),
212
- "settings": entity_data.get("settings", {}),
213
- "categories": entity_data.get("categories", []),
214
- "exclusions": entity_data.get("exclusions", []),
215
- "organization_id": entity_data.get("organizationId", 0),
216
- "created_at": entity_data.get("createdAt"),
217
- "updated_at": entity_data.get("updatedAt"),
218
- "created_by": entity_data.get("createdBy"),
219
- "is_default": entity_data.get("isDefault", False),
220
- "baseline_count": entity_data.get("baselineCount", 0),
221
- }
222
-
223
- # Remove None values
224
- mapped_data = {k: v for k, v in mapped_data.items() if v is not None}
225
-
226
- return BaselineProfile(**mapped_data)
227
-
228
-
229
- class UpdateBaselineProfileCommand(Command[BaselineProfile]):
230
- """Command to update an existing baseline profile."""
231
-
232
- def __init__(self, http_client: HTTPClient, profile_id: str, request: CreateBaselineProfileRequest):
233
- self.http_client = http_client
234
- self.profile_id = profile_id
235
- self.request = request
236
-
237
- def execute(self) -> BaselineProfile:
238
- """Execute the command to update a baseline profile."""
239
- data = self.request.model_dump(exclude_none=True)
240
-
241
- response = self.http_client.put(f"baselines/profiles/{self.profile_id}", json_data=data)
242
-
243
- entity_data = response.get("result", {})
244
-
245
- mapped_data = {
246
- "id": entity_data.get("_id"),
247
- "name": entity_data.get("name"),
248
- "description": entity_data.get("description"),
249
- "settings": entity_data.get("settings", {}),
250
- "categories": entity_data.get("categories", []),
251
- "exclusions": entity_data.get("exclusions", []),
252
- "organization_id": entity_data.get("organizationId", 0),
253
- "created_at": entity_data.get("createdAt"),
254
- "updated_at": entity_data.get("updatedAt"),
255
- "created_by": entity_data.get("createdBy"),
256
- "is_default": entity_data.get("isDefault", False),
257
- "baseline_count": entity_data.get("baselineCount", 0),
258
- }
259
-
260
- # Remove None values
261
- mapped_data = {k: v for k, v in mapped_data.items() if v is not None}
262
-
263
- return BaselineProfile(**mapped_data)
264
-
265
-
266
- class DeleteBaselineProfileCommand(Command[Dict[str, Any]]):
267
- """Command to delete a baseline profile."""
268
-
269
- def __init__(self, http_client: HTTPClient, profile_id: str):
270
- self.http_client = http_client
271
- self.profile_id = profile_id
272
-
273
- def execute(self) -> Dict[str, Any]:
274
- """Execute the command to delete a baseline profile."""
275
- response = self.http_client.delete(f"baselines/profiles/{self.profile_id}")
276
- return response
277
-
278
-
279
- class CreateBaselineScheduleCommand(Command[BaselineSchedule]):
280
- """Command to create a baseline schedule."""
281
-
282
- def __init__(self, http_client: HTTPClient, baseline_id: str, schedule_data: Dict[str, Any]):
283
- self.http_client = http_client
284
- self.baseline_id = baseline_id
285
- self.schedule_data = schedule_data
286
-
287
- def execute(self) -> BaselineSchedule:
288
- """Execute the command to create a baseline schedule."""
289
- response = self.http_client.post("baselines/schedules", json_data=self.schedule_data)
290
-
291
- entity_data = response.get("result", {})
292
-
293
- mapped_data = {
294
- "id": entity_data.get("_id"),
295
- "baseline_id": entity_data.get("baselineId"),
296
- "baseline_name": entity_data.get("baselineName"),
297
- "schedule_type": entity_data.get("scheduleType"),
298
- "cron_expression": entity_data.get("cronExpression"),
299
- "interval_minutes": entity_data.get("intervalMinutes"),
300
- "enabled": entity_data.get("enabled", True),
301
- "next_run": entity_data.get("nextRun"),
302
- "last_run": entity_data.get("lastRun"),
303
- "run_count": entity_data.get("runCount", 0),
304
- "organization_id": entity_data.get("organizationId", 0),
305
- "created_at": entity_data.get("createdAt"),
306
- "updated_at": entity_data.get("updatedAt"),
307
- "created_by": entity_data.get("createdBy"),
308
- }
309
-
310
- # Remove None values
311
- mapped_data = {k: v for k, v in mapped_data.items() if v is not None}
312
-
313
- return BaselineSchedule(**mapped_data)
314
-
315
-
316
- class DeleteBaselineScheduleCommand(Command[Dict[str, Any]]):
317
- """Command to delete a baseline schedule."""
318
-
319
- def __init__(self, http_client: HTTPClient, schedule_id: str):
320
- self.http_client = http_client
321
- self.schedule_id = schedule_id
322
-
323
- def execute(self) -> Dict[str, Any]:
324
- """Execute the command to delete a baseline schedule."""
325
- response = self.http_client.delete(f"baselines/schedules/{self.schedule_id}")
326
- return response
327
-
328
-
329
- class RefreshBaselineCommand(Command[Baseline]):
330
- """Command to refresh/rebuild a baseline."""
331
-
332
- def __init__(self, http_client: HTTPClient, baseline_id: str):
333
- self.http_client = http_client
334
- self.baseline_id = baseline_id
335
-
336
- def execute(self) -> Baseline:
337
- """Execute the command to refresh a baseline."""
338
- response = self.http_client.post(f"baselines/{self.baseline_id}/refresh")
339
-
340
- entity_data = response.get("result", {})
341
-
342
- mapped_data = {
343
- "id": entity_data.get("_id"),
344
- "name": entity_data.get("name"),
345
- "description": entity_data.get("description"),
346
- "type": entity_data.get("type"),
347
- "status": entity_data.get("status", "creating"),
348
- "endpoint_id": entity_data.get("endpointId"),
349
- "endpoint_name": entity_data.get("endpointName"),
350
- "organization_id": entity_data.get("organizationId", 0),
351
- "created_at": entity_data.get("createdAt"),
352
- "updated_at": entity_data.get("updatedAt"),
353
- "created_by": entity_data.get("createdBy"),
354
- "item_count": entity_data.get("itemCount", 0),
355
- "file_count": entity_data.get("fileCount", 0),
356
- "registry_count": entity_data.get("registryCount", 0),
357
- "service_count": entity_data.get("serviceCount", 0),
358
- "process_count": entity_data.get("processCount", 0),
359
- "network_connection_count": entity_data.get("networkConnectionCount", 0),
360
- "tags": entity_data.get("tags", []),
361
- "profile_id": entity_data.get("profileId"),
362
- "profile_name": entity_data.get("profileName"),
363
- "last_comparison": entity_data.get("lastComparison"),
364
- "comparison_count": entity_data.get("comparisonCount", 0),
365
- }
366
-
367
- # Remove None values
368
- mapped_data = {k: v for k, v in mapped_data.items() if v is not None}
369
-
370
- return Baseline(**mapped_data)
371
-
372
-
373
- class AcquireBaselineByFilterCommand(Command[Dict[str, Any]]):
374
- """Command to acquire baselines by asset filter criteria."""
375
-
376
- def __init__(self, http_client: HTTPClient, payload: Dict[str, Any]):
377
- self.http_client = http_client
378
- self.payload = payload
379
-
380
- def execute(self) -> Dict[str, Any]:
381
- """Execute the command to acquire baselines by filter."""
382
- response = self.http_client.post("baseline/acquire", json_data=self.payload)
383
- return response
384
-
385
-
386
- class CompareBaselineByEndpointCommand(Command[Dict[str, Any]]):
387
- """Command to compare baseline acquisition tasks by endpoint ID."""
388
-
389
- def __init__(self, http_client: HTTPClient, payload: Dict[str, Any]):
390
- self.http_client = http_client
391
- self.payload = payload
392
-
393
- def execute(self) -> Dict[str, Any]:
394
- """Execute the command to compare baselines by endpoint."""
395
- response = self.http_client.post("baseline/compare", json_data=self.payload)
396
- return response
1
+ """
2
+ Baseline-related commands for the Binalyze AIR SDK.
3
+ """
4
+
5
+ from typing import Dict, Any
6
+
7
+ from ..base import Command
8
+ from ..http_client import HTTPClient
9
+
10
+
11
+ class AcquireBaselineByFilterCommand(Command[Dict[str, Any]]):
12
+ """Command to acquire baselines by asset filter criteria."""
13
+
14
+ def __init__(self, http_client: HTTPClient, payload: Dict[str, Any]):
15
+ self.http_client = http_client
16
+ self.payload = payload
17
+
18
+ def execute(self) -> Dict[str, Any]:
19
+ """Execute the command to acquire baselines by filter."""
20
+ return self.http_client.post("baseline/acquire", json_data=self.payload)
21
+
22
+
23
+ class CompareBaselineByEndpointCommand(Command[Dict[str, Any]]):
24
+ """Command to compare baseline acquisition tasks by endpoint ID."""
25
+
26
+ def __init__(self, http_client: HTTPClient, payload: Dict[str, Any]):
27
+ self.http_client = http_client
28
+ self.payload = payload
29
+
30
+ def execute(self) -> Dict[str, Any]:
31
+ """Execute the command to compare baseline tasks."""
32
+ return self.http_client.post("baseline/compare", json_data=self.payload)