Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
53 changes: 52 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,60 @@
# Change Log

## Unreleased
## v0.7.0

### Breaking Changes

* Generated client operations take the members of their input as keyword-only
parameters instead of an input object: `client.assume_role(role_arn="...",
role_session_name="...")` rather than `client.assume_role(AssumeRoleInput(...))`.
An operation without input members is called with no arguments. Interceptors
still receive the input model, which the client builds from the keyword
arguments before any other client setup.
* Members marked `@required` are required keyword parameters, including members
of input structures and `@clientOptional` members. A member with a default may
be omitted, and so may an idempotency token. Passing `None` is the same as
omitting a member: a member with a modeled default is sent with that default,
and any other is not sent. A call that leaves a required member unset raises a
`TypeError` before the request is sent.
* A member of an operation input whose Python name is `plugins` or `self` is
generated as `plugins_` or `self_`, because it would collide with a parameter
every client method already declares. Only the Python name changes, not the
wire representation, and members of nested structures are not affected.

### Features

* Nested structures and unions in a request may be written as dictionaries, as
generated models, or as a mix of both. A union is a dictionary with exactly one
key, the Python name of the variant being set, and a value that is not `None`.
Unknown keys, missing required members, malformed unions, and a `str` passed
for a list raise a `TypeError` that gives the path to the problem and never
includes a value. Under a `@sensitive` shape it does not include the keys the
caller wrote either.
* A model passed in a request is used as it is, never copied or changed, so a
model from a response can be sent back. It is still checked before the request
is sent: a required member that is `None`, an unknown union variant, or a
dictionary inside a model raises the same `TypeError`. A dictionary is only
converted outside a model. A member a model sets to `None` stays unset, even if
it has a default.
* An operation's idempotency token is generated when it is omitted or `None`. It
is generated once per call, after every interceptor's
`modify_before_serialization` hook has run and before the request is
serialized, so every retry sends the same token. A token the caller passes is
sent unchanged, even an empty one.
* Every structure and union reachable from an operation input has a `TypedDict`
form named with a `Params` suffix, such as `AssumeRoleInputParams`, declared in
the generated model stubs. At runtime the name is plain `dict`, so importing it
builds nothing. List and map members are typed `Sequence` and `Mapping`, which
accept a collection of models, of dictionaries, or of both.
* An operation input with a streaming body has two dictionary forms, because the
sync and async clients accept different bodies. The plain form, such as
`PutObjectInputParams`, takes the bodies a sync client can send, so it can be
unpacked into either client. The form with an `Async` prefix, such as
`AsyncPutObjectInputParams`, also takes async streams, and only the async
client accepts it.
* Generated client packages include a `py.typed` marker, so type checkers use
the types of an installed client.

* Generated AWS clients validate the checksums of response payloads for operations with the `aws.protocols#httpChecksum` trait, such as Amazon S3's `GetObject`. These clients depend on the `checksums` extra of `smithy-aws-core`.
* Generated AWS clients calculate checksums of request payloads for operations with the `aws.protocols#httpChecksum` trait, which fixes Amazon S3 operations that require one, such as `PutBucketPolicy` and `DeleteObjects`.

Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,11 @@ import asyncio

from echo.client import EchoService
from echo.config import Config
from echo.models import EchoMessageInput


async def main() -> None:
async with EchoService(Config(endpoint_uri="https://example.com/")) as client:
response = await client.echo_message(EchoMessageInput(message="spam"))
response = await client.echo_message(message="spam")
print(response.message)


Expand Down
Loading
Loading