Skip to content

chore(clients): allow commands to be constructed without arg if optional #5901

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

Merged
merged 4 commits into from
Mar 15, 2024

Conversation

trivikr
Copy link
Member

@trivikr trivikr commented Mar 14, 2024

Issue

Description

Allow commands to be constructed without arg if optional

Testing

$ yarn tsc --version
Version 5.4.2

Before

$ cat test.ts
import { STS } from "@aws-sdk/client-sts";
const client = new STS();
client.getCallerIdentity().then(console.log);

$ yarn tsc test.ts
test.ts:3:8 - error TS2554: Expected 1-3 arguments, but got 0.

3 client.getCallerIdentity().then(console.log);
         ~~~~~~~~~~~~~~~~~

  node_modules/@aws-sdk/client-sts/dist-types/STS.d.ts:45:23
    45     getCallerIdentity(args: GetCallerIdentityCommandInput, options?: __HttpHandlerOptions): Promise<GetCallerIdentityCommandOutput>;
                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    An argument for 'args' was not provided.


Found 1 error in test.ts:3

After

$ cat test.ts
import { STS } from "../aws-sdk-js-v3/clients/client-sts";
const client = new STS();
client.getCallerIdentity().then(console.log);

$ yarn tsc test.ts

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@trivikr trivikr marked this pull request as ready for review March 14, 2024 23:51
@trivikr trivikr requested review from a team as code owners March 14, 2024 23:51
@trivikr trivikr merged commit 56e6715 into aws:main Mar 15, 2024
@trivikr trivikr deleted the command-without-args branch March 15, 2024 00:00
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make Command input object optional -- ELBv2: Cannot read properties of undefined (read 'LoadBalancerArns')
2 participants