-
Notifications
You must be signed in to change notification settings - Fork 26
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
feat: enable endpoint discovery #887
Conversation
…es instances across `withClient` calls
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, one clarification/question.
import kotlin.reflect.KClass | ||
|
||
@InternalApi | ||
public class DiscoveredEndpointErrorInterceptor( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Documentation/reason for existing
|
||
actual.shouldContainOnlyOnceWithDiff( | ||
""" | ||
internal suspend fun asEndpointResolver(client: TestClient, delegate: EndpointResolverAdapter) = EndpointResolver { request -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correctness: Why does the conversion asEndpointResolver
need to be suspend
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, it does not need to be.
assertEquals(0, cache.get("a") { uncachedValue() }) | ||
assertEquals(1, cache.get("b") { uncachedValue() }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here instead of uncachedValue()
it could be better to pass a function that throws an exception, to check that the cached value is read instead of the pass-through function being invoked
SonarCloud Quality Gate failed. 0 Bugs No Coverage information Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
Issue #
Closes #146
Description of changes
Enables endpoint discovery for services that specify the correct traits in their models. Specifically:
Note that this does not fully implement the Smithy spec because it assumes that no operation name or identifiers are passed to the discover endpoints operation, which is true for all AWS services that currently support endpoint discovery (i.e., DynamoDB, Timestream Query, and Timestream Write).
Companion PR: aws-sdk-kotlin#976
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.