-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: eng-114 register digital twin without cred
- Loading branch information
1 parent
c2fa58c
commit 5a0295f
Showing
34 changed files
with
973 additions
and
491 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from indykite_sdk.indykite.identity.v1beta2 import identity_management_api_pb2 as pb2 | ||
from indykite_sdk.model.digital_twin_kind import DigitalTwinKind | ||
from indykite_sdk.model.register_digital_twin_without_credential import RegisterDigitalTwinWithoutCredential | ||
import sys | ||
import indykite_sdk.utils.logger as logger | ||
|
||
|
||
def register_digital_twin_without_credential(self, tenant_id, kind, tags, properties, bookmarks=[]): | ||
sys.excepthook = logger.handle_excepthook | ||
try: | ||
if kind and validate_kind(kind): | ||
response = self.stub.RegisterDigitalTwinWithoutCredential( | ||
pb2.RegisterDigitalTwinWithoutCredentialRequest( | ||
tenant_id=str(tenant_id), | ||
digital_twin_kind=kind, | ||
digital_twin_tags=tags, | ||
properties=properties, | ||
bookmarks=bookmarks | ||
) | ||
) | ||
return RegisterDigitalTwinWithoutCredential.deserialize(response) | ||
return None | ||
except Exception as exception: | ||
return logger.logger_error(exception) | ||
|
||
|
||
def validate_kind(kind): | ||
try: | ||
kinds = [k.value for k in DigitalTwinKind] | ||
if kind in kinds: | ||
return True | ||
return False | ||
except Exception as exception: | ||
return logger.logger_error(exception) |
Oops, something went wrong.