-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Pull static * Update header for generated files * Sync generated files with static * Remove stringify for TypeSubscript * Remove subresources sorting * Replace BotocoreClientError with botocore.exceptions.ClientError * Remove client_error_class from templates * Add more ruff rules for output check * Remove unused code * Add missing future annotations for client * Add new inline Unions support * Remove unused code, update tests * Update tests for TypeUnion * Use builtins for list, dict, set, type * Fix tests * Add docstrings for override functions and methods * Add full package support for check_output * Revert typing.Set -> builtins.set (dynamodb is incompatible) * Update docstrings * Fix find_type_annotation_parents to TypeSubscript * Replace parent for TypeSubscript * Preserve old types, use old types only in unions * Apply latest changes from main * Use map parent lookup * Update types in all generated files * Remove template duplication for types-boto3-custom * Update aio integration * Fix old union syntax annotations shallow * Fix tests * Fix aiobotocore client __aexit__ annotations * Add typing.Self support * Refactor imports * Allow passing python version to sanity scripts * Type ignore conditional imports for mypy * Fix unit tests * Add type:ignore reason for methods * Remove Client.close method, it comes from static stubs * Pass ResourceMeta class to ServiceResource * Imports from aioboto3 and boto3 are no longer safe, but importing ServiceResource in __init__ is safe * Add type: ignore to method definition as well for pyright * Exceptions are inherited from BaseClientExceptions * Add overrride for create_client methods * Delete all unused ignored messages in check_output * Resolve circular dependency, add Attribute.copy method * Unbind some staticmethods * Remove some more static methods * Replace all hanging staticmethods * Fix missing method replacements
- Loading branch information
Showing
121 changed files
with
1,000 additions
and
891 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,29 @@ | ||
""" | ||
Message-related utils. | ||
Copyright 2024 Vlad Emelianov | ||
""" | ||
|
||
from mypy_boto3_builder.chat.type_defs import Message | ||
|
||
|
||
def as_string(message: Message | list[tuple[str, str]] | str) -> str: | ||
""" | ||
Convert message to string. | ||
""" | ||
if isinstance(message, str): | ||
return message | ||
result = (item if isinstance(item, str) else item[1] for item in message) | ||
return "".join(result) | ||
|
||
|
||
def as_message(message: Message | str) -> Message: | ||
""" | ||
Convert message or string to Message. | ||
""" | ||
if not message: | ||
return () | ||
if isinstance(message, str): | ||
return (message,) | ||
|
||
return message |
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
Oops, something went wrong.