Skip to content

feat(data-classes): AppSync Lambda authorizer event #610

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Aug 16, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat(event-sources): rename to to_dict
  • Loading branch information
Michael Brewer committed Aug 15, 2021
commit 23e52bf800030c1728b4c10b9a80ecd797b4c264
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,6 @@ def denied_fields(self, denied_fields: List[str]) -> "AppSyncAuthorizerResponse"
self._data["deniedFields"] = denied_fields
return self

def asdict(self) -> dict:
def to_dict(self) -> dict:
"""Return the response as a dict"""
return self._data
8 changes: 4 additions & 4 deletions tests/functional/test_data_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1450,8 +1450,8 @@ def test_appsync_authorizer_response():
.ttl(15)
)

assert expected == response.asdict()
assert expected == response.to_dict()

assert {"isAuthorized": False} == AppSyncAuthorizerResponse().asdict()
assert {"isAuthorized": True} == AppSyncAuthorizerResponse().authorize().ttl(None).asdict()
assert {"isAuthorized": True, "ttlOverride": 0} == AppSyncAuthorizerResponse().authorize().ttl().asdict()
assert {"isAuthorized": False} == AppSyncAuthorizerResponse().to_dict()
assert {"isAuthorized": True} == AppSyncAuthorizerResponse().authorize().ttl(None).to_dict()
assert {"isAuthorized": True, "ttlOverride": 0} == AppSyncAuthorizerResponse().authorize().ttl().to_dict()