Skip to content

Commit 493ba46

Browse files
author
Aravindhan Palanisamy
committed
resolve PR comments
1 parent 7708287 commit 493ba46

File tree

5 files changed

+14
-20
lines changed

5 files changed

+14
-20
lines changed

examples/assetmanagement/assets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
is_limited=False,
4444
date="2022-06-07T18:58:05.000Z",
4545
),
46-
is_n_i_asset=True,
46+
is_NI_asset=True,
4747
workspace="846e294a-a007-47ac-9fc2-fac07eab240e",
4848
location=AssetLocation(
4949
state=AssetPresenceWithSystemConnection(
@@ -60,7 +60,7 @@
6060
),
6161
properties={"Key1": "Value1"},
6262
keywords=["Keyword1"],
63-
discovery_type=AssetDiscoveryType.AUTOMATIC,
63+
discovery_type=AssetDiscoveryType.MANUAL,
6464
file_ids=["608a5684800e325b48837c2a"],
6565
supports_self_test=True,
6666
supports_reset=True,

nisystemlink/clients/assetmanagement/_asset_management_client.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def __init__(self, configuration: Optional[HttpConfiguration] = None):
2727
is used to obtain the configuration.
2828
2929
Raises:
30-
ApiException: If unable to communicate with the AssetManagement Service.
30+
ApiException: If unable to communicate with the asset management Service.
3131
"""
3232
if configuration is None:
3333
configuration = core.HttpConfigurationManager.get_configuration()
@@ -44,10 +44,10 @@ def create_assets(
4444
assets: Array of assets that should be created.
4545
4646
Returns:
47-
AssetsCreatePartialSuccessResponse: Array of created assets and array of failed.
47+
CreateAssetsPartialSuccessResponse: Array of created assets and array of failed.
4848
4949
Raises:
50-
ApiException: If unable to communicate with the `asset management` service or if there are invalid
50+
ApiException: If unable to communicate with the asset management service or if there are invalid
5151
arguments.
5252
"""
5353
...
@@ -62,11 +62,11 @@ def query_assets(
6262
query: Object containing filters to apply when retrieving assets.
6363
6464
Returns:
65-
AssetsResponse: Assets Response containing the assets satisfying the query and
65+
QueryAssetsResponse: Assets Response containing the assets satisfying the query and
6666
the total count of matching assets.
6767
6868
Raises:
69-
ApiException: If unable to communicate with the `asset management` service or if there are invalid
69+
ApiException: If unable to communicate with the asset management service or if there are invalid
7070
arguments.
7171
"""
7272
...
@@ -76,13 +76,12 @@ def delete_assets(self, ids: List[str]) -> models.DeleteAssetsResponse:
7676
"""Delete Assets.
7777
7878
Args:
79-
assets: Arry of IDs of the assets to delete all information for.
79+
ids: List of IDs of the assets to delete.
8080
8181
Returns:
82-
DeleteAssetsResponse: Response Object containing the ids of the assets which were deleted.
82+
DeleteAssetsResponse: Response containing the IDs of the assets that were deleted.
8383
8484
Raises:
85-
ApiException: If unable to communicate with the `asset management` service or if there are invalid
86-
arguments.
85+
ApiException: If unable to communicate with the asset management service or if there are invalid arguments.
8786
"""
8887
...

nisystemlink/clients/assetmanagement/models/_asset.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from typing import Dict, List, Optional
33

44
from nisystemlink.clients.core._uplink._json_model import JsonModel
5+
from pydantic import Field
56

67
from ._asset_calibration import (
78
CalibrationStatus,
@@ -67,7 +68,7 @@ class Asset(JsonModel):
6768
self_calibration: Optional[SelfCalibration] = None
6869
"""Gets or sets the last self-calibration of the asset."""
6970

70-
is_NI_asset: Optional[bool] = None
71+
is_NI_asset: Optional[bool] = Field(alias="isNIAsset", default=None)
7172
"""Gets or sets whether this asset is an NI asset (true) or a third-party asset (false)."""
7273

7374
id: Optional[str] = None

nisystemlink/clients/assetmanagement/models/_asset_location.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,8 @@ class SystemConnection(Enum):
2020
[CONNECTED_UPDATE_PENDING, CONNECTED_UPDATE_SUCCESSFUL, CONNECTED_UPDATE_FAILED] are equivalent to CONNECTED.
2121
"""
2222

23-
APPROVED = "APPROVED"
24-
DISCONNECTED = "DISCONNECTED"
25-
CONNECTED_UPDATE_PENDING = "CONNECTED_UPDATE_PENDING"
2623
CONNECTED = "CONNECTED"
27-
CONNECTED_UPDATE_FAILED = "CONNECTED_UPDATE_FAILED"
28-
UNSUPPORTED = "UNSUPPORTED"
29-
ACTIVATED = "ACTIVATED"
30-
CONNECTED_UPDATE_SUCCESSFUL = "CONNECTED_UPDATE_SUCCESSFUL"
24+
DISCONNECTED = "DISCONNECTED"
3125

3226

3327
class AssetPresenceWithSystemConnection(JsonModel):

tests/integration/assetmanagement/test_asset_management.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def create_asset(client: AssetManagementClient):
8383
def _create_assets(
8484
new_assets: CreateAssetRequest,
8585
) -> CreateAssetsPartialSuccessResponse:
86-
response = client.create_assets(new_assets)
86+
response = client.create_assets(assets = new_assets)
8787
responses.append(response)
8888
return response
8989

0 commit comments

Comments
 (0)