Add the ability to generate Swift Concurrency implementations. #70
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
Description of changes:
Adds support for Swift Concurrency based implementations in a backwards-compatible manner.
These changes only relate to the
service-model-swift-code-generate-2.x
branch - which is only used to generate thesmoke-aws
package and (in conjunction with changes tosmoke-aws-generate
) result inamzn/smoke-aws@main...on_swift_concurrency_threads
(baseName)ClientProtocolV2: a new protocol that just contains Swift Concurrency (Async/Await) based APIs
(baseName)ClientProtocol: an existing protocol that now conforms to the new
(baseName)ClientProtocolV2
protocol. There are no other changes to this protocol.(baseName)ClientProtocol+async: existing extensions to the existing
(baseName)ClientProtocol
that provide Swift Concurrency (Async/Await) based APIs by delegating to the callback-based async APIs in the existing protocol. There are no changes to these extensions but they will now satisfy the conformance to the(baseName)ClientProtocolV2
by providing a default implementation unless a conforming type provides one itself.AWS(baseName)Client: an existing type that conforms to the
(baseName)ClientProtocol
, adding Swift Concurrency based implementations that call into the Swift Concurrency based APIs ofsmoke-http
. Because these APIs are now implemented within this type, they will override the default implementations in the extension of the protocol.Mock(baseName)ClientV2 and Throwing(baseName)ClientV2: Mock implementations that conform to the
(baseName)ClientProtocolV2
protocol. These implementations just provide the ability to mock the Swift Concurrency (Async/Await) based APIs and therefore do not require passing anEventLoop
to their initializer.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.