Skip to content
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(endpoint): expose static endpoint param instructions provider #590

Merged
merged 2 commits into from
Sep 19, 2022

Conversation

kuhe
Copy link
Contributor

@kuhe kuhe commented Sep 16, 2022

This exposes the static instructions object for each command so that it can be used by other internal packages like s3 presigner and lib-upload that need to resolve the v2 endpoint of e.g. PutObjectCommand without necessarily sending an instance of that command.

before:

public resolveMiddleware() {
    this.middlewareStack.use(getEndpointPlugin(configuration, { /* instructions literal object */ })  
}

after:

public static instructions(): EndpointParameterInstructions {
    return { /* instructions literal object */ };
}

public resolveMiddleware() {
    this.middlewareStack.use(getEndpointPlugin(configuration, Command.instructions())  
}

Since the instructions are not tied to individual Command instances, the function can be static.

@kuhe kuhe requested a review from a team as a code owner September 16, 2022 18:47
@kuhe kuhe merged commit 911f2af into smithy-lang:main Sep 19, 2022
@kuhe kuhe deleted the endpoints-20-instructions branch September 19, 2022 16:46
srchase pushed a commit to srchase/smithy-typescript that referenced this pull request Mar 17, 2023
…mithy-lang#590)

* feat(endpoint): expose static endpoint param instructions provider

* feat(endpoint): rename instructions method on commands to be more specific
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants