Skip to content

Commit bc15985

Browse files
author
GitHub Actions
committed
Auto commit from main repo: manual-sync
1 parent 700291f commit bc15985

30 files changed

Lines changed: 240 additions & 162 deletions

__init__.py

Whitespace-only changes.

armis_sdk/clients/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Required by mkdocs

armis_sdk/clients/assets_client.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import datetime
22
from typing import AsyncIterator
3-
from typing import Literal
43
from typing import Optional
54
from typing import Type
65
from typing import Union
@@ -15,14 +14,7 @@
1514
from armis_sdk.entities.asset import Asset
1615
from armis_sdk.entities.asset import AssetT
1716
from armis_sdk.entities.device import Device
18-
19-
AssetIdSource = Literal[
20-
"ASSET_ID",
21-
"IPV4_ADDRESS",
22-
"IPV6_ADDRESS",
23-
"MAC_ADDRESS",
24-
"SERIAL_NUMBER",
25-
]
17+
from armis_sdk.types.asset_id_source import AssetIdSource
2618

2719

2820
@universalasync.wrap

armis_sdk/clients/collectors_client.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from armis_sdk.core.base_entity_client import BaseEntityClient
1212
from armis_sdk.entities.collector_image import CollectorImage
1313
from armis_sdk.entities.download_progress import DownloadProgress
14-
from armis_sdk.enums.collector_image_type import CollectorImageType
14+
from armis_sdk.types.collector_image_type import CollectorImageType
1515

1616

1717
@universalasync.wrap
@@ -26,7 +26,7 @@ class CollectorsClient(BaseEntityClient):
2626
async def download_image(
2727
self,
2828
destination: Union[str, IO[bytes]],
29-
image_type: CollectorImageType = CollectorImageType.OVA,
29+
image_type: CollectorImageType = "OVA",
3030
) -> AsyncIterator[DownloadProgress]:
3131
"""Download a collector image to a specified destination path / file.
3232
@@ -71,15 +71,12 @@ async def main():
7171
async with client.stream("GET", collector_image.url) as response:
7272
response.raise_for_status()
7373
total_size = int(response.headers.get("Content-Length", "0"))
74-
# pylint: disable-next=contextmanager-generator-missing-cleanup
7574
with self.open_file(destination) as file:
7675
async for chunk in response.aiter_bytes():
7776
file.write(chunk)
7877
yield DownloadProgress(downloaded=file.tell(), total=total_size)
7978

80-
async def get_image(
81-
self, image_type: CollectorImageType = CollectorImageType.OVA
82-
) -> CollectorImage:
79+
async def get_image(self, image_type: CollectorImageType = "OVA") -> CollectorImage:
8380
"""Get collector image information including download URL and credentials.
8481
8582
Args:
@@ -108,7 +105,7 @@ async def main():
108105
"""
109106
async with self._armis_client.client() as client:
110107
response = await client.get(
111-
"/v3/collectors/_image", params={"image_type": image_type.value}
108+
"/v3/collectors/_image", params={"image_type": image_type}
112109
)
113110
data = response_utils.get_data_dict(response)
114111
return CollectorImage.model_validate(data)

armis_sdk/core/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Required by mkdocs

armis_sdk/entities/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Required by mkdocs

armis_sdk/entities/collector_image.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
from pydantic import Field
44

55
from armis_sdk.core.base_entity import BaseEntity
6-
from armis_sdk.enums.collector_image_type import CollectorImageType
6+
from armis_sdk.types.collector_image_type import CollectorImageType
77

88

99
class CollectorImage(BaseEntity):
1010
"""
1111
An entity that represents the details required to download and run a collector image.
1212
"""
1313

14-
image_type: CollectorImageType = Field(strict=False)
14+
image_type: CollectorImageType
1515
"""The type of the image."""
1616

1717
image_password: str
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Required by mkdocs

armis_sdk/enums/collector_image_type.py

Lines changed: 0 additions & 36 deletions
This file was deleted.

armis_sdk/types/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Required by mkdocs

0 commit comments

Comments
 (0)