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

ApiGatewayManagementApiClient - error in the example code #6024

Closed
Easy-Cloud-in opened this issue Apr 25, 2024 · 2 comments
Closed

ApiGatewayManagementApiClient - error in the example code #6024

Easy-Cloud-in opened this issue Apr 25, 2024 · 2 comments
Assignees
Labels
closed-for-staleness documentation This is a problem with documentation. guidance General information and guidance, answers to FAQs, or recommended best practices/resources. p2 This is a standard priority issue response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.

Comments

@Easy-Cloud-in
Copy link

Describe the issue

import { ApiGatewayManagementApiClient, DeleteConnectionCommand } from "@aws-sdk/client-apigatewaymanagementapi"; // ES Modules import
// const { ApiGatewayManagementApiClient, DeleteConnectionCommand } = require("@aws-sdk/client-apigatewaymanagementapi"); // CommonJS import
const client = new ApiGatewayManagementApiClient(config);
const input = { // DeleteConnectionRequest
  ConnectionId: "STRING_VALUE", // required
};
const command = new DeleteConnectionCommand(input);
const response = await client.send(command);
// {};

Property 'send' does not exist on type 'ApiGatewayManagementApiClient'

Links

https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/apigatewaymanagementapi/command/DeleteConnectionCommand/

@Easy-Cloud-in Easy-Cloud-in added documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged. labels Apr 25, 2024
@RanVaknin RanVaknin self-assigned this Apr 25, 2024
@RanVaknin
Copy link
Contributor

Hi @Easy-Cloud-in ,

I'm not sure why you are seeing this error. I'm able to run tsc on this code without any errors:

import { ApiGatewayManagementApiClient, DeleteConnectionCommand } from "@aws-sdk/client-apigatewaymanagementapi";

const client = new ApiGatewayManagementApiClient({region: "us-east-1"});
const input = { ConnectionId: "STRING_VALUE" };
const command = new DeleteConnectionCommand(input);

async function foo(){
  try {
    const response = await client.send(command)
    console.log(response)
  }catch(err){
    console.log(err)
  }
}
foo()
$ ls          
node_modules      package-lock.json package.json      sample.ts
$ tsc sample.ts 
$ ls
node_modules      package-lock.json package.json      sample.js         sample.ts

which SDK version and TS version are you using? Can I see the contents of your package.json and tsconfig if you have one?

Thanks,
Ran~

@RanVaknin RanVaknin added response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. guidance General information and guidance, answers to FAQs, or recommended best practices/resources. p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Apr 25, 2024
Copy link

github-actions bot commented May 6, 2024

This issue has not received a response in 1 week. If you still think there is a problem, please leave a comment to avoid the issue from automatically closing.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-for-staleness documentation This is a problem with documentation. guidance General information and guidance, answers to FAQs, or recommended best practices/resources. p2 This is a standard priority issue response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants