-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Lucas McDonald
committed
Aug 18, 2023
1 parent
7c9fe47
commit 022511b
Showing
21 changed files
with
77 additions
and
21 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
52 changes: 52 additions & 0 deletions
52
...dels/Extendable/runtimes/python/src/simple_extendable_resources/extern/native_resource.py
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,52 @@ | ||
# Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from simple_extendable_resources_internaldafny_types import ( | ||
IExtendableResource as DafnyIExtendableResource | ||
) | ||
import ExtendableResource | ||
from simple_extendable_resources.smithygenerated.models import IExtendableResource | ||
import simple_extendable_resources_internaldafny_nativeresourcefactory | ||
|
||
class NativeResource(IExtendableResource): | ||
_impl: DafnyIExtendableResource | ||
|
||
def __init__(self, _impl): | ||
self._impl = _impl | ||
|
||
def GetExtendableResourceData(self, nativeInput): | ||
print("nativeInput") | ||
print(nativeInput) | ||
a = self._impl.GetExtendableResourceData(nativeInput) | ||
print("a") | ||
print(a) | ||
return a | ||
|
||
def AlwaysModeledError(self, nativeInput): | ||
print("AlwaysModeledError") | ||
print(nativeInput) | ||
return self._impl.AlwaysModeledError(nativeInput) | ||
|
||
def AlwaysMultipleErrors(self, nativeInput): | ||
return self._impl.AlwaysMultipleErrors(nativeInput) | ||
|
||
def AlwaysOpaqueError(self, nativeInput): | ||
if nativeInput.value == None: | ||
raise Exception("Python Hard Coded Exception") | ||
return self._impl.AlwaysOpaqueError(nativeInput) | ||
|
||
class NativeResourceFactory: | ||
|
||
@staticmethod | ||
def DafnyFactory(): | ||
dafny_resource = ExtendableResource.ExtendableResource() | ||
dafny_resource.ctor__() | ||
native_resource = NativeResource(dafny_resource) | ||
|
||
# to_dafny | ||
return native_resource | ||
|
||
|
||
simple_extendable_resources_internaldafny_nativeresourcefactory.default__ = NativeResourceFactory | ||
|
||
DafnyFactory = NativeResourceFactory |
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
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